29 lines
1.4 KiB
HTML
29 lines
1.4 KiB
HTML
{{define "page_nav"}}
|
|
<ul class="nav justify-content-center {{.NavClass}} {{if eq .IsVertical true}}flex-column{{end}}{{if eq .IsTab true}}nav-tabs{{end}}" {{if eq .IsTab true}}role="tablist"{{end}}>
|
|
{{range $item := .NavItems}}
|
|
|
|
{{if gt (len $item.ChildItems) 0}}
|
|
{{ $hasActiveChild := false }}
|
|
{{range $child := $item.ChildItems}}
|
|
{{if $child.IsActive}}
|
|
{{ $hasActiveChild = true }}
|
|
{{end}}
|
|
{{end}}
|
|
<li class="nav-item dropdown">
|
|
<a href="{{$item.Link}}" {{if eq .IsDisabled true}}disabled{{end}} data-bs-toggle="dropdown"
|
|
class="nav-link dropdown-toggle {{if eq .IsActive true or $hasActiveChild}}active{{end}} {{if eq .IsDisabled true}}disabled{{end}}">{{$item.Text}}</a>
|
|
<ul class="dropdown-menu">
|
|
{{ range $item.ChildItems}}
|
|
{{template "content_dropdown_item" .}}
|
|
{{end}}
|
|
</ul>
|
|
</li>
|
|
{{else}}
|
|
<li class="nav-item"><a href="{{$item.Link}}" {{if eq .IsDisabled true}}disabled{{end}} class="nav-link {{if eq .IsActive true}}active{{end}} {{if eq .IsDisabled true}}disabled{{end}}">
|
|
{{$item.Text}}
|
|
</a></li>
|
|
{{end}}
|
|
|
|
{{end}}
|
|
</ul>
|
|
{{end}}
|