mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-29 18:40:10 -04:00
All paragraphs should have class="govuk-body", or be otherwise custom-styled. This commit adds some extra checks to our test fixture that looks for paragraphs that don’t have any styling. Our test coverage is pretty good, so this should check almost all pages, and prevent regressions. I’ve done this in such a way that it can be extended for other elements (e.g. links) in the future.
40 lines
1.3 KiB
HTML
40 lines
1.3 KiB
HTML
{% from "components/form.html" import form_wrapper %}
|
|
{% from "components/button/macro.njk" import govukButton %}
|
|
|
|
{% macro banner(body, type=None, with_tick=False, delete_button=None, subhead=None, context=None, action=None, id=None) %}
|
|
<div
|
|
class='banner{% if type %}-{{ type }}{% endif %}{% if with_tick %}-with-tick{% endif %}'
|
|
{% if type == 'dangerous' %}
|
|
role='group'
|
|
tabindex='-1'
|
|
{% endif %}
|
|
{% if id %}
|
|
id={{ id }}
|
|
{% endif %}
|
|
>
|
|
{% if subhead -%}
|
|
<h1 class="banner-title">{{ subhead }}</h1>
|
|
{%- endif -%}
|
|
{{ body }}
|
|
{% if context %}
|
|
<p class="govuk-body">
|
|
{{ context }}
|
|
</p>
|
|
{% endif %}
|
|
{% if delete_button %}
|
|
{% call form_wrapper(action=action) %}
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
|
{{ govukButton({
|
|
"text": delete_button,
|
|
"name": "delete",
|
|
"classes": "govuk-button--warning govuk-!-margin-top-2",
|
|
}) }}
|
|
{% endcall %}
|
|
{% endif %}
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% macro banner_wrapper(type=None, with_tick=False, delete_button=None, subhead=None, action=None, id=None) %}
|
|
{{ banner(caller()|safe, type=type, with_tick=with_tick, delete_button=delete_button, subhead=subhead, action=action, id=id) }}
|
|
{% endmacro %}
|