From 48c6a3923ac71f5b52670b1f118995d26dba0835 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 16 Aug 2021 13:32:20 -0700 Subject: [PATCH] Save reading status update --- bookwyrm/forms.py | 1 + .../snippets/reading_modals/finish_reading_modal.html | 1 + .../templates/snippets/reading_modals/start_reading_modal.html | 1 + .../templates/snippets/reading_modals/want_to_read_modal.html | 1 + bookwyrm/templatetags/status_display.py | 3 ++- 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bookwyrm/forms.py b/bookwyrm/forms.py index c9e795c3..e8812470 100644 --- a/bookwyrm/forms.py +++ b/bookwyrm/forms.py @@ -86,6 +86,7 @@ class CommentForm(CustomForm): "privacy", "progress", "progress_mode", + "reading_status", ] diff --git a/bookwyrm/templates/snippets/reading_modals/finish_reading_modal.html b/bookwyrm/templates/snippets/reading_modals/finish_reading_modal.html index 84e762c5..3a034693 100644 --- a/bookwyrm/templates/snippets/reading_modals/finish_reading_modal.html +++ b/bookwyrm/templates/snippets/reading_modals/finish_reading_modal.html @@ -11,6 +11,7 @@ Finish "{{ book_title }}" {% block modal-form-open %}
{% csrf_token %} + {% endblock %} {% block reading-dates %} diff --git a/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html b/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html index 6b04a32e..099fd915 100644 --- a/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html +++ b/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html @@ -10,6 +10,7 @@ Start "{{ book_title }}" {% block modal-form-open %} + {% csrf_token %} {% endblock %} diff --git a/bookwyrm/templates/snippets/reading_modals/want_to_read_modal.html b/bookwyrm/templates/snippets/reading_modals/want_to_read_modal.html index f4f214c8..9263fe32 100644 --- a/bookwyrm/templates/snippets/reading_modals/want_to_read_modal.html +++ b/bookwyrm/templates/snippets/reading_modals/want_to_read_modal.html @@ -10,5 +10,6 @@ Want to Read "{{ book_title }}" {% block modal-form-open %} + {% csrf_token %} {% endblock %} diff --git a/bookwyrm/templatetags/status_display.py b/bookwyrm/templatetags/status_display.py index 0d013775..d0390e38 100644 --- a/bookwyrm/templatetags/status_display.py +++ b/bookwyrm/templatetags/status_display.py @@ -70,7 +70,8 @@ def get_header_template(status): """get the path for the status template""" if isinstance(status, models.Boost): status = status.boosted_status - filename = "snippets/status/headers/{:s}.html".format(status.status_type.lower()) + header_type = status.reading_status or status.status_type.lower() + filename = f"snippets/status/headers/{header_type}.html" header_template = select_template([filename, "snippets/status/headers/note.html"]) return header_template.render({"status": status})