diff options
Diffstat (limited to 'ishtar_common/templates')
| -rw-r--r-- | ishtar_common/templates/blocks/form_snippet.html (renamed from ishtar_common/templates/form_snippet.html) | 0 | ||||
| -rw-r--r-- | ishtar_common/templates/blocks/inline_formset.html | 25 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/wizard/default_wizard.html | 4 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/wizard/parcels_wizard.html | 28 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/wizard/towns_wizard.html | 10 |
5 files changed, 58 insertions, 9 deletions
diff --git a/ishtar_common/templates/form_snippet.html b/ishtar_common/templates/blocks/form_snippet.html index 2f841e078..2f841e078 100644 --- a/ishtar_common/templates/form_snippet.html +++ b/ishtar_common/templates/blocks/form_snippet.html 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 %} diff --git a/ishtar_common/templates/ishtar/wizard/default_wizard.html b/ishtar_common/templates/ishtar/wizard/default_wizard.html index e2abc80b6..b56324a78 100644 --- a/ishtar_common/templates/ishtar/wizard/default_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/default_wizard.html @@ -6,6 +6,7 @@ {{form.media}} {% endblock %} {% block content %} +{% block wizard_head %} <h2>{{wizard_label}}</h2> <form action="." method="post" name='wizard'>{% csrf_token %} <ul id='form_path'> @@ -17,6 +18,8 @@ <li>» <button name="form_prev_step" value="{{forloop.counter|add:previous_step_counter}}">{{step.form_label}}</button></li> {% endfor %} </ul> +{% endblock %} +{% block wizard_form %} <div class='form'> {% if reminder %}<div class='reminder'>{{ reminder }}</div>{%endif%} {{ wizard.form.media }} @@ -43,3 +46,4 @@ </div> </form> {% endblock %} +{% endblock %} diff --git a/ishtar_common/templates/ishtar/wizard/parcels_wizard.html b/ishtar_common/templates/ishtar/wizard/parcels_wizard.html new file mode 100644 index 000000000..94e9820ab --- /dev/null +++ b/ishtar_common/templates/ishtar/wizard/parcels_wizard.html @@ -0,0 +1,28 @@ +{% extends "ishtar/wizard/default_wizard.html" %} +{% load i18n range inline_formset %} +{% block extra_head %} +{{wizard.form.media}} +{% endblock %} +{% block wizard_form %} +<div class='form'> +{% if reminder %}<div class='reminder'>{{ reminder }}</div>{%endif%} +{{ wizard.form.media }} +{{ wizard.management_form }} + {{ wizard.form.management_form }} +<div class='top_button'><input type="submit" id="submit_form" value="{% trans "Validate" %}"/></div> + {%if wizard.form.non_form_errors%} +<table class='formset'> +<tr class='error'><th colspan='2'>{{wizard.form.non_form_errors}}</th></tr> +</table>{%endif%} +<table class='inline-table'> + <tr>{% for field in wizard.form.forms.0 %}<th>{{ field.label_tag }}</th>{% endfor %}</tr> + {% inline_formset 'Parcels' wizard.form.forms False %} +</table> +<p><button name="formset_modify" value="{{wizard.steps.current}}">{% trans "Add/Modify" %}</button></p> +<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" /> +{{ previous_fields|safe }} +<input type="submit" id="submit_form" name='validate' value="{% trans "Validate" %}"/> +{% if next_steps %}<input type="submit" id="submit_end_form" name='validate_and_end' value="{% trans "Validate and end" %}"/>{% endif %} +</div> +</form> +{% endblock %} diff --git a/ishtar_common/templates/ishtar/wizard/towns_wizard.html b/ishtar_common/templates/ishtar/wizard/towns_wizard.html index cd40e6049..cc3487df3 100644 --- a/ishtar_common/templates/ishtar/wizard/towns_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/towns_wizard.html @@ -4,15 +4,7 @@ {% block extra_head %} {{wizard.form.media}} {% endblock %} -{% block content %} -<h2>{{wizard_label}}</h2> -<form action="." method="post" name='wizard'>{% csrf_token %} -<ul id='form_path'> -{% for step in previous_steps %} - <li>» <button name="form_prev_step" value="{{forloop.counter0}}">{{step.form_label}}</button></li> -{% endfor %} - <li class='current'>» <a href='#'>{{current_step.form_label}}</a></li> -</ul> +{% block wizard_form %} <div class='form'> {% if TOWNS %} {% if wizard.form.forms %} |
