From 71b2f91a73e7b871d6d1450ed7bdee7034fdfa25 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 8 Sep 2021 19:30:24 -0700 Subject: [PATCH] Ties draft functionality to more status fields --- .../templates/snippets/create_status/comment.html | 7 ++++++- .../create_status/content_warning_field.html | 4 +++- .../create_status/content_warning_toggle.html | 10 +++++++++- .../templates/snippets/create_status/layout.html | 2 +- .../templates/snippets/create_status/quotation.html | 8 +++++++- .../templates/snippets/create_status/review.html | 12 +++++++++++- 6 files changed, 37 insertions(+), 6 deletions(-) diff --git a/bookwyrm/templates/snippets/create_status/comment.html b/bookwyrm/templates/snippets/create_status/comment.html index 8f3f5c2b..4bf1fc24 100644 --- a/bookwyrm/templates/snippets/create_status/comment.html +++ b/bookwyrm/templates/snippets/create_status/comment.html @@ -35,11 +35,16 @@ uuid: a unique identifier used to make html "id" attributes unique and clarify j size="3" value="{% firstof draft.progress readthrough.progress '' %}" id="progress_{{ uuid }}" + data-cache-draft="id_progress_comment_{{ book.id }}" >
-
diff --git a/bookwyrm/templates/snippets/create_status/content_warning_toggle.html b/bookwyrm/templates/snippets/create_status/content_warning_toggle.html index 40668a42..1c7676db 100644 --- a/bookwyrm/templates/snippets/create_status/content_warning_toggle.html +++ b/bookwyrm/templates/snippets/create_status/content_warning_toggle.html @@ -1,7 +1,15 @@ {% load i18n %}
- + {% trans "Include spoiler alert" as button_text %} {% firstof draft.content_warning status.content_warning as pressed %} {% include 'snippets/toggle/toggle_button.html' with text=button_text icon="warning is-size-4" controls_text="spoilers" controls_uid=uuid focus="id_content_warning" checkbox="id_show_spoilers" class="toggle-button" pressed=pressed %} diff --git a/bookwyrm/templates/snippets/create_status/layout.html b/bookwyrm/templates/snippets/create_status/layout.html index 5b435f27..b4b11bb1 100644 --- a/bookwyrm/templates/snippets/create_status/layout.html +++ b/bookwyrm/templates/snippets/create_status/layout.html @@ -14,7 +14,7 @@ reply_parent: the Status object this post will be in reply to, if applicable {% block form_open %} {# default form tag syntax, can be overriddden #} -
+ {% endblock %} {% csrf_token %} diff --git a/bookwyrm/templates/snippets/create_status/quotation.html b/bookwyrm/templates/snippets/create_status/quotation.html index c6f1f85f..25f3199b 100644 --- a/bookwyrm/templates/snippets/create_status/quotation.html +++ b/bookwyrm/templates/snippets/create_status/quotation.html @@ -24,6 +24,7 @@ uuid: a unique identifier used to make html "id" attributes unique and clarify j id="id_quote_{{ book.id }}_{{ type }}" placeholder="{% blocktrans with book_title=book.title %}An excerpt from '{{ book_title }}'{% endblocktrans %}" required + data-cache-draft="id_quote_{{ book.id }}_{{ type }}" >{{ draft.quote|default:'' }}
@@ -32,7 +33,11 @@ uuid: a unique identifier used to make html "id" attributes unique and clarify j
-
diff --git a/bookwyrm/templates/snippets/create_status/review.html b/bookwyrm/templates/snippets/create_status/review.html index 714055a1..67214f33 100644 --- a/bookwyrm/templates/snippets/create_status/review.html +++ b/bookwyrm/templates/snippets/create_status/review.html @@ -15,7 +15,17 @@ uuid: a unique identifier used to make html "id" attributes unique and clarify j
- +