Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sidebar.html « navigators « partials « layouts - github.com/hossainemruz/toha.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 75d0dcfc75e57a91a0fa625bd9051c6d85654a00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{{ range .menus }}
  {{ $class:= "" }}
  {{ $icon:= "fa-plus-circle" }}
  <!-- If the current menu is the selected menu or it contain the selected menu, set expand icon and set "active" class -->
  {{ if or ($.ctx.HasMenuCurrent "sidebar" .)  ($.ctx.IsMenuCurrent "sidebar" .)}}
    {{ $icon = "fa-minus-circle"}}
    {{ $class = "active" }}
  {{end}}
  {{ if .HasChildren }}
    <!-- Add current entry -->
    <li>
      <i class="fas {{ $icon }}"></i><a class="{{$class}}" href="{{ .URL }}">{{.Name}}</a>
      <!-- Add sub-tree -->
      <ul class="{{ $class }}">
        {{ partial "navigators/sidebar.html" (dict "menus" .Children "ctx" $.ctx) }}
      </ul>
    </li>
  {{ else }}
    <!-- No sub-tree. So, only add current entry -->
    <li><a class="{{$class}}" href="{{ .URL }}">{{.Name}}</a></li>
  {{ end }}
{{ end }}