Merge pull request #1737 from MITx/diana/fix-login-dialog
Remove duplicate login dialog.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
left: 0;
|
||||
margin: 100px auto;
|
||||
top: 0;
|
||||
z-index: 200;
|
||||
height:500px;
|
||||
}
|
||||
|
||||
.login-box input[type=submit] {
|
||||
@@ -18,75 +18,18 @@
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
#lean_overlay {
|
||||
display: block;
|
||||
position: fixed;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
z-index: 100;
|
||||
width:100%;
|
||||
height:100%;
|
||||
}
|
||||
</style>
|
||||
</%block>
|
||||
|
||||
<section id="login-modal" class="modal login-modal login-box">
|
||||
<div class="inner-wrapper">
|
||||
<header>
|
||||
<h2>Log In</h2>
|
||||
<hr>
|
||||
</header>
|
||||
|
||||
<form id="login_form" class="login_form" method="post" data-remote="true" action="/login">
|
||||
<label>E-mail</label>
|
||||
<input name="email" type="email">
|
||||
<label>Password</label>
|
||||
<input name="password" type="password">
|
||||
<label class="remember-me">
|
||||
<input name="remember" type="checkbox" value="true">
|
||||
Remember me
|
||||
</label>
|
||||
<div class="submit">
|
||||
<input name="submit" type="submit" value="Access My Courses">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<section class="login-extra">
|
||||
<p>
|
||||
<span>Not enrolled? <a href="#signup-modal" class="close-login" rel="leanModal">Sign up.</a></span>
|
||||
<a href="#forgot-password-modal" rel="leanModal" class="pwd-reset">Forgot password?</a>
|
||||
</p>
|
||||
% if settings.MITX_FEATURES.get('AUTH_USE_OPENID'):
|
||||
<p>
|
||||
<a href="${MITX_ROOT_URL}/openid/login/">login via openid</a>
|
||||
</p>
|
||||
% endif
|
||||
</section>
|
||||
|
||||
<div class="close-modal">
|
||||
<div class="inner">
|
||||
<p>✕</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class='login-box'></section>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$(document).delegate('#login_form', 'ajax:success', function(data, json, xhr) {
|
||||
if(json.success) {
|
||||
next = getParameterByName('next');
|
||||
if(next) {
|
||||
location.href = next;
|
||||
} else {
|
||||
location.href = "${reverse('dashboard')}";
|
||||
}
|
||||
} else {
|
||||
if($('#login_error').length == 0) {
|
||||
$('#login_form').prepend('<div id="login_error" class="modal-form-error"></div>');
|
||||
}
|
||||
$('#login_error').html(json.value).stop().css("display", "block");
|
||||
$(document).ready(
|
||||
function() {
|
||||
// show dialog
|
||||
$('#login').click();
|
||||
}
|
||||
});
|
||||
);
|
||||
})(this)
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user