Skip to content
Extraits de code Groupes Projets
_dataTable.twig 3,61 ko
Newer Older
  • Learn to ignore specific revisions
  •     {% include visualizationTemplate %}
    
    {% set isDataTableEmpty = (dataTable is empty or dataTableHasNoData|default(false)) %}
    
    {% set showCardAsContentBlock = (properties.show_as_content_block and properties.show_title and not isWidget) %}
    {% set showOnlyTitleWithoutCard = not showCardAsContentBlock and properties.title and properties.show_title %}
    
    {% if showCardAsContentBlock  %}
    <div class="card">
    <div class="card-content">
        {% if properties.title %}
            <h2 class="card-title"
    
                {% if properties.title_edit_entity_url %}edit-url="{{ properties.title_edit_entity_url }}"{% endif %}
    
                  piwik-enriched-headline
            >{{ properties.title }}</h2>
        {% endif %}
    {% elseif showOnlyTitleWithoutCard %}
        <div>
        <h2>{{ properties.title }}</h2>
    {% endif %}
    
    {% set showCardTableIsEmpty = not properties.show_as_content_block and isDataTableEmpty and not isWidget %}
    {% if showCardTableIsEmpty %}
        <div class="card">
        <div class="card-content">
    {% endif %}
    
    
    mattab's avatar
    mattab a validé
    {% 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 %}">
    
        {% if properties.description %}
            <div class="card-description">{{ properties.description }}</div>
        {% endif %}
    
    
        <div class="reportDocumentation">
    
            {% if properties.documentation|default is not empty %}<p>{{ properties.documentation|raw }}</p>{% endif %}
    
            {% if reportLastUpdatedMessage is defined and reportLastUpdatedMessage %}<span class='helpDate'>{{ reportLastUpdatedMessage|raw }}</span>{% endif %}
    
        <div class="dataTableWrapper">
            {% if error is defined %}
                {{ error.message }}
    
                {% if properties.show_header_message is defined and properties.show_header_message is not empty %}
                    <div class='datatableHeaderMessage'>{{ properties.show_header_message | raw }}</div>
                {% endif %}
    
    
                    <div class="pk-emptyDataTable">
                    {% if showReportDataWasPurgedMessage is defined and showReportDataWasPurgedMessage %}
                        {{ 'CoreHome_DataForThisReportHasBeenPurged'|translate(deleteReportsOlderThan) }}
    
                    {% elseif properties.no_data_message %}
                        {{ properties.no_data_message|raw }}
    
                    {% else %}
                        {{ 'CoreHome_ThereIsNoDataForThisReport'|translate }}
                    {% endif %}
                    </div>
                {% else %}
    
                    {% include visualizationTemplate %}
    
                {% if properties.show_footer %}
                    {% include "@CoreHome/_dataTableFooter.twig" %}
                {% endif %}
    
                {% include "@CoreHome/_dataTableJS.twig" %}
    
    {% if showCardTableIsEmpty %}
        </div></div>
    {% endif %}
    
    {% if showCardAsContentBlock %}
        </div></div>
    {% elseif showOnlyTitleWithoutCard %}
        </div>
    {% endif %}