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

_actionsList.twig « templates « Live « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8d8bc1572a994531db1b9f4108e75d8e7ba880c6 (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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
{% set previousAction = false %}
{% for action in actionDetails %}
    {% set customVariablesTooltip %}
        {% if action.customVariables is defined %}
            {{ 'CustomVariables_CustomVariables'|translate }}:
            {% for id,customVariable in action.customVariables %}
                {% set name = 'customVariablePageName' ~ id %}
                {% set value = 'customVariablePageValue' ~ id %}
                - {{ customVariable[name]|raw }} {% if customVariable[value]|length > 0 %} = {{ customVariable[value]|raw }}{% endif %}

                {# line break above is important #}
            {% endfor %}
        {% endif %}
    {% endset %}

    <li class="{% if action.goalName is defined %}goal{% else %}action{% endif %}"
        title="{{ action.serverTimePretty }}{% if action.url is defined and action.url|trim|length %}

{{ action.url }}{% endif %}{% if customVariablesTooltip|trim|length %}

{{ customVariablesTooltip|trim }}{% endif -%}
        {%- if action.generationTime is defined %}

{{ 'General_ColumnGenerationTime'|translate }}: {{ action.generationTime|raw }}{% endif %}
        {%- if action.timeSpentPretty is defined %}

{{ 'General_TimeOnPage'|translate }}: {{ action.timeSpentPretty|raw }}{% endif -%}">
        <div>
        {% if action.type == 'ecommerceOrder' or action.type == 'ecommerceAbandonedCart' %}
        {# Ecommerce Abandoned Cart / Ecommerce Order #}
            <img src="{{ action.icon }}"/>
            {% if action.type == 'ecommerceOrder' %}
                <strong>{{ 'Goals_EcommerceOrder'|translate }}</strong>
                <span style='color:#666;'>({{ action.orderId }})</span>
            {% else %}
                <strong>{{'Goals_AbandonedCart'|translate}}</strong>

                {# TODO: would be nice to have the icons Orders / Cart in the ecommerce log footer #}
            {% endif %}
            <p>
            <span {% if not isWidget %}style='margin-left:20px;'{% endif %}>
                {% if action.type == 'ecommerceOrder' %}
{# spacing is important for tooltip to look nice #}
{% set ecommerceOrderTooltip %}{{ 'General_ColumnRevenue'|translate }}: {{ action.revenue|money(clientSideParameters.idSite)|raw }}
{% if action.revenueSubTotal is not empty %} - {{ 'General_Subtotal'|translate }}: {{ action.revenueSubTotal|money(clientSideParameters.idSite)|raw }}{% endif %}

{% if action.revenueTax is not empty %} - {{ 'General_Tax'|translate }}: {{ action.revenueTax|money(clientSideParameters.idSite)|raw }}{% endif %}

{% if action.revenueShipping is not empty %} - {{ 'General_Shipping'|translate }}: {{ action.revenueShipping|money(clientSideParameters.idSite)|raw }}{% endif %}

{% if action.revenueDiscount is not empty %} - {{ 'General_Discount'|translate }}: {{ action.revenueDiscount|money(clientSideParameters.idSite)|raw }}{% endif %}
{% endset %}
                <abbr title="{{ ecommerceOrderTooltip }}">{{ 'General_ColumnRevenue'|translate }}:
                {% else %}
                    {% set revenueLeft %}{{ 'General_ColumnRevenue'|translate }}{% endset %}
                    {{ 'Goals_LeftInCart'|translate(revenueLeft) }}:
                {% endif %}
                    <strong>{{ action.revenue|money(clientSideParameters.idSite)|raw }}</strong>
                {% if action.type == 'ecommerceOrder' %}
                </abbr>
                {% endif %}, {{ 'General_Quantity'|translate }}: {{ action.items }}

                {# Ecommerce items in Cart/Order #}
                {% if action.itemDetails is not empty %}
                    <ul style='list-style:square;margin-left:{% if isWidget %}15{% else %}50{% endif %}px;'>
                        {% for product in action.itemDetails %}
                            <li>
                                {{ product.itemSKU }}{% if product.itemName is not empty %}: {{ product.itemName }}{% endif %}
                                {% if product.itemCategory is not empty %} ({{ product.itemCategory }}){% endif %}
                                ,
                                {{ 'General_Quantity'|translate }}: {{ product.quantity }},
                                {{ 'General_Price'|translate }}: {{ product.price|money(clientSideParameters.idSite)|raw }}
                            </li>
                        {% endfor %}
                    </ul>
                {% endif %}
            </span>
            </p>
        {% elseif action.goalName is not defined%}
            {# Page view / Download / Outlink / Event #}
            {% if action.pageTitle|default(false) is not empty %}
                <span class="truncated-text-line">{{ action.pageTitle|rawSafeDecoded }}</span>
            {% endif %}
            {% if action.siteSearchKeyword is defined %}
                {% if action.type == 'search' %}
                    <img src='{{ action.icon }}' title='{{ 'Actions_SubmenuSitesearch'|translate }}' class="action-list-action-icon search">
                {% endif %}
                <span class="truncated-text-line">{{ action.siteSearchKeyword|rawSafeDecoded }}</span>
            {% endif %}
            {% if action.eventCategory|default(false) is not empty %}
                <img src='{{ action.icon }}' title='{{ 'Events_Event'|translate }}' class="action-list-action-icon event">
                <span class="truncated-text-line event">{{ action.eventCategory|rawSafeDecoded }} - {{ action.eventAction|rawSafeDecoded }} {% if action.eventName is defined %}- {{ action.eventName|rawSafeDecoded }}{% endif %} {% if action.eventValue is defined %}[{{ action.eventValue }}]{% endif %}</span>
            {% endif %}
            {% if action.url is not empty %}
                {% if action.type == 'action' and action.pageTitle|default(false) is not empty %}<p>{% endif %}
                {% if action.type == 'download' or action.type == 'outlink' %}
                    <img src='{{ action.icon }}' class="action-list-action-icon {{ action.type }}">
                {% endif %}

                {% if action.eventCategory|default(false) is not empty
                    and previousAction.url|default(false) == action.url %}
                    {# For events, do not show (url) if the Event URL is the same as the URL last displayed #}
                {% else %}
                    {% if action.url|trim|lower starts with 'javascript:' or
                          action.url|trim|lower starts with 'vbscript:' or
                          action.url|trim|lower starts with 'data:' %}
                        {{ action.url }}
                    {%  else %}
                    <a href="{{ action.url }}" rel="noreferrer" target="_blank" class="{% if action.eventCategory|default(false) is empty %}action-list-url{# don't put URL on new line for events #}{% endif %} truncated-text-line"
                       {% if overrideLinkStyle is not defined or overrideLinkStyle %}style="text-decoration:underline;"{% endif %}>
                       {{ action.url }}
                    </a>
                    {%  endif %}
                {% endif %}
                {% if action.type == 'action' and action.pageTitle|default(false) is not empty %}</p>{% endif %}
            {% elseif action.type != 'search' and action.type != 'event' %}
                <p>
                <span>{{ clientSideParameters.pageUrlNotDefined }}</span>
                </p>
            {% endif %}
        {% else %}
            {# Goal conversion #}
            <img src="{{ action.icon }}" />
            <strong>{{ action.goalName }}</strong>
            {% if action.revenue > 0 %}, {{ 'General_ColumnRevenue'|translate }}:
                <strong>{{ action.revenue|money(clientSideParameters.idSite)|raw }}</strong>
            {% endif %}
        {% endif %}
        </div>
    </li>

    {% set previousAction = action %}
{% endfor %}