mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-24 12:21:22 -05:00
Make blank letter template on adding
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.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user