{% load i18n %}

{% csrf_token %}

{{ inlineformset.management_form }}

{% for hidden in form.hidden_fields %}{{ hidden }}{% endfor %}

<fieldset class="module aligned">
    {% for field in form.visible_fields %}
        <div class="form-row {{ field.name }}{% if field.errors %} errors{% endif %}">
            {% if field.errors %}
                <ul class="errorlist">
                    {% for error in field.errors %}
                        <li>{{ error }}</li>
                    {% endfor %}
                </ul>
            {% endif %}
            <div>
                <label {% if field.field.required %}class="required" {% endif %}for="{{ field.id_for_label }}">{{ field.label }}</label>
                {{ field }}{% if field.help_text %}
                <p class="help">{{ field.help_text }}</p>{% endif %}
            </div>
        </div>
    {% endfor %}
</fieldset>
