Commit 12f897ee by Victor Shnayder

Also make the actual ?next redirection work with caching

- use js instead of django to do the redirection
parent de2e5c7d
...@@ -430,9 +430,6 @@ def university_profile(request, org_id): ...@@ -430,9 +430,6 @@ def university_profile(request, org_id):
context = dict(courses=courses, org_id=org_id) context = dict(courses=courses, org_id=org_id)
template_file = "university_profile/{0}.html".format(org_id).lower() 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) return render_to_response(template_file, context)
def render_notifications(request, course, notifications): def render_notifications(request, course, notifications):
......
...@@ -525,6 +525,7 @@ PIPELINE_JS = { ...@@ -525,6 +525,7 @@ PIPELINE_JS = {
'js/my_courses_dropdown.js', 'js/my_courses_dropdown.js',
'js/toggle_login_modal.js', 'js/toggle_login_modal.js',
'js/sticky_filter.js', 'js/sticky_filter.js',
'js/query-params.js',
], ],
'output_filename': 'js/lms-application.js' 'output_filename': 'js/lms-application.js'
}, },
......
...@@ -147,7 +147,6 @@ ...@@ -147,7 +147,6 @@
<%block name="js_extra"> <%block name="js_extra">
<script type="text/javascript" src="${static.url('js/query-params.js')}"></script>
<script type="text/javascript""> <script type="text/javascript"">
$(window).load(function() { $(window).load(function() {
if(getParameterByName('next')) { if(getParameterByName('next')) {
......
...@@ -46,11 +46,11 @@ ...@@ -46,11 +46,11 @@
(function() { (function() {
$(document).delegate('#login_form', 'ajax:success', function(data, json, xhr) { $(document).delegate('#login_form', 'ajax:success', function(data, json, xhr) {
if(json.success) { if(json.success) {
% if request.REQUEST.get('next', False): if(getParameterByName('next')) {
location.href="${request.REQUEST.get('next')}"; location.href = getParameterByName('next');
% else: } else {
location.href="${reverse('dashboard')}"; location.href = "${reverse('dashboard')}";
% endif }
} else { } else {
if($('#login_error').length == 0) { if($('#login_error').length == 0) {
$('#login_form').prepend('<div id="login_error" class="modal-form-error"></div>'); $('#login_form').prepend('<div id="login_error" class="modal-form-error"></div>');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment