{#- A JSON document on a record page, laid out as it reads. An object or a list folds on its first line and, folded, says how much it holds. The folding is plain HTML, so it works without a script; the buttons above only fold everything at once or copy the document. Takes `outline`, from JSONField.outline, and `pretty`, the document laid out as text for copying. -#} {% import "adminsite/_icons.html" as icons %} {%- macro name(piece) -%} {%- if piece.name -%} {{ piece.name }}: {%- endif -%} {%- endmacro -%} {%- macro part(piece, depth) -%} {%- set comma = "" if piece.last else "," -%} {%- set opening = "{" if piece.kind == "object" else "[" -%} {%- set closing = "}" if piece.kind == "object" else "]" -%} {#- Each level steps in by the width of the arrow a folding part has. -#} {%- set indent = depth * 1.25 -%} {%- if piece.children and depth == 0 -%}