Move letter too long banner message over from utils, also refactor

This commit is contained in:
Pea Tyczynska
2019-10-01 17:16:15 +01:00
parent b42c7c4c9f
commit 12ec2870af
14 changed files with 63 additions and 38 deletions

View File

@@ -1,12 +1,15 @@
{% from "components/form.html" import form_wrapper %}
{% macro banner(body, type=None, with_tick=False, delete_button=None, subhead=None, context=None, action=None) %}
{% 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>
@@ -26,6 +29,6 @@
</div>
{% endmacro %}
{% macro banner_wrapper(type=None, with_tick=False, delete_button=None, subhead=None, action=None) %}
{{ banner(caller()|safe, type=type, with_tick=with_tick, delete_button=delete_button, subhead=subhead, action=action) }}
{% 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 %}