From a0b57837a7bfa3b2e73aa9b8208800f64dfd7c53 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 23 Feb 2021 13:34:16 -0800 Subject: [PATCH 1/3] Moves status templates into dir --- bookwyrm/templates/book.html | 2 +- bookwyrm/templates/feed/direct_messages.html | 2 +- bookwyrm/templates/feed/feed.html | 2 +- bookwyrm/templates/feed/thread.html | 2 +- bookwyrm/templates/snippets/{ => status}/status.html | 4 ++-- bookwyrm/templates/snippets/{ => status}/status_body.html | 6 +++--- .../templates/snippets/{ => status}/status_content.html | 0 bookwyrm/templates/snippets/{ => status}/status_header.html | 0 .../templates/snippets/{ => status}/status_options.html | 0 bookwyrm/templates/user/user.html | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) rename bookwyrm/templates/snippets/{ => status}/status.html (63%) rename bookwyrm/templates/snippets/{ => status}/status_body.html (89%) rename bookwyrm/templates/snippets/{ => status}/status_content.html (100%) rename bookwyrm/templates/snippets/{ => status}/status_header.html (100%) rename bookwyrm/templates/snippets/{ => status}/status_options.html (100%) diff --git a/bookwyrm/templates/book.html b/bookwyrm/templates/book.html index 0bef2856..4d15a3a5 100644 --- a/bookwyrm/templates/book.html +++ b/bookwyrm/templates/book.html @@ -242,7 +242,7 @@
{% for review in reviews %}
- {% include 'snippets/status.html' with status=review hide_book=True depth=1 %} + {% include 'snippets/status/status.html' with status=review hide_book=True depth=1 %}
{% endfor %} diff --git a/bookwyrm/templates/feed/direct_messages.html b/bookwyrm/templates/feed/direct_messages.html index 8c53cbeb..f3102ee7 100644 --- a/bookwyrm/templates/feed/direct_messages.html +++ b/bookwyrm/templates/feed/direct_messages.html @@ -16,7 +16,7 @@ {% endif %} {% for activity in activities %}
- {% include 'snippets/status.html' with status=activity %} + {% include 'snippets/status/status.html' with status=activity %}
{% endfor %} diff --git a/bookwyrm/templates/feed/feed.html b/bookwyrm/templates/feed/feed.html index 8d6152e2..7029fd69 100644 --- a/bookwyrm/templates/feed/feed.html +++ b/bookwyrm/templates/feed/feed.html @@ -32,7 +32,7 @@ {% endif %} {% for activity in activities %}
-{% include 'snippets/status.html' with status=activity %} +{% include 'snippets/status/status.html' with status=activity %}
{% endfor %} diff --git a/bookwyrm/templates/feed/thread.html b/bookwyrm/templates/feed/thread.html index aa67d5bb..18ab6ea3 100644 --- a/bookwyrm/templates/feed/thread.html +++ b/bookwyrm/templates/feed/thread.html @@ -8,7 +8,7 @@ {% endwith %} {% endif %} -{% include 'snippets/status.html' with status=status main=is_root %} +{% include 'snippets/status/status.html' with status=status main=is_root %} {% if depth <= max_depth and direction >= 0 %} {% for reply in status|replies %} diff --git a/bookwyrm/templates/snippets/status.html b/bookwyrm/templates/snippets/status/status.html similarity index 63% rename from bookwyrm/templates/snippets/status.html rename to bookwyrm/templates/snippets/status/status.html index 13d5ee7c..162fad97 100644 --- a/bookwyrm/templates/snippets/status.html +++ b/bookwyrm/templates/snippets/status/status.html @@ -4,8 +4,8 @@ {% include 'snippets/avatar.html' with user=status.user %} {% include 'snippets/username.html' with user=status.user %} boosted - {% include 'snippets/status_body.html' with status=status|boosted_status %} + {% include 'snippets/status/status_body.html' with status=status|boosted_status %} {% else %} - {% include 'snippets/status_body.html' with status=status %} + {% include 'snippets/status/status_body.html' with status=status %} {% endif %} {% endif %} diff --git a/bookwyrm/templates/snippets/status_body.html b/bookwyrm/templates/snippets/status/status_body.html similarity index 89% rename from bookwyrm/templates/snippets/status_body.html rename to bookwyrm/templates/snippets/status/status_body.html index 00ae5460..dfc0ac68 100644 --- a/bookwyrm/templates/snippets/status_body.html +++ b/bookwyrm/templates/snippets/status/status_body.html @@ -5,13 +5,13 @@ {% block card-header %}

- {% include 'snippets/status_header.html' with status=status %} + {% include 'snippets/status/status_header.html' with status=status %}

{% endblock %} {% block card-content %} - {% include 'snippets/status_content.html' with status=status %} + {% include 'snippets/status/status_content.html' with status=status %} {% endblock %} @@ -55,7 +55,7 @@ {{ status.published_date | post_date }}
{% endblock %} diff --git a/bookwyrm/templates/snippets/status_content.html b/bookwyrm/templates/snippets/status/status_content.html similarity index 100% rename from bookwyrm/templates/snippets/status_content.html rename to bookwyrm/templates/snippets/status/status_content.html diff --git a/bookwyrm/templates/snippets/status_header.html b/bookwyrm/templates/snippets/status/status_header.html similarity index 100% rename from bookwyrm/templates/snippets/status_header.html rename to bookwyrm/templates/snippets/status/status_header.html diff --git a/bookwyrm/templates/snippets/status_options.html b/bookwyrm/templates/snippets/status/status_options.html similarity index 100% rename from bookwyrm/templates/snippets/status_options.html rename to bookwyrm/templates/snippets/status/status_options.html diff --git a/bookwyrm/templates/user/user.html b/bookwyrm/templates/user/user.html index c7f6d3b5..e1c19e53 100644 --- a/bookwyrm/templates/user/user.html +++ b/bookwyrm/templates/user/user.html @@ -64,7 +64,7 @@ {% for activity in activities %}
- {% include 'snippets/status.html' with status=activity %} + {% include 'snippets/status/status.html' with status=activity %}
{% endfor %} {% if not activities %} From f9dd0b0246032b769837c1244b8f88ef5467e2c3 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 23 Feb 2021 13:42:20 -0800 Subject: [PATCH 2/3] Groups in book preview only used by status templates --- bookwyrm/templates/snippets/{ => status}/book_preview.html | 0 bookwyrm/templates/snippets/status/status_content.html | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename bookwyrm/templates/snippets/{ => status}/book_preview.html (100%) diff --git a/bookwyrm/templates/snippets/book_preview.html b/bookwyrm/templates/snippets/status/book_preview.html similarity index 100% rename from bookwyrm/templates/snippets/book_preview.html rename to bookwyrm/templates/snippets/status/book_preview.html diff --git a/bookwyrm/templates/snippets/status/status_content.html b/bookwyrm/templates/snippets/status/status_content.html index d6dd5ef5..0f59f7fc 100644 --- a/bookwyrm/templates/snippets/status/status_content.html +++ b/bookwyrm/templates/snippets/status/status_content.html @@ -54,9 +54,9 @@ {% if status.book or status.mention_books.count %}
{% if status.book %} - {% include 'snippets/book_preview.html' with book=status.book %} + {% include 'snippets/status/book_preview.html' with book=status.book %} {% elif status.mention_books.count %} - {% include 'snippets/book_preview.html' with book=status.mention_books.first %} + {% include 'snippets/status/book_preview.html' with book=status.mention_books.first %} {% endif %}
{% endif %} From d0c46060e82282c9a3f1008a4e6e003c64185026 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 23 Feb 2021 14:00:19 -0800 Subject: [PATCH 3/3] Adds stars to book preview in status --- bookwyrm/templates/snippets/stars.html | 2 +- bookwyrm/templates/snippets/status/book_preview.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bookwyrm/templates/snippets/stars.html b/bookwyrm/templates/snippets/stars.html index 7d5b63d7..d1576807 100644 --- a/bookwyrm/templates/snippets/stars.html +++ b/bookwyrm/templates/snippets/stars.html @@ -1,7 +1,7 @@

{% if rating %}{{ rating|floatformat }} star{{ rating|floatformat | pluralize }}{% else %}No rating{% endif %} {% for i in '12345'|make_list %} -

diff --git a/bookwyrm/templates/snippets/status/book_preview.html b/bookwyrm/templates/snippets/status/book_preview.html index 0c75f9b1..920b9f53 100644 --- a/bookwyrm/templates/snippets/status/book_preview.html +++ b/bookwyrm/templates/snippets/status/book_preview.html @@ -3,6 +3,7 @@
{% include 'snippets/book_cover.html' with book=book %} + {% include 'snippets/stars.html' with rating=book|rating:request.user %} {% include 'snippets/shelve_button/shelve_button.html' with book=book %}