Ensure only one <h1> per page, even with errors

A page should have only one `<h1>` element. So if there’s an error
message, which contains a `<h1>`, it should replace the page’s normal
`<h1>` element, rather than sit above it.
This commit is contained in:
Chris Hill-Scott
2017-07-24 14:52:52 +01:00
parent befe93ec0b
commit e2bd2e0439
2 changed files with 13 additions and 16 deletions

View File

@@ -23,19 +23,18 @@
{% endcall %}
</div>
{% else %}
<div class="grid-row">
<div class="column-two-thirds">
<h1 class="heading-large">
API keys
</h1>
</div>
<div class="column-one-third">
<a href="{{ url_for('.create_api_key', service_id=current_service.id) }}" class="button align-with-heading">Create an API key</a>
</div>
</div>
{% endif %}
<div class="grid-row">
<div class="column-two-thirds">
<h1 class="heading-large">
API keys
</h1>
</div>
<div class="column-one-third">
<a href="{{ url_for('.create_api_key', service_id=current_service.id) }}" class="button align-with-heading">Create an API key</a>
</div>
</div>
<div class="body-copy-table">
{% call(item, row_number) list_table(
keys,

View File

@@ -27,9 +27,7 @@
</form>
{% endcall %}
</div>
{% endif %}
{% if template_delete_confirmation_message %}
{% elif template_delete_confirmation_message %}
<div class="bottom-gutter">
{% call banner_wrapper(type='dangerous', subhead=template_delete_confirmation_message[0]) %}
<p>
@@ -41,10 +39,10 @@
</form>
{% endcall %}
</div>
{% else %}
<h1 class="heading-large">{{ template.name }}</h1>
{% endif %}
<h1 class="heading-large">{{ template.name }}</h1>
<div class="grid-row">
{% with show_title=False, expanded=True %}
{% include 'views/templates/_template.html' %}