aerodash-1.0.2/templates/system/status-messages.html.twig

templates/system/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.
 * - attributes: HTML attributes for the element, including:
 *   - class: HTML classes.
 *
 * @ingroup themeable
 */
#}

{{ attach_library('revolt/status-message') }}

  {% for type, messages in message_list %}
    {%
      set classes = [
        'message',
        'w-100',
        type == 'status' ? 'alert-success',
        type == 'warning' ? 'alert-warning',
        type == 'error' ? 'alert-danger',
        type == 'info' ? 'alert-info',
      ]
    %}


    <div class="modal open" id="exampleModal" tabindex="-1" aria-labelledby="exampleModal" aria-hidden="true">
      <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
        <div role="contentinfo" aria-label="{{ status_headings[type] }}"{{ attributes|without('role', 'aria-label').addClass(classes) }}>
          {% if status_headings[type] %}
            <div class="modal-header">
              <h2 class="">{{ status_headings[type] }}</h2>
              <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            
            <div class="modal-body">
              {% if messages|length > 1 %}
                <ul>
                  {% for message in messages %}
                    <li>{{ message }}</li>
                  {% endfor %}
                </ul>
              {% else %}
                {{ messages|first }}
              {% endif %}
            </div>

            <div class="modal-footer">
              <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
              <button type="button" class="btn btn-primary">Save changes</button>
            </div>
            {% endif %}
          </div>
        </div>
      </div>
    </div>
  {% endfor %}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc