{% load i18n %}{% comment %} One node of a panel's declared ``layout`` (see vantage.layout: Row, Section, Tab, Tabs), already resolved against this form's actual fields by PanelFormView.get_layout. Recurses over ``node.children`` — a container node includes itself for each child, a leaf field node renders through partials/field.html the same way the fixed-section layout does, so the two paths can never draw a field two different ways. ``node`` uses the key "node" for its own shape (tabs / tab / row / section / field) because a field entry already uses "kind" for its own meaning, the field's FieldKind — the two must not collide. {% endcomment %} {% if node.node == "field" %} {% include "vantage/partials/field.html" with field=node.field %} {% elif node.node == "row" %}
{% for child in node.children %} {% include "vantage/partials/layout_node.html" with node=child %} {% endfor %}
{% elif node.node == "section" %} {% if node.collapsed %}

{{ node.title }}

{% if node.description %}

{{ node.description }}

{% endif %}
{% for child in node.children %} {% include "vantage/partials/layout_node.html" with node=child %} {% endfor %}
{% else %}
{% if node.title %}

{{ node.title }}

{% endif %} {% if node.description %}

{{ node.description }}

{% endif %}
{% for child in node.children %} {% include "vantage/partials/layout_node.html" with node=child %} {% endfor %}
{% endif %} {% elif node.node == "tabs" %} {% comment %} Same radio-group technique as detail.html's related-records tab strip — see the shared CSS comment in vantage.css. `node.id` scopes the radio group's `name`/ids to this one Tabs node, so a Tabs nested inside a Tab inside another Tabs — unusual, but the DSL does not forbid it — does not fight its parent for clicks. {% endcomment %}
{% translate "Sections" %} {% for tab in node.children %}
{% for child in tab.children %} {% include "vantage/partials/layout_node.html" with node=child %} {% endfor %}
{% endfor %}
{% endif %}