1
0
Fork 1
mirror of https://github.com/bookwyrm-social/bookwyrm.git synced 2024-12-15 04:36:34 +00:00

Merge branch 'main' into production

This commit is contained in:
Mouse Reeve 2021-04-15 11:35:30 -07:00
commit 37c5c4979f
12 changed files with 17 additions and 15 deletions

View file

@ -20,7 +20,7 @@ def populate_streams():
) )
for user in users: for user in users:
for stream in activitystreams.streams.values(): for stream in activitystreams.streams.values():
stream.populate_stream(user) stream.populate_streams(user)
class Command(BaseCommand): class Command(BaseCommand):

View file

@ -524,7 +524,7 @@ def to_ordered_collection_page(
""" serialize and pagiante a queryset """ """ serialize and pagiante a queryset """
paginated = Paginator(queryset, PAGE_LENGTH) paginated = Paginator(queryset, PAGE_LENGTH)
activity_page = paginated.page(page) activity_page = paginated.get_page(page)
if id_only: if id_only:
items = [s.remote_id for s in activity_page.object_list] items = [s.remote_id for s in activity_page.object_list]
else: else:

View file

@ -15,10 +15,12 @@
{% endif %} {% endif %}
</h1> </h1>
</div> </div>
{% if request.user.is_authenticated %}
<div class="column is-narrow"> <div class="column is-narrow">
{% trans "Create List" as button_text %} {% trans "Create List" as button_text %}
{% include 'snippets/toggle/open_button.html' with controls_text="create-list" icon="plus" text=button_text focus="create-list-header" %} {% include 'snippets/toggle/open_button.html' with controls_text="create-list" icon="plus" text=button_text focus="create-list-header" %}
</div> </div>
{% endif %}
</header> </header>
<div class="block"> <div class="block">

View file

@ -60,7 +60,7 @@ class Book(View):
paginated = Paginator( paginated = Paginator(
reviews.exclude(Q(content__isnull=True) | Q(content="")), PAGE_LENGTH reviews.exclude(Q(content__isnull=True) | Q(content="")), PAGE_LENGTH
) )
reviews_page = paginated.page(page) reviews_page = paginated.get_page(page)
user_tags = readthroughs = user_shelves = other_edition_shelves = [] user_tags = readthroughs = user_shelves = other_edition_shelves = []
if request.user.is_authenticated: if request.user.is_authenticated:
@ -285,7 +285,7 @@ class Editions(View):
paginated = Paginator(editions.filter(**filters).all(), PAGE_LENGTH) paginated = Paginator(editions.filter(**filters).all(), PAGE_LENGTH)
data = { data = {
"editions": paginated.page(page), "editions": paginated.get_page(page),
"work": work, "work": work,
"languages": languages, "languages": languages,
"formats": set( "formats": set(

View file

@ -39,7 +39,7 @@ class Directory(View):
paginated = Paginator(users, 12) paginated = Paginator(users, 12)
data = { data = {
"users": paginated.page(page), "users": paginated.get_page(page),
} }
return TemplateResponse(request, "directory/directory.html", data) return TemplateResponse(request, "directory/directory.html", data)

View file

@ -40,7 +40,7 @@ class Federation(View):
paginated = Paginator(servers, PAGE_LENGTH) paginated = Paginator(servers, PAGE_LENGTH)
data = { data = {
"servers": paginated.page(page), "servers": paginated.get_page(page),
"sort": sort, "sort": sort,
"form": forms.ServerForm(), "form": forms.ServerForm(),
} }

View file

@ -39,7 +39,7 @@ class Feed(View):
**feed_page_data(request.user), **feed_page_data(request.user),
**{ **{
"user": request.user, "user": request.user,
"activities": paginated.page(page), "activities": paginated.get_page(page),
"suggested_users": suggested_users, "suggested_users": suggested_users,
"tab": tab, "tab": tab,
"goal_form": forms.GoalForm(), "goal_form": forms.GoalForm(),
@ -82,7 +82,7 @@ class DirectMessage(View):
).order_by("-published_date") ).order_by("-published_date")
paginated = Paginator(activities, PAGE_LENGTH) paginated = Paginator(activities, PAGE_LENGTH)
activity_page = paginated.page(page) activity_page = paginated.get_page(page)
data = { data = {
**feed_page_data(request.user), **feed_page_data(request.user),
**{ **{

View file

@ -43,7 +43,7 @@ class ManageInvites(View):
) )
data = { data = {
"invites": paginated.page(page), "invites": paginated.get_page(page),
"form": forms.CreateInviteForm(), "form": forms.CreateInviteForm(),
} }
return TemplateResponse(request, "settings/manage_invites.html", data) return TemplateResponse(request, "settings/manage_invites.html", data)
@ -136,7 +136,7 @@ class ManageInviteRequests(View):
data = { data = {
"ignored": ignored, "ignored": ignored,
"count": paginated.count, "count": paginated.count,
"requests": paginated.page(page), "requests": paginated.get_page(page),
"sort": sort, "sort": sort,
} }
return TemplateResponse(request, "settings/manage_invite_requests.html", data) return TemplateResponse(request, "settings/manage_invite_requests.html", data)

View file

@ -44,7 +44,7 @@ class Lists(View):
paginated = Paginator(lists, 12) paginated = Paginator(lists, 12)
data = { data = {
"lists": paginated.page(page), "lists": paginated.get_page(page),
"list_form": forms.ListForm(), "list_form": forms.ListForm(),
"path": "/list", "path": "/list",
} }
@ -79,7 +79,7 @@ class UserLists(View):
data = { data = {
"user": user, "user": user,
"is_self": request.user.id == user.id, "is_self": request.user.id == user.id,
"lists": paginated.page(page), "lists": paginated.get_page(page),
"list_form": forms.ListForm(), "list_form": forms.ListForm(),
"path": user.local_path + "/lists", "path": user.local_path + "/lists",
} }

View file

@ -70,7 +70,7 @@ class Shelf(View):
"is_self": is_self, "is_self": is_self,
"shelves": shelves.all(), "shelves": shelves.all(),
"shelf": shelf, "shelf": shelf,
"books": paginated.page(page), "books": paginated.get_page(page),
} }
return TemplateResponse(request, "user/shelf.html", data) return TemplateResponse(request, "user/shelf.html", data)

View file

@ -87,7 +87,7 @@ class User(View):
"is_self": is_self, "is_self": is_self,
"shelves": shelf_preview, "shelves": shelf_preview,
"shelf_count": shelves.count(), "shelf_count": shelves.count(),
"activities": paginated.page(page), "activities": paginated.get_page(page),
"goal": goal, "goal": goal,
} }

View file

@ -46,5 +46,5 @@ class UserAdmin(View):
users = users.order_by(sort) users = users.order_by(sort)
paginated = Paginator(users, PAGE_LENGTH) paginated = Paginator(users, PAGE_LENGTH)
data = {"users": paginated.page(page), "sort": sort, "server": server} data = {"users": paginated.get_page(page), "sort": sort, "server": server}
return TemplateResponse(request, "settings/user_admin.html", data) return TemplateResponse(request, "settings/user_admin.html", data)