{% extends "wagtailadmin/admin_base.html" %}
{% load wagtailadmin wagtail i18n %}

{% block furniture %}
    {% slim_sidebar_enabled as slim_sidebar_enabled %}
    {% if slim_sidebar_enabled %}
    <aside id="wagtail-sidebar" data-props="{% menu_props %}"></aside>
    {% else %}
    <aside id="wagtail-sidebar" class="nav-wrapper" data-nav-primary>
        <div class="inner">
            <a href="{% url 'wagtailadmin_home' %}" class="logo" aria-label="{% trans 'Dashboard' %}">
                {% block branding_logo %}
                    {# Mobile-only logo: #}
                    <div class="wagtail-logo-container__mobile u-hidden@sm">
                        <img class="wagtail-logo wagtail-logo__full" src="{% versioned_static 'wagtailadmin/images/wagtail-logo.svg' %}" alt="" width="80" />
                    </div>

                    {# Desktop logo (animated): #}
                    {% include "wagtailadmin/shared/animated_logo.html" %}
                {% endblock %}
                <span class="u-hidden@sm">{% trans "Dashboard" %}</span>
            </a>

            {% menu_search %}
            {% main_nav %}
        </div>
        <div class="explorer__wrapper" data-explorer-menu></div>
    </aside>
    {% endif %}

    <main class="content-wrapper" role="main" id="main">
        <div class="content">
            {# Always show messages div so it can be appended to by JS #}
            <div class="messages">
                {% if messages %}
                    <ul>
                        {% for message in messages %}
                            <li class="{% message_tags message %}">
                              {% if message.level_tag == "error" %}
                                {# There is no error icon, use warning icon instead #}
                                {% icon name="warning" class_name="messages-icon" %}
                              {% elif message.extra_tags == "lock" %}
                                {% icon name="lock" class_name="messages-icon" %}
                              {% elif message.extra_tags == "unlock" %}
                                {% icon name="lock-open" class_name="messages-icon" %}
                              {% else %}
                                {% icon name=message.level_tag class_name="messages-icon" %}
                              {% endif %}
                              {{ message|safe }}
                            </li>
                        {% endfor %}
                    </ul>
                {% endif %}
            </div>

            {% if not slim_sidebar_enabled %}
            <button type="button" id="nav-toggle" class="nav-toggle icon text-replace">{% trans "Menu" %}</button>
            {% endif %}
            {% block content %}{% endblock %}
        </div>
    </main>
{% endblock %}
