1

add pager

This commit is contained in:
Alex Yatskov 2017-12-28 12:14:22 -08:00
parent 1404735bd0
commit 34023a2fb3

View File

@ -11,6 +11,20 @@
</p>
</div>
{{end}}
<ul class="pagination">
<li class="page-item {{if not .Meta.Pager.PageUrlPrevOk}}disabled{{end}}">
<a class="page-link" href="{{.Meta.Pager.PageUrlPrev}}" tabindex="-1">Previous</a>
</li>
{{range $index, $url := .Meta.Pager.PageUrls}}
<li class="page-item {{if eq $index $.Meta.Pager.PageUrlIndex}}disabled{{end}}">
<a class="page-link" href="{{$url}}">{{$index}}</a>
</li>
{{end}}
<li class="page-item {{if not .Meta.Pager.PageUrlNextOk}}disabled{{end}}">
<a class="page-link" href="{{.Meta.Pager.PageUrlNext}}">Next</a>
</li>
</ul>
</div>
{{template "footer" .}}
{{end}}