mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-03 21:21:14 -04:00
Use one page template for each of: - choosing a message template - adding recipients - checking an email message - looking at a job This commit consolidates the two templates into one, and adds logic to show the SMS message pattern or the email message pattern depending on the type of template. It also gives email templates a bit more width, because the body and the from address tend to be quite long.
57 lines
1.9 KiB
HTML
57 lines
1.9 KiB
HTML
{% extends "withnav_template.html" %}
|
||
{% from "components/email-message.html" import email_message %}
|
||
{% from "components/sms-message.html" import sms_message %}
|
||
{% from "components/page-footer.html" import page_footer %}
|
||
{% from "components/textbox.html" import textbox %}
|
||
|
||
{% block page_title %}
|
||
{{ page_heading }} – GOV.UK Notify
|
||
{% endblock %}
|
||
|
||
{% block maincolumn_content %}
|
||
|
||
<h1 class="heading-large">{{ page_heading }}</h1>
|
||
|
||
<form method="POST" enctype="multipart/form-data">
|
||
|
||
{% if templates %}
|
||
{% if not has_jobs %}
|
||
{{ banner(
|
||
"""
|
||
Send yourself a test message
|
||
""",
|
||
subhead='Next step',
|
||
type="tip"
|
||
)}}
|
||
{% endif %}
|
||
<div class="grid-row">
|
||
{% for template in templates %}
|
||
<div class="column-two-thirds">
|
||
{% if 'email' == template_type %}
|
||
{{ email_message(
|
||
template.subject,
|
||
template.formatted_as_markup,
|
||
name=template.name
|
||
) }}
|
||
{% elif 'sms' == template_type %}
|
||
{{ sms_message(template.formatted_as_markup, name=template.name) }}
|
||
{% endif %}
|
||
</div>
|
||
<div class="column-one-third">
|
||
<div class="sms-message-use-links">
|
||
<a href="{{ url_for(".send_messages", service_id=service_id, template_id=template.id) }}">Add recipients</a>
|
||
<a href="{{ url_for(".send_message_to_self", service_id=service_id, template_id=template.id) }}">Send yourself a test</a>
|
||
<a href="{{ url_for(".edit_service_template", service_id=service_id, template_id=template.id) }}">Edit template</a>
|
||
</div>
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
{% endif %}
|
||
|
||
<p>
|
||
<a href="{{ url_for('.add_service_template', service_id=service_id, template_type=template_type) }}" class="button">Add a new template</a>
|
||
</p>
|
||
|
||
</form>
|
||
{% endblock %}
|