2021-05-11 21:41:28 +00:00
{% load utilities %}
2022-01-18 19:20:27 +00:00
{% load shelf_tags %}
2021-05-11 22:14:42 +00:00
2020-03-27 15:10:04 +00:00
{% if request.user.is_authenticated %}
2020-02-22 00:26:52 +00:00
2020-11-17 00:34:26 +00:00
{% with book.id|uuid as uuid %}
2020-11-20 18:05:37 +00:00
{% active_shelf book as active_shelf %}
2021-03-29 19:27:12 +00:00
{% latest_read_through book request.user as readthrough %}
2022-01-18 18:22:20 +00:00
{% with active_shelf_book=active_shelf.book %}
2021-12-31 02:27:33 +00:00
< div class = "field has-addons mb-0 has-text-weight-normal" data-shelve-button-book = "{{ book.id }}" >
2022-01-18 18:22:20 +00:00
{% if switch_mode and active_shelf_book != book %}
2021-01-17 18:40:40 +00:00
< div class = "control" >
{% include 'snippets/switch_edition_button.html' with edition=book size='is-small' %}
2021-01-18 20:25:26 +00:00
< / div >
{% else %}
< div class = "control" >
2021-05-23 00:58:08 +00:00
{% include 'snippets/shelve_button/shelve_button_options.html' with class="shelf-option is-small" shelves=user_shelves active_shelf=active_shelf button_uuid=uuid %}
2021-01-18 20:25:26 +00:00
< / div >
2021-01-31 00:01:36 +00:00
{% include 'snippets/shelve_button/shelve_button_dropdown.html' with class="is-small" button_uuid=uuid%}
2020-12-16 22:45:35 +00:00
{% endif %}
2020-11-06 00:48:15 +00:00
< / div >
2021-01-17 18:10:59 +00:00
2021-12-31 02:06:33 +00:00
{% join "want_to_read" uuid as modal_id %}
2022-01-18 18:22:20 +00:00
{% include 'snippets/reading_modals/want_to_read_modal.html' with book=active_shelf_book id=modal_id class="" %}
2021-01-30 21:11:43 +00:00
2021-12-31 02:06:33 +00:00
{% join "start_reading" uuid as modal_id %}
2022-01-18 18:22:20 +00:00
{% include 'snippets/reading_modals/start_reading_modal.html' with book=active_shelf_book id=modal_id class="" %}
2021-01-17 18:10:59 +00:00
2021-12-31 02:06:33 +00:00
{% join "finish_reading" uuid as modal_id %}
2022-01-18 18:22:20 +00:00
{% include 'snippets/reading_modals/finish_reading_modal.html' with book=active_shelf_book id=modal_id readthrough=readthrough class="" %}
2021-01-17 18:10:59 +00:00
2022-02-12 18:44:06 +00:00
{% join "stop_reading" uuid as modal_id %}
{% include 'snippets/reading_modals/stop_reading_modal.html' with book=active_shelf_book id=modal_id readthrough=readthrough class="" %}
2022-02-11 13:33:46 +00:00
2021-12-31 02:06:33 +00:00
{% join "progress_update" uuid as modal_id %}
2022-01-18 18:22:20 +00:00
{% include 'snippets/reading_modals/progress_update_modal.html' with book=active_shelf_book id=modal_id readthrough=readthrough class="" %}
2021-03-21 00:18:18 +00:00
2022-01-18 18:22:20 +00:00
{% endwith %}
2020-11-17 00:34:26 +00:00
{% endwith %}
2020-03-27 15:10:04 +00:00
{% endif %}