Fix duplicated H1 on ‘New letter branding’ page

For accessibility reasons a page should have one (and only one) H1. This
commit fixes an instance where the H1 was duplicated as a result of the
work done to componentize our page headings.

It also adds an extra check to `client_request` so that we don’t
introduce pages with multiple or no H1s in the future.
This commit is contained in:
Chris Hill-Scott
2019-05-21 15:44:27 +01:00
parent b1df698cf7
commit 9d1a7904a8
5 changed files with 14 additions and 11 deletions

View File

@@ -3,9 +3,10 @@
service_id,
template_type,
current_user,
link_current_item=False
link_current_item=False,
root_element='h1'
) %}
<h1 class="heading-medium folder-heading">
<{{ root_element }} class="heading-medium folder-heading">
{% for folder in folders %}
{% if loop.last and not link_current_item %}
{% if folder.template_type or not folder.id %}
@@ -26,7 +27,7 @@
{% if not loop.last %}{{ folder_path_separator() }}{% endif %}
{% endif %}
{% endfor %}
</h1>
</{{ root_element }}>
{% endmacro %}

View File

@@ -11,7 +11,6 @@
{% block platform_admin_content %}
<h1 class="heading-large">{{ '{} letter branding'.format('Update' if is_update else 'Add')}}</h1>
{{ page_header(
'{} letter branding'.format('Update' if is_update else 'Add'),
back_link=url_for('main.letter_branding')

View File

@@ -14,7 +14,7 @@
<div class="bottom-gutter-1-2">
<h1 class="heading-large">Choose a template</h1>
{{ folder_path(template_folder_path, current_service.id, template_type, current_user) }}
{{ folder_path(template_folder_path, current_service.id, template_type, current_user, root_element='h2') }}
</div>
{% if not templates_and_folders.templates_to_show %}