Merge pull request #586 from mouse-reeve/list-tweaks

List tweaks
This commit is contained in:
Mouse Reeve 2021-02-03 16:45:05 -08:00 committed by GitHub
commit c529ecfb9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View file

@ -9,8 +9,8 @@
</h4>
</header>
<div class="card-image is-flex">
{% 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 %}
</div>
<div class="card-content is-flex-grow-0">

View file

@ -33,9 +33,7 @@
{% if lists %}
<section class="block content">
<h2 class="title">Recent Lists</h2>
{% if request.user.list_set.exists %}
{% include 'lists/list_items.html' with lists=lists %}
{% endif %}
</section>
<div>
{% include 'snippets/pagination.html' with page=lists path=path %}

View file

@ -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'])