summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/blocks/inline_formset.html
blob: f7e18ba2bb9c97c8d90aad51dafe352c50ca5821 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{% load i18n %}
    {% if formset.non_form_errors %}<div class='errors'>{{formset.non_form_errors.as_ul}}</div>{% endif %}
    {% if header %}<table class='inline-table' id='{{formset.prefix}}'>
    <caption>{% trans caption %}</caption>
    <thead>
    <tr>{% for field in formset.0.visible_fields %}
        <th>{{field.label}}</th>{%endfor%}
    </tr>
    </thead>{% endif %}{% for frm in formset%}
    {% if forloop.first and not skip %}<tbody>{%endif%}
    {% if frm.non_field_errors %}
        <tr class="errors">
            <td colspan="{{formset.0.visible_fields|length}}">
            {{frm.non_field_errors.as_ul}}
            </td>
        </tr>
    {% endif %}
    {% if not skip or not forloop.first %}
        <tr>{% endif %}{% for field in frm.visible_fields %}<td>
        {% if field.errors %}<div class='errors'>{{ field.errors.as_ul }}</div>{% endif %}
        {{ field|safe }}
        {# Include the hidden fields in the form #}
        {% if forloop.first %}
          {{ formset.management_form }}
          {% for hidden in frm.hidden_fields %}
          {{ hidden }}
          {% endfor %}
        {% endif %}
        </td>{% endfor %}
    {% if not skip or not forloop.last %}</tr>{% endif %}{%endfor%}
    {% if not skip %}</tbody>{% endif %}{% if header %}
    </table>{% endif %}