mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-22 17:41:08 +00:00
Pulldown for moving books between or off shelves
This commit is contained in:
parent
1b50e83c95
commit
70cd706ce3
2 changed files with 32 additions and 10 deletions
|
@ -67,16 +67,7 @@
|
|||
</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
<form name="unshelve" 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-danger is-small" type="submit" style="">
|
||||
<span class="icon icon-x">
|
||||
<span class="is-sr-only">Remove from shelf</span>
|
||||
</span>
|
||||
</button>
|
||||
</form>
|
||||
{% include 'snippets/shelf_selector.html' with current=shelf %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
31
bookwyrm/templates/snippets/shelf_selector.html
Normal file
31
bookwyrm/templates/snippets/shelf_selector.html
Normal file
|
@ -0,0 +1,31 @@
|
|||
<div class="dropdown is-hoverable">
|
||||
<div class="dropdown-trigger button">
|
||||
<p>Change shelf</p>
|
||||
<span class="icon icon-arrow-down"></span>
|
||||
</div>
|
||||
<div class="dropdown-menu">
|
||||
<ul class="dropdown-content">
|
||||
{% for shelf in request.user.shelf_set.all %}
|
||||
{% if shelf.identifier != current.identifier %}
|
||||
<li>
|
||||
<form class="dropdown-item pt-0 pb-0" name="shelve" action="/shelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="shelf" value="{{ shelf.identifier }}">
|
||||
<button class="button is-small" type="submit">{{ shelf.name }}</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<hr class="navbar-divider">
|
||||
<li>
|
||||
<form class="dropdown-item pt-0 pb-0" 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-small is-danger" type="submit">Unshelve</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in a new issue