mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 18:11:09 +00:00
Only show approved list items
This commit is contained in:
parent
a2e69d783d
commit
846489e88e
2 changed files with 8 additions and 6 deletions
|
@ -23,11 +23,11 @@
|
|||
|
||||
<div class="columns content">
|
||||
<section class="column is-three-quarters">
|
||||
{% if not list.books.exists %}
|
||||
{% if not items.exists %}
|
||||
<p>This list is currently empty</p>
|
||||
{% else %}
|
||||
<ol>
|
||||
{% for item in list.listitem_set.all %}
|
||||
{% for item in items %}
|
||||
<li class="block">
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
|
|
|
@ -64,16 +64,18 @@ class List(View):
|
|||
)
|
||||
suggestions = [s.book for s in suggestions[:5]]
|
||||
if len(suggestions) < 5:
|
||||
suggestions += [s.default_edition for s in \
|
||||
models.Work.objects.filter(
|
||||
~Q(editions__in=book_list.books.all()),
|
||||
).order_by('-updated_date')
|
||||
suggestions += [
|
||||
s.default_edition for s in \
|
||||
models.Work.objects.filter(
|
||||
~Q(editions__in=book_list.books.all()),
|
||||
).order_by('-updated_date')
|
||||
][:5 - len(suggestions)]
|
||||
|
||||
|
||||
data = {
|
||||
'title': '%s | Lists' % book_list.name,
|
||||
'list': book_list,
|
||||
'items': book_list.listitem_set.filter(approved=True),
|
||||
'suggested_books': suggestions,
|
||||
'list_form': forms.ListForm(instance=book_list),
|
||||
'query': query or ''
|
||||
|
|
Loading…
Reference in a new issue