Renaming login url for modal-less login
This commit is contained in:
@@ -367,9 +367,7 @@ def change_enrollment(request):
|
||||
@ensure_csrf_cookie
|
||||
def accounts_login(request, error=""):
|
||||
|
||||
|
||||
return render_to_response('accounts_login.html', {'error': error})
|
||||
|
||||
return render_to_response('login.html', {'error': error})
|
||||
|
||||
|
||||
# Need different levels of logging
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<%inherit file="main.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="js_extra">
|
||||
@@ -28,6 +29,19 @@
|
||||
|
||||
});
|
||||
</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>
|
||||
|
||||
<section class="login container">
|
||||
@@ -45,7 +59,7 @@
|
||||
<h2 class="is-hidden">Login Form</h2>
|
||||
</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 -->
|
||||
<div role="alert" class="status message is-hidden">
|
||||
@@ -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>
|
||||
</div>
|
||||
</aside>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ urlpatterns = ('',
|
||||
url(r'^update_certificate$', 'certificates.views.update_certificate'),
|
||||
url(r'^$', 'branding.views.index', name="root"), # Main marketing page, or redirect to courseware
|
||||
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'^admin_dashboard$', 'dashboard.views.dashboard'),
|
||||
@@ -41,8 +41,8 @@ urlpatterns = ('',
|
||||
|
||||
url(r'^accounts/login$', 'student.views.accounts_login', name="accounts_login"),
|
||||
|
||||
url(r'^login$', 'student.views.login_user', name="login"),
|
||||
url(r'^login/(?P<error>[^/]*)$', 'student.views.login_user'),
|
||||
url(r'^login_ajax$', 'student.views.login_user', name="login"),
|
||||
url(r'^login_ajax/(?P<error>[^/]*)$', 'student.views.login_user'),
|
||||
url(r'^logout$', 'student.views.logout_user', name='logout'),
|
||||
url(r'^create_account$', 'student.views.create_account'),
|
||||
url(r'^activate/(?P<key>[^/]*)$', 'student.views.activate_account', name="activate"),
|
||||
|
||||
Reference in New Issue
Block a user