{# /** * @file * Theme override for status messages. * * Displays status, error, and warning messages, grouped by type. * * An invisible heading identifies the messages for assistive technology. * Sighted users see a colored box. See * https://www.w3.org/TR/WCAG-TECHS/H69.html for info. * * Add an ARIA label to the contentinfo area so that assistive technology * user agents will better describe this landmark. * * Available variables: * - message_list: List of messages to be displayed, grouped by type. * - status_headings: List of all status types. * - attributes: HTML attributes for the element, including: * - class: HTML classes. */ #} {{ attach_library('mercury/messages') }}
{% for type, messages in message_list %} {% if type == 'status' %} {% set type_class = 'bg-green-100 text-green-900' %} {% set type_icon = 'check-circle' %} {% set close_button_class = 'text-green-700 hover:text-green-900 hover:bg-green-200' %} {% elseif type == 'info' %} {% set type_class = 'bg-blue-100 text-blue-900' %} {% set type_icon = 'info' %} {% set close_button_class = 'text-blue-700 hover:text-blue-900 hover:bg-blue-200' %} {% elseif type == 'warning' %} {% set type_class = 'bg-yellow-100 text-yellow-900' %} {% set type_icon = 'warning' %} {% set close_button_class = 'text-yellow-700 hover:text-yellow-900 hover:bg-yellow-200' %} {% elseif type == 'error' %} {% set type_class = 'bg-red-100 text-red-900' %} {% set type_icon = 'x-circle' %} {% set close_button_class = 'text-red-700 hover:text-red-900 hover:bg-red-200' %} {% endif %} {% endfor %}