1- <aside class="main-sidebar <?= config ('Boilerplate ' )->theme ['sidebar ' ]['border ' ] ? 'border-right ' : '' ?> sidebar-<?= config ('Boilerplate ' )->theme ['sidebar ' ]['type ' ] ?> -<?= config ('Boilerplate ' )->theme ['sidebar ' ]['links ' ]['bg ' ] ?> elevation-<?= config ('Boilerplate ' )->theme ['sidebar ' ]['shadow ' ] ?> ">
2- <a href="<?= route_to ('/ ' ) ?> " class="brand-link <?= !empty (config ('Boilerplate ' )->theme ['sidebar ' ]['brand ' ]['bg ' ]) ? 'bg- ' . config ('Boilerplate ' )->theme ['sidebar ' ]['brand ' ]['bg ' ] : '' ?> ">
1+ <aside class="main-sidebar <?= config ('Boilerplate ' )->theme ['sidebar ' ]['border ' ] ? 'border-right ' : '' ?> sidebar-<?= config ('Boilerplate ' )->theme ['sidebar ' ]['type ' ] ?> -<?= config ('Boilerplate ' )->theme ['sidebar ' ]['links ' ]['bg ' ] ?> elevation-<?= config ('Boilerplate ' )->theme ['sidebar ' ]['shadow ' ] ?> ">
2+ <a href="<?= route_to ('/ ' ) ?> " class="brand-link <?= !empty (config ('Boilerplate ' )->theme ['sidebar ' ]['brand ' ]['bg ' ]) ? 'bg- ' . config ('Boilerplate ' )->theme ['sidebar ' ]['brand ' ]['bg ' ] : '' ?> ">
33 <img src="<?= base_url (config ('Boilerplate ' )->theme ['sidebar ' ]['brand ' ]['logo ' ]['icon ' ]) ?> " class="brand-image img-circle elevation-<?= config ('Boilerplate ' )->theme ['sidebar ' ]['brand ' ]['logo ' ]['shadow ' ] ?> " style="opacity: .8">
44 <span class="brand-text"><?= config ('Boilerplate ' )->theme ['sidebar ' ]['brand ' ]['logo ' ]['text ' ] ?> </span>
55 </a>
66 <div class="sidebar">
77 <?php if (config ('Boilerplate ' )->theme ['sidebar ' ]['user ' ]['visible ' ]) { ?>
8- <div class="user-panel py-3 d-flex">
9- <div class="image">
10- <img src="https://cdn.jsdelivr.net/npm/admin-lte@3.0.2/dist/img/avatar.png" class="img-circle elevation-<?= config ('Boilerplate ' )->theme ['sidebar ' ]['user ' ]['shadow ' ] ?> "
11- alt="User Image">
8+ <div class="user-panel py-3 d-flex">
9+ <div class="image">
10+ <img src="https://cdn.jsdelivr.net/npm/admin-lte@3.0.2/dist/img/avatar.png" class="img-circle elevation-<?= config ('Boilerplate ' )->theme ['sidebar ' ]['user ' ]['shadow ' ] ?> "
11+ alt="User Image">
12+ </div>
13+ <div class="info">
14+ <a href="<?= base_url (route_to ('user-profile ' )) ?> " class="d-block"><?= user ()->username ?> </a>
15+ </div>
1216 </div>
13- <div class="info">
14- <a href="<?= base_url (route_to ('user-profile ' )) ?> " class="d-block"><?= user ()->username ?> </a>
17+ <div class="form-inline">
18+ <div class="input-group" data-widget="sidebar-search">
19+ <input class="form-control form-control-sidebar" type="search" id="search" name="search" placeholder="<?= lang ('boilerplate.global.search ' ) ?> " aria-label="Search">
20+ <div class="input-group-append">
21+ <button class="btn btn-sidebar">
22+ <i class="fas fa-search fa-fw"></i>
23+ </button>
24+ </div>
25+ </div>
26+
1527 </div>
16- </div>
1728 <?php } ?>
1829 <nav class="mt-3">
1930 <ul class="nav nav-pills nav-sidebar flex-column nav-child-indent <?= config ('Boilerplate ' )->theme ['sidebar ' ]['compact ' ] ? 'nav-compact ' : '' ?> " data-widget="treeview"
2031 role="menu" data-accordion="false">
21- <?php foreach (menu () as $ parent ) { ?>
22- <li class="nav-item has-treeview <?= current_url () == base_url ($ parent ->route ) || in_array (uri_string (), array_column ($ parent ->children , 'route ' )) ? 'menu-open ' : '' ?> ">
23- <a href="<?= base_url ($ parent ->route ) ?> " class="nav-link <?= current_url () == base_url ($ parent ->route ) || in_array (uri_string (), array_column ($ parent ->children , 'route ' )) ? 'active ' : '' ?> ">
24- <i class="nav-icon <?= $ parent ->icon ?> "></i>
25- <p>
26- <?= $ parent ->title ?>
27- <?php if (count ($ parent ->children )) { ?>
28- <i class="right fas fa-angle-left"></i>
29- <?php } ?>
30- </p>
31- </a>
32- <?php if (count ($ parent ->children )) { ?>
33- <ul class="nav nav-treeview">
34- <?php foreach ($ parent ->children as $ child ) { ?>
35- <li class="nav-item has-treeview">
36- <a href="<?= base_url ($ child ->route ) ?> "
37- class="nav-link <?= current_url () == base_url ($ child ->route ) ? 'active ' : '' ?> ">
38- <i class="nav-icon <?= $ child ->icon ?> "></i>
39- <p><?= $ child ->title ?> </p>
40- </a>
41- </li>
32+ <?php foreach (menu () as $ parent ) { ?>
33+ <li class="nav-item has-treeview <?= current_url () == base_url ($ parent ->route ) || in_array (uri_string (), array_column ($ parent ->children , 'route ' )) ? 'menu-open ' : '' ?> ">
34+ <a href="<?= base_url ($ parent ->route ) ?> " class="nav-link <?= current_url () == base_url ($ parent ->route ) || in_array (uri_string (), array_column ($ parent ->children , 'route ' )) ? 'active ' : '' ?> ">
35+ <i class="nav-icon <?= $ parent ->icon ?> "></i>
36+ <p>
37+ <?= $ parent ->title ?>
38+ <?php if (count ($ parent ->children )) { ?>
39+ <i class="right fas fa-angle-left"></i>
40+ <?php } ?>
41+ </p>
42+ </a>
43+ <?php if (count ($ parent ->children )) { ?>
44+ <ul class="nav nav-treeview">
45+ <?php foreach ($ parent ->children as $ child ) { ?>
46+ <li class="nav-item has-treeview">
47+ <a href="<?= base_url ($ child ->route ) ?> "
48+ class="nav-link <?= current_url () == base_url ($ child ->route ) ? 'active ' : '' ?> ">
49+ <i class="nav-icon <?= $ child ->icon ?> "></i>
50+ <p><?= $ child ->title ?> </p>
51+ </a>
52+ </li>
53+ <?php } ?>
54+ </ul>
4255 <?php } ?>
43- </ul>
44- <?php } ?>
45- </li>
56+ </li>
4657 <?php } ?>
4758 </ul>
4859 </nav>
4960 </div>
50- </aside>
61+ </aside>
62+
63+ <?= $ this ->section ('js ' ) ?>
64+
65+ <script>
66+
67+ $(document).ready(function () {
68+
69+
70+ $("#search").on("keyup", function () {
71+ if (this.value.length > 0) {
72+ $(".nav-sidebar li").hide().filter(function () {
73+ return $(this).text().toLowerCase().indexOf($("#search").val().toLowerCase()) != -1;
74+ }).show();
75+ } else {
76+ $(".sidebar-menu li").show();
77+ }
78+ });
79+
80+ });
81+
82+ </script>
83+
84+
85+ <?= $ this ->endSection () ?>
0 commit comments