2013-09-16 04:44:24 +00:00
|
|
|
{#
|
|
|
|
/**
|
|
|
|
* @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.
|
|
|
|
*
|
2013-11-05 16:43:38 +00:00
|
|
|
* Add an ARIA label to the contentinfo area so that assistive technology
|
|
|
|
* user agents will better describe this landmark.
|
|
|
|
*
|
2013-09-16 04:44:24 +00:00
|
|
|
* Available variables:
|
|
|
|
* - message_list: List of messages to be displayed, grouped by type.
|
|
|
|
* - status_headings: List of all status types.
|
2014-10-10 16:43:27 +00:00
|
|
|
* - attributes: HTML attributes for the element, including:
|
|
|
|
* - class: HTML classes.
|
2013-09-16 04:44:24 +00:00
|
|
|
*
|
|
|
|
* @ingroup themeable
|
|
|
|
*/
|
|
|
|
#}
|
Issue #77245 by drpal, tedbow, nod_, phenaproxima, Wim Leers, googletorp, rteijeiro, vineet.osscube, tim.plunkett, idflood, joelpittet, pk188, lauriii, BarisW, lokapujya, chr.fritsch, droplet, andrewmacpherson, dmsmidt, dawehner, alexpott, jessebeach, NickWilde, DuaelFr, Cottser, seutje, samuel.mortenson: Provide a common API for displaying JavaScript messages
2018-12-05 18:29:18 +00:00
|
|
|
<div data-drupal-messages>
|
2013-09-16 04:44:24 +00:00
|
|
|
{% for type, messages in message_list %}
|
2015-05-07 00:47:34 +00:00
|
|
|
<div role="contentinfo" aria-label="{{ status_headings[type] }}"{{ attributes|without('role', 'aria-label') }}>
|
2013-11-05 16:43:38 +00:00
|
|
|
{% if type == 'error' %}
|
|
|
|
<div role="alert">
|
2013-09-16 04:44:24 +00:00
|
|
|
{% endif %}
|
Issue #77245 by drpal, tedbow, nod_, phenaproxima, Wim Leers, googletorp, rteijeiro, vineet.osscube, tim.plunkett, idflood, joelpittet, pk188, lauriii, BarisW, lokapujya, chr.fritsch, droplet, andrewmacpherson, dmsmidt, dawehner, alexpott, jessebeach, NickWilde, DuaelFr, Cottser, seutje, samuel.mortenson: Provide a common API for displaying JavaScript messages
2018-12-05 18:29:18 +00:00
|
|
|
{% if status_headings[type] %}
|
|
|
|
<h2 class="visually-hidden">{{ status_headings[type] }}</h2>
|
|
|
|
{% endif %}
|
|
|
|
{% if messages|length > 1 %}
|
|
|
|
<ul>
|
|
|
|
{% for message in messages %}
|
|
|
|
<li>{{ message }}</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% else %}
|
|
|
|
{{ messages|first }}
|
|
|
|
{% endif %}
|
2013-11-05 16:43:38 +00:00
|
|
|
{% if type == 'error' %}
|
|
|
|
</div>
|
2013-09-16 04:44:24 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
Issue #77245 by drpal, tedbow, nod_, phenaproxima, Wim Leers, googletorp, rteijeiro, vineet.osscube, tim.plunkett, idflood, joelpittet, pk188, lauriii, BarisW, lokapujya, chr.fritsch, droplet, andrewmacpherson, dmsmidt, dawehner, alexpott, jessebeach, NickWilde, DuaelFr, Cottser, seutje, samuel.mortenson: Provide a common API for displaying JavaScript messages
2018-12-05 18:29:18 +00:00
|
|
|
</div>
|