diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-08-31 10:39:39 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-08-31 10:39:39 +0200 |
| commit | 80e8827b0ff40ffa4c37985a6979fca6d7eba097 (patch) | |
| tree | bb6acadd1f70294bdc1322a0e08aa51f650cfc5f /ishtar_common/templates | |
| parent | 14688dbd9435146b96b0743677579a622aa784ef (diff) | |
| download | Ishtar-80e8827b0ff40ffa4c37985a6979fca6d7eba097.tar.bz2 Ishtar-80e8827b0ff40ffa4c37985a6979fca6d7eba097.zip | |
Target key forms: choose whom to associated with (refs #3725)
Diffstat (limited to 'ishtar_common/templates')
4 files changed, 61 insertions, 0 deletions
diff --git a/ishtar_common/templates/blocks/readonly_input.html b/ishtar_common/templates/blocks/readonly_input.html new file mode 100644 index 000000000..41a0c1305 --- /dev/null +++ b/ishtar_common/templates/blocks/readonly_input.html @@ -0,0 +1,2 @@ +{% for group_name, group_choices, group_index in widget.optgroups %}{% for option in group_choices %} + {% include option.template_name with widget=option %}{% endfor %}{% endfor %} diff --git a/ishtar_common/templates/blocks/readonly_input_option.html b/ishtar_common/templates/blocks/readonly_input_option.html new file mode 100644 index 000000000..b4ac473f0 --- /dev/null +++ b/ishtar_common/templates/blocks/readonly_input_option.html @@ -0,0 +1 @@ +{% if widget.attrs.selected %}<input type="hidden" name="{{ widget.name }}"{% if widget.value != None %} value="{{ widget.value.0 }}"{% endif %}{% include "django/forms/widgets/attrs.html" %} />{% endif %} diff --git a/ishtar_common/templates/ishtar/form.html b/ishtar_common/templates/ishtar/form.html index 539bd0408..236818c66 100644 --- a/ishtar_common/templates/ishtar/form.html +++ b/ishtar_common/templates/ishtar/form.html @@ -5,6 +5,9 @@ <div class='form'> <form enctype="multipart/form-data" action="." method="post"{% if confirm %} onsubmit='return confirm("{{confirm}}");'{% endif %}>{% csrf_token %} + {% for error in form.non_field_errors %} + <p>{{ error }}</p> + {% endfor %} <table> {{form}} </table> diff --git a/ishtar_common/templates/ishtar/formset_import_match.html b/ishtar_common/templates/ishtar/formset_import_match.html new file mode 100644 index 000000000..f37938771 --- /dev/null +++ b/ishtar_common/templates/ishtar/formset_import_match.html @@ -0,0 +1,55 @@ +{% extends "base.html" %} +{% load i18n %} +{% block content %} +<h2>{{page_name}}</h2> +<p><a href="{% url 'current_imports' %}">{% trans "Back to import list" %}</a></p> +<div class='form' id='global-vars'> +<form action="." method="post">{% csrf_token %} + + {% if extra_formset.non_form_errors %} + <div class='errors'>{{extra_formset.non_form_errors.as_ul}}</div>{% endif %} + + {{ formset.management_form }} + {% for hidden in frm.hidden_fields %} {{ hidden }} {% endfor %} + + <div id="{{formset.prefix}}"> + {% for frm in formset %}{% ifchanged frm.target.value %} + {# <table> #}{% if not forloop.first%}</table>{% endif %} + <table class='clean-table'> + <caption>{{ frm.target.field.choices.0.1 }}</caption> + <tr> + <th>{% trans "Key" %}</th> + <th>{% trans "Value" %}</th> + <th>{% trans "For" %}</th> + </tr> + {% endifchanged %} + <tr> + <td> + {{frm.id}} + {{frm.target}} + {{frm.key}} + </td> + <td> + {{frm.value}} + </td> + <td> + {{frm.remember}} + </td> + </tr> + {% if forloop.last %} + </table>{% endif %} + {% endfor %} + + {% if frm.errors %}<ul>{% for error in frm.errors.values %} + <li>{{error}}</li>{% endfor%}</ul>{% endif %} + {% for field in frm %} + {{field}} + {%endfor%} + + </div> + +<input type="submit" value="{% trans 'Validate' %}"/> +</form> +</div> +<p><a href="{% url 'current_imports' %}">{% trans "Back to import list" %}</a></p> +{% endblock %} |
