congo/layouts/partials/pagination.html

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