{% extends 'layout.twig' %}

{% set categoryTitle %}{{ 'CoreAdminHome_Administration'|translate }}{% endset %}

{% set bodyClass = postEvent('Template.bodyClass', 'admin') %}
{% set isAdminArea = true %}

{% block body %}
    {% set topMenuModule = 'CoreAdminHome' %}
    {% set topMenuAction = 'home' %}
    {{ postEvent("Template.header", "admin") }}
    {{ parent() }}
    {{ postEvent("Template.footer", "admin") }}

    <div id="sizewarning" class="notification system notification-error">
        This page can't be rendered on screens with width or height below 200px.
    </div>
    <style>
        {# Inlined to ensure it is only applied in the admin area #}
        @media (max-width: 200px), (max-height: 200px) {
            #sizewarning {
                display: block;
            }

            body > #root {
                display: none!important;
            }
        }
    </style>
{% endblock %}


{% block root %}
    {% include "@CoreHome/_topScreen.twig" %}

    {% set hasSidebar = showMenu is not defined or showMenu %}

    <div class="layoutWithSidebar{% if hasSidebar %} layoutWithSidebar--hasSidebar{% endif %}">
        {% if hasSidebar %}
            {% import '@CoreHome/_menu.twig' as menu %}
            {% set collapsibleMenu = hasSomeAdminAccess %}
            {{ menu.menu(adminMenu, false, 'Menu--admin', currentModule, currentAction, collapsibleMenu, isSuperUser, true) }}
        {% endif %}

        <div class="layoutWithSidebarContent">
            <div class="top_controls">
                {% block topcontrols %}
                {% endblock %}

                {% include "@CoreHome/_headerMessage.twig" %}
            </div>

            <div class="page">
                <div class="pageWrap">
                    {% import 'ajaxMacros.twig' as ajax %}
                    {{ ajax.requestErrorDiv(contactEmail|default(''), areAdsForProfessionalServicesEnabled, currentModule, showMoreFaqInfo) }}
                    {{ postEvent("Template.beforeContent", "admin", currentModule, currentAction) }}

                    <a name="main"></a>
                    {% block notification %}
                        {% include "@CoreHome/_notifications.twig" %}
                    {% endblock %}
                    {% include "@CoreHome/_warningInvalidHost.twig" %}

                    <div class="admin" id="content">

                        <div class="ui-confirm" id="alert">
                            <h2></h2>
                            <input role="no" type="button" value="{{ 'General_Ok'|translate }}"/>
                        </div>

                        {% block content %}
                        {% endblock %}


                    </div>
                </div>
            </div>
        </div>
    </div>

{% endblock %}
