mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-26 10:00:33 +00:00
Updates buttons to call modals in shelve buttons
This commit is contained in:
parent
a576b128c3
commit
e3321c9bad
3 changed files with 21 additions and 8 deletions
10
bookwyrm/templates/snippets/shelve_button/modal_button.html
Normal file
10
bookwyrm/templates/snippets/shelve_button/modal_button.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
{% load utilities %}
|
||||
<form name="fallback_form_{{ 0|uuid }}" method="GET" action="{{ fallback_url }}" autocomplete="off">
|
||||
<button
|
||||
type="submit"
|
||||
class="button {{ class }}"
|
||||
data-modal-open="{{ modal_id }}"
|
||||
>
|
||||
{{ button_text }}
|
||||
</button>
|
||||
</form>
|
|
@ -6,7 +6,7 @@
|
|||
{% with book.id|uuid as uuid %}
|
||||
{% active_shelf book as active_shelf %}
|
||||
{% latest_read_through book request.user as readthrough %}
|
||||
<div class="field has-addons mb-0" data-shelve-button-book="{{ book.id }}">
|
||||
<div class="field has-addons mb-0 has-text-weight-normal" data-shelve-button-book="{{ book.id }}">
|
||||
{% if switch_mode and active_shelf.book != book %}
|
||||
<div class="control">
|
||||
{% include 'snippets/switch_edition_button.html' with edition=book size='is-small' %}
|
||||
|
@ -20,16 +20,16 @@
|
|||
</div>
|
||||
|
||||
{% 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 %}
|
||||
|
|
|
@ -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 %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue