Adds elided page range to shelf pagination

This commit is contained in:
Mouse Reeve
2021-05-03 14:47:27 -07:00
parent 7db8e249cc
commit 7dfc991468
2 changed files with 8 additions and 2 deletions

View File

@ -57,12 +57,17 @@ class Shelf(View):
PAGE_LENGTH,
)
page = paginated.get_page(request.GET.get("page"))
data = {
"user": user,
"is_self": is_self,
"shelves": shelves.all(),
"shelf": shelf,
"books": paginated.get_page(request.GET.get("page")),
"books": page,
"page_range": paginated.get_elided_page_range(
page.number, on_each_side=2, on_ends=1
)
}
return TemplateResponse(request, "user/shelf/shelf.html", data)