Merge pull request #1239 from bookwyrm-social/directory-elided-pages

Uses elided page range for directory view
This commit is contained in:
Mouse Reeve 2021-08-02 17:28:03 -06:00 committed by GitHub
commit 3ec41701e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)