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