-
Notifications
You must be signed in to change notification settings - Fork 614
/
elementindex.html
74 lines (56 loc) · 2.09 KB
/
elementindex.html
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
{% extends "_layouts/cp" %}
{% set elementInstance = craft.app.elements.createElement(elementType) %}
{% set context = 'index' %}
{% if not elementInstance %}
{% exit 404 %}
{% endif %}
{% set sources = craft.app.elementIndexes.getSources(elementType, 'index') %}
{% set customizableSources = (sources is not empty and context == 'index' and currentUser.can('customizeSources')) %}
{% set showSiteMenu = (craft.app.getIsMultiSite() ? (showSiteMenu ?? 'auto') : false) %}
{% if showSiteMenu == 'auto' %}
{% set showSiteMenu = elementInstance.isLocalized() %}
{% endif %}
{% block contextMenu %}
{% if showSiteMenu %}
{% include "_elements/sitemenu" %}
{% endif %}
{% endblock %}
{% block sidebar %}
{% if sources is not empty %}
<nav aria-label="{{ 'Sources'|t('app') }}">
{% include "_elements/sources" %}
</nav>
{% if customizableSources %}
<a class="customize-sources">
<span class="settings icon"></span>
<span class="label">{{ 'Customize'|t('app') }}</span>
</a>
{% endif %}
{% endif %}
{% endblock %}
{% block toolbar %}
{% include '_elements/toolbar' with {
showSiteMenu: false,
} %}
{% endblock %}
{% block content %}
<div class="main">
<div class="elements"></div>
</div>
{% endblock %}
{% block footer %}
<div id="count-spinner" class="spinner hidden"></div>
<div id="count-container" class="light flex-grow"> </div>
<button type="button" id="export-btn" class="btn hidden">{{ 'Export…'|t('app') }}</button>
{% endblock %}
{% block initJs %}
Craft.elementIndex = Craft.createElementIndex('{{ elementType|e("js") }}', $('#page-container'), {
elementTypeName: '{{ elementInstance.displayName()|e("js") }}',
elementTypePluralName: '{{ elementInstance.pluralDisplayName()|e("js") }}',
context: '{{ context }}',
storageKey: 'elementindex.{{ elementType|e("js") }}',
criteria: Craft.defaultIndexCriteria,
toolbarSelector: '#toolbar'
});
{% endblock %}
{% js block('initJs') %}