2024-02-06 16:08:14 -08:00
{% extends "withnav_template.html" %}
{% from "components/banner.html" import banner_wrapper %}
{% from "components/page-header.html" import page_header %}
{% from "components/components/back-link/macro.njk" import usaBackLink %}
{% from "components/components/button/macro.njk" import usaButton %}
{% block service_page_title %}
{{ "Error" if error else "Preview of ‘ {}’ ".format(template.name) }}
{% endblock %}
{% block backLink %}
{{ usaBackLink({ "href": back_link_from_preview }) }}
{% endblock %}
{% block maincolumn_content %}
{% if 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 %}
2024-02-13 13:29:38 -08:00
{{ page_header('Preview') }}
2024-02-06 16:08:14 -08:00
{% endif %}
2024-02-13 13:29:38 -08:00
< h2 id = "{{ file_contents_header_id }}" > Message< / h2 >
2024-02-06 16:08:14 -08:00
2024-02-13 13:29:38 -08:00
< p class = "sms-message-scheduler" > Scheduled:
{{ scheduled_for if scheduled_for else 'Now'}}< / p >
< p class = "sms-message-template" > Template: {{template.name}}< / p >
2024-02-06 16:08:14 -08:00
{{ 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() }}" / >
2024-02-13 13:29:38 -08:00
< p > Placeholder: This message will be delivered to < b > 400 phone numbers< / b > and will use a total of < b > 800 message parts< / b > , leaving Washington DSHS with < b > 249,200 message parts remaining< / b > .< / p >
2024-02-06 17:06:18 -08:00
< h3 > Does everything look good?< / h3 >
2024-02-06 16:08:14 -08:00
{% if not error %}
{% set button_text %}
2024-02-13 13:29:38 -08:00
{{ "Scheduled" if scheduled_for else 'Send'}}
2024-02-06 16:08:14 -08:00
{% endset %}
{{ usaButton({ "text": button_text }) }}
{% endif %}
< / form >
< / div >
{% endblock %}