Add a confirmation page

Generally I prefer confirmation pages to the flash message thing
(they’re harder to miss). So this commit adds one.

It also adds some logic to this page, so that, depending what the user
has told us about the thing they’ve submitted, we can tell them how
quickly to expect a response.
This commit is contained in:
Chris Hill-Scott
2016-12-12 12:29:29 +00:00
parent 438868257f
commit 4ef087fb01
3 changed files with 84 additions and 15 deletions

View File

@@ -96,8 +96,7 @@ def feedback(ticket_type):
resp.json())
)
abort(500, "Feedback submission failed")
flash("Thanks, weve received your feedback", 'default_with_tick')
return redirect(url_for('.support', ticket_type=ticket_type))
return redirect(url_for('.thanks', urgent=urgent, anonymous=anonymous))
return render_template(
'views/support/{}.html'.format(ticket_type),
@@ -119,7 +118,9 @@ def bat_phone():
def thanks():
return render_template(
'views/support/thanks.html',
ticket_type=request.args.get('ticket_type'),
urgent=convert_to_boolean(request.args.get('urgent')),
anonymous=convert_to_boolean(request.args.get('anonymous')),
logged_in=(current_user and current_user.is_authenticated),
)

View File

@@ -0,0 +1,32 @@
{% extends "withoutnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
{% block page_title %}
Thanks for contacting us GOV.UK Notify
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">
Thanks for contacting GOV.UK Notify
</h1>
<p>
{% if anonymous %}
Well look into it
{% else %}
Well get back to you
{% endif %}
{% if urgent %}
within 30 minutes.
{% else %}
by the next working day.
{% endif %}
</p>
<p>
<a href="{{ url_for('.support') }}">Back to support</a>
</p>
{% endblock %}