diff --git a/bookwyrm/templates/lists/lists.html b/bookwyrm/templates/lists/lists.html index 21f6ada4..376449f8 100644 --- a/bookwyrm/templates/lists/lists.html +++ b/bookwyrm/templates/lists/lists.html @@ -27,6 +27,21 @@ {% include 'lists/create_form.html' with controls_text="create_list" %} +{% if request.user.is_authenticated %} + +{% endif %} + {% if lists %}
{% include 'lists/list_items.html' with lists=lists %} diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py index 7facde3e..fa63e983 100644 --- a/bookwyrm/urls.py +++ b/bookwyrm/urls.py @@ -218,6 +218,9 @@ urlpatterns = [ # lists re_path(r"%s/lists/?$" % USER_PATH, views.UserLists.as_view(), name="user-lists"), re_path(r"^list/?$", views.Lists.as_view(), name="lists"), + re_path( + r"^list/bookmarks/?$", views.BookmarkedLists.as_view(), name="bookmarked-lists" + ), re_path(r"^list/(?P\d+)(.json)?/?$", views.List.as_view(), name="list"), re_path(r"^list/add-book/?$", views.list.add_book, name="list-add-book"), re_path( diff --git a/bookwyrm/views/__init__.py b/bookwyrm/views/__init__.py index bb7f9d3e..b016b46c 100644 --- a/bookwyrm/views/__init__.py +++ b/bookwyrm/views/__init__.py @@ -25,7 +25,7 @@ from .invite import ManageInvites, Invite, InviteRequest from .invite import ManageInviteRequests, ignore_invite_request from .isbn import Isbn from .landing import About, Home, Landing -from .list import Lists, List, Curate, UserLists +from .list import Lists, BookmarkedLists, List, Curate, UserLists from .list import bookmark, unbookmark from .notifications import Notifications from .outbox import Outbox diff --git a/bookwyrm/views/list.py b/bookwyrm/views/list.py index 14966bc2..e95ecd57 100644 --- a/bookwyrm/views/list.py +++ b/bookwyrm/views/list.py @@ -63,6 +63,25 @@ class Lists(View): return redirect(book_list.local_path) +@method_decorator(login_required, name="dispatch") +class BookmarkedLists(View): + """bookmarked book list page""" + + def get(self, request): + """display book lists""" + # hide lists with no approved books + lists = request.user.saved_lists.order_by("-updated_date") + + paginated = Paginator(lists, 12) + data = { + "lists": paginated.get_page(request.GET.get("page")), + "list_form": forms.ListForm(), + "path": "/list", + } + return TemplateResponse(request, "lists/lists.html", data) + + +@method_decorator(login_required, name="dispatch") class UserLists(View): """a user's book list page"""