Files
notifications-admin/app/templates/views/send-contact-list.html
Katie Smith 0f0b8b8ae4 Move back link outside of main where it was used in the page header
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.
2021-08-03 11:28:15 +01:00

79 lines
2.9 KiB
HTML

{% extends "withnav_template.html" %}
{% from "components/big-number.html" import big_number -%}
{% from "components/list.html" import list_of_placeholders %}
{% from "components/page-header.html" import page_header %}
{% from "components/table.html" import list_table, field, right_aligned_field_heading, row_heading %}
{% from "components/back-link/macro.njk" import govukBackLink %}
{% block service_page_title %}
Choose an emergency contact list
{% endblock %}
{% block backLink %}
{{ govukBackLink({ "href": url_for('.send_one_off', service_id=current_service.id, template_id=template.id) }) }}
{% endblock %}
{% block maincolumn_content %}
{{ page_header('Choose an emergency contact list') }}
{% if template.placeholders %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-five-sixths">
<p class="govuk-body">
You cannot use an emergency contact list with this template because it
is personalised with {{ list_of_placeholders(template.placeholders) }}.
</p>
<p class="govuk-body">
Emergency contact lists can only include email addresses or phone
numbers.
</p>
</div>
</div>
{% elif contact_lists %}
<div class='dashboard-table ajax-block-container'>
{% call(item, row_number) list_table(
contact_lists,
caption="Emergency contact lists",
caption_visible=False,
empty_message=(
'You have not saved any contact lists yet.'
),
field_headings=[
'File',
'Status'
],
field_headings_visible=False
) %}
{% call row_heading() %}
<div class="file-list">
<a class="file-list-filename-large govuk-link govuk-link--no-visited-state" href="{{ url_for('main.send_from_contact_list', service_id=current_service.id, template_id=template.id, contact_list_id=item.id) }}">{{ item.original_file_name }}</a>
<span class="file-list-hint-large">
Uploaded {{ item.created_at|format_datetime_relative }}
</span>
</div>
{% endcall %}
{% call field() %}
{{ big_number(
item.row_count,
smallest=True,
label=item.row_count|recipient_count_label(item.template_type),
) }}
{% endcall %}
{% endcall %}
</div>
{% else %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-five-sixths">
<p class="govuk-body">
You have not saved any lists of {{ 99|recipient_count_label(template.template_type) }} yet.
</p>
<p class="govuk-body">
To upload and save an emergency contact list, go to the <a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('main.uploads', service_id=current_service.id) }}">uploads</a> page.
</p>
</div>
</div>
{% endif %}
{% endblock %}