mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Use elided page range for federated peer list
This commit is contained in:
parent
992e478e95
commit
03a5ac9c3f
1 changed files with 5 additions and 1 deletions
|
@ -33,9 +33,13 @@ class Federation(View):
|
||||||
servers = servers.order_by(sort)
|
servers = servers.order_by(sort)
|
||||||
|
|
||||||
paginated = Paginator(servers, PAGE_LENGTH)
|
paginated = Paginator(servers, PAGE_LENGTH)
|
||||||
|
page = paginated.get_page(request.GET.get("page"))
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
"servers": paginated.get_page(request.GET.get("page")),
|
"servers": page,
|
||||||
|
"page_range": paginated.get_elided_page_range(
|
||||||
|
page.number, on_each_side=2, on_ends=1
|
||||||
|
),
|
||||||
"sort": sort,
|
"sort": sort,
|
||||||
"form": forms.ServerForm(),
|
"form": forms.ServerForm(),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue