Files
notifications-admin/app/templates/views/manage-templates.html
Chris Hill-Scott 2d55bb7ae2 Use Template to replace/highlight placeholders
This commit brings in the `Template` util, added here:
https://github.com/alphagov/notifications-utils/pull/1

It also does a fair bit of tidying up, which I’ve unfortunately squashed into
this one massive commit. The main change is moving 404 handling into the
templates dao, so that every view isn’t littered with `try: … except(HTTPError)`.

It also adds new features, in a prototypy sort of way, which are:
- download a prefilled example CSV
- show all the columns for your template on the 'check' page
2016-02-18 15:07:14 +00:00

54 lines
1.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/sms-message.html" import sms_message %}
{% from "components/email-message.html" import email_message %}
{% from "components/browse-list.html" import browse_list %}
{% block page_title %}
Manage templates GOV.UK Notify
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">Manage templates</h1>
{% if not has_jobs %}
{{ banner(
'<a href="{}">Send yourself a text message</a>'.format(
url_for(".choose_sms_template", service_id=service_id)
)|safe,
subhead='Next step',
type="tip"
)}}
{% endif %}
<div class="grid-row">
<div class="column-two-thirds">
{% for template in templates %}
{% if template.template_type == 'email' %}
{{ email_message(
template.get_field('subject'),
template.get_field('content'),
name=template.get_field('name'),
edit_link=url_for('.edit_service_template', service_id=service_id, template_id=template.id)
) }}
{% else %}
{{ sms_message(
template.formatted_as_markup,
name=template.name,
id=template.id,
edit_link=url_for('.edit_service_template', service_id=service_id, template_id=template.id)
) }}
{% endif %}
{% endfor %}
<p>
<a href="{{ url_for('.add_service_template', service_id=service_id) }}" class="button">Add new template</a>
</p>
</div>
</div>
{% endblock %}