Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_dataTable.twig « templates « CoreHome « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d6b51d34f15aa56aca927a89aca2f7ad7d38969e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{% set isSubtable = javascriptVariablesToSet.idSubtable is defined and javascriptVariablesToSet.idSubtable != 0 %}
<div class="dataTable {{ properties.datatable_css_class }} {% if isSubtable %}subDataTable{% endif %}"
     data-table-type="{{ properties.datatable_js_type|default('dataTable') }}"
     data-report="{{ properties.report_id }}"
     data-params="{{ javascriptVariablesToSet|json_encode }}">
    <div class="reportDocumentation">
        {% if reportDocumentation|default is not empty %}<p>{{ reportDocumentation|raw }}</p>{% endif %}
        {% if properties.metadata.archived_date is defined %}<span class='helpDate'>{{ properties.metadata.archived_date }}</span>{% endif %}
    </div>
    <div class="dataTableWrapper">
        {% if error is defined %}
            {{ error.message }}
        {% else %}
            {% if dataTable is empty or dataTable.getRowsCount() == 0 %}
                <div class="pk-emptyDataTable">
                {% if showReportDataWasPurgedMessage is defined and showReportDataWasPurgedMessage %}
                    {{ 'CoreHome_DataForThisReportHasBeenPurged'|translate(deleteReportsOlderThan) }}
                {% else %}
                    {{ 'CoreHome_ThereIsNoDataForThisReport'|translate }}
                {% endif %}
                </div>
            {% else %}
                <table cellspacing="0" class="dataTable">
                    {% include "@CoreHome/_dataTableHead.twig" %}

                    <tbody>
                    {% for rowId, row in dataTable.getRows() %}
                        {%- set rowHasSubtable = row.getIdSubDataTable() and javascriptVariablesToSet.controllerActionCalledWhenRequestSubTable is not null -%}
                        {%- set shouldHighlightRow = rowId == constant("Piwik_DataTable::ID_SUMMARY_ROW") and properties.highlight_summary_row -%}
                        
                        {# display this row if it doesn't have a subtable or if we don't replace the row with the subtable #}
                        {% if not rowHasSubtable or not properties.show_expanded|default(false) or not properties.replace_row_with_subtable|default(false) %}
                        <tr {% if rowHasSubtable %}id="{{ row.getIdSubDataTable() }}"{% endif %}
                            class="{{ row.getMetadata('css_class') }} {% if rowHasSubtable %}subDataTable{% endif %}{% if shouldHighlightRow %} highlight{% endif %}">
                            {% for column in dataTableColumns %}
                                <td>
                                    {% include "@CoreHome/_dataTableCell.twig" with properties %}
                                </td>
                            {% endfor %}
                        </tr>
                        {% endif %}
                        
                        {# display subtable if present and showing expanded datatable #}
                        {% if properties.show_expanded|default(false) and rowHasSubtable %}
                            {% include properties.subtable_template with {'dataTable': row.getSubtable()} %}
                        {% endif %}
                    {% endfor %}
                    </tbody>
                </table>
            {% endif %}

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