From e3321c9badef2aba004a16c3ff2a1a1427a53e67 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 30 Dec 2021 18:27:33 -0800 Subject: [PATCH] Updates buttons to call modals in shelve buttons --- .../templates/snippets/shelve_button/modal_button.html | 10 ++++++++++ .../snippets/shelve_button/shelve_button.html | 10 +++++----- .../snippets/shelve_button/shelve_button_options.html | 9 ++++++--- 3 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 bookwyrm/templates/snippets/shelve_button/modal_button.html diff --git a/bookwyrm/templates/snippets/shelve_button/modal_button.html b/bookwyrm/templates/snippets/shelve_button/modal_button.html new file mode 100644 index 000000000..a745b4fba --- /dev/null +++ b/bookwyrm/templates/snippets/shelve_button/modal_button.html @@ -0,0 +1,10 @@ +{% load utilities %} +
+ +
diff --git a/bookwyrm/templates/snippets/shelve_button/shelve_button.html b/bookwyrm/templates/snippets/shelve_button/shelve_button.html index f27c18596..38f6be38c 100644 --- a/bookwyrm/templates/snippets/shelve_button/shelve_button.html +++ b/bookwyrm/templates/snippets/shelve_button/shelve_button.html @@ -6,7 +6,7 @@ {% with book.id|uuid as uuid %} {% active_shelf book as active_shelf %} {% latest_read_through book request.user as readthrough %} -
+
{% if switch_mode and active_shelf.book != book %}
{% include 'snippets/switch_edition_button.html' with edition=book size='is-small' %} @@ -20,16 +20,16 @@
{% join "want_to_read" uuid as modal_id %} -{% include 'snippets/reading_modals/want_to_read_modal.html' with book=active_shelf.book id=modal_id %} +{% include 'snippets/reading_modals/want_to_read_modal.html' with book=active_shelf.book id=modal_id class="" %} {% join "start_reading" uuid as modal_id %} -{% include 'snippets/reading_modals/start_reading_modal.html' with book=active_shelf.book id=modal_id %} +{% include 'snippets/reading_modals/start_reading_modal.html' with book=active_shelf.book id=modal_id class="" %} {% join "finish_reading" uuid as modal_id %} -{% include 'snippets/reading_modals/finish_reading_modal.html' with book=active_shelf.book id=modal_id readthrough=readthrough %} +{% include 'snippets/reading_modals/finish_reading_modal.html' with book=active_shelf.book id=modal_id readthrough=readthrough class="" %} {% join "progress_update" uuid as modal_id %} -{% include 'snippets/reading_modals/progress_update_modal.html' with book=active_shelf.book id=modal_id readthrough=readthrough %} +{% include 'snippets/reading_modals/progress_update_modal.html' with book=active_shelf.book id=modal_id readthrough=readthrough class="" %} {% endwith %} {% endif %} diff --git a/bookwyrm/templates/snippets/shelve_button/shelve_button_options.html b/bookwyrm/templates/snippets/shelve_button/shelve_button_options.html index de50b53e2..add2a77c7 100644 --- a/bookwyrm/templates/snippets/shelve_button/shelve_button_options.html +++ b/bookwyrm/templates/snippets/shelve_button/shelve_button_options.html @@ -23,19 +23,22 @@ {% trans "Start reading" as button_text %} {% url 'reading-status' 'start' book.id as fallback_url %} - {% include 'snippets/toggle/toggle_button.html' with class=class text=button_text controls_text="start_reading" controls_uid=button_uuid focus="modal_title_start_reading" fallback_url=fallback_url %} + {% join "start_reading" button_uuid as modal_id %} + {% include 'snippets/shelve_button/modal_button.html' with class=class fallback_url=fallback_url %} {% elif shelf.identifier == 'read' %} {% trans "Finish reading" as button_text %} {% url 'reading-status' 'finish' book.id as fallback_url %} - {% include 'snippets/toggle/toggle_button.html' with class=class text=button_text controls_text="finish_reading" controls_uid=button_uuid focus="modal_title_finish_reading" fallback_url=fallback_url %} + {% join "finish_reading" button_uuid as modal_id %} + {% include 'snippets/shelve_button/modal_button.html' with class=class fallback_url=fallback_url %} {% elif shelf.identifier == 'to-read' %} {% trans "Want to read" as button_text %} {% url 'reading-status' 'want' book.id as fallback_url %} - {% include 'snippets/toggle/toggle_button.html' with class=class text=button_text controls_text="want_to_read" controls_uid=button_uuid focus="modal_title_want_to_read" fallback_url=fallback_url %} + {% join "want_to_read" button_uuid as modal_id %} + {% include 'snippets/shelve_button/modal_button.html' with class=class fallback_url=fallback_url %} {% elif shelf.editable %}