From 4b32d9aa0c655650df5c8a1df14c13a64ff29ef9 Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Tue, 31 Jul 2018 16:20:10 +0100 Subject: [PATCH] =?UTF-8?q?Edit,=20don=E2=80=99t=20duplicate,=20existing?= =?UTF-8?q?=20templates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main/views/templates.py | 6 +++++- app/templates/views/edit-email-template.html | 5 +---- app/templates/views/edit-letter-template.html | 5 +---- app/templates/views/edit-sms-template.html | 5 +---- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/app/main/views/templates.py b/app/main/views/templates.py index dc23b97c2..732023f65 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -287,6 +287,10 @@ def copy_template(service_id, template_id): request.args.get('from_service'), str(template_id), )['data'] + + if request.method == 'POST': + return add_service_template(service_id, template['template_type']) + template['template_content'] = template['content'] template['name'] = 'Copy of ‘{}’'.format(template['name']) form = form_objects[template['template_type']](**template) @@ -458,7 +462,7 @@ def edit_service_template(service_id, template_id): form=form, template_id=template_id, template_type=template['template_type'], - heading_action='Edit' + heading_action='Edit', ) diff --git a/app/templates/views/edit-email-template.html b/app/templates/views/edit-email-template.html index 6603d79cf..bc6010a29 100644 --- a/app/templates/views/edit-email-template.html +++ b/app/templates/views/edit-email-template.html @@ -13,10 +13,7 @@ {{ heading_action }} email template -
+
{{ textbox(form.name, width='1-1', hint='Your recipients won’t see this', rows=10) }} diff --git a/app/templates/views/edit-letter-template.html b/app/templates/views/edit-letter-template.html index 0fa49c587..804e40339 100644 --- a/app/templates/views/edit-letter-template.html +++ b/app/templates/views/edit-letter-template.html @@ -12,10 +12,7 @@ {{ heading_action }} letter template - +
{{ textbox(form.name, width='1-1', hint='Your recipients won’t see this', rows=10) }} diff --git a/app/templates/views/edit-sms-template.html b/app/templates/views/edit-sms-template.html index 63c929b8e..e7578aee0 100644 --- a/app/templates/views/edit-sms-template.html +++ b/app/templates/views/edit-sms-template.html @@ -13,10 +13,7 @@ {{ heading_action }} text message template - +
{{ textbox(form.name, width='1-1', hint='Your recipients won’t see this') }}