forked from mirrors/bookwyrm
Merge pull request #301 from mouse-reeve/shelf-controls
Pulldown for moving books between or off shelves
This commit is contained in:
commit
5a842ca6ad
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