Go back to template if coming from template

Most users don’t have multiple contact blocks. So by default it should
feel like you’re just editing the one contact block, rather than
managing a collection of them. So this page skips the ‘choose’ page when
the user doesn’t yet have any contact blocks.
This commit is contained in:
Chris Hill-Scott
2019-07-08 09:29:21 +01:00
parent c709d7668e
commit 8e080d6079
3 changed files with 25 additions and 12 deletions

View File

@@ -713,7 +713,7 @@ def service_add_letter_contact(service_id):
)
if request.args.get('from_template'):
return redirect(
url_for('.set_template_sender', service_id=service_id, template_id=request.args.get('from_template'))
url_for('.view_template', service_id=service_id, template_id=request.args.get('from_template'))
)
return redirect(url_for('.service_letter_contact_details', service_id=service_id))
return render_template(

View File

@@ -13,7 +13,7 @@
{{ page_header(
'Add a new address',
back_link=None if request.args.get('from_template') else url_for('.service_letter_contact_details', service_id=current_service.id)
back_link=url_for('main.view_template', template_id=request.args.get('from_template'), service_id=current_service.id) if request.args.get('from_template') else url_for('.service_letter_contact_details', service_id=current_service.id)
) }}
<div class="grid-row">
<div class="column-whole">