Commit fd36c555 by John Jarvis

Renaming login url for modal-less login

parent bfbd7de0
...@@ -367,9 +367,7 @@ def change_enrollment(request): ...@@ -367,9 +367,7 @@ def change_enrollment(request):
@ensure_csrf_cookie @ensure_csrf_cookie
def accounts_login(request, error=""): def accounts_login(request, error=""):
return render_to_response('login.html', {'error': error})
return render_to_response('accounts_login.html', {'error': error})
# Need different levels of logging # Need different levels of logging
......
<%inherit file="main.html" /> <%inherit file="main.html" />
<%namespace name='static' file='static_content.html'/> <%namespace name='static' file='static_content.html'/>
<%! from django.core.urlresolvers import reverse %>
<%block name="title"><title>Log into your edX Account</title></%block> <%block name="title"><title>Log into your edX Account</title></%block>
<%block name="js_extra"> <%block name="js_extra">
...@@ -28,6 +29,19 @@ ...@@ -28,6 +29,19 @@
}); });
</script> </script>
<script type="text/javascript">
(function() {
$(document).delegate('#login-form', 'ajax:success', function(data, json, xhr) {
if(json.success) {
location.href="${reverse('dashboard')}";
}
});
})(this)
</script>
</%block> </%block>
<section class="login container"> <section class="login container">
...@@ -45,7 +59,7 @@ ...@@ -45,7 +59,7 @@
<h2 class="is-hidden">Login Form</h2> <h2 class="is-hidden">Login Form</h2>
</header> </header>
<form role="form" id="login-form" method="post" data-remote="true" action="/login"> <form role="form" id="login-form" method="post" data-remote="true" action="/login_ajax">
<!-- status messages --> <!-- status messages -->
<div role="alert" class="status message is-hidden"> <div role="alert" class="status message is-hidden">
...@@ -117,4 +131,5 @@ ...@@ -117,4 +131,5 @@
<p>Looking for help in logging in or with your edX account? <a href="#">View our help section for answers to commonly asked questions</a></p> <p>Looking for help in logging in or with your edX account? <a href="#">View our help section for answers to commonly asked questions</a></p>
</div> </div>
</aside> </aside>
</section> </section>
...@@ -15,7 +15,7 @@ urlpatterns = ('', ...@@ -15,7 +15,7 @@ urlpatterns = ('',
url(r'^update_certificate$', 'certificates.views.update_certificate'), url(r'^update_certificate$', 'certificates.views.update_certificate'),
url(r'^$', 'branding.views.index', name="root"), # Main marketing page, or redirect to courseware url(r'^$', 'branding.views.index', name="root"), # Main marketing page, or redirect to courseware
url(r'^dashboard$', 'student.views.dashboard', name="dashboard"), url(r'^dashboard$', 'student.views.dashboard', name="dashboard"),
url(r'^signin$', 'student.views.signin_user', name="signin_user"), url(r'^login$', 'student.views.signin_user', name="signin_user"),
url(r'^register$', 'student.views.register_user', name="register_user"), url(r'^register$', 'student.views.register_user', name="register_user"),
url(r'^admin_dashboard$', 'dashboard.views.dashboard'), url(r'^admin_dashboard$', 'dashboard.views.dashboard'),
...@@ -41,8 +41,8 @@ urlpatterns = ('', ...@@ -41,8 +41,8 @@ urlpatterns = ('',
url(r'^accounts/login$', 'student.views.accounts_login', name="accounts_login"), url(r'^accounts/login$', 'student.views.accounts_login', name="accounts_login"),
url(r'^login$', 'student.views.login_user', name="login"), url(r'^login_ajax$', 'student.views.login_user', name="login"),
url(r'^login/(?P<error>[^/]*)$', 'student.views.login_user'), url(r'^login_ajax/(?P<error>[^/]*)$', 'student.views.login_user'),
url(r'^logout$', 'student.views.logout_user', name='logout'), url(r'^logout$', 'student.views.logout_user', name='logout'),
url(r'^create_account$', 'student.views.create_account'), url(r'^create_account$', 'student.views.create_account'),
url(r'^activate/(?P<key>[^/]*)$', 'student.views.activate_account', name="activate"), url(r'^activate/(?P<key>[^/]*)$', 'student.views.activate_account', name="activate"),
......
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