Format pagination partial

This commit is contained in:
vimux 2019-12-02 12:36:31 -05:00
parent 1b73262d85
commit 64780c1741
No known key found for this signature in database
GPG key ID: 5A34FDC4EE832E34

View file

@ -9,13 +9,19 @@
{{- if $showNumber }} {{- if $showNumber }}
{{- $.Scratch.Set "__paginator.ellipsed" false }} {{- $.Scratch.Set "__paginator.ellipsed" false }}
{{- $.Scratch.Set "__paginator.shouldEllipse" false }} {{- $.Scratch.Set "__paginator.shouldEllipse" false }}
{{ else }} {{- else }}
{{- $.Scratch.Set "__paginator.shouldEllipse" (not ($.Scratch.Get "__paginator.ellipsed") ) }} {{- $.Scratch.Set "__paginator.shouldEllipse" (not ($.Scratch.Get "__paginator.ellipsed") ) }}
{{- $.Scratch.Set "__paginator.ellipsed" true }} {{- $.Scratch.Set "__paginator.ellipsed" true }}
{{- end }} {{- end }}
{{- if $showNumber }} {{- if $showNumber }}
{{- if eq . $pag }}<span class="pagination__item pagination__item--active" data-total="{{ $pag.TotalPages }}">{{ .PageNumber }}</span>{{ else }}<a class="pagination__item pagination__item--desktop" href="{{ .URL }}">{{ .PageNumber }}</a>{{- end }} {{- if eq . $pag }}
{{ else if ($.Scratch.Get "__paginator.shouldEllipse") }} <span class="pagination__item pagination__item--active" data-total="{{ $pag.TotalPages }}">
{{- .PageNumber -}}
</span>
{{- else }}
<a class="pagination__item pagination__item--desktop" href="{{ .URL }}">{{ .PageNumber }}</a>
{{- end }}
{{- else if ($.Scratch.Get "__paginator.shouldEllipse") }}
<span class="pagination__item pagination__item--gap">&hellip;</span> <span class="pagination__item pagination__item--gap">&hellip;</span>
{{- end }} {{- end }}
{{- end }} {{- end }}