From e8a95a217bb9d9fd49de3a0ffc14780fcd04ad07 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 25 Aug 2024 20:12:21 -0700 Subject: [PATCH] Moves book suggestion markup to a snippet --- .../book/suggestion_list/book_card.html | 43 +++++++++++++++++++ .../templates/book/suggestion_list/list.html | 43 +------------------ 2 files changed, 45 insertions(+), 41 deletions(-) create mode 100644 bookwyrm/templates/book/suggestion_list/book_card.html diff --git a/bookwyrm/templates/book/suggestion_list/book_card.html b/bookwyrm/templates/book/suggestion_list/book_card.html new file mode 100644 index 000000000..694bc54b2 --- /dev/null +++ b/bookwyrm/templates/book/suggestion_list/book_card.html @@ -0,0 +1,43 @@ +{% load i18n %} +{% load book_display_tags %} + +
+
+ {% with item_book=item.book %} + +
+

+ {% 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 %} +
+ {% endwith %} +
+ +
+ diff --git a/bookwyrm/templates/book/suggestion_list/list.html b/bookwyrm/templates/book/suggestion_list/list.html index fd8eeb368..20fcad63f 100644 --- a/bookwyrm/templates/book/suggestion_list/list.html +++ b/bookwyrm/templates/book/suggestion_list/list.html @@ -1,5 +1,4 @@ {% load i18n %} -{% load book_display_tags %}

{% trans "Suggestions" %} @@ -17,46 +16,8 @@ {% else %}
    {% for item in items %} -
  1. -
    -
    - {% with item_book=item.book %} - -
    -

    - {% 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 %} -
    - {% endwith %} -
    - -
    +
  2. + {% include "book/suggestion_list/book_card.html" %}
  3. {% endfor %}