Skip to content

Commit d010d13

Browse files
authored
sidebar: move active class outside of class attribute conditional (#3492)
2 parents bd0196d + b1c37c3 commit d010d13

1 file changed

Lines changed: 19 additions & 20 deletions

File tree

scripts/lua/sidebar.lp

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
</li>
8686

8787
<li class="header text-uppercase">DNS Control</li>
88-
<!-- Local DNS Records -->
8988
<!-- Enable/Disable Blocking -->
9089
<li id="pihole-disable" class="menu-dns treeview">
9190
<a href="<?=webhome?>#">
@@ -133,50 +132,50 @@
133132
</li>
134133
<li class="header text-uppercase">System</li>
135134
<!-- Settings -->
136-
<li class="menu-system treeview <? if startsWith(scriptname, 'settings/') then ?> active<? end ?>">
135+
<li class="menu-system treeview<? if startsWith(scriptname, 'settings/') then ?> active<? end ?>">
137136
<a href="<?=webhome?>#">
138137
<i class="fa fa-fw menu-icon fa-cogs"></i> <span>Settings</span>
139138
<span class="pull-right-container">
140139
<i class="fa fa-angle-left pull-right"></i>
141140
</span>
142141
</a>
143142
<ul class="treeview-menu">
144-
<li class="<? if scriptname == 'settings/system' then ?> active<? end ?>">
143+
<li<? if scriptname == 'settings/system' then ?> class="active"<? end ?>>
145144
<a href="<?=webhome?>settings/system">
146145
<i class="fa-fw menu-icon fa-solid fa-circle-info"></i> <span>System</span>
147146
</a>
148147
</li>
149-
<li class="<? if scriptname == 'settings/dns' then ?> active<? end ?>">
148+
<li<? if scriptname == 'settings/dns' then ?> class="active"<? end ?>>
150149
<a href="<?=webhome?>settings/dns">
151150
<i class="fa-fw menu-icon fa-solid fa-book-atlas"></i> <span>DNS</span>
152151
</a>
153152
</li>
154-
<li class="<? if scriptname == 'settings/dhcp' then ?> active<? end ?>">
153+
<li<? if scriptname == 'settings/dhcp' then ?> class="active"<? end ?>>
155154
<a href="<?=webhome?>settings/dhcp">
156155
<i class="fa-fw menu-icon fa-solid fa-sitemap"></i> <span>DHCP</span>
157156
</a>
158157
</li>
159-
<li class="<? if scriptname == 'settings/api' then ?> active<? end ?>">
158+
<li<? if scriptname == 'settings/api' then ?> class="active"<? end ?>>
160159
<a href="<?=webhome?>settings/api">
161160
<i class="fa-fw menu-icon fa-solid fa-window-restore"></i> <span>Web interface / API</span>
162161
</a>
163162
</li>
164-
<li class="<? if scriptname == 'settings/privacy' then ?> active<? end ?>">
163+
<li<? if scriptname == 'settings/privacy' then ?> class="active"<? end ?>>
165164
<a href="<?=webhome?>settings/privacy">
166165
<i class="fa-fw menu-icon fa-solid fa-binoculars"></i> <span>Privacy</span>
167166
</a>
168167
</li>
169-
<li class="<? if scriptname == 'settings/teleporter' then ?> active<? end ?>">
168+
<li<? if scriptname == 'settings/teleporter' then ?> class="active"<? end ?>>
170169
<a href="<?=webhome?>settings/teleporter">
171170
<i class="fa-fw menu-icon fa-solid fa-file-export"></i> <span>Teleporter</span>
172171
</a>
173172
</li>
174-
<li class="<? if scriptname == 'settings/dnsrecords' then ?> active<? end ?>">
173+
<li<? if scriptname == 'settings/dnsrecords' then ?> class="active"<? end ?>>
175174
<a href="<?=webhome?>settings/dnsrecords">
176175
<i class="fa-fw menu-icon fa-solid fa-address-book"></i> <span>Local DNS Records</span>
177176
</a>
178177
</li>
179-
<li class="<? if scriptname == 'settings/all' then ?> active<? end ?> settings-level-expert">
178+
<li class="settings-level-expert<? if scriptname == 'settings/all' then ?> active<? end ?>">
180179
<a href="<?=webhome?>settings/all">
181180
<i class="fa-fw menu-icon fa-solid fa-pen-to-square"></i> <span>All settings</span>
182181
</a>
@@ -194,14 +193,14 @@
194193
</a>
195194
<ul class="treeview-menu">
196195
<!-- Pi-hole diagnosis -->
197-
<li class="<? if scriptname == 'messages' then ?> active<? end ?>">
196+
<li<? if scriptname == 'messages' then ?> class="active"<? end ?>>
198197
<a href="<?=webhome?>messages">
199198
<i class="fa fa-fw menu-icon fa-file-medical-alt"></i> <span>Pi-hole diagnosis</span>
200199
<span class="pull-right-container warning-count hidden"></span>
201200
</a>
202201
</li>
203202
<!-- Tail log files -->
204-
<li class="treeview <? if scriptname == 'taillog' then ?> active<? end ?>">
203+
<li class="treeview<? if scriptname == 'taillog' then ?> active<? end ?>">
205204
<a href="<?=webhome?>#">
206205
<i class="fa-fw menu-icon fa-solid fa-list-ul"></i> <span>Tail log files</span>
207206
<span class="pull-right-container">
@@ -210,45 +209,45 @@
210209
</a>
211210
<ul class="treeview-menu">
212211
<!-- Tail pihole.log -->
213-
<li class="<? if scriptname == 'taillog' and GET("file") == "dnsmasq" then ?> active<? end ?>">
212+
<li<? if scriptname == 'taillog' and GET("file") == "dnsmasq" then ?> class="active"<? end ?>>
214213
<a href="<?=webhome?>taillog?file=dnsmasq">
215214
<i class="fa-fw menu-icon fa-solid fa-list-ul"></i> pihole.log
216215
</a>
217216
</li>
218217
<!-- Tail FTL.log -->
219-
<li class="<? if scriptname == 'taillog' and GET("file") == "ftl" then ?> active<? end ?>">
218+
<li<? if scriptname == 'taillog' and GET("file") == "ftl" then ?> class="active"<? end ?>>
220219
<a href="<?=webhome?>taillog?file=ftl">
221220
<i class="fa-fw menu-icon fa-solid fa-list-ul"></i> FTL.log
222221
</a>
223222
</li>
224223
<!-- Tail webserver.log -->
225-
<li class="<? if scriptname == 'taillog' and GET("file") == "webserver" then ?> active<? end ?>">
224+
<li<? if scriptname == 'taillog' and GET("file") == "webserver" then ?> class="active"<? end ?>>
226225
<a href="<?=webhome?>taillog?file=webserver">
227226
<i class="fa-fw menu-icon fa-solid fa-list-ul"></i> webserver.log
228227
</a>
229228
</li>
230229
</ul>
231230
</li>
232-
<!-- Run gravity.sh -->
233-
<li class="<? if scriptname == 'gravity' then ?> active<? end ?>">
231+
<!-- Update Gravity -->
232+
<li<? if scriptname == 'gravity' then ?> class="active"<? end ?>>
234233
<a href="<?=webhome?>gravity">
235234
<i class="fa fa-fw menu-icon fa-arrow-circle-down"></i> <span>Update Gravity</span>
236235
</a>
237236
</li>
238237
<!-- Query Lists -->
239-
<li class="<? if scriptname == 'search' then ?> active<? end ?>">
238+
<li<? if scriptname == 'search' then ?> class="active"<? end ?>>
240239
<a href="<?=webhome?>search">
241240
<i class="fa fa-fw menu-icon fa-search"></i> <span>Search Lists</span>
242241
</a>
243242
</li>
244243
<!-- Interfaces -->
245-
<li class="<? if scriptname == 'interfaces' then ?> active<? end ?>">
244+
<li<? if scriptname == 'interfaces' then ?> class="active"<? end ?>>
246245
<a href="<?=webhome?>interfaces">
247246
<i class="fa fa-fw menu-icon fa-wifi"></i> <span>Interfaces</span>
248247
</a>
249248
</li>
250249
<!-- Network -->
251-
<li class="<? if scriptname == 'network' then ?> active<? end ?>">
250+
<li<? if scriptname == 'network' then ?> class="active"<? end ?>>
252251
<a href="<?=webhome?>network">
253252
<i class="fa fa-fw menu-icon fa-network-wired"></i> <span>Network</span>
254253
</a>

0 commit comments

Comments
 (0)