congo/layouts/partials/pagination.html

40 lines
1.0 KiB
HTML
Raw Permalink Normal View History

2021-08-11 05:28:33 +00:00
{{ $paginator := .Paginator }}
{{ if gt $paginator.TotalPages 1 }}
2021-08-16 00:41:00 +00:00
<ul class="flex flex-row mt-8">
2021-08-11 05:28:33 +00:00
{{ if $paginator.HasPrev }}
2021-08-16 00:41:00 +00:00
<li>
2021-08-11 05:28:33 +00:00
<a
href="{{ $paginator.Prev.URL }}"
2021-08-16 00:41:00 +00:00
class="mx-1 block min-w-[1.8rem] text-center hover:bg-primary-600 hover:text-white rounded"
2021-08-11 05:28:33 +00:00
rel="prev"
>
&larr;
</a>
</li>
{{ end }}
{{ range $paginator.Pagers }}
2021-08-16 00:41:00 +00:00
<li>
<a
href="{{ .URL }}"
class="mx-1 block min-w-[1.8rem] text-center hover:bg-primary-600 hover:text-white rounded {{ if eq . $paginator }}
bg-primary-200 dark:bg-primary-400 dark:text-gray-800
{{ end }}"
>
{{ .PageNumber }}
</a>
2021-08-11 05:28:33 +00:00
</li>
{{ end }}
{{ if $paginator.HasNext }}
2021-08-16 00:41:00 +00:00
<li>
2021-08-11 05:28:33 +00:00
<a
href="{{ $paginator.Next.URL }}"
2021-08-16 00:41:00 +00:00
class="mx-1 block min-w-[1.8rem] text-center hover:bg-primary-600 hover:text-white rounded"
2021-08-11 05:28:33 +00:00
rel="next"
>
&rarr;
</a>
</li>
{{ end }}
</ul>
{{ end }}