From acba5cfc75e3c481ad62a58ff62544a71d2d0d7b Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 29 Sep 2020 20:44:33 -0700 Subject: [PATCH] Creates snippet for book cover tiles layout --- bookwyrm/templates/editions.html | 21 +------------------- bookwyrm/templates/snippets/book_tiles.html | 22 +++++++++++++++++++++ bookwyrm/templates/tag.html | 18 +++++------------ 3 files changed, 28 insertions(+), 33 deletions(-) create mode 100644 bookwyrm/templates/snippets/book_tiles.html diff --git a/bookwyrm/templates/editions.html b/bookwyrm/templates/editions.html index 40881a48..8b7f54fb 100644 --- a/bookwyrm/templates/editions.html +++ b/bookwyrm/templates/editions.html @@ -4,26 +4,7 @@

Editions of "{{ work.title }}"

- -
-
-
- {% for book in editions %} - {% if forloop.counter0|divisibleby:"5" %} -
-
- {% endif %} -
- -
- {% endfor %} -
-
+ {% include 'snippets/book_tiles.html' with books=editions %}
{% endblock %} diff --git a/bookwyrm/templates/snippets/book_tiles.html b/bookwyrm/templates/snippets/book_tiles.html new file mode 100644 index 00000000..bb116625 --- /dev/null +++ b/bookwyrm/templates/snippets/book_tiles.html @@ -0,0 +1,22 @@ +
+
+
+ {% for book in books %} + {% if forloop.counter0|divisibleby:"5" %} +
+
+ {% endif %} +
+ +
+ {% endfor %} +
+
+
+ diff --git a/bookwyrm/templates/tag.html b/bookwyrm/templates/tag.html index f9e89093..15b8ff28 100644 --- a/bookwyrm/templates/tag.html +++ b/bookwyrm/templates/tag.html @@ -1,20 +1,12 @@ {% extends 'layout.html' %} {% load fr_display %} {% block content %} -
-

Books tagged "{{ tag.name }}"

-
- {% for book in books.all %} -
- - {% include 'snippets/book_cover.html' with book=book %} - - {% include 'snippets/rate_action.html' with user=request.user book=book %} - {% include 'snippets/shelve_button.html' with book=book %} -
- {% endfor %} -
+ +
+

Books tagged "{{ tag.name }}"

+ {% include 'snippets/book_tiles.html' with books=books.all %}
+ {% endblock %}