forked from mirrors/bookwyrm
remove from any shelf in all books shelf view
- fixes removing book from 'all books' shelf erroring - remove from any shelf item is on when in 'all books'
This commit is contained in:
parent
e247e96832
commit
c704c7eb8f
1 changed files with 18 additions and 3 deletions
|
@ -53,15 +53,30 @@
|
|||
{% endwith %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<li class="navbar-divider" role="separator"></li>
|
||||
|
||||
{% if shelf.identifier == 'all' %}
|
||||
{% for shelved_in in book.shelves.all %}
|
||||
<li class="navbar-divider m-0" role="separator" ></li>
|
||||
<li role="menuitem" class="dropdown-item p-0">
|
||||
<form name="shelve" action="/unshelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="shelf" value="{{ current.id }}">
|
||||
<button class="button is-fullwidth is-small is-radiusless is-danger is-light" type="submit">{% trans "Remove" %}</button>
|
||||
<input type="hidden" name="shelf" value="{{ shelved_in.id }}">
|
||||
<button class="button is-fullwidth is-small is-radiusless is-danger is-light" type="submit">{% trans "Remove from" %} {{ shelved_in.name }}</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<li class="navbar-divider" role="separator" ></li>
|
||||
<li role="menuitem" class="dropdown-item p-0">
|
||||
<form name="shelve" action="/unshelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="shelf" value="{{ shelf.id }}">
|
||||
<button class="button is-fullwidth is-small is-radiusless is-danger is-light" type="submit">{% trans "Remove from" %} {{ shelf.name }}</button>
|
||||
</form>
|
||||
</li>
|
||||
{% 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 %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue