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

@@ -1,4 +1,5 @@
{% extends "withnav_template.html" %}
{% from "components/banner.html" import banner_wrapper %}
{% from "components/page-header.html" import page_header %}
{% block service_page_title %}
@@ -6,16 +7,19 @@
{% endblock %}
{% block maincolumn_content %}
{{ page_header(
{% if status == 'invalid' and error %}
{% call banner_wrapper(type='dangerous') %}
<h1 class="banner-title">{{ error.title }}</h1>
{% if error.detail %}
<p>{{ error.detail | safe }}</p>
{% endif %}
{% endcall %}
{% else %}
{{ page_header(
original_filename,
back_link=url_for('main.upload_letter', service_id=current_service.id)
) }}
{% if status == 'invalid' %}
<p class="notification-status-cancelled" id="validation-error-message">
Validation failed
</p>
{% endif %}
) }}
{% endif %}
<div class="letter-sent">
{{ template|string }}