moviewyrm/fedireads/templates/snippets/shelve_button.html
2020-04-09 11:23:37 +01:00

22 lines
1 KiB
HTML

{% load fr_display %}
{% if request.user.is_authenticated %}
<div class="dropdown secondary">
<form name="shelve" action="/shelve/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}"></input>
<input type="hidden" name="shelf" value="{% shelve_button_identifier book %}"></input>
<button class="dropdown-button" type="submit" style="">{% shelve_button_text book %}</button></form><div class="dropdown-arrow" style="display: inline;"><button class="dropdown-button">&dArr;</button>
<div class="dropdown-content">
<form name="shelve" action="/shelve/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}"></input>
{% for shelf in request.user.shelf_set.all %}
<button class="secondary" name="shelf" type="submit" value="{{ shelf.identifier }}" {% if shelf in book.shelf_set.all %} disabled {% endif %}>{{ shelf.name }} {% if shelf in book.shelf_set.all %} ✓ {% endif %}</button>
{% endfor %}
</form>
</div>
</div>
</div>
{% endif %}