Files
notifications-admin/app/templates/views/choose-template.html
Chris Hill-Scott d1665e7109 Make ‘get started’ work for emails and texts
Previously the ‘get started’ block on the dashboard pushed users into
starting with a text message. This led to users writing email content
into a tet message template because it didn’t match their expectations.

Also, the ‘send yourself a test’ link from the dashboard:
- wasn’t much used, because users responded to the similar call to
  action on the choose template page instead
- was confusing if you had created an email template because it
  presupposed that you’d created a text message template

So this commit changes the ‘get started’ block to be a choice between
creating an email template or a text message template. We reckon that
the language of ‘set up’ will help establish that templates are not
equivalent to individual messages. This language is now repeated on the
‘choose template’ page when you don’t have templates as well.
2016-04-01 07:58:23 +01:00

93 lines
3.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% 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 %}
{% if not templates %}
<h1 class="heading-large">{{ page_heading }}</h1>
{% if current_user.has_permissions(permissions=['manage_templates'], any_=True) %}
<p class="bottom-gutter">
You need a template before you can send
{{ 'emails' if 'email' == template_type else 'text messages' }}
</p>
<a href="{{ url_for('.add_service_template', service_id=service_id, template_type=template_type) }}" class="button">Add a new template</a>
{% else %}
<p>You need to ask your service manager to add templates before you can send messages</p>
{% endif %}
{% else %}
<div class="grid-row">
<div class="column-two-thirds">
<h1 class="heading-large">{{ page_heading }}</h1>
</div>
{% if current_user.has_permissions(permissions=['manage_templates'], admin_override=True) %}
<div class="column-one-third">
<a href="{{ url_for('.add_service_template', service_id=service_id, template_type=template_type) }}" class="button align-with-heading">Add new template</a>
</div>
{% endif %}
</div>
{% if not has_jobs %}
{% if current_user.has_permissions(permissions=['send_texts', 'send_emails', 'send_letters'], any_=True) %}
{{ banner(
"""
Send yourself a test
""",
subhead='Next step:',
type="tip"
)}}
{% endif %}
{% 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,
edit_link=(
url_for(".edit_service_template", service_id=service_id, template_id=template.id)
if current_user.has_permissions(permissions=['manage_templates'], admin_override=True) else
None
)
) }}
{% elif 'sms' == template_type %}
{{ sms_message(
template.formatted_as_markup,
name=template.name,
edit_link=(
url_for(".edit_service_template", service_id=service_id, template_id=template.id)
if current_user.has_permissions(permissions=['manage_templates'], admin_override=True) else
None
)
) }}
{% endif %}
</div>
<div class="column-one-third">
<div class="sms-message-use-links">
{% if current_user.has_permissions(permissions=['send_texts', 'send_emails', 'send_letters']) %}
<a href="{{ url_for(".send_messages", service_id=service_id, template_id=template.id) }}">Send a batch</a>
<a href="{{ url_for(".send_message_to_self", service_id=service_id, template_id=template.id) }}">Send yourself a test</a>
{% endif %}
{% if current_user.has_permissions(permissions=['manage_api_keys']) %}
<a href="{{ url_for(".send_from_api", service_id=service_id, template_id=template.id) }}">API integration</a>
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% endif %}
{% endblock %}