Files
notifications-admin/app/templates/components/banner.html

30 lines
954 B
HTML
Raw Normal View History

{% macro banner(body, type=None, with_tick=False, delete_button=None, subhead=None, context=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 context %}
<p>
{{ context }}
</p>
{% endif %}
2016-01-26 16:20:57 +00:00
{% if delete_button %}
<form method='post'>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<button type="submit" class="button" name="delete">{{ delete_button }}</button>
2016-01-26 16:20:57 +00:00
</form>
{% endif %}
</div>
2015-12-17 14:05:35 +00:00
{% 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 %}