{% extends "dashboard.twig" %}

{% block notification %}
    {% include "@CoreHome/_notifications.twig" %}
{% endblock %}

{% block topcontrols %}
    {% include "@CoreHome/_siteSelectHeader.twig" %}
{% endblock %}

{% set bodyId = 'site-without-data' %}

{% block content %}

    <script type="text/javascript" charset="utf-8">
        $(document).ready(function () {
            $('<div />').insertAfter('.site-without-data').liveWidget({
                interval: 1000,
                onUpdate: function () {
                    // reload page as soon as a visit was detected
                    broadcast.propagateNewPage('date=today');
                },
                dataUrlParams: {
                    module: 'Live',
                    action: 'getLastVisitsStart'
                }
            });
        });
    </script>

    <div class="site-without-data">
            <h1 id="start-tracking-data-header">
                {{ 'SitesManager_SiteWithoutDataStartTrackingDataHeader'|translate }}
            </h1>
            <p>{{ siteWithoutDataStartTrackingTranslationKey|translate('<a rel="noreferrer noopener" target="_blank" class="emailTrackingCode" href="mailto:?subject=' ~ 'SitesManager_EmailInstructionsSubject'|translate|url_encode|e('html_attr') ~ '&body=' ~ emailBody|url_encode|e('html_attr') ~ '">', '</a>', '<a rel="noreferrer noopener" target="_blank" href="' ~ inviteUserLink ~'">', '</a>')|raw }}</p>
            <p>{{ 'SitesManager_SiteWithoutDataStartTrackingDataDescriptionLine2'|translate('<a rel="noreferrer noopener" class="ignoreSitesWithoutData" href="' ~ linkTo({module: 'SitesManager', action: 'ignoreNoDataMessage'}) ~'">', '</a>')|raw }}</p>
            <p>&nbsp;</p>

            <div piwik-widget-loader='{"module":"SitesManager","action":"siteWithoutDataTabs"}' loading-message="{{ 'SitesManager_DetectingYourSite'|translate|e('html_attr') }}..."></div>

            {% set afterIntroEventContent %}{{ postEvent('Template.siteWithoutData.afterIntro') }}{% endset %}
            <div class="no-data-footer row">
                {% if afterIntroEventContent %}
                    <hr/>
                {% endif %}
                {{ afterIntroEventContent }}
            </div>
            {{ postEvent('Template.siteWithoutData.afterTrackingHelp') }}
    </div>

{% endblock %}
