dedijk4/system/templates/partials/messages.html.twig

15 lines
423 B
Twig
Raw Normal View History

2020-02-19 16:42:35 +01:00
{% set status_mapping = {'info':'green', 'error': 'red', 'warning': 'yellow'} %}
{% if grav.messages.all %}
<div id="messages">
{% for message in grav.messages.fetch %}
{% set scope = message.scope|e %}
{% set color = status_mapping[scope] %}
<div class="notices {{ scope }} {{ color }}"><p>{{ message.message|raw }}</p></div>
{% endfor %}
</div>
{% endif %}