forked from mirrors/bookwyrm
Merge pull request #838 from mouse-reeve/reshelve-fix
Fixes re-shelving books from all books view
This commit is contained in:
commit
6e66154e35
3 changed files with 9 additions and 4 deletions
|
@ -12,7 +12,7 @@
|
|||
<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="change-shelf-from" value={{ current.identifier }}>
|
||||
<input type="hidden" name="change-shelf-from" value="{{ current.identifier }}">
|
||||
<input type="hidden" name="shelf" value="{{ shelf.identifier }}">
|
||||
<button class="button is-fullwidth is-small" type="submit">{{ shelf.name }}</button>
|
||||
</form>
|
||||
|
|
|
@ -111,7 +111,12 @@
|
|||
{% endif %}
|
||||
{% if shelf.user == request.user %}
|
||||
<td>
|
||||
{% include 'snippets/shelf_selector.html' with current=shelf %}
|
||||
{% if not shelf.id %}
|
||||
{% active_shelf book as current %}
|
||||
{% include 'snippets/shelf_selector.html' with current=current.shelf class="is-small" %}
|
||||
{% else %}
|
||||
{% include 'snippets/shelf_selector.html' with current=shelf class="is-small" %}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
|
|
|
@ -102,7 +102,7 @@ def create_shelf(request):
|
|||
return redirect(request.headers.get("Referer", "/"))
|
||||
|
||||
shelf = form.save()
|
||||
return redirect("/user/%s/shelf/%s" % (request.user.localname, shelf.identifier))
|
||||
return redirect(shelf.local_path)
|
||||
|
||||
|
||||
@login_required
|
||||
|
@ -114,7 +114,7 @@ def delete_shelf(request, shelf_id):
|
|||
return HttpResponseBadRequest()
|
||||
|
||||
shelf.delete()
|
||||
return redirect("/user/%s/shelves" % request.user.localname)
|
||||
return redirect("user-shelves", request.user.localname)
|
||||
|
||||
|
||||
@login_required
|
||||
|
|
Loading…
Reference in a new issue