Merge pull request #7 from zonggen/fix-paginator
paginator: quick fix on newer/older btn
This commit is contained in:
commit
34767350d1
2 changed files with 18 additions and 4 deletions
|
@ -164,6 +164,14 @@
|
|||
margin-left: 1em;
|
||||
}
|
||||
|
||||
.ml-2 {
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
.mr-2 {
|
||||
margin-right: 2em;
|
||||
}
|
||||
|
||||
.mw-6 {
|
||||
min-width: 6em;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
{{ $page := $.Paginator }}
|
||||
{{ if gt $page.TotalPages 1 }}
|
||||
<div class="mt-2">
|
||||
{{ if $page.HasNext }}
|
||||
<a href="{{ $page.Next.URL }}">Older →</a>
|
||||
{{ if $page.HasPrev }}
|
||||
<a href="{{ $page.Prev.URL }}" class="mr-2">← Newer</a>
|
||||
{{ else }}
|
||||
<a href="{{ $page.Prev.URL }}">← Newer</a>
|
||||
<span class="mr-2">← Newer</span>
|
||||
{{ end }}
|
||||
|
||||
{{ if $page.HasNext }}
|
||||
<a href="{{ $page.Next.URL }}" class="ml-2">Older →</a>
|
||||
{{ else }}
|
||||
<span class="ml-2">Older →</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in a new issue