Show if a letter has been cancelled

At the moment we are manually cancelling letters for people when they
ask us to. Once’s we’ve done this there is no indication that it’s
happened except for the date going red on the list of letters.

This commit adds some error messaging and styling to show when a letter
is cancelled.

Letting people cancel their own letters will be a future enhancement.
This commit is contained in:
Chris Hill-Scott
2018-10-11 10:54:39 +01:00
parent 78cb3d1165
commit c01d761a3c
8 changed files with 84 additions and 26 deletions

View File

@@ -154,7 +154,7 @@
align='right'
) %}
{% if displayed_on_single_line %}<span class="align-with-message-body">{% endif %}
{% if notification.status|format_notification_status_as_url %}
{% if notification.status|format_notification_status_as_url(notification.notification_type) %}
<a href="{{ notification.status|format_notification_status_as_url }}">
{% endif %}
{% if notification['notification_type'] != "letter" or notification.status == 'virus-scan-failed' %}
@@ -162,12 +162,19 @@
notification.template.template_type
) }}
{% endif %}
{% if notification.status|format_notification_status_as_url %}
{% if notification.notification_type == "letter" and notification.status == 'permanent-failure' %}
Cancelled
{% endif %}
{% if notification.status|format_notification_status_as_url(notification.notification_type) %}
</a>
{% endif %}
<span class="status-hint">
{% if notification['notification_type'] == "letter" %}
{{ notification.created_at|format_datetime_short }}
{% if notification.status == 'permanent-failure' %}
{{ (notification.updated_at)|format_datetime_short }}
{% else %}
{{ (notification.created_at)|format_datetime_short }}
{% endif %}
{% else %}
{{ notification.status|format_notification_status_as_time(
notification.created_at|format_datetime_short,