Merge pull request #821 from mouse-reeve/shelve-buttons

Unshelve option in shelve button menu
This commit is contained in:
Mouse Reeve 2021-03-29 12:50:38 -07:00 committed by GitHub
commit 1e1d07e4e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View file

@ -3,6 +3,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">
{% if switch_mode and active_shelf.book != book %}
<div class="control">
@ -20,7 +21,6 @@
{% include 'snippets/shelve_button/start_reading_modal.html' with book=active_shelf.book controls_text="start-reading" controls_uid=uuid %}
{% latest_read_through book request.user as readthrough %}
{% include 'snippets/shelve_button/finish_reading_modal.html' with book=active_shelf.book controls_text="finish-reading" controls_uid=uuid readthrough=readthrough %}
{% include 'snippets/shelve_button/progress_update_modal.html' with book=shelf_book.book controls_text="progress-update" controls_uid=uuid readthrough=readthrough %}

View file

@ -28,6 +28,8 @@
{% if dropdown %}</li>{% endif %}
{% endfor %}
{% if dropdown %}
{% if readthrough and active_shelf.shelf.identifier != 'read' %}
<li role="menuitem">
<div class="dropdown-item pt-0 pb-0">
{% trans "Update progress" as button_text %}
@ -35,3 +37,18 @@
</div>
</li>
{% endif %}
{% if active_shelf.shelf %}
<li role="menuitem">
<div class="dropdown-item pt-0 pb-0">
<form name="shelve" action="/unshelve/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ active_shelf.book.id }}">
<input type="hidden" name="shelf" value="{{ active_shelf.shelf.id }}">
<button class="button is-fullwidth is-small is-danger is-light" type="submit">{% trans "Unshelve" %}</button>
</form>
</div>
</li>
{% endif %}
{% endif %}