Also make the actual ?next redirection work with caching
- use js instead of django to do the redirection
This commit is contained in:
@@ -430,9 +430,6 @@ 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):
|
||||
|
||||
@@ -525,6 +525,7 @@ PIPELINE_JS = {
|
||||
'js/my_courses_dropdown.js',
|
||||
'js/toggle_login_modal.js',
|
||||
'js/sticky_filter.js',
|
||||
'js/query-params.js',
|
||||
],
|
||||
'output_filename': 'js/lms-application.js'
|
||||
},
|
||||
|
||||
@@ -147,7 +147,6 @@
|
||||
|
||||
|
||||
<%block name="js_extra">
|
||||
<script type="text/javascript" src="${static.url('js/query-params.js')}"></script>
|
||||
<script type="text/javascript"">
|
||||
$(window).load(function() {
|
||||
if(getParameterByName('next')) {
|
||||
|
||||
@@ -46,11 +46,11 @@
|
||||
(function() {
|
||||
$(document).delegate('#login_form', 'ajax:success', function(data, json, xhr) {
|
||||
if(json.success) {
|
||||
% if request.REQUEST.get('next', False):
|
||||
location.href="${request.REQUEST.get('next')}";
|
||||
% else:
|
||||
location.href="${reverse('dashboard')}";
|
||||
% endif
|
||||
if(getParameterByName('next')) {
|
||||
location.href = getParameterByName('next');
|
||||
} else {
|
||||
location.href = "${reverse('dashboard')}";
|
||||
}
|
||||
} else {
|
||||
if($('#login_error').length == 0) {
|
||||
$('#login_form').prepend('<div id="login_error" class="modal-form-error"></div>');
|
||||
|
||||
Reference in New Issue
Block a user