From 7dba126848902d329b45681d69770fb0bebab3e3 Mon Sep 17 00:00:00 2001 From: eric Date: Mon, 5 Dec 2011 23:31:03 -0500 Subject: [PATCH] when a user is not logged in, clicking add to wishlist now ends them at the work page ...where we need to have the add functionality --- frontend/templates/book_panel.html | 4 ++-- static/js/wishlist.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) 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; }); });