Improve rendering of JSON data

This commit is contained in:
Jeremy Stretch 2023-12-01 09:24:23 -05:00
parent 2ed261e9c2
commit e4824db40b

View File

@ -149,11 +149,23 @@
<table class="table table-hover attr-table"> <table class="table table-hover attr-table">
<tr> <tr>
<th scope="row">{% trans "Custom validators" %}</th> <th scope="row">{% trans "Custom validators" %}</th>
<td>{{ object.data.CUSTOM_VALIDATORS|placeholder }}</td> {% if object.data.CUSTOM_VALIDATORS %}
<td class="font-monospace">
<pre>{{ object.data.CUSTOM_VALIDATORS|json }}</pre>
</td>
{% else %}
<td>{{ ''|placeholder }}</td>
{% endif %}
</tr> </tr>
<tr> <tr>
<th scope="row">{% trans "Protection rules" %}</th> <th scope="row">{% trans "Protection rules" %}</th>
<td>{{ object.data.PROTECTION_RULES|placeholder }}</td> {% if object.data.PROTECTION_RULES %}
<td>
<pre>{{ object.data.PROTECTION_RULES|json }}</pre>
</td>
{% else %}
<td>{{ ''|placeholder }}</td>
{% endif %}
</tr> </tr>
</table> </table>
</div> </div>
@ -165,7 +177,13 @@
<table class="table table-hover attr-table"> <table class="table table-hover attr-table">
<tr> <tr>
<th scope="row">{% trans "Default user preferences" %}</th> <th scope="row">{% trans "Default user preferences" %}</th>
<td>{{ object.data.DEFAULT_USER_PREFERENCES|placeholder }}</td> {% if object.data.DEFAULT_USER_PREFERENCES %}
<td>
<pre>{{ object.data.DEFAULT_USER_PREFERENCES|json }}</pre>
</td>
{% else %}
<td>{{ ''|placeholder }}</td>
{% endif %}
</tr> </tr>
</table> </table>
</div> </div>