Commit fd002344 by Kyle Fiedler

Added new styles for errors and added flash to show the user resubmitted the form

--HG--
branch : kf-login-errors
parent 95e7c2b4
...@@ -4,7 +4,6 @@ ${ error } ...@@ -4,7 +4,6 @@ ${ error }
<div id="login_div"> <div id="login_div">
<h1>Log in to MITx</h1> <h1>Log in to MITx</h1>
<form id="login_form" method="post"> <form id="login_form" method="post">
<div id="login_error"></div>
<ol> <ol>
<li> <li>
<label>E-mail*</label> <label>E-mail*</label>
......
...@@ -122,8 +122,10 @@ $(document).ready(function(){ ...@@ -122,8 +122,10 @@ $(document).ready(function(){
function(json) { function(json) {
if(json.success) { if(json.success) {
location.href="/courseware"; location.href="/courseware";
} else if($('#login_error').length == 0) {
$('#login_form').prepend('<div id="login_error">Email or password is incorrect.</div>');
} else { } else {
$('#login_error').html("Invalid Login"); $('#login_error').stop().css("background-color", "#933").animate({ backgroundColor: "#333"}, 2000);
} }
} }
); );
......
...@@ -65,14 +65,17 @@ div.leanModal_box { ...@@ -65,14 +65,17 @@ div.leanModal_box {
text-align: left; text-align: left;
div#enroll_error, div#login_error, div#pwd_error { div#enroll_error, div#login_error, div#pwd_error {
$error-color: #333;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
background-color: #F50200; background-color: $error-color;
border: darken($error-color, 20%);
color: #fff; color: #fff;
text-shadow: 0 1px 0 darken($error-color, 10%);
font-family: "Open sans";
font-weight: bold; font-weight: bold;
letter-spacing: 1px; letter-spacing: 1px;
margin-bottom: lh(); margin: (-(lh())) (-(lh())) lh();
padding: lh(.2); padding: lh(.5);
text-transform: uppercase;
&:empty { &:empty {
padding: 0; padding: 0;
......
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