-
Notifications
You must be signed in to change notification settings - Fork 1
/
_navigation.html.twig
159 lines (148 loc) · 8.94 KB
/
_navigation.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<header class="uk-flex">
<button uk-toggle="target: #unite-main-menu-main; animation: uk-animation-slide-top"><i data-feather="menu"></i></button>
{% block manage_domain %}
<button class="uk-button uk-button-default uk-flex-1" type="button">
<span>{{ unite.domain }}</span>
<i class="uk-margin-small-right" data-feather="chevron-down"></i>
</button>
{% if is_granted(constant('UniteCMS\\CoreBundle\\Security\\Voter\\DomainVoter::UPDATE'), unite.domain) %}
<div id="unite-main-menu-domain" uk-dropdown="mode: click; pos: bottom-left; offset: -50; animation: uk-animation-slide-top" class="uk-width-large">
<div class="uk-dropdown-grid uk-child-width-1-2@m" uk-grid>
{% else %}
<div id="unite-main-menu-domain" uk-dropdown="mode: click; pos: bottom-left; offset: -50; animation: uk-animation-slide-top" class="uk-width-medium">
<div class="uk-dropdown-grid uk-child-width-1-1@m" uk-grid>
{% endif %}
<div>
<ul class="uk-nav uk-dropdown-nav">
<li class="uk-nav-header">
<a href="{{ url('unitecms_core_domain_index', [unite.organization]) }}">
<i data-feather="home"></i>
{{ unite.organization }}
</a>
</li>
{% for d in unite.organization.domains %}
{% if is_granted(constant('UniteCMS\\CoreBundle\\Security\\Voter\\DomainVoter::VIEW'), d) %}
<li{% if d == unite.domain %} class="uk-active"{% endif %}>
<a href="{{ url('unitecms_core_domain_view', [d]) }}">
<i data-feather="globe" class="uk-margin-small-right"></i> {{ d }}
</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% if is_granted(constant('UniteCMS\\CoreBundle\\Security\\Voter\\DomainVoter::UPDATE'), unite.domain) %}
<div class="uk-flex uk-flex-middle uk-flex-center">
<ul class="uk-nav uk-dropdown-nav secondary">
<li class="uk-nav-header">Manage this domain</li>
<li>
<a href="{{ url('unitecms_core_domain_update', [unite.domain]) }}">
<i class="uk-margin-small-right" data-feather="settings"></i>
{% trans %}domain.menu.manage.update{% endtrans %}
</a>
</li>
{% if is_granted(constant('UniteCMS\\CoreBundle\\Security\\Voter\\DomainVoter::DELETE'), unite.domain) %}
<li>
<a class="uk-text-danger" href="{{ url('unitecms_core_domain_delete', [unite.domain]) }}">
<i class="uk-margin-small-right" data-feather="trash-2"></i>
{% trans %}domain.menu.manage.trash{% endtrans %}
</a></li>
{% endif %}
</ul>
</div>
{% endif %}
</div>
<button type="button" uk-close uk-toggle="target: #unite-main-menu-domain; animation: uk-animation-slide-top"></button>
</div>
{% endblock manage_domain %}
<button uk-toggle="target: #unite-main-menu-user; animation: uk-animation-slide-top"><i data-feather="user"></i></button>
</header>
<article id="unite-main-menu-main" class="uk-flex-1" hidden>
<button type="button" uk-close uk-toggle="target: #unite-main-menu-main; animation: uk-animation-slide-top"></button>
{% block empty_placeholder %}
{% if unite.domain.contentTypes|length == 0 and unite.domain.settingTypes|length == 0 %}
<div class="uk-placeholder uk-text-small uk-text-center">
{% if is_granted(constant('UniteCMS\\CoreBundle\\Security\\Voter\\DomainVoter::UPDATE'), unite.domain) %}
{% trans %}domain.menu.empty_placehodler_admin{% endtrans %}
{% else %}
{% trans %}domain.menu.empty_placehodler_user{% endtrans %}
{% endif %}
</div>
{% endif %}
{% endblock empty_placeholder %}
<ul class="uk-nav uk-nav-parent-icon" uk-nav>
{% block content_types %}
{% if unite.domain.contentTypes|length > 0 %}
<li class="uk-nav-header">{% trans %}domain.menu.content_types.headline{% endtrans %}</li>
{% for type in unite.domain.contentTypes %}
{% if is_granted(constant('UniteCMS\\CoreBundle\\Security\\Voter\\ContentVoter::LIST'), type) %}
<li><a {% spaceless %}
{% if view is defined and view.contentType.identifier == type.identifier and view.identifier == 'all' %}
class="uk-active"
{% endif %}
{% endspaceless %} href="{{ url('unitecms_core_content_index', [type]) }}">
<i class="uk-margin-small-right" data-feather="{{ type.icon ? type.icon : 'layers' }}"></i>
{{ type }}
</a>
{% if type.views|length > 1 %}
<ul class="uk-nav-sub">
{% for v in type.views %}
{% if v.identifier != "all" %}
<li><a {% spaceless %}
{% if view is defined and view.contentType.identifier == type.identifier and view.identifier == v.identifier %}
class="uk-active"
{% endif %}
{% endspaceless %}href="{{ url('unitecms_core_content_index', [v]) }}">
<i class="uk-margin-small-right" data-feather="{{ v.icon ? v.icon : 'layers' }}"></i>
{{ v }}
</a>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</li>
{% endif %}
{% endfor %}
{% endif %}
{% endblock content_types %}
{% block setting_types %}
{% if unite.domain.settingTypes|length > 0 %}
<li class="uk-nav-header">{% trans %}domain.menu.setting_types.headline{% endtrans %}</li>
{% for type in unite.domain.settingTypes %}
{% if is_granted(constant('UniteCMS\\CoreBundle\\Security\\Voter\\SettingVoter::UPDATE'), type) %}
<li><a {% spaceless %}
{% if settingType is defined and settingType.identifier == type.identifier %}
class="uk-active"
{% endif %}
{% endspaceless %} href="{{ url('unitecms_core_setting_index', [type]) }}">
<i class="uk-margin-small-right" data-feather="{{ type.icon ? type.icon : 'settings' }}"></i>
{{ type }}
</a></li>
{% endif %}
{% endfor %}
{% endif %}
{% endblock setting_types %}
{% block member_types %}
{% if is_granted(constant('UniteCMS\\CoreBundle\\Security\\Voter\\DomainVoter::UPDATE'), unite.domain) %}
<li class="uk-nav-header">{% trans %}domain.menu.domain_member_types.headline{% endtrans %}</li>
{% for type in unite.domain.domainMemberTypes %}
<li><a {% spaceless %}
{% if memberType is defined and memberType.identifier == type.identifier %}
class="uk-active"
{% endif %}
{% endspaceless %} href="{{ url('unitecms_core_domainmember_index', [type]) }}">
<i class="uk-margin-small-right" data-feather="{{ type.icon ? type.icon : 'users' }}"></i>
{{ type }}
</a>
</li>
{% endfor %}
{% endif %}
{% endblock member_types %}
</ul>
</article>
{% block footer %}
<footer id="unite-main-menu-user" hidden>
<button type="button" uk-close uk-toggle="target: #unite-main-menu-user; animation: uk-animation-slide-top"></button>
{% include '@UniteCMSCore/_user-menu.html.twig' %}
</footer>
{% endblock footer %}