mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 01:51:08 +00:00
Merge pull request #1239 from bookwyrm-social/directory-elided-pages
Uses elided page range for directory view
This commit is contained in:
commit
3ec41701e7
1 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue