Browse Source

added template macros

master
Holger Frey 7 years ago
parent
commit
57c6b175cd
  1. 14
      ordr2/templates/macros.jinja2

14
ordr2/templates/macros.jinja2

@ -0,0 +1,14 @@
{% macro flash_messages() -%}
{% for queue in ('ok', 'warning', 'error') %}
{% for message in request.session.pop_flash(queue) %}
{% set css_class = 'danger' if queue == 'error' else queue %}
<div class="alert alert-{{ css_class }} role="alert">
{{message|safe}}
</div>
{% endfor %}
{% endfor %}
{%- endmacro %}
{% macro center_column_hack() -%}
</div><div class="col-2"></div>
{%- endmacro %}