Adds shelve buttons to books on author page

This commit is contained in:
Mouse Reeve 2021-10-20 17:51:42 -07:00
parent 3eb3225d2c
commit de93beca84
2 changed files with 2 additions and 1 deletions

View file

@ -110,6 +110,7 @@
{% for book in books %} {% for book in books %}
<div class="column is-one-fifth"> <div class="column is-one-fifth">
{% include 'landing/small-book.html' with book=book %} {% include 'landing/small-book.html' with book=book %}
{% include 'snippets/shelve_button/shelve_button.html' with book=book %}
</div> </div>
{% endfor %} {% endfor %}
</div> </div>

View file

@ -29,7 +29,7 @@ class Author(View):
).order_by("-edition_rank") ).order_by("-edition_rank")
books = ( books = (
models.Edition.objects.filter( models.Edition.viewer_aware_objects(request.user).filter(
Q(authors=author) | Q(parent_work__authors=author) Q(authors=author) | Q(parent_work__authors=author)
) )
.annotate(default_id=Subquery(default_editions.values("id")[:1])) .annotate(default_id=Subquery(default_editions.values("id")[:1]))