From c5d530c0c4d45f86dbe57a33465f00267b5f2fd0 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Mon, 25 Oct 2021 15:30:48 +1100 Subject: [PATCH] translate all read statuses This fixes #1566 - "Already translated strings sometimes show up untranslated in UI" - add generatednote status header template - include the relevant template (to-read/reading/read) based on the status.content - remove GeneratedNote block from note status header template This is probably not the most correct way of resolving the problem, but it's simple and it works. --- .../snippets/status/headers/generatednote.html | 11 +++++++++++ bookwyrm/templates/snippets/status/headers/note.html | 8 -------- 2 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 bookwyrm/templates/snippets/status/headers/generatednote.html diff --git a/bookwyrm/templates/snippets/status/headers/generatednote.html b/bookwyrm/templates/snippets/status/headers/generatednote.html new file mode 100644 index 000000000..58a65adbe --- /dev/null +++ b/bookwyrm/templates/snippets/status/headers/generatednote.html @@ -0,0 +1,11 @@ +{% if status.content == 'wants to read' %} + {% include 'snippets/status/headers/to_read.html' with book=status.mention_books.first %} +{% endif %} + +{% if status.content == 'finished reading' %} + {% include 'snippets/status/headers/read.html' with book=status.mention_books.first %} +{% endif %} + +{% if status.content == 'started reading' %} + {% include 'snippets/status/headers/reading.html' with book=status.mention_books.first %} +{% endif %} diff --git a/bookwyrm/templates/snippets/status/headers/note.html b/bookwyrm/templates/snippets/status/headers/note.html index b07b9109a..f2fda47f1 100644 --- a/bookwyrm/templates/snippets/status/headers/note.html +++ b/bookwyrm/templates/snippets/status/headers/note.html @@ -3,13 +3,6 @@ {% load status_display %} {% load utilities %} -{% if status.status_type == 'GeneratedNote' %} -{% with book=status.mention_books.first %} -{{ status.content|safe }} {{ book|book_title }} -{% endwith %} - -{% else %} - {% with parent_status=status|parent %} {% if parent_status %} {% blocktrans trimmed with username=parent_status.user.display_name user_path=parent_status.user.local_path status_path=parent_status.local_path %} @@ -18,5 +11,4 @@ replied to {{ username}}'s