diff --git a/bookwyrm/templates/shelf.html b/bookwyrm/templates/shelf.html index 390b9fc6..4b27e3a4 100644 --- a/bookwyrm/templates/shelf.html +++ b/bookwyrm/templates/shelf.html @@ -122,7 +122,7 @@
{% include 'snippets/book_cover.html' with book=book size="small" %} diff --git a/bookwyrm/views.py b/bookwyrm/views.py index df08ab18..0d7726b6 100644 --- a/bookwyrm/views.py +++ b/bookwyrm/views.py @@ -765,12 +765,17 @@ def shelf_page(request, username, shelf_identifier): if is_api_request(request): return ActivitypubResponse(shelf.to_activity(**request.GET)) + books = models.ShelfBook.objects.filter( + added_by=user, shelf=shelf + ).order_by('-updated_date').all() + data = { 'title': '%s\'s %s shelf' % (user.display_name, shelf.name), 'user': user, 'is_self': is_self, 'shelves': shelves.all(), 'shelf': shelf, + 'books': [b.book for b in books], } return TemplateResponse(request, 'shelf.html', data) |