15148 add copy button to config context

This commit is contained in:
Arthur 2024-05-03 15:24:41 -07:00 committed by Jeremy Stretch
parent 0cc2963e6f
commit 5b7c392d81
3 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,5 @@
{% load helpers %} {% load helpers %}
<div class="rendered-context-data mt-1"> <div class="rendered-context-data mt-1">
<pre class="block">{% if format == 'json' %}{{ data|json }}{% elif format == 'yaml' %}{{ data|yaml }}{% else %}{{ data }}{% endif %}</pre> <pre class="block" {% if copyid %}id="{{ copyid }}{% endif %}">{% if format == 'json' %}{{ data|json }}{% elif format == 'yaml' %}{{ data|yaml }}{% else %}{{ data }}{% endif %}</pre>
</div> </div>

View File

@ -1,4 +1,7 @@
<div> <div>
{% if copyid %}
{% copy_content copyid %}
{% endif %}
<div class="btn-group btn-group-sm" role="group"> <div class="btn-group btn-group-sm" role="group">
<a href="?format=json" type="button" class="btn btn-outline-dark{% if format == 'json' %} active{% endif %}">JSON</a> <a href="?format=json" type="button" class="btn btn-outline-dark{% if format == 'json' %} active{% endif %}">JSON</a>
<a href="?format=yaml" type="button" class="btn btn-outline-dark{% if format == 'yaml' %} active{% endif %}">YAML</a> <a href="?format=yaml" type="button" class="btn btn-outline-dark{% if format == 'yaml' %} active{% endif %}">YAML</a>

View File

@ -9,10 +9,10 @@
<div class="card"> <div class="card">
<h5 class="card-header d-flex justify-content-between"> <h5 class="card-header d-flex justify-content-between">
{% trans "Rendered Context" %} {% trans "Rendered Context" %}
{% include 'extras/inc/configcontext_format.html' %} {% include 'extras/inc/configcontext_format.html' with copyid="rendered_context" %}
</h5> </h5>
<div class="card-body"> <div class="card-body">
{% include 'extras/inc/configcontext_data.html' with data=rendered_context format=format %} {% include 'extras/inc/configcontext_data.html' with data=rendered_context format=format copyid="rendered_context" %}
</div> </div>
</div> </div>
</div> </div>