mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-05 05:50:41 -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.
47 lines
1.7 KiB
HTML
47 lines
1.7 KiB
HTML
{% extends "withnav_template.html" %}
|
||
{% from "components/banner.html" import banner_wrapper %}
|
||
{% from "components/file-upload.html" import file_upload %}
|
||
{% from "components/page-header.html" import page_header %}
|
||
{% from "components/back-link/macro.njk" import govukBackLink %}
|
||
|
||
{% block service_page_title %}
|
||
Upload a letter
|
||
{% endblock %}
|
||
|
||
{% block backLink %}
|
||
{% if not error %}
|
||
{{ govukBackLink({ "href": url_for('main.uploads', service_id=current_service.id) }) }}
|
||
{% endif %}
|
||
{% endblock %}
|
||
|
||
{% block maincolumn_content %}
|
||
<div class="govuk-grid-row">
|
||
<div class="govuk-grid-column-five-sixths">
|
||
{% if error %}
|
||
{% call banner_wrapper(type='dangerous') %}
|
||
<h1 class="banner-title">{{ error.title }}</h1>
|
||
{% if error.detail %}
|
||
<p class="govuk-body">{{ error.detail | safe }}</p>
|
||
{% endif %}
|
||
{% endcall %}
|
||
{% else %}
|
||
{{ page_header('Upload a letter') }}
|
||
<p class="govuk-body">Upload a single letter as a PDF and we’ll print, pack and post it for you.</p>
|
||
<p class="govuk-body">You can use this feature if you send a lot of one-off letters or if our reusable letter templates do not meet your needs.</p>
|
||
{% endif %}
|
||
|
||
<p class="govuk-body">
|
||
{{ file_upload(
|
||
form.file,
|
||
allowed_file_extensions=['pdf'],
|
||
action=url_for('main.upload_letter', service_id=current_service.id),
|
||
button_text='Upload your file again' if error else 'Choose file',
|
||
show_errors=False
|
||
)}}
|
||
</p>
|
||
|
||
<p class="govuk-body">Your file must meet our <a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('main.letter_specification') }}">letter specification</a>.</p>
|
||
</div>
|
||
</div>
|
||
{% endblock %}
|