{% load arctic_tags %} {% if layout %} {# TODO Move layout to it's own template file #} {% for index, layout_item in layout.items %}
{% if layout_item.fieldset.title or layout_item.fieldset.description %}
{% if layout_item.fieldset.collapsible %} {% endif %} {% endif %} {% if layout_item.fieldset.title %}
{{ layout_item.fieldset.title }}
{% endif %} {% if layout_item.fieldset.description %}

{{ layout_item.fieldset.description }}

{% endif %} {% if layout_item.fieldset.title or layout_item.fieldset.description %}
{% endif %} {# In case it's collapsed by default and does not have a title or description #} {% if layout_item.fieldset.collapsible and not layout_item.fieldset.title and not layout_item.fieldset.description %}
{# TODO add translation #}
General
{% endif %}
{% for row in layout_item.rows %}
{% if row|typename == 'dict' %} {% include 'arctic/partials/form_field.html' with field=row.field style=style column=row.column layout=True %} {% else %} {% for field in row %} {% include 'arctic/partials/form_field.html' with field=field.field style=style column=field.column layout=True %} {% endfor %} {% endif %}
{% endfor %}
{% endfor %} {% else %} {# TODO Move this section to it's own template file #}
{% for field in form %}{% include 'arctic/partials/form_field.html' %}{% endfor %}
{% block errors %} {% for error in form.non_field_errors %} {{ error }} {% endfor %} {% endblock %} {% endif %}