Make a function for parsing help query param

Our templates are a littered with `request.args.get('help', '0')`.
This commit refactors these into a single helper method, which can be
used by the view functions, then passed to the template.

This makes the templates cleaner, and should make it easier to refactor
`help` out of the query parameters entirely in the future.
This commit is contained in:
Chris Hill-Scott
2016-07-05 11:39:07 +01:00
parent d71269ca87
commit 80e0832f7d
7 changed files with 22 additions and 13 deletions

View File

@@ -55,7 +55,7 @@
{% endcall %}
{{ page_footer("Preview", back_link=(
url_for('.choose_template', service_id=current_service.id, template_type=template.template_type)) if not request.args['help'] else None
url_for('.send_messages', service_id=current_service.id, template_id=template.id)) if not help else None
) }}
</form>