From 476d65552ef16843352c478b5d924bbfceb91b1e Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 3 Feb 2021 16:01:49 -0800 Subject: [PATCH 1/3] Hide other people's empty lists from lists page --- bookwyrm/views/list.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bookwyrm/views/list.py b/bookwyrm/views/list.py index ce0cedb42..88938a67e 100644 --- a/bookwyrm/views/list.py +++ b/bookwyrm/views/list.py @@ -29,6 +29,7 @@ class Lists(View): user = request.user if request.user.is_authenticated else None lists = models.List.objects.filter( ~Q(user=user), + books__isnull=False, ).all() lists = privacy_filter(request.user, lists, ['public', 'followers']) From 39d31060e10e343b187b1b568ecabefc261d294c Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 3 Feb 2021 16:11:42 -0800 Subject: [PATCH 2/3] Sort list preview by most recently added --- bookwyrm/templates/lists/list_items.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bookwyrm/templates/lists/list_items.html b/bookwyrm/templates/lists/list_items.html index 4560147f1..942579ca9 100644 --- a/bookwyrm/templates/lists/list_items.html +++ b/bookwyrm/templates/lists/list_items.html @@ -9,8 +9,8 @@
- {% for book in list.books.all|slice:5 %} - {% include 'snippets/book_cover.html' with book=book size="small" %} + {% for book in list.listitem_set.all|slice:5 %} + {% include 'snippets/book_cover.html' with book=book.book size="small" %} {% endfor %}
From 3f2f27bcaca32ec592cc8ab972bb73d93938a55f Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 3 Feb 2021 16:40:29 -0800 Subject: [PATCH 3/3] Fixes logged out list view --- bookwyrm/templates/lists/lists.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/bookwyrm/templates/lists/lists.html b/bookwyrm/templates/lists/lists.html index ad2dfbaf8..96ad81533 100644 --- a/bookwyrm/templates/lists/lists.html +++ b/bookwyrm/templates/lists/lists.html @@ -33,9 +33,7 @@ {% if lists %}

Recent Lists

- {% if request.user.list_set.exists %} {% include 'lists/list_items.html' with lists=lists %} - {% endif %}
{% include 'snippets/pagination.html' with page=lists path=path %}