{{ define "fragments/pagination" }} {{/* Params: Page (pagination.Page), BasePath (string), QueryParams (url.Values), TotalCount (int)|HasMore (bool) */}} {{/* Cursor mode when HasMore is provided */}} {{ $page := .Page }} {{ $totalCount := .TotalCount }} {{ $basePath := .BasePath }} {{ $queryParams := safeUrl .QueryParams.Encode }} {{ $cursor := mapContains . "HasMore" }} {{ $prev := $page.Previous.Offset }} {{ $next := $page.Next.Offset }} {{ $hasNext := false }} {{ if $cursor }} {{ $hasNext = .HasMore }} {{ else }} {{ $hasNext = lt $next $totalCount }} {{ end }}