{% extends 'layout.twig' %}

{% set categoryTitle %}Tag Manager{% endset %}

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

{% block body %}
    {% set topMenuModule = 'TagManager' %}
    {% set topMenuAction = tagAction|default('') %}
    {{ postEvent("Template.header", "tagmanager") }}
    {{ parent() }}
    {{ postEvent("Template.footer", "tagmanager") }}
{% 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 %}
            {{ menu.menu(tagManagerMenu, false, 'Menu--admin', currentModule, currentAction, null, null, true) }}
        {% endif %}

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

                    <div class="top_bar_sites_selector piwikTopControl">
                        <div
                            vue-entry="CoreHome.SiteSelector"
                            show-selected-site="true"
                            show-all-sites-item="false"
                            class="sites_autocomplete"
                        ></div>
                    </div>

                    <div class="piwikTopControl">
                        <div
                            vue-entry="TagManager.ContainerSelector"
                            {% if container is defined and container is not empty %}container-name="{{ (container.name ~ ' (' ~ container.idcontainer ~ ')')|json_encode }}"{% endif %}
                        ></div>
                    </div>
                {% endblock %}

                <span class="icon icon-arrowup"></span>
            </div>

            <div class="page">
                <div class="pageWrap">
                    {% import 'ajaxMacros.twig' as ajax %}
                    {{ ajax.requestErrorDiv(emailSuperUser|default(''), areAdsForProfessionalServicesEnabled, currentModule) }}
                    {{ 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 %}
