diff --git a/bookwyrm/templates/snippets/shelf_selector.html b/bookwyrm/templates/snippets/shelf_selector.html index 1bc448ec..edc291e0 100644 --- a/bookwyrm/templates/snippets/shelf_selector.html +++ b/bookwyrm/templates/snippets/shelf_selector.html @@ -12,7 +12,7 @@ diff --git a/bookwyrm/templates/user/shelf.html b/bookwyrm/templates/user/shelf.html index 8d23dce4..d1de6e00 100644 --- a/bookwyrm/templates/user/shelf.html +++ b/bookwyrm/templates/user/shelf.html @@ -111,7 +111,12 @@ {% endif %} {% if shelf.user == request.user %} - {% 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 %} {% endif %} diff --git a/bookwyrm/views/shelf.py b/bookwyrm/views/shelf.py index 971eb858..88982b26 100644 --- a/bookwyrm/views/shelf.py +++ b/bookwyrm/views/shelf.py @@ -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