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

_dataTableCell.twig « templates « CoreHome « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2db35451369229ac3cb64a90d026e4bf332ebf23 (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
{% spaceless %}
{% set tooltipIndex = column ~ '_tooltip' %}
{% if row.getMetadata(tooltipIndex) %}<span class="cell-tooltip" data-tooltip="{{ row.getMetadata(tooltipIndex) }}">{% endif %}
{% if not row.getIdSubDataTable() and column=='label' and row.getMetadata('url') %}
    <a rel="noreferrer"
       target="_blank"
       href='{% if row.getMetadata('url')|slice(0,4) not in ['http','ftp:'] %}http://{% endif %}{{ row.getMetadata('url')|rawSafeDecoded }}'>
    {% if not row.getMetadata('logo') %}
        <img class="link" width="10" height="9"
             src="plugins/Morpheus/images/link.png"/>
    {% endif %}
{% endif %}

{% set totals = dataTable.getMetadata('totals') %}
{% if column in totals|keys -%}
    {% set labelColumn   = columns_to_display|first %}
    {% set reportTotal   = totals[column] %}
    {% if siteSummary is defined and siteSummary is not empty and siteSummary.getFirstRow %}
        {% set siteTotal = siteSummary.getFirstRow.getColumn(column) %}
    {% else %}
        {% set siteTotal = 0 %}
    {% endif %}
    {% set rowPercentage = row.getColumn(column)|percentage(reportTotal, 1) %}
    {% set metricTitle   = translations[column]|default(column) %}
    {% set reportLabel   = row.getColumn(labelColumn)|truncate(40)|rawSafeDecoded %}

    {% set reportRatioTooltip = 'General_ReportRatioTooltip'|translate(reportLabel, rowPercentage|e('html_attr'), reportTotal|e('html_attr'), metricTitle|e('html_attr'), translations[labelColumn]|default(labelColumn)|e('html_attr')) %}

    {% if siteTotal and siteTotal > reportTotal %}
        {% set totalPercentage   = row.getColumn(column)|percentage(siteTotal, 1) %}
        {% set totalRatioTooltip = 'General_TotalRatioTooltip'|translate(totalPercentage, siteTotal|number(2,0), metricTitle) %}
    {% else %}
        {% set totalRatioTooltip = '' %}
    {% endif %}

    <span class="ratio"
          title="{{ reportRatioTooltip|raw }} {{ totalRatioTooltip|e('html_attr') }}"
          >&nbsp;{{ rowPercentage }}</span>
{%- endif %}

{% if column=='label' %}
    {% import 'macros.twig' as piwik %}

    <span class='label{% if row.getMetadata('is_aggregate') %} highlighted{% endif %}'
    {% if properties is defined and properties.tooltip_metadata_name is not empty %}title="{{ row.getMetadata(properties.tooltip_metadata_name) }}"{% endif %}>
        {{ piwik.logoHtml(row.getMetadata(), row.getColumn('label')) }}
        {% if row.getMetadata('html_label_prefix') %}<span class='label-prefix'>{{ row.getMetadata('html_label_prefix') | raw }}&nbsp;</span>{% endif -%}
{% endif %}<span class="value">
    {%- if row.getColumn(column) or (column=='label' and row.getColumn(column) is same as("0")) %}{% if column=='label' %}{{- row.getColumn(column)|rawSafeDecoded -}}{% else %}{% if row.getMetadata('html_column_' ~ column ~ '_prefix') %}<span class='column-prefix'>{{ row.getMetadata('html_column_' ~ column ~ '_prefix') | raw }}&nbsp;</span>{% endif -%}{{- row.getColumn(column)|number(2,0)|rawSafeDecoded -}}{% endif %}
    {%- else -%}-
    {%- endif -%}</span>
{% if column=='label' %}{%- if row.getMetadata('html_label_suffix') %}<span class='label-suffix'>{{ row.getMetadata('html_label_suffix') | raw }}</span>{% endif -%}</span>{% endif %}
{% if not row.getIdSubDataTable() and column=='label' and row.getMetadata('url') %}
    </a>
{% endif %}
{% if row.getMetadata(tooltipIndex) %}</span>{% endif %}

{% endspaceless %}