Add basic flow for adding email _or_ sms templates

Templates now have:
- a type (email or sms)
- a subject (if they are email templates)

We don’t want two completely separate view files for email and SMS, because they
would have an enormous amount of repetition.

So this commit adds
- different templates for SMS and email templates
- different form objects for SMS and email templates

…and wires them up.
This commit is contained in:
Chris Hill-Scott
2016-02-22 14:45:13 +00:00
parent 8247f3d568
commit c6de605311
14 changed files with 160 additions and 107 deletions

View File

@@ -0,0 +1,43 @@
{% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
{% block page_title %}
{{ h1 }} GOV.UK Notify
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">Edit email template</h1>
<form method="post">
<div class="grid-row">
<div class="column-two-thirds">
{{ textbox(form.name, width='1-1') }}
{% if 'email' == template_type %}
{{ textbox(form.subject, width='1-1') }}
{% endif %}
</div>
</div>
<div class="grid-row">
<div class="column-two-thirds">
{{ textbox(form.template_content, highlight_tags=True, width='1-1') }}
</div>
<div class="column-one-third">
<label for='template_content' class='edit-template-placeholder-hint'>
Add placeholders using double brackets, eg Your thing
is due on ((date))
</label>
</div>
</div>
{{ page_footer(
'Save',
delete_link=url_for('.delete_service_template', service_id=service_id, template_id=template_id) if template_id or None,
delete_link_text='Delete this template',
back_link=url_for('.choose_template', template_type=template_type, service_id=service_id),
back_link_text='Cancel'
) }}
</form>
{% endblock %}