This commit is contained in:
JACS 2026-05-01 18:26:24 -05:00
parent da0530d79b
commit eec9697a71
3 changed files with 46 additions and 24 deletions

View file

@ -1,10 +1,10 @@
{{define "tabler_navbar_menu"}}
<ul class="navbar-nav">
{{range $key, $item := .NavbarMenu}}
{{range $key, $item := .NavbarMenu}}
<li class="nav-item{{if $item.Active}} active{{end}}{{if $item.Children}} dropdown{{end}}">
<a class="nav-link{{if $item.Children}} dropdown-toggle{{end}}{{if $item.Disabled}} disabled{{end}}" {{if $item.Children}}href="#navbar-{{$key}}" data-bs-toggle="dropdown" data-bs-auto-close="outside" role="button" aria-haspopup="true" aria-expanded="false"{{else}}href="/{{$item.URL}}"{{end}}{{if $item.Active}} aria-current="page"{{end}}>
<a class="nav-link{{if $item.Children}} dropdown-toggle{{end}}{{if $item.Disabled}} disabled{{end}}" {{if $item.Children}}href="#navbar-{{$key}}" data-bs-toggle="dropdown" data-bs-auto-close="outside" role="button" aria-haspopup="true" aria-expanded="false"{{else}}href="{{$item.URL}}"{{end}}{{if $item.Active}} aria-current="page"{{end}}>
<span class="nav-link-icon d-md-none d-lg-inline-block">
<i class="icon ti ti-{{$item.Icon}}"></i>
{{template "tabler_icon" $item.Icon}}
</span>
<span class="nav-link-title">{{$item.Title}}</span>
{{if $item.Badge}}<span class="badge badge-sm bg-red text-red-fg">{{$item.Badge}}</span>{{end}}
@ -17,9 +17,10 @@
<div class="dropdown-menu-column">
{{end}}
{{range $child := $item.Children}}
{{range $childIndex, $child := $item.Children}}
{{if $child.Children}}<div class="dropend">{{end}}
<a class="dropdown-item{{if $child.Children}} dropdown-toggle{{end}}{{if $child.Color}} text-{{$child.Color}}{{end}}" {{if $child.Children}}href="#sidebar-{{$child.URL}}" data-bs-toggle="dropdown" data-bs-auto-close="outside" role="button" aria-haspopup="true" aria-expanded="false"{{else}}href="{{$child.URL}}"{{end}}{{if $child.URL}} target="_blank" rel="noopener"{{end}}>
<a class="dropdown-item{{if $child.Children}} dropdown-toggle{{end}}{{if $child.Color}} text-{{$child.Color}}{{end}}" {{if $child.Children}}href="#sidebar-{{$child.URL}}" data-bs-toggle="dropdown" data-bs-auto-close="outside" role="button" aria-haspopup="true" aria-expanded="false"{{else}}href="{{$child.URL}}"{{end}}{{if $child.URL}}{{end}}>
{{if $child.Icon}}{{template "tabler_icon_small" $child.Icon}}{{end}}
{{$child.Title}}
{{if $child.Badge}}<span class="badge badge-sm bg-green-lt text-uppercase ms-auto">{{$child.Badge}}</span>{{end}}
</a>
@ -43,6 +44,6 @@
</div>
{{end}}
</li>
{{end}}
{{end}}
</ul>
{{end}}
{{end}}