diff --git a/frontend/templates/book_panel.html b/frontend/templates/book_panel.html index 6a55311f..52400da9 100644 --- a/frontend/templates/book_panel.html +++ b/frontend/templates/book_panel.html @@ -35,7 +35,7 @@ {% else %}{% if request.user.is_anonymous %}
- Add to Wishlist + Add to Wishlist
{% else %}{% if work in request.user.wishlist.works.all %}
@@ -70,7 +70,7 @@
{% else %}{% if request.user.is_anonymous %}
- Add to Wishlist + Add to Wishlist
{% else %}{% if work in request.user.wishlist.works.all %}
diff --git a/static/js/wishlist.js b/static/js/wishlist.js index 32bb10ff..890fae45 100644 --- a/static/js/wishlist.js +++ b/static/js/wishlist.js @@ -28,7 +28,9 @@ $(document).ready(function() { $(".create-account").each(function (index, element) { $(element).click(function() { - window.location = "/accounts/login/?next=" + $(location).attr('href'); + var span = $(element).find("span"); + var work_url = span.attr('title') + window.location = "/accounts/login/?next=" + work_url; }); });