diff --git a/bookwyrm/static/js/status_cache.js b/bookwyrm/static/js/status_cache.js index 2a50bfcb..418b7dee 100644 --- a/bookwyrm/static/js/status_cache.js +++ b/bookwyrm/static/js/status_cache.js @@ -187,6 +187,7 @@ let StatusCache = new class { .forEach(item => BookWyrm.addRemoveClass(item, "is-hidden", false)); // Remove existing disabled states + button.querySelectorAll("[data-shelf-dropdown-identifier] button") .forEach(item => item.disabled = false); diff --git a/bookwyrm/templates/book/book.html b/bookwyrm/templates/book/book.html index 36241ee2..713e7abe 100644 --- a/bookwyrm/templates/book/book.html +++ b/bookwyrm/templates/book/book.html @@ -153,12 +153,21 @@ {# user's relationship to the book #}
+ {% if user_shelfbooks.count > 0 %} +

+ {% trans "You have shelved this edition in:" %} +

+ + {% endif %} {% for shelf in other_edition_shelves %}

{% blocktrans with book_path=shelf.book.local_path shelf_path=shelf.shelf.local_path shelf_name=shelf.shelf.name %}A different edition of this book is on your {{ shelf_name }} shelf.{% endblocktrans %} diff --git a/bookwyrm/templates/snippets/reading_modals/finish_reading_modal.html b/bookwyrm/templates/snippets/reading_modals/finish_reading_modal.html index 3c127160..a35ed9e0 100644 --- a/bookwyrm/templates/snippets/reading_modals/finish_reading_modal.html +++ b/bookwyrm/templates/snippets/reading_modals/finish_reading_modal.html @@ -9,10 +9,11 @@ Finish "{{ book_title }}" {% endblock %} {% block modal-form-open %} -

+ {% csrf_token %} + {% endblock %} {% block reading-dates %} diff --git a/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html b/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html index cd0b64f3..423f77eb 100644 --- a/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html +++ b/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html @@ -9,8 +9,9 @@ Start "{{ book_title }}" {% endblock %} {% block modal-form-open %} - + + {% csrf_token %} {% endblock %} diff --git a/bookwyrm/templates/snippets/reading_modals/want_to_read_modal.html b/bookwyrm/templates/snippets/reading_modals/want_to_read_modal.html index d1f06d8f..2fb976bf 100644 --- a/bookwyrm/templates/snippets/reading_modals/want_to_read_modal.html +++ b/bookwyrm/templates/snippets/reading_modals/want_to_read_modal.html @@ -9,8 +9,9 @@ Want to Read "{{ book_title }}" {% endblock %} {% block modal-form-open %} - + + {% csrf_token %} {% endblock %} diff --git a/bookwyrm/templates/snippets/shelf_selector.html b/bookwyrm/templates/snippets/shelf_selector.html index ca5a39f6..4b32f5a8 100644 --- a/bookwyrm/templates/snippets/shelf_selector.html +++ b/bookwyrm/templates/snippets/shelf_selector.html @@ -1,29 +1,88 @@ {% extends 'components/dropdown.html' %} {% load i18n %} +{% load bookwyrm_tags %} +{% load utilities %} + {% block dropdown-trigger %} {% trans "Move book" %} {% endblock %} {% block dropdown-list %} +{% with book.id|uuid as uuid %} +{% active_shelf book as active_shelf %} +{% latest_read_through book request.user as readthrough %} + {% for shelf in user_shelves %} + +{% if shelf.editable %}
+{% else%} +{% comparison_bool shelf.identifier active_shelf.shelf.identifier as is_current %} +{% with button_class="is-fullwidth is-small shelf-option is-radiusless is-white" %} + +{% endwith %} +{% endif %} {% endfor %} - + +{% if shelf.identifier == 'all' %} +{% for shelved_in in book.shelves.all %} + +{% endfor %} +{% else %} + + +{% endif %} + +{% include 'snippets/reading_modals/want_to_read_modal.html' with book=active_shelf.book controls_text="want_to_read" controls_uid=uuid move_from=current.id refresh=True %} + +{% include 'snippets/reading_modals/start_reading_modal.html' with book=active_shelf.book controls_text="start_reading" controls_uid=uuid move_from=current.id refresh=True %} + +{% include 'snippets/reading_modals/finish_reading_modal.html' with book=active_shelf.book controls_text="finish_reading" controls_uid=uuid move_from=current.id readthrough=readthrough refresh=True %} + +{% endwith %} {% endblock %} diff --git a/bookwyrm/templates/snippets/shelve_button/shelve_button_dropdown_options.html b/bookwyrm/templates/snippets/shelve_button/shelve_button_dropdown_options.html index 32319f86..8c1881ce 100644 --- a/bookwyrm/templates/snippets/shelve_button/shelve_button_dropdown_options.html +++ b/bookwyrm/templates/snippets/shelve_button/shelve_button_dropdown_options.html @@ -32,7 +32,7 @@ {% elif shelf.editable %} -
+ {% csrf_token %}