From aa564b26c8533cb19f389a3ab87d33c632432bba Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 14 Jan 2021 13:02:50 -0800 Subject: [PATCH] Uses snippet for toggle buttons --- bookwyrm/templates/book.html | 12 ++++++------ bookwyrm/templates/search_results.html | 8 ++------ .../snippets/content_warning_field.html | 12 ++++++------ .../templates/snippets/create_status_form.html | 3 +-- .../snippets/finish_reading_modal.html | 2 +- bookwyrm/templates/snippets/readthrough.html | 16 ++++------------ bookwyrm/templates/snippets/reply_form.html | 5 +---- bookwyrm/templates/snippets/shelve_button.html | 16 +++++----------- .../snippets/start_reading_modal.html | 2 +- bookwyrm/templates/snippets/status_body.html | 18 +++++------------- .../templates/snippets/status_content.html | 4 ++-- .../snippets/toggle/toggle_button.html | 9 +++++++++ bookwyrm/templates/snippets/trimmed_text.html | 4 ++-- 13 files changed, 45 insertions(+), 66 deletions(-) create mode 100644 bookwyrm/templates/snippets/toggle/toggle_button.html diff --git a/bookwyrm/templates/book.html b/bookwyrm/templates/book.html index 35c8dd5fe..240bef171 100644 --- a/bookwyrm/templates/book.html +++ b/bookwyrm/templates/book.html @@ -95,14 +95,14 @@ {% if request.user.is_authenticated and perms.bookwyrm.edit_book and not book|book_description %}
- +
- + {% endif %} @@ -64,9 +62,7 @@ {% endif %} {% endfor %} {% if local_results.results %} - + {% include 'snippets/toggle/toggle_button.html' with text="Hide results from other catalogues" small=True controls_text="fewer-results" %} {% endif %}
diff --git a/bookwyrm/templates/snippets/content_warning_field.html b/bookwyrm/templates/snippets/content_warning_field.html index 9249602af..91bc8ba44 100644 --- a/bookwyrm/templates/snippets/content_warning_field.html +++ b/bookwyrm/templates/snippets/content_warning_field.html @@ -2,18 +2,18 @@ {% with 0|uuid as uuid %}
- +
- +
diff --git a/bookwyrm/templates/snippets/create_status_form.html b/bookwyrm/templates/snippets/create_status_form.html index a0c6b817d..88f201162 100644 --- a/bookwyrm/templates/snippets/create_status_form.html +++ b/bookwyrm/templates/snippets/create_status_form.html @@ -27,14 +27,13 @@ {% endif %} - {% include 'snippets/content_warning_field.html' %} - {% if type == 'quote' %} {% else %} {% endif %} + {% include 'snippets/content_warning_field.html' %} {% if type == 'quote' %}
diff --git a/bookwyrm/templates/snippets/finish_reading_modal.html b/bookwyrm/templates/snippets/finish_reading_modal.html index d04d508d7..a057b29d8 100644 --- a/bookwyrm/templates/snippets/finish_reading_modal.html +++ b/bookwyrm/templates/snippets/finish_reading_modal.html @@ -37,7 +37,7 @@
-
diff --git a/bookwyrm/templates/snippets/readthrough.html b/bookwyrm/templates/snippets/readthrough.html index 682505533..7930b93f0 100644 --- a/bookwyrm/templates/snippets/readthrough.html +++ b/bookwyrm/templates/snippets/readthrough.html @@ -17,16 +17,8 @@ {% endif %}
- - + {% include 'snippets/toggle/toggle_button.html' with small=True text="Edit read dates" icon="pencil" controls_text="edit-readthrough" controls_uid=readthrough.id %} + {% include 'snippets/toggle/toggle_button.html' with small=True text="Delete these read dates" icon="x" controls_text="delete-readthrough" controls_uid=readthrough.id %}
@@ -39,7 +31,7 @@ {% include 'snippets/readthrough_form.html' with readthrough=readthrough %}
- + {% include 'snippets/toggle/toggle_button.html' with text="Cancel" controls_text="show-readthrough" controls_uid=readthrough.id %}
@@ -62,7 +54,7 @@ -