Add check tour notification page

On submit of form on this page, will continue to normal sending flow
which can be shared code as there is no longer previous context needed
of where they have come from
This commit is contained in:
David McDonald
2020-09-30 14:22:42 +01:00
parent 9347c9a979
commit f0a8c97eeb
2 changed files with 111 additions and 1 deletions

View File

@@ -111,4 +111,30 @@ def _get_tour_step_back_link(service_id, template_id, step_index):
@main.route("/services/<uuid:service_id>/tour/<uuid:template_id>/check", methods=['GET'])
@user_has_permissions('send_messages', restrict_admin_usage=True)
def check_tour_notification(service_id, template_id):
pass
db_template = current_service.get_template(template_id)
template = get_template(
db_template,
current_service,
show_recipient=True,
)
placeholders = fields_to_fill_in(template, prefill_current_user=True)
if not all_placeholders_in_session(template.placeholders):
return redirect(url_for(
'.tour_step', service_id=current_service.id, template_id=template_id, step_index=1
))
back_link = url_for(
'.tour_step', service_id=current_service.id, template_id=template_id, step_index=len(placeholders)
)
template.values = get_recipient_and_placeholders_from_session(template.template_type)
return render_template(
'views/notifications/check.html',
template=template,
back_link=back_link,
help='2',
)