mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-25 10:29:14 -04:00
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.
69 lines
2.0 KiB
HTML
69 lines
2.0 KiB
HTML
{% 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 %}
|