From 80e8827b0ff40ffa4c37985a6979fca6d7eba097 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 31 Aug 2017 10:39:39 +0200 Subject: Target key forms: choose whom to associated with (refs #3725) --- ishtar_common/templates/blocks/readonly_input.html | 2 + .../templates/blocks/readonly_input_option.html | 1 + ishtar_common/templates/ishtar/form.html | 3 ++ .../templates/ishtar/formset_import_match.html | 55 ++++++++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 ishtar_common/templates/blocks/readonly_input.html create mode 100644 ishtar_common/templates/blocks/readonly_input_option.html create mode 100644 ishtar_common/templates/ishtar/formset_import_match.html (limited to 'ishtar_common/templates') 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 %}{% 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 @@
{% csrf_token %} + {% for error in form.non_field_errors %} +

{{ error }}

+ {% endfor %} {{form}}
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 %} +

{{page_name}}

+

{% trans "Back to import list" %}

+
+{% csrf_token %} + + {% if extra_formset.non_form_errors %} +
{{extra_formset.non_form_errors.as_ul}}
{% endif %} + + {{ formset.management_form }} + {% for hidden in frm.hidden_fields %} {{ hidden }} {% endfor %} + +
+ {% for frm in formset %}{% ifchanged frm.target.value %} + {# #}{% if not forloop.first%}
{% endif %} + + + + + + + + {% endifchanged %} + + + + + + {% if forloop.last %} +
{{ frm.target.field.choices.0.1 }}
{% trans "Key" %}{% trans "Value" %}{% trans "For" %}
+ {{frm.id}} + {{frm.target}} + {{frm.key}} + + {{frm.value}} + + {{frm.remember}} +
{% endif %} + {% endfor %} + + {% if frm.errors %}
    {% for error in frm.errors.values %} +
  • {{error}}
  • {% endfor%}
{% endif %} + {% for field in frm %} + {{field}} + {%endfor%} + +
+ + + +
+

{% trans "Back to import list" %}

+{% endblock %} -- cgit v1.2.3