diff --git a/fedireads/static/format.css b/fedireads/static/format.css index b4f16177..44a9b620 100644 --- a/fedireads/static/format.css +++ b/fedireads/static/format.css @@ -113,6 +113,10 @@ h2 { margin-right: 1em; } +.book-preview.grid { + float: left; +} + .book-cover.small { width: 50px; height: auto; diff --git a/fedireads/templates/tag.html b/fedireads/templates/tag.html index 39887f91..8c18f400 100644 --- a/fedireads/templates/tag.html +++ b/fedireads/templates/tag.html @@ -5,7 +5,7 @@

Books tagged "{{ tag.name }}"

{% for book in books.all %} -
+
{% include 'snippets/book.html' with book=book size=large %}
{% endfor %} diff --git a/fedireads/views.py b/fedireads/views.py index f0c9c179..b77c5181 100644 --- a/fedireads/views.py +++ b/fedireads/views.py @@ -243,11 +243,11 @@ def author_page(request, author_identifier): def tag_page(request, tag_id): ''' books related to a tag ''' - tag = models.Tag.objects.filter(identifier=tag_id).first() - books = models.Book.objects.filter(tag=tag).all() + tag_obj = models.Tag.objects.filter(identifier=tag_id).first() + books = models.Book.objects.filter(tag__identifier=tag_id) data = { 'books': books, - 'tag': tag, + 'tag': tag_obj, } return TemplateResponse(request, 'tag.html', data)