From 11a0c1691b04c79ea26e626ff4c7d217253fc21d Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 9 Jul 2022 12:39:02 -0700 Subject: [PATCH 1/5] Move status_preview snippet to notifications directory That's the only place it's used, always nice to de-clutter the snippets directory --- bookwyrm/templates/notifications/items/boost.html | 2 +- bookwyrm/templates/notifications/items/fav.html | 2 +- bookwyrm/templates/notifications/items/mention.html | 2 +- bookwyrm/templates/notifications/items/reply.html | 2 +- .../{snippets => notifications/items}/status_preview.html | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename bookwyrm/templates/{snippets => notifications/items}/status_preview.html (100%) diff --git a/bookwyrm/templates/notifications/items/boost.html b/bookwyrm/templates/notifications/items/boost.html index a1a0a24fbf..2c2bf695b9 100644 --- a/bookwyrm/templates/notifications/items/boost.html +++ b/bookwyrm/templates/notifications/items/boost.html @@ -118,7 +118,7 @@
- {% include 'snippets/status_preview.html' with status=related_status %} + {% include 'notifications/items/status_preview.html' with status=related_status %}
{{ related_status.published_date|timesince }} diff --git a/bookwyrm/templates/notifications/items/fav.html b/bookwyrm/templates/notifications/items/fav.html index 0bface201f..9cda6b9280 100644 --- a/bookwyrm/templates/notifications/items/fav.html +++ b/bookwyrm/templates/notifications/items/fav.html @@ -119,7 +119,7 @@
- {% include 'snippets/status_preview.html' with status=related_status %} + {% include 'notifications/items/status_preview.html' with status=related_status %}
{{ related_status.published_date|timesince }} diff --git a/bookwyrm/templates/notifications/items/mention.html b/bookwyrm/templates/notifications/items/mention.html index 8640526358..c3b3c1f34d 100644 --- a/bookwyrm/templates/notifications/items/mention.html +++ b/bookwyrm/templates/notifications/items/mention.html @@ -51,7 +51,7 @@
- {% include 'snippets/status_preview.html' with status=related_status %} + {% include 'notifications/items/status_preview.html' with status=related_status %}
{{ related_status.published_date|timesince }} diff --git a/bookwyrm/templates/notifications/items/reply.html b/bookwyrm/templates/notifications/items/reply.html index 099e22078c..16c84d4395 100644 --- a/bookwyrm/templates/notifications/items/reply.html +++ b/bookwyrm/templates/notifications/items/reply.html @@ -54,7 +54,7 @@
- {% include 'snippets/status_preview.html' with status=related_status %} + {% include 'notifications/items/status_preview.html' with status=related_status %}
{{ related_status.published_date|timesince }} diff --git a/bookwyrm/templates/snippets/status_preview.html b/bookwyrm/templates/notifications/items/status_preview.html similarity index 100% rename from bookwyrm/templates/snippets/status_preview.html rename to bookwyrm/templates/notifications/items/status_preview.html From be5e1be5f6569de226137805bb37491814a4012d Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 9 Jul 2022 13:12:46 -0700 Subject: [PATCH 2/5] Use content warnings in notifications --- .../notifications/items/status_preview.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bookwyrm/templates/notifications/items/status_preview.html b/bookwyrm/templates/notifications/items/status_preview.html index b1eb3eca7a..c5d31599b1 100644 --- a/bookwyrm/templates/notifications/items/status_preview.html +++ b/bookwyrm/templates/notifications/items/status_preview.html @@ -1,4 +1,17 @@ -{% if status.content %} +{% load i18n %} +{% if status.content_warning %} + +{% trans "Content warning" as text %} + + + {{ text }} + + + + {{ status.content_warning }} + + +{% elif status.content %} {{ status.content | safe | truncatewords_html:10 }}{% if status.mention_books %} {{ status.mention_books.first.title }}{% endif %} From 591c4d9b751efb6fff9b019a5e80a3a001a8ce30 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 9 Jul 2022 13:33:58 -0700 Subject: [PATCH 3/5] Fixes numbering on book lists --- bookwyrm/static/css/bookwyrm/components/_book_list.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bookwyrm/static/css/bookwyrm/components/_book_list.scss b/bookwyrm/static/css/bookwyrm/components/_book_list.scss index 0b10934892..3377de6b30 100644 --- a/bookwyrm/static/css/bookwyrm/components/_book_list.scss +++ b/bookwyrm/static/css/bookwyrm/components/_book_list.scss @@ -6,11 +6,11 @@ ol.ordered-list { counter-reset: list-counter; } -ol.ordered-list li { +ol.ordered-list > li { counter-increment: list-counter; } -ol.ordered-list li::before { +ol.ordered-list > li::before { content: counter(list-counter); position: absolute; left: -20px; From 7a772c7d3e6fa64978e9b4ca968bd8320ee41863 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 10 Jul 2022 09:30:39 -0700 Subject: [PATCH 4/5] Use POST instead of GET for logout function --- bookwyrm/templates/user_menu.html | 12 +++++++++--- bookwyrm/views/landing/login.py | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bookwyrm/templates/user_menu.html b/bookwyrm/templates/user_menu.html index 3a31365516..2d23d1b244 100644 --- a/bookwyrm/templates/user_menu.html +++ b/bookwyrm/templates/user_menu.html @@ -68,9 +68,15 @@
  • - - {% trans 'Log out' %} - +
  • diff --git a/bookwyrm/views/landing/login.py b/bookwyrm/views/landing/login.py index ccee61297f..7cac5ad889 100644 --- a/bookwyrm/views/landing/login.py +++ b/bookwyrm/views/landing/login.py @@ -77,7 +77,7 @@ def post(self, request): class Logout(View): """log out""" - def get(self, request): + def post(self, request): """done with this place! outa here!""" logout(request) return redirect("/") From 64bfe5934f5db5115d4289c285b7c1cd6a56a2e7 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 10 Jul 2022 09:39:51 -0700 Subject: [PATCH 5/5] Tick version number This was reported as a security issue, so updating the version number to indicate where the issue has been fixed. --- bookwyrm/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index c1335edf66..ad8cad75b1 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -11,7 +11,7 @@ env = Env() env.read_env() DOMAIN = env("DOMAIN") -VERSION = "0.4.2" +VERSION = "0.4.3" RELEASE_API = env( "RELEASE_API",