From a922b8fd04b6f7188e58153fc15f1a9ea8f72536 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 10 Mar 2022 09:03:24 -0800 Subject: [PATCH] Uses details to show/hide content warning field --- .../create_status/content_warning_field.html | 49 ++++++++++++------- .../create_status/content_warning_toggle.html | 17 ------- .../snippets/create_status/layout.html | 4 +- 3 files changed, 32 insertions(+), 38 deletions(-) delete mode 100644 bookwyrm/templates/snippets/create_status/content_warning_toggle.html diff --git a/bookwyrm/templates/snippets/create_status/content_warning_field.html b/bookwyrm/templates/snippets/create_status/content_warning_field.html index 14428f30d..2a2161f71 100644 --- a/bookwyrm/templates/snippets/create_status/content_warning_field.html +++ b/bookwyrm/templates/snippets/create_status/content_warning_field.html @@ -1,22 +1,33 @@ {% load i18n %} -
- - +
+ + + + {% trans "Include spoiler alert" %} + + + + + +
+ +
+
diff --git a/bookwyrm/templates/snippets/create_status/content_warning_toggle.html b/bookwyrm/templates/snippets/create_status/content_warning_toggle.html deleted file mode 100644 index a5c41cbcb..000000000 --- a/bookwyrm/templates/snippets/create_status/content_warning_toggle.html +++ /dev/null @@ -1,17 +0,0 @@ -{% load i18n %} - -
- - {% trans "Include spoiler alert" as button_text %} - {% firstof draft.content_warning status.content_warning as pressed %} - {% firstof local_uuid '' as local_uuid %} - {% include 'snippets/toggle/toggle_button.html' with text=button_text icon="warning is-size-4" controls_text="spoilers" controls_uid=uuid|add:local_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 0585638d9..915e5114b 100644 --- a/bookwyrm/templates/snippets/create_status/layout.html +++ b/bookwyrm/templates/snippets/create_status/layout.html @@ -37,8 +37,6 @@ reply_parent: the Status object this post will be in reply to, if applicable {% endif %} {% endblock %} - {% include "snippets/create_status/content_warning_field.html" %} - {# fields that go between the content warnings and the content field (ie, quote) #} {% block pre_content_additions %}{% endblock %} @@ -55,6 +53,8 @@ reply_parent: the Status object this post will be in reply to, if applicable {# additional fields that go after the content block (ie, progress) #} {% block post_content_additions %}{% endblock %} + {% include "snippets/create_status/content_warning_field.html" %} + {% block options_block %} {# cw, post privacy, and submit button #} {% include "snippets/create_status/post_options_block.html" %}