Skip to content

Commit 24688d6

Browse files
committed
Fix pagination links
1 parent c1a25b6 commit 24688d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/http/templates/package_results.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ <h3 class="text-sm font-semibold text-gray-900 truncate group-hover:text-brand-p
2828
</div>
2929
{{if gt .TotalPages 1}}
3030
<div class="flex justify-center items-center gap-2 pb-8">
31-
{{if gt .Page 1}}<a hx-get="{{paginatePartial .Filters (sub .Page 1)}}" hx-target="#package-results" hx-swap="innerHTML show:#filter-form:top" class="px-4 py-2 border border-gray-200 rounded-lg text-sm hover:bg-gray-50 transition-colors cursor-pointer">&laquo; Previous</a>{{end}}
31+
{{if gt .Page 1}}<a href="{{paginate .Filters (sub .Page 1)}}" hx-get="{{paginatePartial .Filters (sub .Page 1)}}" hx-target="#package-results" hx-swap="innerHTML show:#filter-form:top" class="px-4 py-2 border border-gray-200 rounded-lg text-sm hover:bg-gray-50 transition-colors cursor-pointer">&laquo; Previous</a>{{end}}
3232
<span class="px-4 py-2 text-sm text-gray-500">Page {{.Page}} of {{.TotalPages}}</span>
33-
{{if lt .Page .TotalPages}}<a hx-get="{{paginatePartial .Filters (add .Page 1)}}" hx-target="#package-results" hx-swap="innerHTML show:#filter-form:top" class="px-4 py-2 border border-gray-200 rounded-lg text-sm hover:bg-gray-50 transition-colors cursor-pointer">Next &raquo;</a>{{end}}
33+
{{if lt .Page .TotalPages}}<a href="{{paginate .Filters (add .Page 1)}}" hx-get="{{paginatePartial .Filters (add .Page 1)}}" hx-target="#package-results" hx-swap="innerHTML show:#filter-form:top" class="px-4 py-2 border border-gray-200 rounded-lg text-sm hover:bg-gray-50 transition-colors cursor-pointer">Next &raquo;</a>{{end}}
3434
</div>
3535
{{end}}
3636
<p id="package-count" hx-swap-oob="true" class="text-sm text-gray-500 whitespace-nowrap">{{formatNumberComma .Total}} packages available</p>

0 commit comments

Comments
 (0)