{% extends 'layout.twig' %}

{% block head %}
    {{ parent() }}
{% endblock %}

{% set title %}{{ siteName|raw }} - {{ 'CoreHome_WebAnalyticsReports'|translate }}{% endset %}

{% block pageDescription %}Web Analytics report for {{ siteName|escape("html_attr") }} - Matomo{% endblock %}

{% set bodyClass = postEvent('Template.bodyClass', 'dashboard') %}

{% block body %}
    {{ postEvent("Template.header", "dashboard") }}
    {{ parent() }}
    {{ postEvent("Template.footer", "dashboard") }}
{% endblock %}

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

    {% set hasSidebar = showMenu is defined and showMenu %}

    <div class="layoutWithSidebar{% if hasSidebar %} layoutWithSidebar--hasSidebar{% endif %}">
        {% if hasSidebar %}
            <div id="secondNavBar" class="sideBar Menu--dashboard z-depth-1">
                <div vue-entry="CoreHome.QuickAccess"></div>
                <div vue-entry="CoreHome.ReportingMenu"></div>
            </div>
        {% endif %}
        <div class="layoutWithSidebarContent">
            <div class="top_controls">
                {% block topcontrols %}
                {% endblock %}
            </div>

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

                    {{ postEvent("Template.beforeContent", "dashboard", currentModule, currentAction) }}

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

                    <div vue-entry="CoreHome.Comparisons"></div>

                    {% block content %}
                    {% endblock %}

                    <div class="clear"></div>
                </div>
            </div>
        </div>
    </div>

{% if whatisnewShow is defined and whatisnewShow %}
    <script>
        document.addEventListener("DOMContentLoaded", function(event) {
            const tooltip = '{{ 'CoreAdminHome_WhatIsNewTooltip'|translate }}';
            window.Piwik_Popover.createPopupAndLoadUrl('module=CoreAdminHome&action=whatIsNew', tooltip.replace(/&#039;/g,"'"), 'what-is-new-popup');
        });
    </script>
{% endif %}

{% endblock %}
