base.pt
8.76 KB
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<html
metal:use-macro="load: tangsel.base:views/templates/admin_base.pt"
tal:define="
route_name request.matched_route.name;
"
>
<ul metal:fill-slot="navs" data-te-sidenav-menu-ref id="sidebarnav">
<div class="caption">
<span class="hide-menu">MENU</span>
</div>
<li
tal:repeat="menu get_esppt_menus()"
tal:attributes="class python: 'sidebar-item' if not menu['children'] else 'sidebar-item hs-accordion'"
tal-condition="python:menu['children'] and (not menu['permission'] or has_permission(request, menu['permission']))"
>
<a
tal:define="class_reg 'hs-accordion-toggle sidebar-link dropdown-menu-link' if menu['children'] else 'sidebar-link dark-sidebar-link'; class_active 'active activemenu dark:text-white' if route_name in menu['route_name'] else ''"
tal:attributes="href python: home+menu['path'] if not menu['children'] else 'javascript:void()'; class string:$class_reg $class_active"
>
<i
tal:condition="menu['nama'].strip() == 'E-SPPT Home'"
tal:attributes="class 'ti ti-home text-xl flex-shrink-0 dark:text-white' if route_name in menu['route_name'] else 'ti ti-home text-xl flex-shrink-0'"
></i>
<i
tal:condition="menu['nama'].strip() == 'Unduh E-SPPT'"
tal:attributes="class 'ti ti-cloud-down text-xl flex-shrink-0 dark:text-white' if route_name in menu['route_name'] else 'ti ti-cloud-down text-xl flex-shrink-0'"
></i>
<i
tal:condition="menu['nama'].strip() == 'My NOP'"
tal:attributes="class 'ti ti-credit-card text-xl flex-shrink-0 dark:text-white' if route_name in menu['route_name'] else 'ti ti-credit-card text-xl flex-shrink-0'"
></i>
<i
tal:condition="menu['nama'].strip() == 'My SPPT'"
tal:attributes="class 'ti ti-script text-xl flex-shrink-0 dark:text-white' if route_name in menu['route_name'] else 'ti ti-script text-xl flex-shrink-0'"
></i>
<i
tal:condition="menu['nama'].strip() == 'Admin'"
tal:attributes="class 'ti ti-adjustments text-xl flex-shrink-0 dark:text-white' if route_name in menu['route_name'] else 'ti ti-adjustments text-xl flex-shrink-0'"
></i>
<span
tal:attributes="class python: 'hide-menu flex-shrink-0' if not menu['children'] else 'hide-menu'"
>${menu['nama']}</span
>
<span tal:condition="menu['children']" class="hide-menu ms-auto">
<i
tal:condition="menu['children']"
class="ti ti-chevron-down text-lg ms-auto hs-accordion-active:hidden"
></i>
<i
tal:condition="menu['children']"
class="ti ti-chevron-up text-lg ms-auto hs-accordion-active:block ml-auto hidden z-10 relative"
></i>
</span>
</a>
<div
tal-condition="python:menu['children'] and (not menu['permission'] or has_permission(request, menu['permission']))"
tal:define="class_reg 'hs-accordion-content'; class_active 'active-menu' if route_name in menu['route_name'] else ''"
tal:attributes="class string:$class_reg $class_active"
id="blog-accordion"
>
<ul class>
<li tal:repeat="submenu menu['children']" class="pl-4 pr-3">
<a
tal:define="class_reg 'dropdown-submenu-link'; class_active 'active text-primary dark:text-primary' if route_name in submenu['route_name'] else ''"
tal:attributes="class string:$class_reg $class_active"
class="dropdown-submenu-link"
href="${home}${submenu['path']}"
>
<i class="ti ti-circle flex-shrink-0 text-xs me-3"></i>
<span class="hide-menu">${submenu['nama']}</span>
</a>
</li>
</ul>
</div>
</li>
</ul>
<div
metal:fill-slot="navs-horizontal"
id="topbarnav"
class="flex gap-1 items-center relative"
>
<!-- Dropdown Menu / Multilevel -->
<div
tal:repeat="hmenu get_esppt_menus()"
class="hs-dropdown [--strategy:static] lg:[--strategy:absolute] [--adaptive:none] sm:[--trigger:hover] relative"
>
<a
tal:attributes="href python: home+hmenu['path'] if not hmenu['children'] else 'javascript:void()'; class 'horizontal-menu bg-primary text-white dark:text-white hover:bg-primary hover:text-white' if route_name in hmenu['route_name'] else 'horizontal-menu dark:text-white hover:bg-primary hover:text-white'"
>
<i
tal:condition="hmenu['nama'].strip() == 'E-SPPT Home'"
tal:attributes="class 'ti ti-home text-base' if route_name in hmenu['route_name'] else 'ti ti-home text-xl flex-shrink-0'"
></i>
<i
tal:condition="hmenu['nama'].strip() == 'Unduh E-SPPT'"
tal:attributes="class 'ti ti-cloud-down text-base' if route_name in hmenu['route_name'] else 'ti ti-cloud-down text-xl flex-shrink-0'"
></i>
<i
tal:condition="hmenu['nama'].strip() == 'My NOP'"
tal:attributes="class 'ti ti-credit-card text-base' if route_name in hmenu['route_name'] else 'ti ti-credit-card text-xl flex-shrink-0'"
></i>
<i
tal:condition="hmenu['nama'].strip() == 'My SPPT'"
tal:attributes="class 'ti ti-script text-base' if route_name in hmenu['route_name'] else 'ti ti-script text-xl flex-shrink-0'"
></i>
<i
tal:condition="hmenu['nama'].strip() == 'Admin'"
tal:attributes="class 'ti ti-adjustments text-base' if route_name in hmenu['route_name'] else 'ti ti-adjustments text-xl flex-shrink-0'"
></i>
${hmenu['nama']}
<i
tal:condition="hmenu['children']"
class="ti ti-chevron-down ms-auto text-lg"
></i>
</a>
<div
tal:condition="hmenu['children']"
id="${hmenu['nama'].strip()}"
class="horizontal-items hs-dropdown-menu before:absolute left-0 hidden transition-[opacity,margin] duration-[0.1ms] sm:duration-[150ms] hs-dropdown-open:opacity-100 opacity-0"
>
<a
tal:repeat="hsubmenu hmenu['children']"
class="horizontal-link"
href="${home}${hsubmenu['path']}"
>
<i class="ti ti-circle text-base flex-shrink-0"></i>
<span class="hide-menu flex-shrink-0 text-sm leading-tight"
>${hsubmenu['nama']}</span
>
</a>
</div>
</div>
<div
tal:repeat="hmenu get_base_menus()"
class="hs-dropdown [--strategy:static] lg:[--strategy:absolute] [--adaptive:none] sm:[--trigger:hover] relative"
>
<a
tal:attributes="href python: home+hmenu['path'] if not hmenu['children'] else 'javascript:void()'; class 'horizontal-menu bg-primary text-white dark:text-white hover:bg-primary hover:text-white' if route_name in hmenu['route_name'] else 'horizontal-menu dark:text-white hover:bg-primary hover:text-white'"
>
<i
tal:condition="hmenu['nama'].strip() == 'E-SPPT Home'"
tal:attributes="class 'ti ti-home text-base' if route_name in hmenu['route_name'] else 'ti ti-home text-xl flex-shrink-0'"
></i>
<i
tal:condition="hmenu['nama'].strip() == 'Unduh E-SPPT'"
tal:attributes="class 'ti ti-cloud-down text-base' if route_name in hmenu['route_name'] else 'ti ti-cloud-down text-xl flex-shrink-0'"
></i>
<i
tal:condition="hmenu['nama'].strip() == 'My NOP'"
tal:attributes="class 'ti ti-credit-card text-base' if route_name in hmenu['route_name'] else 'ti ti-credit-card text-xl flex-shrink-0'"
></i>
<i
tal:condition="hmenu['nama'].strip() == 'My SPPT'"
tal:attributes="class 'ti ti-script text-base' if route_name in hmenu['route_name'] else 'ti ti-script text-xl flex-shrink-0'"
></i>
<i
tal:condition="hmenu['nama'].strip() == 'Admin'"
tal:attributes="class 'ti ti-adjustments text-base' if route_name in hmenu['route_name'] else 'ti ti-adjustments text-xl flex-shrink-0'"
></i>
${hmenu['nama']}
<i
tal:condition="hmenu['children']"
class="ti ti-chevron-down ms-auto text-lg"
></i>
</a>
<div
tal:condition="hmenu['children']"
id="${hmenu['nama'].strip()}"
class="horizontal-items hs-dropdown-menu before:absolute left-0 hidden transition-[opacity,margin] duration-[0.1ms] sm:duration-[150ms] hs-dropdown-open:opacity-100 opacity-0"
>
<a
tal:repeat="hsubmenu hmenu['children']"
class="horizontal-link"
href="${home}${hsubmenu['path']}"
>
<i class="ti ti-circle text-base flex-shrink-0"></i>
<span class="hide-menu flex-shrink-0 text-sm leading-tight"
>${hsubmenu['nama']}</span
>
</a>
</div>
</div>
</div>
</html>