From 96f505a7e72c8a2c05ac02aad511d5f99b0c5a0e Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 15 Mar 2017 10:53:24 +0000 Subject: [PATCH] Make blank letter template on adding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When adding a letter it’s hard to know how the stuff you’re typing is going to look. So rather than go straight to the edit form let’s show users a blank letter. They can then choose which part of it they want to edit first. And will have a better idea of how their changes are going to show up. In research we also saw nervousness around saving a template and wanting to ‘preview’ it first. Hopefully this flow will make people feel less precious about saving a template because they’ve already done it once just by creating the template. --- app/main/views/templates.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/main/views/templates.py b/app/main/views/templates.py index 065130e6d..9ecedc0cb 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -178,6 +178,22 @@ def add_template_by_type(service_id): ) if form.validate_on_submit(): + + if form.template_type.data == 'letter': + blank_letter = service_api_client.create_service_template( + 'Untitled', + 'letter', + 'Content', + service_id, + 'Title', + 'normal', + ) + return redirect(url_for( + '.view_template', + service_id=service_id, + template_id=blank_letter['data']['id'], + )) + return redirect(url_for( '.add_service_template', service_id=service_id,