blob: 00158a85dfa9440b43481ca532c7d14917e6118a [file] [log] [blame]
<!--
Copyright 2019 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
{{define "pagination_summary"}}
{{- if gt .TotalCount .ResultCount -}}
{{- add .Offset 1}} – {{add .Offset .ResultCount}} of
{{- end}} {{if .Approximate}}about {{end}}{{.TotalCount -}}
{{end}}
{{define "pagination_nav"}}
{{if gt (len .Pages) 1}}
<div class="Pagination-nav">
<div class="Pagination-navInner">
{{ $pagination := . }}
{{if .PrevPage}}
<a class="Pagination-previous" href="{{.PageURL .PrevPage}}">Previous</a>
{{else}}
<span class="Pagination-previous" aria-disabled="true">Previous</span>
{{end}}
{{$page := .Page}}
{{range $i := .Pages}}
{{if eq $i $page}}
<b class="Pagination-number">{{$i}}</b>
{{else}}
<a class="Pagination-number" href="{{$pagination.PageURL $i}}">{{$i}}</a>
{{end}}
{{end}}
{{if .NextPage}}
<a class="Pagination-next" href="{{.PageURL .NextPage}}">Next</a>
{{else}}
<span class="Pagination-next" aria-disabled="true">Next</span>
{{end}}
</div>
</div>
{{end}}
{{end}}