2017-06-23 15:02:20 +01:00
|
|
|
|
{% extends "withnav_template.html" %}
|
2017-07-25 22:57:01 +01:00
|
|
|
|
{% from "components/banner.html" import banner_wrapper %}
|
2017-06-23 15:02:20 +01:00
|
|
|
|
{% from "components/message-count-label.html" import message_count_label %}
|
2019-11-29 09:02:16 +00:00
|
|
|
|
{% from "components/page-header.html" import page_header %}
|
|
|
|
|
|
{% from "components/back-link/macro.njk" import govukBackLink %}
|
2020-01-30 14:01:13 +00:00
|
|
|
|
{% from "components/button/macro.njk" import govukButton %}
|
2017-06-23 15:02:20 +01:00
|
|
|
|
|
|
|
|
|
|
{% block service_page_title %}
|
2018-08-06 11:20:50 +01:00
|
|
|
|
{{ "Error" if error else "Preview of ‘{}’".format(template.name) }}
|
2017-06-23 15:02:20 +01:00
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
|
|
{% block maincolumn_content %}
|
2018-10-30 16:32:10 +00:00
|
|
|
|
{% if template.template_type == 'letter' and current_service.trial_mode %}
|
2019-11-29 09:02:16 +00:00
|
|
|
|
{{ govukBackLink({ "href": back_link }) }}
|
2018-10-30 16:32:10 +00:00
|
|
|
|
{% set error = 'trial-mode-letters' %}
|
|
|
|
|
|
<div class="bottom-gutter">
|
2018-11-01 14:45:12 +00:00
|
|
|
|
{% call banner_wrapper(type='dangerous') %}
|
|
|
|
|
|
{% with
|
|
|
|
|
|
count_of_recipients=1
|
|
|
|
|
|
%}
|
2018-10-30 16:32:10 +00:00
|
|
|
|
{% include "partials/check/trying-to-send-letters-in-trial-mode.html" %}
|
2018-11-01 14:45:12 +00:00
|
|
|
|
{% endwith %}
|
|
|
|
|
|
{% endcall %}
|
2018-10-30 16:32:10 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
{% elif error == 'not-allowed-to-send-to' %}
|
2019-11-29 09:02:16 +00:00
|
|
|
|
{{ govukBackLink({ "href": back_link }) }}
|
2017-07-25 22:57:01 +01:00
|
|
|
|
<div class="bottom-gutter">
|
|
|
|
|
|
{% call banner_wrapper(type='dangerous') %}
|
|
|
|
|
|
{% with
|
|
|
|
|
|
count_of_recipients=1,
|
2017-07-25 23:06:55 +01:00
|
|
|
|
template_type_label=(
|
|
|
|
|
|
'phone number' if template.template_type == 'sms' else 'email address'
|
|
|
|
|
|
)
|
2017-07-25 22:57:01 +01:00
|
|
|
|
%}
|
|
|
|
|
|
{% include "partials/check/not-allowed-to-send-to.html" %}
|
|
|
|
|
|
{% endwith %}
|
|
|
|
|
|
{% endcall %}
|
|
|
|
|
|
</div>
|
2017-06-29 16:06:36 +01:00
|
|
|
|
{% elif error == 'too-many-messages' %}
|
2019-11-29 09:02:16 +00:00
|
|
|
|
{{ govukBackLink({ "href": back_link }) }}
|
2017-07-25 22:57:01 +01:00
|
|
|
|
<div class="bottom-gutter">
|
|
|
|
|
|
{% call banner_wrapper(type='dangerous') %}
|
|
|
|
|
|
{% include "partials/check/too-many-messages.html" %}
|
|
|
|
|
|
{% endcall %}
|
|
|
|
|
|
</div>
|
2017-06-29 16:06:36 +01:00
|
|
|
|
{% elif error == 'message-too-long' %}
|
2017-06-29 15:33:31 +01:00
|
|
|
|
{# the only row_errors we can get when sending one off messages is that the message is too long #}
|
2019-11-29 09:02:16 +00:00
|
|
|
|
{{ govukBackLink({ "href": back_link }) }}
|
2017-07-25 22:57:01 +01:00
|
|
|
|
<div class="bottom-gutter">
|
|
|
|
|
|
{% call banner_wrapper(type='dangerous') %}
|
|
|
|
|
|
{% include "partials/check/message-too-long.html" %}
|
|
|
|
|
|
{% endcall %}
|
|
|
|
|
|
</div>
|
2019-10-01 17:16:15 +01:00
|
|
|
|
{% elif letter_too_long %}
|
|
|
|
|
|
{% set error = 'letter-too-long' %}
|
2019-11-29 09:02:16 +00:00
|
|
|
|
{{ govukBackLink({ "href": back_link }) }}
|
2019-10-01 17:16:15 +01:00
|
|
|
|
<div class="bottom-gutter">
|
2019-10-24 14:17:01 +01:00
|
|
|
|
{% call banner_wrapper(type='dangerous') %}
|
2019-10-01 17:16:15 +01:00
|
|
|
|
{% include "partials/check/letter-too-long.html" %}
|
|
|
|
|
|
{% endcall %}
|
|
|
|
|
|
</div>
|
2017-06-29 15:33:31 +01:00
|
|
|
|
{% else %}
|
2019-04-29 11:44:05 +01:00
|
|
|
|
{{ page_header(
|
|
|
|
|
|
'Preview of ‘{}’'.format(template.name),
|
|
|
|
|
|
back_link=back_link
|
|
|
|
|
|
) }}
|
2017-06-29 15:33:31 +01:00
|
|
|
|
{% endif %}
|
2017-06-23 15:02:20 +01:00
|
|
|
|
|
|
|
|
|
|
{{ template|string }}
|
|
|
|
|
|
|
2018-11-19 15:21:09 +00:00
|
|
|
|
<div class="js-stick-at-bottom-when-scrolling">
|
2017-06-30 11:49:03 +01:00
|
|
|
|
<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'>
|
2017-06-23 15:02:20 +01:00
|
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
2019-10-01 17:16:15 +01:00
|
|
|
|
{% if not error %}
|
2020-01-30 14:01:13 +00:00
|
|
|
|
{% set button_text %}Send 1 {{ message_count_label(1, template.template_type, suffix='') }}{% endset %}
|
|
|
|
|
|
{{ govukButton({ "text": button_text }) }}
|
2017-06-23 15:02:20 +01:00
|
|
|
|
{% endif %}
|
2018-10-30 14:27:09 +00:00
|
|
|
|
{% if template.template_type == 'letter' %}
|
2019-12-06 07:53:46 +00:00
|
|
|
|
<a href="{{ url_for('no_cookie.check_notification_preview', service_id=current_service.id, template_id=template.id, filetype='pdf') }}" download class="govuk-link govuk-link--no-visited-state page-footer-right-aligned-link{% if error %}-without-button{% endif %}">Download as a PDF</a>
|
2018-10-30 14:27:09 +00:00
|
|
|
|
{% endif %}
|
2017-06-23 15:02:20 +01:00
|
|
|
|
</form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{% endblock %}
|