answer/ui/template/page.html

31 lines
1.1 KiB
HTML
Raw Normal View History

2022-11-30 16:18:23 +08:00
{{define "page"}}
<ul class="d-inline-flex mb-0 pagination pagination-sm">
2022-11-30 17:47:40 +08:00
{{ if ne .page.Currpage 1 }}
2022-11-30 16:18:23 +08:00
<li class="page-item">
<a class="page-link" href="?page={{$.page.Prevpage}}"><span aria-hidden="true">{{translator $.language "ui.pagination.prev"}}</span><span
class="visually-hidden">{{translator $.language "ui.pagination.prev"}}</span></a>
2022-11-30 16:18:23 +08:00
</li>
{{ end }}
{{ range $value := .page.Pages }}
2022-11-30 16:27:23 +08:00
{{ if eq $.page.Currpage $value }}
2022-11-30 16:18:23 +08:00
<li class="page-item active">
<span class="page-link" href="?page={{$value}}">{{$value}}
<span class="visually-hidden">(current)</span>
</span>
</li>
{{ else }}
<li class="page-item">
<a class="page-link" href="?page={{$value}}">{{$value}}</a>
</li>
{{ end }}
{{ end }}
2022-11-30 16:27:23 +08:00
{{ if lt $.page.Currpage $.page.Totalpages }}
2022-11-30 16:18:23 +08:00
<li class="page-item">
<a class="page-link" href="?page={{$.page.Nextpage}}"><span aria-hidden="true">{{translator $.language "ui.pagination.next"}}</span><span
class="visually-hidden">{{translator $.language "ui.pagination.next"}}</span></a>
2022-11-30 16:18:23 +08:00
</li>
{{ end }}
</ul>
{{end}}
2022-11-30 17:47:40 +08:00