Use the new error messages when uploading a letter

We now use the pattern of showing a box at the top of the page with the
error. The error message has a heading and can have additional details.
Error messages and the invalid pages get stored in the S3 metadata.
This commit is contained in:
Katie Smith
2019-10-15 15:56:06 +01:00
parent 3223956ba2
commit 3b3f74bbf0
7 changed files with 122 additions and 43 deletions

View File

@@ -4,10 +4,11 @@
button_text="Choose file",
alternate_link=None,
alternate_link_text=None,
hint=None
hint=None,
show_errors=True
) %}
<form method="post" enctype="multipart/form-data" {% if action %}action="{{ action }}"{% endif %} class="{% if field.errors %}form-group-error{% endif %}" data-module="file-upload">
<form method="post" enctype="multipart/form-data" {% if action %}action="{{ action }}"{% endif %} class="{% if field.errors and show_errors %}form-group-error{% endif %}" data-module="file-upload">
<label class="file-upload-label" for="{{ field.name }}">
<span class="visually-hidden">{{ field.label.text }}</span>
{% if hint %}
@@ -15,7 +16,7 @@
{{ hint }}
</span>
{% endif %}
{% if field.errors %}
{% if field.errors and show_errors %}
<span class="error-message">
{{ field.errors[0] }}
</span>