From 370fd68a2cd50dad5520119be614b36b513a9371 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 11 Mar 2016 07:45:10 +0000 Subject: [PATCH] Fix innaccurate headings on add/edit template page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The same `.html` file is shared between adding a template and editing a template. The page heading needs to be contextual to the URL, either ‘add’ or ‘edit’. Somewhere along the way this got lost; this commit reinstates it. --- app/main/views/templates.py | 11 +++++++++-- app/templates/views/edit-email-template.html | 6 ++++-- app/templates/views/edit-sms-template.html | 6 ++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/app/main/views/templates.py b/app/main/views/templates.py index 0b7119e9d..f390ff9af 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -13,6 +13,11 @@ form_objects = { 'sms': SMSTemplateForm } +page_headings = { + 'email': 'email', + 'sms': 'text message' +} + @main.route("/services//templates/add-", methods=['GET', 'POST']) @login_required @@ -42,7 +47,8 @@ def add_service_template(service_id, template_type): 'views/edit-{}-template.html'.format(template_type), form=form, template_type=template_type, - service_id=service_id + service_id=service_id, + heading_action='Add' ) @@ -70,7 +76,8 @@ def edit_service_template(service_id, template_id): form=form, service_id=service_id, template_id=template_id, - template_type=template['template_type'] + template_type=template['template_type'], + heading_action='Edit' ) diff --git a/app/templates/views/edit-email-template.html b/app/templates/views/edit-email-template.html index 2a41722e3..0505fc97c 100644 --- a/app/templates/views/edit-email-template.html +++ b/app/templates/views/edit-email-template.html @@ -3,12 +3,14 @@ {% from "components/page-footer.html" import page_footer %} {% block page_title %} - {{ h1 }} – GOV.UK Notify + {{ heading_action }} email template – GOV.UK Notify {% endblock %} {% block maincolumn_content %} -

Edit email template

+

+ {{ heading_action }} email template +

diff --git a/app/templates/views/edit-sms-template.html b/app/templates/views/edit-sms-template.html index f4a395928..a571c300a 100644 --- a/app/templates/views/edit-sms-template.html +++ b/app/templates/views/edit-sms-template.html @@ -3,12 +3,14 @@ {% from "components/page-footer.html" import page_footer %} {% block page_title %} - {{ h1 }} – GOV.UK Notify + {{ heading_action }} text message template – GOV.UK Notify {% endblock %} {% block maincolumn_content %} -

Edit text message template

+

+ {{ heading_action }} text message template +