diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index cbb12e44cc..a70349bec3 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -82,6 +82,8 @@ def index(request, extra_context={}, user=None): domain=domain) context = {'universities': universities, 'entries': entries} context.update(extra_context) + if request.REQUEST.get('next', False): + context['show_login_immediately'] = True return render_to_response('index.html', context) def course_from_id(course_id): diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index c474da8d8b..7da5d06741 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -404,6 +404,9 @@ def university_profile(request, org_id): context = dict(courses=courses, org_id=org_id) template_file = "university_profile/{0}.html".format(org_id).lower() + if request.REQUEST.get('next', False): + context['show_login_immediately'] = True + return render_to_response(template_file, context) def render_notifications(request, course, notifications): diff --git a/lms/templates/index.html b/lms/templates/index.html index 0ee00b57c0..8cabe62f09 100644 --- a/lms/templates/index.html +++ b/lms/templates/index.html @@ -147,28 +147,10 @@ % if show_signup_immediately is not UNDEFINED: -% endif +% elif show_login_immediately is not UNDEFINED: + +% endif \ No newline at end of file diff --git a/lms/templates/login_modal.html b/lms/templates/login_modal.html index d7d327178c..0b19399fc0 100644 --- a/lms/templates/login_modal.html +++ b/lms/templates/login_modal.html @@ -46,7 +46,11 @@ (function() { $(document).delegate('#login_form', 'ajax:success', function(data, json, xhr) { if(json.success) { - location.href="${reverse('dashboard')}"; + % if request.REQUEST.get('next', False): + location.href="${request.REQUEST.get('next')}"; + % else: + location.href="${reverse('dashboard')}"; + % endif } else { if($('#login_error').length == 0) { $('#login_form').prepend('');