2019-03-14 17:31:51 +00:00
|
|
|
{% from "components/form.html" import form_wrapper %}
|
2020-01-30 15:44:06 +00:00
|
|
|
{% from "components/button/macro.njk" import govukButton %}
|
2019-03-14 17:31:51 +00:00
|
|
|
|
2019-10-01 17:16:15 +01:00
|
|
|
{% macro banner(body, type=None, with_tick=False, delete_button=None, subhead=None, context=None, action=None, id=None) %}
|
2017-02-13 12:11:32 +00:00
|
|
|
<div
|
|
|
|
|
class='banner{% if type %}-{{ type }}{% endif %}{% if with_tick %}-with-tick{% endif %}'
|
|
|
|
|
{% if type == 'dangerous' %}
|
|
|
|
|
role='group'
|
|
|
|
|
tabindex='-1'
|
|
|
|
|
{% endif %}
|
2019-10-01 17:16:15 +01:00
|
|
|
{% if id %}
|
|
|
|
|
id={{ id }}
|
|
|
|
|
{% endif %}
|
2017-02-13 12:11:32 +00:00
|
|
|
>
|
2016-03-17 11:45:48 +00:00
|
|
|
{% if subhead -%}
|
2017-07-24 14:50:56 +01:00
|
|
|
<h1 class="banner-title">{{ subhead }}</h1>
|
2016-03-17 11:45:48 +00:00
|
|
|
{%- endif -%}
|
2016-01-11 11:27:42 +00:00
|
|
|
{{ body }}
|
2018-11-15 17:14:03 +00:00
|
|
|
{% if context %}
|
2020-05-29 17:11:01 +01:00
|
|
|
<p class="govuk-body">
|
2018-11-15 17:14:03 +00:00
|
|
|
{{ context }}
|
|
|
|
|
</p>
|
|
|
|
|
{% endif %}
|
2016-01-26 16:20:57 +00:00
|
|
|
{% if delete_button %}
|
2019-03-14 17:31:51 +00:00
|
|
|
{% call form_wrapper(action=action) %}
|
2016-01-26 16:20:57 +00:00
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
2020-01-30 15:44:06 +00:00
|
|
|
{{ govukButton({
|
|
|
|
|
"text": delete_button,
|
|
|
|
|
"name": "delete",
|
|
|
|
|
"classes": "govuk-button--warning govuk-!-margin-top-2",
|
|
|
|
|
}) }}
|
2019-03-14 17:31:51 +00:00
|
|
|
{% endcall %}
|
2016-01-26 16:20:57 +00:00
|
|
|
{% endif %}
|
2016-01-11 11:27:42 +00:00
|
|
|
</div>
|
2015-12-17 14:05:35 +00:00
|
|
|
{% endmacro %}
|
2016-03-07 18:47:05 +00:00
|
|
|
|
2019-10-01 17:16:15 +01:00
|
|
|
{% 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) }}
|
2016-03-07 18:47:05 +00:00
|
|
|
{% endmacro %}
|