mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 03:51:08 +00:00
Merge pull request #1365 from bookwyrm-social/discover-quotes
Show quotes without content as large discover cards
This commit is contained in:
commit
2d090935f0
1 changed files with 10 additions and 3 deletions
|
@ -16,6 +16,7 @@ class Discover(View):
|
||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
"""tiled book activity page"""
|
"""tiled book activity page"""
|
||||||
|
# all activities in the "federated" feed associated with a book
|
||||||
activities = (
|
activities = (
|
||||||
activitystreams.streams["local"]
|
activitystreams.streams["local"]
|
||||||
.get_activity_stream(request.user)
|
.get_activity_stream(request.user)
|
||||||
|
@ -29,13 +30,19 @@ class Discover(View):
|
||||||
|
|
||||||
large_activities = Paginator(
|
large_activities = Paginator(
|
||||||
activities.filter(mention_books__isnull=True)
|
activities.filter(mention_books__isnull=True)
|
||||||
.exclude(content=None, quotation__quote=None)
|
# exclude statuses with no user-provided content for large panels
|
||||||
.exclude(content=""),
|
.exclude(
|
||||||
|
Q(Q(content="") | Q(content__isnull=True)) & Q(quotation__isnull=True),
|
||||||
|
),
|
||||||
6,
|
6,
|
||||||
)
|
)
|
||||||
small_activities = Paginator(
|
small_activities = Paginator(
|
||||||
activities.filter(
|
activities.filter(
|
||||||
Q(mention_books__isnull=False) | Q(content=None) | Q(content="")
|
Q(mention_books__isnull=False)
|
||||||
|
| Q(
|
||||||
|
Q(Q(content="") | Q(content__isnull=True))
|
||||||
|
& Q(quotation__isnull=True),
|
||||||
|
)
|
||||||
),
|
),
|
||||||
4,
|
4,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue