{% from "components/icon.html" import Icon %} {% macro Alert(title=None, message=None, actions=None, level='info', fragment=None, vue_template=False) -%} {% set role = 'alertdialog' if actions else 'alert' %} {% set levels = { 'warning': { 'icon': 'alert', 'tone': 'assertive' }, 'error': { 'icon': 'alert', 'tone': 'assertive' }, 'info': { 'icon': 'info', 'tone': 'polite' }, 'success': { 'icon': 'ok', 'tone': 'polite' } } %}
{% if vue_template %}

{% elif title %}

{{title}}

{% endif %} {% if message %}
{{ message | safe }}
{% endif %} {% if caller %}
{{ caller() }}
{% endif %} {% if fragment %}
{% include fragment %}
{% endif %} {% if actions %}
{% if actions is string %} {{ actions | safe }} {% elif actions is iterable %} {% for action in actions %} {% if 'icon' in action %}{{ Icon(action["icon"]) }}{% endif %} {{ action["label"] }} {% endfor %} {% endif %}
{% endif %}
{%- endmacro %}