-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathmultidelete-macro.twig
80 lines (78 loc) · 2.8 KB
/
multidelete-macro.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
{% macro insertButton(targetId, type) %}
{{ include_javascript('javascripts/multidelete.js') }}
{% set modalId = modalId is not empty ? modalId : 'MultiDeleteModal' ~ targetId %}
<a
class="btn btn-sm btn-danger"
title="{{ _t('DELETE_ALL_SELECTED_ITEMS')|e('html_attr') }}"
data-toggle="modal"
role="button"
href="#{{ modalId }}"
onclick="multiDeleteService.updateNbSelected('{{ modalId }}')">
<i class="fa fa-trash"></i>
{{ _t('DELETE_SELECTION') }}
</a>
<div class="modal fade multidelete"
id="{{ modalId }}"
tabindex="-1"
role="dialog"
aria-labelledby="{{ modalId }}Label"
aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="{{ modalId }}Label">{{ _t('DELETE_ALL_SELECTED_ITEMS') }}</h3>
</div>
<div class="modal-body">
<div class="alert alert-info">
<b>{{ _t('NUMBER_OF_ELEMENTS') }} :</b>
<span class="nb-elem-selected"></span>
</div>
<button class="btn btn-sm btn-warning start-btn-delete-all" data-target="{{ targetId }}" data-type="{{ type }}">{{ _t('DELETE') }}</button>
<br/><br/>
<div class="multi-delete-results"></div>
</div>
<div class="modal-footer">
<div class="progressbar progress">
<div class="progress-bar" role="progressbar"
style="width: 0%;"
aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
</div>
</div>
</div>
</div>{# .modal-content #}
</div>{# .modal-dialog #}
</div>
{% endmacro insertButton %}
{% macro insertSelectLine(targetId, itemId, disabled = false, type = 'pages') %}
<td>
{% set id = "selectline_#{ targetId }_#{ itemId|e('html_attr') }" %}
<label for="{{id}}">
<input
{% if disabled %}
disabled
{% else %}
class="selectline"
data-itemid="{{ itemId }}"
{% endif %}
type="checkbox"
id="{{id}}"
name="{{id}}"
value="">
<span></span>
</label>
</td>
{% endmacro insertSelectLine %}
{% macro insertSelectAll(targetId, selectAllType) %}
{{ include_javascript('javascripts/multidelete.js') }}
<th class="prevent-sorting not-export-this-col">
<label class="check-all-container" for="checkbox_checkall_{{ selectAllType }}_{{ targetId }}">
<input
type="checkbox"
id="checkbox_checkall_{{ selectAllType }}_{{ targetId }}"
name="checkbox_checkall_{{ selectAllType }}_{{targetId }}"
value="" onclick="checkAllFirstCol(this)">
<span></span>
</label>
</th>
{% endmacro insertSelectAll %}