only show own shelves in shelf_selector dropdown

This commit is contained in:
Hugh Rundle 2022-01-02 13:09:40 +11:00
parent f7c6cb3598
commit 93d59c33ff
No known key found for this signature in database
GPG key ID: CD23D6039184286B

View file

@ -63,16 +63,18 @@
{% endfor %} {% endfor %}
{% if shelf.identifier == 'all' %} {% 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 class="navbar-divider m-0" role="separator" ></li>
<li role="menuitem" class="dropdown-item p-0"> <li role="menuitem" class="dropdown-item p-0">
<form name="shelve" action="/unshelve/" method="post"> <form name="shelve" action="/unshelve/" method="post">
{% csrf_token %} {% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}"> <input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="shelf" value="{{ shelved_in.id }}"> <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" %} {{ shelved_in.name }}</button> <button class="button is-fullwidth is-small is-radiusless is-danger is-light" type="submit">{% trans "Remove from" %} {{ user_shelf.name }}</button>
</form> </form>
</li> </li>
{% endif %}
{% endfor %} {% endfor %}
{% else %} {% else %}
<li class="navbar-divider" role="separator" ></li> <li class="navbar-divider" role="separator" ></li>