easy_news-8.x-2.3/templates/components/status-messages.html.twig
templates/components/status-messages.html.twig
{#
/**
* @file
* Default theme implementation 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 http://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.
* - display: (optional) May have a value of 'status' or 'error' when only
* displaying messages of that specific type.
*/
#}
{{ attach_library('classy/messages') }}
{{ attach_library('uikitty/notifysystem') }}
{{ attach_library('uikitty/notify') }}
{% block messages %}
{% for type, messages in message_list %}
{%
set classes = [
'uk-alert',
'uk-alert--' ~ type,
'uk-margin-top',
]
%}
{% if type == 'error' %}{% endif %}
{% if status_headings[type] %}
<h2 class="uk-hidden">{{ status_headings[type] }}</h2>
{% endif %}
{% if messages | length > 1 %}
<ul class="messages__list">
{% for message in messages %}
<button class="uk-button uk-notify-alert uk-hidden" data-message='{{ message }}' data-pos="bottom-right">alert</button>
{% endfor %}
</ul>
{% else %}
<button class="uk-button uk-notify-alert uk-hidden" data-message='{{ messages|first }}' data-pos="bottom-right">alert</button>
{% endif %}
{% if type == 'error' %}{% endif %}
{# Remove type specific classes. #}
{% set attributes = attributes.removeClass(classes) %}
{% endfor %}
{% endblock messages %}
