Ensure correct page titles on send test flows

We have some fairly complicated nested if statements in our Jinja that
decide what the page titles should be. It’s only going to get more
complicated with the send individual message routes.

So this commit:
- moves the logic from Jinja to Python
- adds tests to check things are working as expected
- sets the page titles to the right thing for each flow
This commit is contained in:
Chris Hill-Scott
2017-05-25 13:31:23 +01:00
parent 27c1463213
commit 82549c817a
3 changed files with 79 additions and 14 deletions

View File

@@ -5,25 +5,13 @@
{% from "components/table.html" import list_table, field, text_field, index_field, index_field_heading %}
{% block service_page_title %}
{% if request.args['help'] %}
Example text message
{% else %}
Send yourself a test
{% endif %}
{{ page_title }}
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">
{% if request.args['help'] %}
Example text message
{% else %}
{% if template.template_type == 'letter' %}
Print a test letter
{% else %}
Send yourself a test
{% endif %}
{% endif %}
{{ page_title }}
</h1>
<form method="post" class="js-stick-at-top-when-scrolling" data-module="autofocus">