Files
notifications-admin/app/templates/views/check-sms.html
Chris Hill-Scott d2562889b8 Replace CSV preview with rendered messages
If there are less than 7 messages, show them all.

If there are more than 7, show the first and last three, and a link to the
remaining x.
2015-12-11 14:02:42 +00:00

69 lines
2.0 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "admin_template.html" %}
{% from "components/sms-message.html" import sms_message %}
{% from "components/table.html" import table, field %}
{% from "components/placeholder.html" import placeholder %}
{% block page_title %}
GOV.UK Notify | Send text messages
{% endblock %}
{% block content %}
<div class="grid-row">
<div class="column-two-thirds">
<h1 class="heading-xlarge">Send text messages</h1>
<h2 class="heading-medium">Check and confirm</h2>
<p>
<form method="POST" enctype="multipart/form-data">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="submit" class="button" value="Send {{ number_of_recipients }} text messages" />
<a class="button-secondary" role="button" href="{{ url_for(".sendsms") }}">Back</a>
</form>
</p>
{% if recipients.first_three and recipients.last_three %}
{% for recipient in recipients.first_three %}
{{ sms_message(
message_template|replace_placeholders(recipient),
"Row {}{}".format(loop.index, recipient['phone'])
) }}
{% endfor %}
<p>
<a href="#">See rows 4 to {{ number_of_recipients - 3 }}</a>
</p>
{% for recipient in recipients.last_three %}
{{ sms_message(
message_template|replace_placeholders(recipient),
"Row {}{}".format(number_of_recipients - 3 + loop.index, recipient['phone'])
) }}
{% endfor %}
{% else %}
{% for recipient in recipients.all %}
{{ sms_message(
message_template|replace_placeholders(recipient),
"Row {}{}".format(loop.index, recipient['phone'])
) }}
{% endfor %}
{% endif %}
<p>
<form method="POST" enctype="multipart/form-data">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="submit" class="button" value="Send {{ number_of_recipients }} text messages" />
<a class="button-secondary" role="button" href="{{ url_for(".sendsms") }}">Back</a>
</form>
</p>
</div>
</div>
{% endblock %}