Change page title on new broadcast template page

Since broadcast services can only have one type of template we probably
don’t need to disambiguate what kind of template you’re creating.

And you’ve just come from a page where the button says ‘New template’,
without the choice of radios after, so it’s nice for the page title to
match that.
This commit is contained in:
Chris Hill-Scott
2020-08-17 13:01:33 +01:00
parent 36c1ffa7be
commit 95078d2d51
2 changed files with 22 additions and 2 deletions

View File

@@ -5,13 +5,13 @@
{% from "components/form.html" import form_wrapper %}
{% block service_page_title %}
{{ heading_action }} broadcast template
{{ heading_action }} template
{% endblock %}
{% block maincolumn_content %}
{{ page_header(
'{} broadcast template'.format(heading_action),
'{} template'.format(heading_action),
back_link=url_for('main.view_template', service_id=current_service.id, template_id=template.id) if template else url_for('main.choose_template', service_id=current_service.id, template_folder_id=template_folder_id)
) }}

View File

@@ -2052,6 +2052,26 @@ def test_route_invalid_permissions(
service_one)
@pytest.mark.parametrize('template_type, expected', (
('email', 'New email template'),
('sms', 'New text message template'),
('broadcast', 'New template'),
))
def test_add_template_page_title(
client_request,
service_one,
template_type,
expected,
):
service_one['permissions'] += [template_type]
page = client_request.get(
'.add_service_template',
service_id=SERVICE_ONE_ID,
template_type=template_type,
)
assert normalize_spaces(page.select_one('h1').text) == expected
def test_can_create_email_template_with_emoji(
client_request,
mock_create_service_template