mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-12 13:20:43 -04:00
The page_header macro includes an optional back link. Since the page_header is always used inside `<main>`, where the back link should not be, this stops setting the back link in the page header and instead sets it in the new `backLink` block.
121 lines
5.1 KiB
HTML
121 lines
5.1 KiB
HTML
{% extends "withnav_template.html" %}
|
||
{% from "components/banner.html" import banner %}
|
||
{% from "components/ajax-block.html" import ajax_block %}
|
||
{% from "components/page-header.html" import page_header %}
|
||
{% from "components/page-footer.html" import page_footer %}
|
||
{% from "components/back-link/macro.njk" import govukBackLink %}
|
||
|
||
{% block service_page_title %}
|
||
{{ 1|message_count_label(template.template_type, suffix='') | capitalize }}
|
||
{% endblock %}
|
||
|
||
{% block backLink %}
|
||
{% if back_link %}
|
||
{{ govukBackLink({ "href": back_link }) }}
|
||
{% endif %}
|
||
{% endblock %}
|
||
|
||
{% block maincolumn_content %}
|
||
|
||
{{ page_header(
|
||
1|message_count_label(template.template_type, suffix='') | capitalize
|
||
) }}
|
||
<p class="govuk-body">
|
||
{% if is_precompiled_letter %}
|
||
{% if created_by %}
|
||
Uploaded
|
||
{% else %}
|
||
Provided as PDF
|
||
{% endif %}
|
||
{% else %}
|
||
{% if help %}
|
||
‘{{ template.name }}’
|
||
{% else %}
|
||
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('.view_template', service_id=current_service.id, template_id=template.id) }}">‘{{ template.name }}’</a>
|
||
{% endif %}
|
||
was sent
|
||
{% endif %}
|
||
{% if job and job.original_file_name != 'Report' %}
|
||
{% set destination =
|
||
{'letter': 'an address', 'email': 'an email address', 'sms': 'a phone number'} %}
|
||
to {{ destination[template.template_type] }} from
|
||
<a class="govuk-link govuk-link--no-visited-state" 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 %}
|
||
{{ created_at|format_datetime_human }}
|
||
</p>
|
||
|
||
{% if template.template_type == 'letter' %}
|
||
{% if notification_status == 'cancelled' %}
|
||
<p class="notification-status-cancelled">
|
||
Cancelled {{ updated_at|format_datetime_short }}
|
||
</p>
|
||
{% elif notification_status == 'validation-failed' %}
|
||
<p class="notification-status-cancelled">
|
||
{{ message.summary | safe }}
|
||
</p>
|
||
{% elif notification_status == 'permanent-failure' %}
|
||
<p class="notification-status-cancelled">
|
||
Permanent failure – The provider cannot print the letter. Your letter will not be dispatched.
|
||
</p>
|
||
{% elif notification_status == 'technical-failure' %}
|
||
<p class="notification-status-cancelled">
|
||
Technical failure – Notify will resend once the team have
|
||
fixed the problem
|
||
</p>
|
||
{% else %}
|
||
{% if sent_with_test_key %}
|
||
{% if is_precompiled_letter %}
|
||
<p class="govuk-body">
|
||
This letter passed our checks, but we will not print it because you used a test key.
|
||
</p>
|
||
{% else %}
|
||
<p class="govuk-body">
|
||
We will not print this letter because you used a test key.
|
||
</p>
|
||
{% endif %}
|
||
{% else %}
|
||
<p class="govuk-body">
|
||
{{ letter_print_day }}
|
||
</p>
|
||
<p class="govuk-body">
|
||
Estimated delivery date: {{ estimated_letter_delivery_date|format_day_of_week }} {{ estimated_letter_delivery_date|format_date_short }}
|
||
</p>
|
||
{% endif %}
|
||
{% endif %}
|
||
{% endif %}
|
||
|
||
<div class="{{ 'letter-sent' if template.template_type == 'letter' else '' }}">
|
||
{{ template|string }}
|
||
</div>
|
||
|
||
{% if template.template_type == 'letter' %}
|
||
<div class="js-stick-at-bottom-when-scrolling">
|
||
<div class="page-footer">
|
||
{% if show_cancel_button %}
|
||
<span class="page-footer-delete-link page-footer-delete-link-without-button">
|
||
<a class="govuk-link govuk-link--destructive" 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 %}
|
||
<a class="govuk-link govuk-link--no-visited-state page-footer-right-aligned-link-without-button" 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' %}
|
||
{{ ajax_block(partials, updates_url, 'status', finished=finished) }}
|
||
{% endif %}
|
||
|
||
{% if current_user.has_permissions('send_messages') and current_user.has_permissions('view_activity') and template.template_type == 'sms' and can_receive_inbound %}
|
||
<p class="govuk-body">
|
||
<a class="govuk-link govuk-link--no-visited-state" 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 %}
|
||
|
||
{% endblock %}
|