Enhance JSON display by integrating pretty JSON formatter in various templates

This commit is contained in:
Ross
2026-03-16 12:08:34 +00:00
parent 3ea51f976d
commit 1cadbab742
5 changed files with 80 additions and 78 deletions
@@ -169,7 +169,13 @@
<div class="mt-3"> <div class="mt-3">
<details> <details>
<summary class="small">Annotation JSON</summary> <summary class="small">Annotation JSON</summary>
<div class="mt-2 small">{% if question.image_annotations %}<pre class="mb-0">{{ question.image_annotations }}</pre>{% else %}No saved annotations.{% endif %}</div> <div class="mt-2 small">
{% if question.image_annotations %}
{% include 'atlas/partials/json_pretty.html' with json_value=question.image_annotations title='Image annotations' %}
{% else %}
No saved annotations.
{% endif %}
</div>
</details> </details>
</div> </div>
@@ -743,12 +743,10 @@
<details> <details>
<summary class="small text-muted" style="cursor:pointer;">Show advanced (viewer state & annotations)</summary> <summary class="small text-muted" style="cursor:pointer;">Show advanced (viewer state & annotations)</summary>
<div> <div>
<strong>Viewer State:</strong> {% include 'atlas/partials/json_pretty.html' with json_value=ds.viewerstate title='Viewer State' %}
<pre class="small">{{ ds.viewerstate|default:"{}" }}</pre>
</div> </div>
<div> <div>
<strong>Annotations:</strong> {% include 'atlas/partials/json_pretty.html' with json_value=ds.annotations title='Annotations' %}
<pre class="small">{{ ds.annotations|default:"{}" }}</pre>
</div> </div>
</details> </details>
</div> </div>
@@ -67,12 +67,10 @@
<details> <details>
<summary class="small text-muted" style="cursor:pointer;">Show advanced (viewer state & annotations)</summary> <summary class="small text-muted" style="cursor:pointer;">Show advanced (viewer state & annotations)</summary>
<div> <div>
<strong>Viewer State:</strong> {% include 'atlas/partials/json_pretty.html' with json_value=ds.viewerstate title='Viewer State' %}
<pre class="small">{{ ds.viewerstate|default:"{}" }}</pre>
</div> </div>
<div> <div>
<strong>Annotations:</strong> {% include 'atlas/partials/json_pretty.html' with json_value=ds.annotations title='Annotations' %}
<pre class="small">{{ ds.annotations|default:"{}" }}</pre>
</div> </div>
</details> </details>
</div> </div>