From 8355b16b1ae2f213de8d9f98221227f587e3b29f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 27 Nov 2020 11:26:55 +0100 Subject: Documents: dynamic filter of support and medium by document type - collapse related fields on edition --- ishtar_common/templates/blocks/bs_form_snippet.html | 2 +- ishtar_common/templates/ishtar/forms/document.html | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/blocks/bs_form_snippet.html b/ishtar_common/templates/blocks/bs_form_snippet.html index e24220005..3d84ce3dc 100644 --- a/ishtar_common/templates/blocks/bs_form_snippet.html +++ b/ishtar_common/templates/blocks/bs_form_snippet.html @@ -1,5 +1,5 @@ {% load i18n from_dict %} -{% if form.non_field_errors %} +{% if form.non_field_errors and not no_error %} diff --git a/ishtar_common/templates/ishtar/forms/document.html b/ishtar_common/templates/ishtar/forms/document.html index ed5a39daf..8e2683a03 100644 --- a/ishtar_common/templates/ishtar/forms/document.html +++ b/ishtar_common/templates/ishtar/forms/document.html @@ -13,18 +13,18 @@
{% if form.non_field_errors or form.errors %}
-
- {% trans "Error on validation. Check all your fields. Modification not saved." %} +
+ {% trans "Error on validation. Check all your fields. Modification not saved." %} +
+ {% for key, error_details in form.errors.items %} + {% with field=key|from_dict:form.fields %}{{ field.label }}{{error_details}}{% endwith %} + {% endfor %}
- {% for error in form.non_field_errors %} -

{{ error }}

- {% endfor %} - {% for key, error_details in form.errors.items %} - {% with field=key|from_dict:form.fields %}{{ field.label }}{{error_details}}{% endwith %} - {% endfor %} -
{% endif %} - {% bs_form form %} + {% if item_related_label %}
+ {% trans "Related items" %}{% trans ":" %} {{ item_related_label }} +
{% endif %} + {% bs_form form 0 True %}
{% endblock %} -- cgit v1.2.3