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-20 07:02:08 +00:00
class="mx-1 block min-w-[1.8rem] text-center hover:bg-primary-600 hover:text-neutral 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 }}"
2021-08-20 07:02:08 +00:00
class="mx-1 block min-w-[1.8rem] text-center hover:bg-primary-600 hover:text-neutral rounded {{ if eq . $paginator }}
bg-primary-200 dark:bg-primary-400 dark:text-neutral-800
2021-08-16 00:41:00 +00:00
{{ 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-20 07:02:08 +00:00
class="mx-1 block min-w-[1.8rem] text-center hover:bg-primary-600 hover:text-neutral rounded"
2021-08-11 05:28:33 +00:00
rel="next"
>
&rarr;
</a>
</li>
{{ end }}
</ul>
{{ end }}