Merge pull request #1752 from hughrun/shelf-selector-fix

only show own shelves in shelf_selector dropdown
This commit is contained in:
Mouse Reeve 2022-01-02 07:14:20 -08:00 committed by GitHub
commit 73d6dbab4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,16 +63,18 @@
{% endfor %}
{% if shelf.identifier == 'all' %}
{% for shelved_in in book.shelves.all %}
{% for user_shelf in user_shelves %}
{% if user_shelf 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="{{ 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>
<input type="hidden" name="shelf" value="{{ user_shelf.id }}">
<button class="button is-fullwidth is-small is-radiusless is-danger is-light" type="submit">{% trans "Remove from" %} {{ user_shelf.name }}</button>
</form>
</li>
{% endif %}
{% endfor %}
{% else %}
<li class="navbar-divider" role="separator" ></li>