{# -*- coding: utf-8 -*-

  This file is part of Invenio.
  Copyright (C) 2015-2018 CERN.

  Invenio is free software; you can redistribute it and/or modify it
  under the terms of the MIT License; see LICENSE file for more details.
#}
{%- macro flashed_messages() -%}
  {%- block messages %}
    {%- for category, msg in get_flashed_messages(with_categories=True) %}
      {%- set category = 'info' if category not in ['info', 'error', 'warning', 'success'] else category %}
      <div class="ui {{ category }} flashed message">
        <div class="ui grid container">
          <div class="fifteen wide left aligned column">
            <p>{{ msg }}</p>
          </div>
          <div class="right aligned column">
            <i class="flashed close icon"></i>
          </div>
        </div>
      </div>
    {%- endfor %}
  {%- endblock messages %}
{%- endmacro %}
