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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
{%- set subtablesAreDisabled = properties.show_goals_columns|default(false)
and properties.disable_subtable_when_show_goals|default(false) -%}
{%- set showingEmbeddedSubtable = properties.show_embedded_subtable is not empty
and idSubtable|default(false) -%}
{% if error is defined %}
{{ error.message }}
{% else %}
{%- if not showingEmbeddedSubtable -%}
<div class="dataTableScroller">
<table cellspacing="0" class="dataTable">
{% include "@CoreHome/_dataTableHead.twig" %}
<tbody>
{%- endif -%}
{% if showingEmbeddedSubtable and dataTableHasNoData %}
{% if clientSideParameters is not defined or clientSideParameters.filter_pattern_recursive is not defined or not clientSideParameters.filter_pattern_recursive %}
<tr class="nodata">
<td colspan="{{ properties.columns_to_display|length }}">{{ 'CoreHome_CategoryNoData'|translate }}</td>
</tr>
{% endif %}
{% else %}
{% set rowIndex = properties.filter_offset|default(0) + 1 %}
{%- for rowId, row in dataTable.getRows() -%}
{%- set rowHasSubtable = not subtablesAreDisabled and row.getIdSubDataTable() and properties.subtable_controller_action is not null -%}
{%- set rowSubtableId = row.getMetadata('idsubdatatable_in_db')|default(row.getIdSubDataTable()) -%}
{%- set isSummaryRow = rowId == constant('Piwik\\DataTable::ID_SUMMARY_ROW') or row.getMetadata('is_summary') -%}
{%- set shouldHighlightRow = isSummaryRow and properties.highlight_summary_row -%}
{% set dimensions = dataTable.getMetadata('dimensions')|default([]) %}
{# display this row if it doesn't have a subtable or if we don't replace the row with the subtable #}
{%- set showRow = subtablesAreDisabled
or not rowHasSubtable
or not properties.show_expanded|default(false)
or not properties.replace_row_with_subtable|default(false) -%}
{% if showRow %}
<tr {% if rowHasSubtable %}id="{{ rowSubtableId }}"{% endif %}
{% if row.getMetadata('segment') is not false %} data-segment-filter="{{ row.getMetadata('segment')|e('html_attr') }}"{% endif %}
{% if row.getMetadata('url') is not false %} data-url-label="{{ row.getMetadata('url')|rawSafeDecoded }}"{% endif %}
data-row-metadata="{{ row.getMetadata|json_encode|e('html_attr') }}"
class="{{ row.getMetadata('css_class') }} {% if rowHasSubtable %}subDataTable{% endif %}{% if shouldHighlightRow %} highlight{% endif %}{% if isSummaryRow %} summaryRow{% endif %} {% if isComparing %}parentComparisonRow{% endif %}"
{% if rowHasSubtable %}title="{{ 'CoreHome_ClickRowToExpandOrContract'|translate }}"{% endif %}
{% if rowIdentifier|default != 'label' %}data-label="{{ row.getColumn(rowIdentifier) ? row.getColumn(rowIdentifier) : row.getMetadata(rowIdentifier) }}" data-label-pretty="{{ row.getColumn('label') }}"{% endif %}
>
{% for column in properties.columns_to_display %}
{% set cellAttributes = visualization.getCellHtmlAttributes(row, column) %}
<td class="{% if column =='label' or column in dimensions %}label{% else %}column{% endif %} {% if loop.first %}first{% endif %} {{ cellAttributes.class|default|e('html_attr') }}"
{% if cellAttributes is not empty %}{% for name, value in cellAttributes %}{{ name|e('html') }}="{{ value|e('html_attr') }}" {% endfor %}{% endif %}
>
{% if isComparing and column == 'label' %}
<span class="prefix-numeral">{{ rowIndex }}.</span>
{% endif %}
{% include "@CoreHome/_dataTableCell.twig" with properties %}
</td>
{% endfor %}
</tr>
{% if row.getComparisons() %}
{% include "@CoreVisualizations/_dataTableViz_htmlTable_comparisons.twig" with {
'comparedRow': row,
'dataTable': row.getComparisons(),
'rootDataTable': dataTable,
'dimensions': dimensions,
} %}
{% endif %}
{% endif %}
{# display subtable if present and showing expanded datatable #}
{% if properties.show_expanded|default(false) and rowHasSubtable %}
{% include "@CoreVisualizations/_dataTableViz_htmlTable.twig" with {'dataTable': row.getSubtable(), 'idSubtable': rowSubtableId} %}
{% endif %}
{% set rowIndex = rowIndex + 1 %}
{%- endfor -%}
{% if dataTable.getTotalsRow and properties.show_totals_row %}
{% set row = dataTable.getTotalsRow %}
{% set rowId = 'totalsRow' %}
<tr class="{{ row.getMetadata('css_class') }} totalsRow"
title="Total values for this table">
{% for column in properties.columns_to_display %}
<td class="{% if column =='label' %}label{% else %}column{% endif %} {% if loop.first %}first{% endif %}">
{% include "@CoreHome/_dataTableCell.twig" with properties %}
</td>
{% endfor %}
</tr>
{% endif %}
{% endif %}
{%- if not showingEmbeddedSubtable -%}
</tbody>
</table>
</div>
{%- endif -%}
{% endif %}
|