2017-06-12 17:21:25 +01:00
{% extends "withnav_template.html" %}
{% from "components/banner.html" import banner %}
{% from "components/ajax-block.html" import ajax_block %}
2017-06-24 17:12:45 +01:00
{% from "components/message-count-label.html" import message_count_label %}
2017-06-12 17:21:25 +01:00
{% from "components/page-footer.html" import page_footer %}
{% block service_page_title %}
2017-07-04 14:05:11 +01:00
{{ message_count_label(1, template.template_type, suffix='') | capitalize }}
2017-06-12 17:21:25 +01:00
{% endblock %}
{% block maincolumn_content %}
< h1 class = "heading-large" >
2017-06-24 17:12:45 +01:00
{{ message_count_label(1, template.template_type, suffix='') | capitalize }}
2017-06-12 17:21:25 +01:00
< / h1 >
2017-06-24 17:12:45 +01:00
< p >
2018-03-02 17:06:51 +00:00
{% if is_precompiled_letter %}
2019-01-17 14:22:58 +00:00
Provided as PDF
2017-07-04 09:32:09 +01:00
{% else %}
2018-03-02 17:06:51 +00:00
{% if help %}
2018-11-27 16:49:01 +00:00
‘ {{ template.name }}’
2018-03-02 17:06:51 +00:00
{% else %}
2018-11-27 16:49:01 +00:00
< a href = "{{ url_for('.view_template', service_id=current_service.id, template_id=template.id) }}" > ‘ {{ template.name }}’ < / a >
2018-03-02 17:06:51 +00:00
{% endif %}
2018-11-27 16:49:01 +00:00
was sent
2017-07-04 09:32:09 +01:00
{% endif %}
2017-06-24 17:12:45 +01:00
{% if job and job.original_file_name != 'Report' %}
2018-11-27 16:49:01 +00:00
{% set destination =
{'letter': 'an address', 'email': 'an email address', 'sms': 'a phone number'} %}
to {{ destination[template.template_type] }} from
2017-06-24 17:12:45 +01:00
< a href = "{{ url_for('.view_job', service_id=current_service.id, job_id=job.id) }}" > {{ job.original_file_name }}< / a >
{% elif created_by %}
by {{ created_by.name }}
{% endif %}
on {{ created_at|format_datetime_short }}
< / p >
2017-07-13 13:05:41 +01:00
{% if template.template_type == 'letter' %}
2018-12-04 15:07:20 +00:00
{% if notification_status in ('permanent-failure', 'cancelled') %}
2018-10-11 10:54:39 +01:00
< p class = "notification-status-cancelled" >
Cancelled {{ updated_at|format_datetime_short }}
< / p >
2018-10-29 12:11:47 +00:00
{% elif notification_status == 'validation-failed' %}
< p class = "notification-status-cancelled" >
2019-01-09 13:09:51 +00:00
Validation failed – content is outside the printable area
2018-10-29 12:11:47 +00:00
< / p >
2019-01-10 17:25:23 +00:00
{% elif notification_status == 'technical-failure' %}
< p class = "notification-status-cancelled" >
Technical failure – Notify will resend once the team have
fixed the problem
< / p >
2018-10-11 10:54:39 +01:00
{% else %}
2019-01-17 14:22:58 +00:00
{% if sent_with_test_key %}
{% if is_precompiled_letter %}
< p >
2019-01-22 10:38:40 +00:00
This letter passed our checks, but we will not print it because you used a test key.
2019-01-17 14:22:58 +00:00
< / p >
{% else %}
< p >
2019-01-22 10:38:40 +00:00
We will not print this letter because you used a test key.
2019-01-17 14:22:58 +00:00
< / p >
{% endif %}
{% else %}
< p >
{{ letter_print_day }}
< / p >
< p >
Estimated delivery date: {{ estimated_letter_delivery_date|string|format_date_short }}
< / p >
{% endif %}
2018-10-11 10:54:39 +01:00
{% endif %}
2017-07-13 13:05:41 +01:00
{% endif %}
2019-02-07 15:59:31 +00:00
< div class = "{{ 'letter-sent' if template.template_type == 'letter' else '' }}" >
{{ template|string }}
< / div >
2017-06-12 17:21:25 +01:00
2018-11-22 12:16:32 +00:00
{% if template.template_type == 'letter' %}
< div class = "js-stick-at-bottom-when-scrolling" >
< div class = "page-footer" >
2018-12-05 10:58:27 +00:00
{% if show_cancel_button %}
< span class = "page-footer-delete-link page-footer-delete-link-without-button" >
< a href = "{{ url_for('main.cancel_letter', service_id=current_service.id, notification_id=notification_id) }}" > Cancel sending this letter< / a >
< / span >
{% else %}
< div > < / div >
{% endif %}
2018-11-22 12:16:32 +00:00
< a class = "page-footer-right-aligned-link" href = "{{ url_for('main.view_letter_notification_as_preview', service_id=current_service.id, notification_id=notification_id, filetype='pdf') }}" download > Download as a PDF< / a >
< / div >
< / div >
{% elif template.template_type == 'email' %}
< div class = "js-stick-at-bottom-when-scrolling" >
{{ ajax_block(partials, updates_url, 'status', finished=finished) }}
< / div >
{% elif template.template_type == 'sms' %}
2017-07-13 13:05:41 +01:00
{{ ajax_block(partials, updates_url, 'status', finished=finished) }}
{% endif %}
2017-06-12 17:21:25 +01:00
2018-06-13 16:35:00 +01:00
{% if current_user.has_permissions('send_messages') and current_user.has_permissions('view_activity') and template.template_type == 'sms' and can_receive_inbound %}
2017-10-16 10:30:59 +01:00
< p >
< a href = "{{ url_for('.conversation', service_id=current_service.id, notification_id=notification_id, _anchor='n{}'.format(notification_id)) }}" > See all text messages sent to this phone number< / a >
< / p >
{% endif %}
2017-06-12 17:21:25 +01:00
{% endblock %}