Uses elided page range for directory view

This commit is contained in:
Mouse Reeve 2021-08-02 16:15:14 -07:00
parent 7980d74b01
commit c56c6aa8e4

View file

@ -32,8 +32,12 @@ class Directory(View):
paginated = Paginator(users, 12)
page = paginated.get_page(request.GET.get("page"))
data = {
"users": paginated.get_page(request.GET.get("page")),
"page_range": paginated.get_elided_page_range(
page.number, on_each_side=2, on_ends=1
),
"users": page,
}
return TemplateResponse(request, "directory/directory.html", data)