Files
notifications-admin/app/templates/components/banner.html
Chris Hill-Scott befe93ec0b Make sure confirmation/danger banners have a H1
This makes errors on all pages have a `<h1>` element, which is important
for accessibility. It means a bit of rewriting the messages, but I think
they’re better for it.
2017-07-27 11:52:54 +01:00

25 lines
867 B
HTML

{% macro banner(body, type=None, with_tick=False, delete_button=None, subhead=None) %}
<div
class='banner{% if type %}-{{ type }}{% endif %}{% if with_tick %}-with-tick{% endif %}'
{% if type == 'dangerous' %}
role='group'
tabindex='-1'
{% endif %}
>
{% if subhead -%}
<h1 class="banner-title">{{ subhead }}</h1>
{%- endif -%}
{{ body }}
{% if delete_button %}
<form method='post'>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="submit" class="button" name="delete" value="{{ delete_button }}" />
</form>
{% endif %}
</div>
{% endmacro %}
{% macro banner_wrapper(type=None, with_tick=False, delete_button=None, subhead=None) %}
{{ banner(caller()|safe, type=type, with_tick=with_tick, delete_button=delete_button, subhead=subhead) }}
{% endmacro %}