/
subscriber.html.twig
83 lines (83 loc) · 5.98 KB
/
subscriber.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
<div class="row">
<div id="hookSubscriberAreas" class="col-md-6">
<fieldset>
<legend>{{ __('Attached areas') }}</legend>
{% for category, areas in subscriberAreasAndCategories %}
<fieldset class="sareas_category">
<legend>{{ category }}</legend>
{% for sarea in areas %}
{% set sarea_md5 = sarea|php('md5') %}
<div id="sarea_{{ sarea_md5 }}" class="sarea_wrapper">
<input type="hidden" id="sarea_{{ sarea_md5 }}_a" value="{{ sarea }}" />
<input type="hidden" id="sarea_{{ sarea_md5 }}_c" value="{{ subscriberAreasToCategories[sarea] }}" />
<input type="hidden" id="sarea_{{ sarea_md5 }}_i" value="{{ sarea_md5 }}" />
<h4><i class="fa fa-caret-right"></i> {{ subscriberAreasToTitles[sarea] }} <span class="small">({{ sarea }})</span></h4>
<ol id="sarea_{{ sarea_md5 }}_list" class="">
{% if areasSorting[category][sarea] is defined %}
{% for parea in areasSorting[category][sarea] %}
{% set parea_md5 = parea|php('md5') %}
{% set attached_area_identifier = parea_md5 ~ '-' ~ sarea_md5 %}
<li id="attachedarea_{{ attached_area_identifier }}" class="clearfix z-sortable list-group-item ui-draggable" style="cursor: move; left: 0; top: 0; opacity: 1; position: relative;">
<i class="fa fa-arrows"></i>
<span>
{{ areasSortingTitles[parea] }} <span class="small">({{ parea }})</span>
<a class="detachlink" title="{{ __('Detach') }} {{ areasSortingTitles[parea] }}" href="javascript:void(0)" onclick="unbindProviderAreaFromSubscriberArea('{{ sarea_md5 }}', '{{ sarea }}', '{{ parea_md5 }}', '{{ parea }}');"><i class="fa fa-remove"></i></a>
</span>
<input type="hidden" id="attachedarea_{{ attached_area_identifier }}_a" value="{{ parea }}" />
<input type="hidden" id="attachedarea_{{ attached_area_identifier }}_c" value="{{ category }}" />
<input type="hidden" id="attachedarea_{{ attached_area_identifier }}_i" value="{{ parea_md5 }}" />
</li>
{% endfor %}
{% endif %}
<li id="sarea_empty_{{ sarea_md5 }}"{% if areasSorting[category][sarea] is defined %} class="hide"{% endif %}>
<span>{{ __('There aren\'t any areas attached here.<br />Drag an area from the right and drop it here to attach it.')|raw }}</span>
</li>
</ol>
</div>
{% endfor %}
</fieldset>
{% else %}
<p class="alert alert-warning">{{ __f('There are no subscribers available for %sub%.', {"%sub%": currentmodule}) }}</p>
{% endfor %}
</fieldset>
</div>
<div id="hookProviderAreas" class="col-md-6">
<fieldset>
<legend>{{ __('Available areas') }}</legend>
{% for hookprovider in hookproviders %}
{% if hookprovider.areas is not empty %}
<div class="parea_wrapper">
<h4><i class="fa fa-caret-right"></i> {{ hookprovider.displayname }}</h4>
<div class="panel-content">
{% for category, areas in hookprovider.areasAndCategories %}
<fieldset class="pareas_category">
<legend>{{ category }}</legend>
{% set draglist_identifier = hookprovider.name ~ '_' ~ category %}
{% set draglist_identifier_md5 = draglist_identifier|php('md5') %}
<ol id="availableareasdraglist_{{ draglist_identifier_md5 }}" class="list-group">
{% for parea in areas %}
{% set parea_md5 = parea|php('md5') %}
{% set available_area_identifier = parea_md5 ~ '-sarea_identifier' %}
<li id="availablearea_{{ available_area_identifier }}" class="z-draggable clearfix list-group-item">
<i class="fa fa-long-arrow-left"></i>
<span>
{{ hookprovider.areasToTitles[parea]|default('Area') }} <span class="small">({{ parea }})
</span>
<a class="detachlink hide" title="{{ __('Detach') }} {{ hookprovider.areasToTitles[parea] }}" href="javascript:void(0)" onclick="unbindProviderAreaFromSubscriberArea('##id', '##name', '{{ parea_md5 }}', '{{ parea }}');"><i class="fa fa-remove"></i></a></span>
<input type="hidden" id="availablearea_{{ available_area_identifier }}_a" value="{{ parea }}" />
<input type="hidden" id="availablearea_{{ available_area_identifier }}_c" value="{{ hookprovider.areasToCategories[parea] }}" />
<input type="hidden" id="availablearea_{{ available_area_identifier }}_i" value="{{ parea_md5 }}" />
</li>
{% endfor %}
</ol>
</fieldset>
{% endfor %}
</div>
</div>
{% endif %}
{% else %}
<p class="alert alert-warning">{{ __f('There are no providers available for %sub%.', {"%sub%": currentmodule}) }}</p>
{% endfor %}
</fieldset>
</div>
</div>