From 434cb7e5b5a969575583e45c3fd85fd04fdf2f0c Mon Sep 17 00:00:00 2001
From: Joachim
+ {% trans "There are currently no suggestions." %}
+
+
+
+ {% include 'snippets/book_titleby.html' %}
+
+ {% blocktrans trimmed with username=item.user.display_name user_path=item.user.local_path %}
+ Added by {{ username }}
+ {% endblocktrans %}
+
+ TODO :: endorsements
+
- {% trans "There are currently no suggestions." %}
-
-
- {% blocktrans %}No books found matching the query "{{ query }}"{% endblocktrans %} {% trans "No books found" %} {% include 'snippets/book_titleby.html' with book=book %}{% trans "Your reading activity" %}
{% trans "Subjects" %}
diff --git a/bookwyrm/templates/book/suggestion_list/list.html b/bookwyrm/templates/book/suggestion_list/list.html
new file mode 100644
index 0000000000..8f9ad179ac
--- /dev/null
+++ b/bookwyrm/templates/book/suggestion_list/list.html
@@ -0,0 +1,11 @@
+{% load i18n %}
+{% if book.suggestionlist %}
+ {% trans "Suggestions" %}
+{% else %}
+
+{% endif %}
diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py
index ac3a805803..7ee4bca8e0 100644
--- a/bookwyrm/urls.py
+++ b/bookwyrm/urls.py
@@ -664,6 +664,11 @@
views.update_book_from_remote,
name="book-update-remote",
),
+ re_path(
+ rf"{BOOK_PATH}/create-suggestion-list/?$",
+ views.create_suggestion_list,
+ name="book-create-suggestion-list",
+ ),
re_path(
r"^author/(?P{% trans "Your reading activity" %}
{% trans "Subjects" %}
@@ -408,8 +404,11 @@ {% trans "Lists" %}
+ {% trans "Suggestions" %}
+
+
{% if book.suggestionlist %}
- {% trans "Suggestions" %}
+{% with book.suggestionlist.listitem_set.all as items %}
+
+ {% if items.count == 0 %}
+
+
+ {% for item in items %}
+
+ {% endif %}
+{% endwith %}
{% else %}
-
+
+
{% trans "Suggestions" %}
{% if book.suggestionlist %}
{% with book.suggestionlist.listitem_set.all as items %}
- {% if items.count == 0 %}
-
-
@@ -28,7 +22,7 @@
{% endif %}
{% endwith %}
{% else %}
{% with book=item.book %}
@@ -54,12 +48,15 @@
{% endfor %}
+
{% include 'lists/created_text.html' with list=list %}
@@ -28,7 +28,7 @@{% include 'lists/created_text.html' with list=list %}
+ {% endif %}+ {% include 'snippets/book_titleby.html' with book=item_book %} +
+ {% if item_book|book_description %} ++ {% with full=item_book|book_description trim_length=20 %} + {% include 'snippets/trimmed_text.html' with hide_more=True %} + {% endwith %} + {% endif %} + {% include "lists/list_item_notes.html" with list=book.suggestion_list hide_edit=True %}
- {% include 'snippets/book_titleby.html' %} -
{% endwith %}{% blocktrans %}No books found matching the query "{{ query }}"{% endblocktrans %}
{% else %} -{% trans "No books found" %}
- {% endif %} - {% endif %} - - {% if suggested_books|length > 0 %} - {% for book in suggested_books %} -{% include 'snippets/book_titleby.html' with book=book %}
- - {% join "add_item" list.id book.id as modal_id %} - - {% include "lists/add_item_modal.html" with id=modal_id is_suggestion=True %} -{% blocktrans %}No books found matching the query "{{ query }}"{% endblocktrans %}
{% else %} -{% trans "No books found" %}
- {% endif %} - {% endif %} - - {% if suggested_books|length > 0 %} - {% for book in suggested_books %} -{% include 'snippets/book_titleby.html' with book=book %}
- - {% join "add_item" list.id book.id as modal_id %} - - {% include "lists/add_item_modal.html" with id=modal_id %} -{% blocktrans %}No books found matching the query "{{ query }}"{% endblocktrans %}
{% else %} +{% trans "No books found" %}
+{% endif %} +{% endif %} + +{% if suggested_books|length > 0 %} + {% for book in suggested_books %} +{% include 'snippets/book_titleby.html' with book=book %}
+ + {% join "add_item" list.id book.id as modal_id %} + + {% include "lists/add_item_modal.html" with id=modal_id is_suggestion=is_suggestion %} ++ {% include 'snippets/book_titleby.html' with book=item_book %} +
+ {% if item_book|book_description %} ++ {% with full=item_book|book_description trim_length=20 %} + {% include 'snippets/trimmed_text.html' with hide_more=True %} + {% endwith %} + {% endif %} + {% include "lists/list_item_notes.html" with list=book.suggestion_list hide_edit=True %} +
+ {% blocktrans trimmed with username=item.user.display_name user_path=item.user.local_path %} + Added by {{ username }} + {% endblocktrans %} +
++ TODO :: endorsements +
+- {% include 'snippets/book_titleby.html' with book=item_book %} -
- {% if item_book|book_description %} -- {% with full=item_book|book_description trim_length=20 %} - {% include 'snippets/trimmed_text.html' with hide_more=True %} - {% endwith %} - {% endif %} - {% include "lists/list_item_notes.html" with list=book.suggestion_list hide_edit=True %} -
- {% blocktrans trimmed with username=item.user.display_name user_path=item.user.local_path %} - Added by {{ username }} - {% endblocktrans %} -
-- TODO :: endorsements -
-+
{% include 'snippets/book_titleby.html' with book=item_book %}
{% if item_book|book_description %} -- {% with full=item_book|book_description trim_length=20 %} - {% include 'snippets/trimmed_text.html' with hide_more=True %} ++ {% with full=item_book|book_description %} + {% include 'snippets/trimmed_text.html' with trim_length=15 hide_more=True %} {% endwith %} ++ {% else %} + {% include "lists/list_item_notes.html" with list=book.suggestion_list hide_edit=True %} {% endif %} - {% include "lists/list_item_notes.html" with list=book.suggestion_list hide_edit=True %}
{% blocktrans trimmed with username=item.user.display_name user_path=item.user.local_path %} Added by {{ username }} diff --git a/bookwyrm/templates/book/suggestion_list/list.html b/bookwyrm/templates/book/suggestion_list/list.html index 20fcad63f1..635d5d93bb 100644 --- a/bookwyrm/templates/book/suggestion_list/list.html +++ b/bookwyrm/templates/book/suggestion_list/list.html @@ -1,15 +1,23 @@ {% load i18n %} +{% load humanize %}
{% include 'snippets/book_titleby.html' with book=item_book %}
- {% if item_book|book_description %} + {% if item.notes %} + {% include "lists/list_item_notes.html" with list=book.suggestion_list hide_edit=True no_trim=False trim_length=15 %} + {% else %}{% with full=item_book|book_description %} {% include 'snippets/trimmed_text.html' with trim_length=15 hide_more=True %} {% endwith %}- {% else %} - {% include "lists/list_item_notes.html" with list=book.suggestion_list hide_edit=True %} {% endif %}
+ {% blocktrans trimmed with title=book.title %} + Readers who liked {{ title }} recommend giving these books a try: + {% endblocktrans %} +
+ {% with book.suggestion_list.listitem_set.all|slice:3 as items %} {% if items|length == 0 %} @@ -22,16 +22,22 @@{% include 'lists/created_text.html' with list=list %} @@ -35,7 +35,7 @@
{% trans "Have a recommendation for someone who liked this book?" %}
+{% blocktrans trimmed with title=book.title %} Readers who liked {{ title }} recommend giving these books a try: {% endblocktrans %}
+ +{% if suggestion_list %} + {% if items|length == 0 %}{% trans "Have a recommendation for someone who liked this book?" %}
{% include "book/suggestion_list/search.html" with list=suggestion_list is_suggestion=True %}{% trans "Have a recommendation for someone who liked this book?" %}
-