-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
_list.html.twig
140 lines (139 loc) · 7.24 KB
/
_list.html.twig
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
134
135
136
137
138
139
140
{#
Variables
- lead
- events
#}
<!-- filter form -->
<form method="post" action="{{ path('mautic_contact_auditlog_action', {'leadId': lead.id}) }}" class="panel" id="auditlog-filters">
<div class="form-control-icon pa-xs">
<input type="text" class="form-control bdr-w-0" name="search" id="search" placeholder="{{ 'mautic.core.search.placeholder'|trans }}" value="{{ events['filters']['search']|e }}">
<span class="the-icon fa fa-search text-muted mt-xs"></span>
</div>
{% if events.types is defined and events.types is iterable %}
<div class="history-search panel-footer text-muted">
<div class="row">
<div class="col-sm-5 mna-3">
<label class="pt-lg">{{ 'mautic.lead.lead.filter.bundles.include.placeholder'|trans }}</label>
<select name="includeEvents[]" multiple="multiple" class="form-control bdr-w-0"">
{% for typeKey, typeName in events.types %}
<option value="{{ typeKey }}" {% if typeKey in events.filters.includeEvents %}selected{% endif %}>
{{- typeName -}}
</option>
{% endfor %}
</select>
</div>
<div class="col-sm-5 mna-3">
<label class="pt-lg">{{ 'mautic.lead.lead.filter.bundles.exclude.placeholder'|trans }}</label>
<select name="excludeEvents[]" multiple="multiple" class="form-control bdr-w-0">
{% for typeKey, typeName in events.types %}
<option value="{{ typeKey }}" {% if typeKey in events.filters.excludeEvents %}selected{% endif %}>
{{- typeName -}}
</option>
{% endfor %}
</select>
</div>
<div class="col-sm-2 mt-lg">
<a class="btn btn-default btn-block mt-lg" href="{{ url('mautic_contact_auditlog_export_action', {'leadId': lead.id}) }}" data-toggle="download">
<span>
<i class="fa fa-download"></i> <span>{{ 'mautic.core.export'|trans }}</span>
</span>
</a>
</div>
</div>
</div>
{% endif %}
<input type="hidden" name="leadId" id="leadId" value="{{ lead.id|e }}" />
</form>
<script>
mauticLang['showMore'] = '{{ 'mautic.core.more.show'|trans }}';
mauticLang['hideMore'] = '{{ 'mautic.core.more.hide'|trans }}';
</script>
<div id="auditlog-table">
<!-- auditlog -->
<div class="table-responsive">
<table class="table table-hover" id="contact-auditlog">
<thead>
<tr>
<th class="timeline-icon">
<a class="btn btn-sm btn-nospin btn-default" data-activate-details="all" data-toggle="tooltip" title="{{ 'mautic.lead.timeline.toggle_all_details'|trans }}">
<span class="fa fa-fw fa-level-down"></span>
</a>
</th>
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'orderBy': 'userName',
'text': 'mautic.lead.timeline.user_name',
'class': 'timeline-name',
'sessionVar': 'lead.'~lead.id~'.auditlog',
'baseUrl': path('mautic_contact_auditlog_action', {'leadId': lead.id}),
'target': '#auditlog-table',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'orderBy': 'action',
'text': 'mautic.lead.timeline.event_type',
'class': 'visible-md visible-lg timeline-type',
'sessionVar': 'lead.'~lead.id~'.auditlog',
'baseUrl': path('mautic_contact_auditlog_action', {'leadId': lead.id}),
'target': '#auditlog-table',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'orderBy': 'dateAdded',
'text': 'mautic.lead.timeline.event_timestamp',
'class': 'visible-md visible-lg timeline-timestamp',
'sessionVar': 'lead.'~lead.id~'.auditlog',
'baseUrl': path('mautic_contact_auditlog_action', {'leadId': lead.id}),
'target': '#auditlog-table',
}) }}
</tr>
<tbody>
{% for event in events.events %}
{% set counter = loop.index0 + 1 %}
{% set icon = event.icon|default('fa-history') %}
{% set eventLabel = event.eventLabel|default(event.eventType) %}
{% if eventLabel is iterable %}
{% set linkType = eventLabel.isExternal is defined ? 'data-toggle="ajax"' : 'target="_new"' %}
{% set eventLabel = '<a href="'~eventLabel.href~'" '~linkType~'>'~eventLabel.label~'</a>' %}
{% endif %}
{% set rowStripe = cycle(['', 'timeline-row-highlighted'], loop.index0) %}
{% set hasDetails = false %}
{% for key, value in event.details %}
{% if event.contentTemplate is defined and event.details|length > 0 %}
{% set hasDetails = true %}
{% endif %}
{% endfor %}
<tr class="timeline-row {{ rowStripe }} {% if event.featured is defined %}timeline-featured{% endif %}">
<td class="timeline-icon">
<a href="javascript:void(0);"
data-activate-details="{{ counter }}"
class="btn btn-sm btn-nospin btn-default {% if event.contentTemplate is not defined or hasDetails == false %}disabled{% endif %}"
data-toggle="tooltip"
title="{{ 'mautic.lead.timeline.toggle_details'|trans }}">
<span class="fa fa-fw {{ icon }}"></span>
</a>
</td>
<td class="timeline-name">{{ eventLabel }}</td>
<td class="timeline-type">{% if event.eventType is defined %}{{ ('mautic.lead.event.'~event.eventType)|trans }}{% endif %}
</td>
<td class="timeline-timestamp">{{ dateToText(event.timestamp, 'local', 'Y-m-d H:i:s', true) }}</td>
</tr>
{% if event.contentTemplate and hasDetails == true %}
<!-- contentTemplate: "{{ event.contentTemplate }}" -->
<tr class="timeline-row {{ rowStripe }} timeline-details hide" id="auditlog-details-{{ counter }}">
<td colspan="4">
{{ include([event.contentTemplate, event.contentTemplate], {'event': event, 'lead': lead}) }}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
{{ include('@MauticCore/Helper/pagination.html.twig', {
'page': events.page,
'fixedPages': events.maxPages,
'fixedLimit': true,
'baseUrl': path('mautic_contact_auditlog_action', {'leadId': lead.id}),
'target': '#auditlog-table',
'totalItems': events.total,
}) }}
<!--/ auditlog -->
</div>