Commit a788db53 by Victor Shnayder

Show login modal if there's a next param to index, university index

* also replace the external-auth-related popping up of the signup form with jquery.
Presumably it takes care of the browser specific stuff.
parent 6472e0eb
......@@ -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):
......
......@@ -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):
......
......@@ -147,28 +147,10 @@
% if show_signup_immediately is not UNDEFINED:
<script type="text/javascript">
function dosignup(){
comp = document.getElementById('signup_action');
try { //in firefox
comp.click();
return;
} catch(ex) {}
try { // in old chrome
if(document.createEvent) {
var e = document.createEvent('MouseEvents');
e.initEvent( 'click', true, true );
comp.dispatchEvent(e);
return;
}
} catch(ex) {}
try { // in IE, safari
if(document.createEventObject) {
var evObj = document.createEventObject();
comp.fireEvent("onclick", evObj);
return;
}
} catch(ex) {}
}
$(window).load(dosignup);
$(window).load(function() {$('#signup_action').trigger("click");});
</script>
% endif
% elif show_login_immediately is not UNDEFINED:
<script type="text/javascript">
$(window).load(function() {$('#login').trigger("click");});
</script>
% endif
\ No newline at end of file
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