{% load suit_tags %}
{% if fieldset.name %}

{{ fieldset.name }} {% if fieldset.description %} {{ fieldset.description|safe }} {% endif %}

{% endif %} {% for line in fieldset %} {% with singlefield=line.fields|length_is:'1' %}
{% for field in line %} {% spaceless %} {# write special control tags only for first multi field #} {% if forloop.first %}
{{ field.label_tag }}
{# if multi-fields and first field #} {% if not singlefield %}
{% endif %} {% else %} {# If multi-fields and not first wrap also label #} {% if not singlefield and not forloop.first %}
{% endif %} {{ field.label_tag }} {% endif %} {% if not field.is_readonly and field.errors %}
{% endif %} {# If multi-fields and wrap controls too #} {% if not singlefield %}
{% endif %} {% if field.is_readonly %} {{ field|field_contents_foreign_linked|linebreaksbr }} {% else %} {{ field.field }} {% endif %} {# For single field errors#} {% if singlefield and line.errors %} {{ line.errors }} {% endif %} {# For multi field errors #} {% if field.errors and not singlefield and not field.is_readonly %} {{ field.errors|striptags }} {% endif %} {% if field.field.help_text %} {{ field.field.help_text|safe }} {% endif %} {% if not field.is_readonly and field.errors %}
{% endif %} {% if not singlefield %}
{# close multi-controls #}
{# close multi-field-box #} {% endif %} {% if forloop.last %}
{% endif %} {% endspaceless %} {% endfor %}
{% endwith %} {% endfor %}
{# For closing line #} {% if 'plugin-holder' in fieldset.classes %}
{% endif %}