diff options
| author | Étienne Loks <etienne.loks@proxience.com> | 2013-04-04 22:43:13 +0000 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@proxience.com> | 2013-04-04 22:43:13 +0000 |
| commit | ee8c9ad6004ab35e409c7041a0eba214b45c36d7 (patch) | |
| tree | a2c624b1ce76c6d57a8a156766e4863710d8ae19 /ishtar_common/templates/blocks | |
| parent | 56aea239caffef95c481aac3b77a8d43e8d3ca35 (diff) | |
| parent | e51684c2adb656d3ef14e40e649e280a6c0bf1b8 (diff) | |
| download | Ishtar-ee8c9ad6004ab35e409c7041a0eba214b45c36d7.tar.bz2 Ishtar-ee8c9ad6004ab35e409c7041a0eba214b45c36d7.zip | |
Merge branch 'master' of lysithea.proxience.net:/home/proxience/git/ishtar
Diffstat (limited to 'ishtar_common/templates/blocks')
| -rw-r--r-- | ishtar_common/templates/blocks/form_snippet.html | 13 | ||||
| -rw-r--r-- | ishtar_common/templates/blocks/inline_formset.html | 25 |
2 files changed, 38 insertions, 0 deletions
diff --git a/ishtar_common/templates/blocks/form_snippet.html b/ishtar_common/templates/blocks/form_snippet.html new file mode 100644 index 000000000..2f841e078 --- /dev/null +++ b/ishtar_common/templates/blocks/form_snippet.html @@ -0,0 +1,13 @@ +{% load i18n %} + {% if form.non_field_errors %}<tr class='errors'> + <td colspan='3'>{{form.non_field_errors}}</td> + </tr>{%endif%} + {% for field in form %}{% if not field.is_hidden %} + <tr{% if field.field.required %} class='required'{% endif %}> + <th>{{ field.label_tag }}</th> + <td> {{ field.errors }}{{field|safe}}</td>{% if field.help_text %} + <td><a href="#{{field.auto_id}}" class="help_display" title="{% trans "Help"%}">?</a></td> + </tr> + <tr class="help_text" id="{{field.auto_id}}_help"> + <td colspan="3"><div>{{field.help_text}}</div></td> + {%endif%}</tr>{% else %}{{field}}{% endif %}{% endfor %} 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 %} |
