{% load suit_forms %} {% comment %} suit's own layout of Django's admin/includes/fieldset.html (4.2): Bootstrap grid rows sized by suit_form_size (.form-group.row, label + column classes) instead of Django's .form-row / .flex-container / .fieldBox. Kept from Django: the row classes (errors, hidden, field-), checkbox and readonly rendering, the _helptext id on help texts. {% endcomment %}
{% if fieldset.name %}

{{ fieldset.name }}

{% endif %} {% if fieldset.description %}
{{ fieldset.description|safe }}
{% endif %} {% for line in fieldset %} {% with fields_count=line.fields|length %}
{% for field in line %} {% if fields_count == 1 or forloop.first %}
{% endif %} {# Open multi-field #} {% if fields_count != 1 %}
{% if not forloop.first %}
{% endif %} {% endif %} {% if field.is_readonly %}

{{ field.contents }}

{% else %} {{ field.field }} {% endif %} {% if field.errors and fields_count != 1 and not field.is_readonly %}
{{ field.errors }}
{% endif %} {% if fields_count == 1 and line.errors %}
{{ line.errors }}
{% endif %} {% if field.field.help_text %} {{ field.field.help_text|safe }} {% endif %} {# Close multi-field #} {% if fields_count != 1 %} {# Close multi-field-content #} {% if not forloop.first %}
{% endif %}
{% endif %} {# Close multi-row first field container #} {% if fields_count == 1 or forloop.last %}
{% endif %} {% endfor %}
{% endwith %} {% endfor %}