mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-06 06:20:53 -04:00
This page is a good use case for sticky footers because the primary action on the page would otherwise be off the bottom of the viewport.
74 lines
2.7 KiB
HTML
74 lines
2.7 KiB
HTML
{% extends "withnav_template.html" %}
|
||
{% from "components/banner.html" import banner_wrapper %}
|
||
{% from "components/message-count-label.html" import message_count_label %}
|
||
|
||
{% block service_page_title %}
|
||
{{ "Error" if error else "Preview of ‘{}’".format(template.name) }}
|
||
{% endblock %}
|
||
|
||
{% block maincolumn_content %}
|
||
{% if template.template_type == 'letter' and current_service.trial_mode %}
|
||
{% set error = 'trial-mode-letters' %}
|
||
<div class="bottom-gutter">
|
||
{% call banner_wrapper(type='dangerous') %}
|
||
{% with
|
||
count_of_recipients=1
|
||
%}
|
||
{% include "partials/check/trying-to-send-letters-in-trial-mode.html" %}
|
||
{% endwith %}
|
||
{% endcall %}
|
||
</div>
|
||
{% elif error == 'not-allowed-to-send-to' %}
|
||
<div class="bottom-gutter">
|
||
{% call banner_wrapper(type='dangerous') %}
|
||
{% with
|
||
count_of_recipients=1,
|
||
template_type_label=(
|
||
'phone number' if template.template_type == 'sms' else 'email address'
|
||
)
|
||
%}
|
||
{% include "partials/check/not-allowed-to-send-to.html" %}
|
||
{% endwith %}
|
||
{% endcall %}
|
||
</div>
|
||
{% elif error == 'too-many-messages' %}
|
||
<div class="bottom-gutter">
|
||
{% call banner_wrapper(type='dangerous') %}
|
||
{% include "partials/check/too-many-messages.html" %}
|
||
{% endcall %}
|
||
</div>
|
||
{% elif error == 'message-too-long' %}
|
||
{# the only row_errors we can get when sending one off messages is that the message is too long #}
|
||
<div class="bottom-gutter">
|
||
{% call banner_wrapper(type='dangerous') %}
|
||
{% include "partials/check/message-too-long.html" %}
|
||
{% endcall %}
|
||
</div>
|
||
{% else %}
|
||
<h1 class="heading-large">
|
||
Preview of ‘{{ template.name }}’
|
||
</h1>
|
||
{% endif %}
|
||
|
||
{{ template|string }}
|
||
|
||
<div class="js-stick-at-bottom-when-scrolling">
|
||
<form method="post" enctype="multipart/form-data" action="{{url_for(
|
||
'main.send_notification',
|
||
service_id=current_service.id,
|
||
template_id=template.id,
|
||
help='3' if help else 0
|
||
)}}" class='page-footer'>
|
||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||
{% if not error %}
|
||
<button type="submit" class="button">Send 1 {{ message_count_label(1, template.template_type, suffix='') }}</button>
|
||
{% endif %}
|
||
<a href="{{ back_link }}" class="page-footer-back-link">Back</a>
|
||
{% if template.template_type == 'letter' %}
|
||
<a href="{{ url_for('main.check_notification_preview', service_id=current_service.id, template_id=template.id, filetype='pdf') }}" download class="page-footer-right-aligned-link">Download as a printable PDF</a>
|
||
{% endif %}
|
||
</form>
|
||
</div>
|
||
|
||
{% endblock %}
|