2020-02-21 23:39:25 +00:00
{% load fr_display %}
2020-03-27 15:10:04 +00:00
{% if request.user.is_authenticated %}
2020-02-22 00:26:52 +00:00
{% if not pulldown %}
2020-04-08 17:04:45 +00:00
< div class = "dropdown secondary" >
2020-02-22 00:26:52 +00:00
< form name = "shelve" action = "/shelve/" method = "post" >
2020-02-21 23:39:25 +00:00
{% csrf_token %}
2020-02-22 00:26:52 +00:00
< input type = "hidden" name = "book" value = "{{ book.id }}" > < / input >
< input type = "hidden" name = "shelf" value = "{% shelve_button_identifier book %}" > < / input >
2020-04-08 17:04:45 +00:00
< button class = "dropdown-button" type = "submit" style = "" > {% shelve_button_text book %}< / button > < / form > < div class = "dropdown-arrow" style = "display: inline;" > < button class = "dropdown-button" > ⇓ < / 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 %}
2020-04-09 10:23:08 +00:00
< 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 >
2020-04-08 17:04:45 +00:00
{% endfor %}
< / form >
< / div >
< / div >
< / div >
2020-02-21 23:39:25 +00:00
2020-02-22 00:26:52 +00:00
{% else %}
< form name = "shelve" action = "/shelve/" method = "post" >
{% csrf_token %}
< input type = "hidden" name = "book" value = "{{ book.id }}" > < / input >
< select name = "shelf" >
{% for shelf in request.user.shelf_set.all %}
< option value = "{{ shelf.identifier }}" { % if book in shelf . books . all % } selected { % endif % } >
{{ shelf.name }}{% if book in shelf.books.all %} ✓ {% endif %}
< / option >
{% endfor %}
< / select >
2020-03-15 21:15:36 +00:00
< button class = "secondary" type = "submit" > Shelve< / button >
2020-02-22 00:26:52 +00:00
< / form >
{% endif %}
2020-03-27 15:10:04 +00:00
{% endif %}