mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 20:11:14 +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">
|
<div class="columns content">
|
||||||
<section class="column is-three-quarters">
|
<section class="column is-three-quarters">
|
||||||
{% if not list.books.exists %}
|
{% if not items.exists %}
|
||||||
<p>This list is currently empty</p>
|
<p>This list is currently empty</p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<ol>
|
<ol>
|
||||||
{% for item in list.listitem_set.all %}
|
{% for item in items %}
|
||||||
<li class="block">
|
<li class="block">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<header class="card-header">
|
<header class="card-header">
|
||||||
|
|
|
@ -64,16 +64,18 @@ class List(View):
|
||||||
)
|
)
|
||||||
suggestions = [s.book for s in suggestions[:5]]
|
suggestions = [s.book for s in suggestions[:5]]
|
||||||
if len(suggestions) < 5:
|
if len(suggestions) < 5:
|
||||||
suggestions += [s.default_edition for s in \
|
suggestions += [
|
||||||
models.Work.objects.filter(
|
s.default_edition for s in \
|
||||||
~Q(editions__in=book_list.books.all()),
|
models.Work.objects.filter(
|
||||||
).order_by('-updated_date')
|
~Q(editions__in=book_list.books.all()),
|
||||||
|
).order_by('-updated_date')
|
||||||
][:5 - len(suggestions)]
|
][:5 - len(suggestions)]
|
||||||
|
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
'title': '%s | Lists' % book_list.name,
|
'title': '%s | Lists' % book_list.name,
|
||||||
'list': book_list,
|
'list': book_list,
|
||||||
|
'items': book_list.listitem_set.filter(approved=True),
|
||||||
'suggested_books': suggestions,
|
'suggested_books': suggestions,
|
||||||
'list_form': forms.ListForm(instance=book_list),
|
'list_form': forms.ListForm(instance=book_list),
|
||||||
'query': query or ''
|
'query': query or ''
|
||||||
|
|
Loading…
Reference in a new issue