{% if properties.show_visualization_only %}
    {% include visualizationTemplate %}
{%- else -%}

{% set summaryRowId = constant('Piwik\\DataTable::ID_SUMMARY_ROW') %}{# ID_SUMMARY_ROW #}
{% set isSubtable = javascriptVariablesToSet.idSubtable is defined and javascriptVariablesToSet.idSubtable != 0 %}
<div class="dataTable {{ visualizationCssClass }} {{ properties.datatable_css_class|default('') }} {% if isSubtable %}subDataTable{% endif %}"
     data-table-type="{{ properties.datatable_js_type }}"
     data-report="{{ properties.report_id }}"
     data-report-metadata="{{ reportMetdadata|json_encode|e('html_attr') }}"
     data-props="{% if clientSideProperties is empty %}{}{% else %}{{ clientSideProperties|json_encode }}{% endif %}"
     data-params="{% if clientSideParameters is empty %}{}{% else %}{{ clientSideParameters|json_encode }}{% endif %}">
    <div class="reportDocumentation">
        {% if properties.documentation|default is not empty %}<p>{{ properties.documentation|raw }}</p>{% endif %}
        {% if reportLastUpdatedMessage is defined %}<span class='helpDate'>{{ reportLastUpdatedMessage }}</span>{% endif %}
    </div>
    <div class="dataTableWrapper">
        {% if error is defined %}
            {{ error.message }}
        {% else %}
            {% if dataTable is empty or dataTableHasNoData|default(false) %}
                <div class="pk-emptyDataTable">
                {% if showReportDataWasPurgedMessage is defined and showReportDataWasPurgedMessage %}
                    {{ 'CoreHome_DataForThisReportHasBeenPurged'|translate(deleteReportsOlderThan) }}
                {% else %}
                    {{ 'CoreHome_ThereIsNoDataForThisReport'|translate }}
                {% endif %}
                </div>
            {% else %}
                {% include visualizationTemplate %}
            {% endif %}

            {% if properties.show_footer %}
                {% include "@CoreHome/_dataTableFooter.twig" %}
            {% endif %}
            {% include "@CoreHome/_dataTableJS.twig" %}
        {% endif %}
    </div>
</div>

{%- endif %}