diff options
| author | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-04-04 20:49:29 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-04-04 20:49:29 +0200 |
| commit | f41b22f173bb9c9c331fa9eab2a7a8d47d0a57db (patch) | |
| tree | 673bfb7389360f360ddaafcfe1a4d133d67f4c36 /ishtar_common/templates/blocks/inline_formset.html | |
| parent | 93de2ae2223f284431000c66ba7d94f6f73eb658 (diff) | |
| download | Ishtar-f41b22f173bb9c9c331fa9eab2a7a8d47d0a57db.tar.bz2 Ishtar-f41b22f173bb9c9c331fa9eab2a7a8d47d0a57db.zip | |
Inline formset to manage parcels
Diffstat (limited to 'ishtar_common/templates/blocks/inline_formset.html')
| -rw-r--r-- | ishtar_common/templates/blocks/inline_formset.html | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ishtar_common/templates/blocks/inline_formset.html b/ishtar_common/templates/blocks/inline_formset.html new file mode 100644 index 000000000..e36405118 --- /dev/null +++ b/ishtar_common/templates/blocks/inline_formset.html @@ -0,0 +1,25 @@ +{% load i18n %} + {% if extra_formset.non_form_errors %}<div class='errors'>{{extra_formset.non_form_errors.as_ul}}</div>{% endif %} + {% if header %}<table class='inline-table'> + <caption>{% trans caption %}</caption> + {% endif %}{% for frm in formset%}{% if header %}<thead> + <tr>{% for field in frm.visible_fields%} + <th>{{field.label}}</th>{%endfor%} + </tr> + </thead>{% endif %} + {% if forloop.first and not skip %}<tbody>{%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 }} + {# 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 %} |
