diff options
Diffstat (limited to 'ishtar_common/templates/ishtar/forms/document.html')
-rw-r--r-- | ishtar_common/templates/ishtar/forms/document.html | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ishtar_common/templates/ishtar/forms/document.html b/ishtar_common/templates/ishtar/forms/document.html index b3a9a8e15..ed5a39daf 100644 --- a/ishtar_common/templates/ishtar/forms/document.html +++ b/ishtar_common/templates/ishtar/forms/document.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load i18n inline_formset table_form %} +{% load i18n inline_formset table_form from_dict %} {% block extra_head %} {{form.media}} {% endblock %} @@ -11,9 +11,19 @@ {% block content %} <h2>{{page_name}}</h2> <div class='form{% if not form.SEARCH_AND_SELECT %} container{% endif %}'> + {% if form.non_field_errors or form.errors %} + <div class="alert alert-danger"> + <div><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> + {% trans "Error on validation. Check all your fields. Modification not saved." %} + </div> {% for error in form.non_field_errors %} <p>{{ error }}</p> {% endfor %} + {% for key, error_details in form.errors.items %} + {% with field=key|from_dict:form.fields %}<strong>{{ field.label }}</strong>{{error_details}}{% endwith %} + {% endfor %} +</div> + {% endif %} {% bs_form form %} </div> {% endblock %} |