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

15 lines
423 B
Twig
Raw Permalink Normal View History

2024-03-26 13:31:26 +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 %}