diff --git a/bookwyrm/templates/lists/list.html b/bookwyrm/templates/lists/list.html index 8f171bb4..38be3edf 100644 --- a/bookwyrm/templates/lists/list.html +++ b/bookwyrm/templates/lists/list.html @@ -5,7 +5,7 @@

{{ list.name }} {% include 'snippets/privacy-icons.html' with item=list %}

-

Created by {% include 'snippets/username.html' with user=list.user %}

+

Created {% if list.curation != 'open' %} and curated{% endif %} by {% include 'snippets/username.html' with user=list.user %}

{% include 'snippets/trimmed_text.html' with full=list.description %}
{% if request.user == list.user %} @@ -64,7 +64,7 @@ {% if not list.curation == 'closed' or request.user == list.user %}
-

Add Books

+

{% if list.curation == 'open' or request.user == list.user %}Add{% else %}Suggest{% endif %} Books

{% for book in suggested_books %}
@@ -75,7 +75,7 @@
{% csrf_token %} - +
diff --git a/bookwyrm/templates/snippets/privacy-icons.html b/bookwyrm/templates/snippets/privacy-icons.html index 793fbc8b..c917f553 100644 --- a/bookwyrm/templates/snippets/privacy-icons.html +++ b/bookwyrm/templates/snippets/privacy-icons.html @@ -1,18 +1,18 @@ {% if item.privacy == 'public' %} - - Public post + + Public {% elif item.privacy == 'unlisted' %} - - Unlisted post + + Unlisted {% elif item.privacy == 'followers' %} - - Followers-only post + + Followers-only {% else %} - - Private post + + Private {% endif %} diff --git a/bookwyrm/views/list.py b/bookwyrm/views/list.py index 63f99c4a..c126102d 100644 --- a/bookwyrm/views/list.py +++ b/bookwyrm/views/list.py @@ -55,11 +55,19 @@ class List(View): suggestions = request.user.shelfbook_set.filter( ~Q(book__in=book_list.books.all()) ) + 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') + ][:5 - len(suggestions)] + data = { 'title': '%s | Lists' % book_list.name, 'list': book_list, - 'suggested_books': [s.book for s in suggestions[:5]], + 'suggested_books': suggestions, 'list_form': forms.ListForm(instance=book_list), } return TemplateResponse(request, 'lists/list.html', data)