Check for sectionCount<=5 instead of sectionCound< 5

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
hossainemruz 2021-04-01 23:51:48 +06:00
parent ab97350a01
commit 89bef62411

View file

@ -59,14 +59,14 @@
{{ range sort $sections "section.weight" }} {{ range sort $sections "section.weight" }}
{{ if and (.section.enable) (.section.showOnNavbar)}} {{ if and (.section.enable) (.section.showOnNavbar)}}
{{ $sectionCount = add $sectionCount 1}} {{ $sectionCount = add $sectionCount 1}}
{{ if lt $sectionCount 5 }} {{ if le $sectionCount 5 }}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="#{{ partial "helpers/get-section-id.html" . }}">{{ .section.name }}</a> <a class="nav-link" href="#{{ partial "helpers/get-section-id.html" . }}">{{ .section.name }}</a>
</li> </li>
{{ end }} {{ end }}
{{ end }} {{ end }}
{{- end }} {{- end }}
{{ if gt $sectionCount 4 }} {{ if gt $sectionCount 5 }}
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{i18n "more" }}</a> <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{i18n "more" }}</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown"> <div class="dropdown-menu" aria-labelledby="navbarDropdown">
@ -74,7 +74,7 @@
{{ range sort $sections "section.weight" }} {{ range sort $sections "section.weight" }}
{{ if and (.section.enable) (.section.showOnNavbar) }} {{ if and (.section.enable) (.section.showOnNavbar) }}
{{ $sectionCount = add $sectionCount 1}} {{ $sectionCount = add $sectionCount 1}}
{{ if gt $sectionCount 4 }} {{ if gt $sectionCount 5 }}
<a class="dropdown-item" href="#{{ partial "helpers/get-section-id.html" . }}">{{ .section.name }}</a> <a class="dropdown-item" href="#{{ partial "helpers/get-section-id.html" . }}">{{ .section.name }}</a>
{{ end }} {{ end }}
{{ end }} {{ end }}