From 48832313479aa3c03368ddf9ca1bdd6c6461d334 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 31 Jan 2021 09:08:06 -0800 Subject: [PATCH] Fixes model test --- bookwyrm/templates/lists/list-item.html | 2 +- bookwyrm/templates/lists/list.html | 41 ++++++++++++++++++- bookwyrm/templates/lists/lists.html | 4 +- bookwyrm/templates/snippets/book_preview.html | 4 +- bookwyrm/tests/models/test_list.py | 2 +- bookwyrm/urls.py | 5 ++- bookwyrm/views/list.py | 11 ++++- 7 files changed, 58 insertions(+), 11 deletions(-) diff --git a/bookwyrm/templates/lists/list-item.html b/bookwyrm/templates/lists/list-item.html index 0f0cb8a6..9018c0ef 100644 --- a/bookwyrm/templates/lists/list-item.html +++ b/bookwyrm/templates/lists/list-item.html @@ -1,2 +1,2 @@ -

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

+

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

{% include 'snippets/trimmed_text.html' with full=list.description %} diff --git a/bookwyrm/templates/lists/list.html b/bookwyrm/templates/lists/list.html index c17f3d9e..854ee4c5 100644 --- a/bookwyrm/templates/lists/list.html +++ b/bookwyrm/templates/lists/list.html @@ -1,7 +1,44 @@ {% extends 'layout.html' %} {% block content %} -

{{ list.name }}

-{{ list }} +
+
+

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

+ {% include 'snippets/trimmed_text.html' with full=list.description %} +
+
+ {% include 'snippets/toggle/open_button.html' with text="Edit list" icon="pencil" controls_text="edit-list" %} +
+
+
+
+

Books

+ {% if not list.books.exists %} +

This list is currently empty

+ {% else %} + {% for book in list.books.all %} + {{ book }} + {% endfor %} + {% endif %} +
+ +
+

Add Books

+ {% for book in suggested_books %} +
+ +
+

{% include 'snippets/book_titleby.html' with book=book %}

+
+ {% csrf_token %} + +
+
+
+ {% endfor %} +
+
{% endblock %} diff --git a/bookwyrm/templates/lists/lists.html b/bookwyrm/templates/lists/lists.html index 73f98e77..8f8f7e19 100644 --- a/bookwyrm/templates/lists/lists.html +++ b/bookwyrm/templates/lists/lists.html @@ -67,7 +67,7 @@ {% if request.user.list_set.exists %}