forked from developer italia
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
{% extends "admin/change_form.html" %}
|
||||
{% block admin_change_form_document_ready %}
|
||||
{{ block.super }}
|
||||
<script>
|
||||
Array.from(document.querySelectorAll('div.readonly')).forEach(div => {
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(div.innerText);
|
||||
} catch {
|
||||
// Not valid JSON
|
||||
return;
|
||||
}
|
||||
div.style.whiteSpace = 'pre-wrap';
|
||||
div.style.fontFamily = 'courier';
|
||||
div.style.fontSize = '0.9em';
|
||||
div.innerText = JSON.stringify(data, null, 2);
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user