{% load crispy_forms_tags %}

{% if formset_tag %}
<form class="ui form{% if formset.has_errors %} error{% endif %}" {{ flat_attrs|safe }} method="{{ formset_method }}" {% if formset.is_multipart %} enctype="multipart/form-data"{% endif %}>
{% endif %}
    {% if formset_method|lower == 'post' and not disable_csrf %}
        {% csrf_token %}
    {% endif %}

    <div>
        {{ formset.management_form|crispy }}
    </div>

    {% include "semantic-ui/errors_formset.html" %}

    {% for form in formset %}
        {% include "semantic-ui/display_form.html" %}
    {% endfor %}

    {% if inputs %}
        {% for input in inputs %}
            {% include "semantic-ui/layout/baseinput.html" %}
        {% endfor %}
    {% endif %}
{% if formset_tag %}</form>{% endif %}
