Merge pull request #258 from warpc/230-error_messages

[refs #230] Fix error messages + some refactoring
This commit is contained in:
Vladimir Sharshov 2012-03-02 04:55:55 -08:00
commit 6bb3d36c81
12 changed files with 632 additions and 556 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -1,55 +1,23 @@
function disError(elem) {
$("#hint").fadeOut("fast");
if (document.getElementById("user_login").className=="registartion-input-error") {
if (this.id=="user_login") {
document.getElementById("user_login").className="registartion-input-focus";
} else {
document.getElementById("user_login").className="registartion-input-no-focus";
}
}
if (document.getElementById("user_password").className=="registartion-input-error") {
if (this.id=="user_password") {
document.getElementById("user_password").className="registartion-input-focus";
} else {
document.getElementById("user_password").className="registartion-input-no-focus";
}
}
buttonCheck();
}
//= require jquery
function buttonCheck() {
var login_default = document.getElementById("login_default").value;
var pass_default = document.getElementById("password_default").value;
if ((document.getElementById("user_login").value!="")&&(document.getElementById("user_login").value!=login_default)&&
(document.getElementById("user_password").value!="")&&(document.getElementById("user_password").value!=pass_default)) {
document.getElementById("btnLogin").className = "button";
} else {
document.getElementById("btnLogin").className = "button disabled";
}
}
$(document).ready(function() {
var login_default = $('#login_default').val();
var pass_default = $('#password_default').val();
function changeCheck(el) {
var el = el,
input = el.getElementsByTagName("input")[0];
$('.registartion-input').live('keydown', function() {
var id = $(this).attr('id');
if(id == 'user_login' || id == 'user_password') { id = 'login_error'}
$('.error.'+id).fadeOut('slow');
}).live('focus', function() {
var id = $(this).attr('id');
if(id == 'user_login' && $(this).val() == login_default) { $(this).val('')}
else if(id == 'user_password' && $(this).val() == pass_default) { $(this).val('')}
$(this).addClass('registartion-input-focus').removeClass('registartion-input-error');
}).live('blur', function() {
var id = $(this).attr('id');
if(id == 'user_login') { $(this).val(login_default)}
else if(id == 'user_password') {$(this).val(pass_default)}
$(this).addClass('registartion-input-no-focus').removeClass('registartion-input-focus');
});
if(input.checked) {
el.style.backgroundPosition="0 0";
input.checked=false;
}
else {
el.style.backgroundPosition="0 -17px";
input.checked=true;
}
return true;
}
function startChangeCheck(el) {
var el = el,
input = el.getElementsByTagName("input")[0];
if(input.checked) { el.style.backgroundPosition="0 -17px"; }
return true;
}
function startCheck() {
startChangeCheck(document.getElementById("niceCheckbox1"));
}
});

View File

@ -0,0 +1,326 @@
html, body {
margin: 0;
padding: 0;
font-family: Tahoma, Geneva, Helvetica, sans-serif;
color: #565667;
background: #1f60a1 image-url("bg.png") repeat-x;
min-width: 940px;
min-height: 300px;
text-align: center;
height: 100%;
}
header, section, footer, aside, nav, article, menu {
display: block;
}
input[type="text"]:focus { outline: none; }
input[type="password"]:focus { outline: none; }
input:focus { outline: none; }
select:focus { outline: none; }
a img { border: none; }
.wrap {
width: 940px;
margin: 0 auto;
text-align: center;
min-height: 95%;
}
.both {
clear: both;
}
/* Header */
header div.logo {
background: image-url("logo.png") no-repeat 50% 100%;
height: 89px;
width: 233px;
margin: 0 auto;
text-align: center;
padding-top: 12%;
}
header div.text {
color: #FFF;
font-size: 28px;
width: 800px;
text-align: left;
margin-left: 90px;
margin-top: 50px;
font-family: Arial;
text-shadow: 0px 1px 1px #000000;
filter: dropshadow(color=#000000, offx=0, offy=1);
padding-left: 0px;
}
.niceCheck {
width: 17px;
height: 17px;
display: inline-block;
cursor: pointer;
background: image-url("checkbox.png");
}
.niceCheck input {
display: none;
}
/* Content */
article {
width: 257px;
height: 227px;
background: #1c394c image-url("bg-signup.png") repeat-x;
border-radius: 5px;
border: 1px solid #38658c;
margin: 0 auto;
text-align: center;
margin-top: 75px;
-webkit-box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.5);
box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.5);
}
a.button, input.button {
background: #125687;
background: image-url("button-green-normal.png");
border-radius: 3px;
color: #FFF;
font-family: Tahoma;
font-size: 12px;
-webkit-font-smoothing: antialiased;
font-weight: normal;
padding: 5px 25px;
text-align: center;
border: none;
height: 25px;
width: 106px;
text-decoration: none;
}
input.button {
padding: 3px 27px 8px 27px;
height: 25px;
width: auto;
}
a.button:hover, input.button:hover {
background: #1874b6;
background: image-url("button-green-hover.png");
cursor: pointer;
}
a.button:active, input.button:active{
background: image-url("button-green-press.png");
}
a.button:disabled, a.button.disabled, input.button:disabled, input.button.disabled {
background: #125687;
background: image-url("button-green-disabled.png");
cursor: default;
}
article h1 {
color: #FFF;
font-size: 18px;
font-weight: normal;
font-family: Tahoma;
margin-bottom: 5px;
}
.registartion-input, .registartion-input-focus, .registartion-input-error, .registartion-input-no-focus {
height: 24px;
width: 217px;
border: 1px solid #8199a9;
border-radius: 2px;
color: #cfcfcf;
font-family: Tahoma;
font-size: 12px;
padding-left: 10px;
margin-top: 10px;
}
.registartion-input-focus, .registartion-input-focus-signup {
color: #575756;
-webkit-box-shadow: 0px 0px 7px 2px rgba(126, 183, 237, 0.75);
-moz-box-shadow: 0px 0px 7px 2px rgba(126, 183, 237, 0.75);
box-shadow: 0px 0px 7px 2px rgba(126, 183, 237, 0.75);
}
.registartion-input-no-focus, .registartion-input-no-focus-signup {
color: #575756;
}
.registartion-input-error, .registartion-input-error-signup {
border: 1px solid #bd4d40;
outline:1px solid #bd4d40;
outline-offset:-2px;
}
div.registration div.remember{
color: #FFF;
font-size: 12px;
float: left;
padding-left: 15px;
padding-top: 5px;
}
div.registration div.remember div.check {
float: left;
margin-top: 15px;
margin-right: 4px;
}
div.registration div.remember div.text {
float: left;
margin-top: 15px;
}
div.registration div.in {
float: right;
padding-right: 15px;
padding-top: 15px;
}
div.hr {
margin-top: 10px;
height: 1px;
width: 100%;
border-bottom: 1px solid #264862;
border-top: 1px solid #264862;
}
article div.other div.left{
float: left;
font-size: 12px;
color: #FFFFFF;
margin-top: 6px;
margin-left: 15px;
}
article div.other div.right {
float: right;
margin-right: 15px;
margin-top: 13px;
}
div.forgot {
width: 257px;
text-align: center;
margin: 0 auto;
}
div.password {
float: right;
padding-top: 4px;
}
div.password p {
margin: 0;
padding: 0;
}
div.password a {
color: #FFF;
font-size: 12px;
text-decoration: none;
}
div.password a:hover {
text-decoration: underline;
}
nav {
width: 96px;
height: 47px;
background: image-url("registration.png") no-repeat;
float: right;
cursor: pointer;
}
nav p {
font-size: 14px;
color: #FFF;
margin: 0;
padding: 0;
padding-top: 10px;
}
div.error {
width: auto;
height: auto;
font-size: 12px;
position: absolute;
margin-top: -159px;
margin-left: 582px;
display: none;
}
div.error div.img {
background: image-url("error-arrow.png") 0% 5px no-repeat;
width: 19px;
height: 35px;
float: left;
}
div.error div.msg {
background: #ededed;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
width: auto;
height: auto;
float: left;
-webkit-box-shadow: 0px 6px 3px -3px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0px 6px 3px -3px rgba(0, 0, 0, 0.2);
box-shadow: 0px 6px 3px -3px rgba(0, 0, 0, 0.2);
padding: 5px 20px 5px;
}
div.error p{
margin:0;
padding: 0;
text-align: center;
}
/* Footer */
footer {
height: 32px;
padding-left: 15px;
width: 900px;
margin: 0 auto;
text-align: center;
}
footer ul {
margin: 0;
padding: 0;
list-style: none;
font-size: 12px;
color: #FFF;
padding-top: 10px;
text-align: center;
}
footer ul li {
display: inline;
}
footer ul li a {
font-size: 12px;
color: #FFF;
text-decoration: none;
}
footer ul li a:hover {
text-decoration: underline;
}

View File

@ -1,223 +1,285 @@
html, body {
margin: 0;
padding: 0;
font-family: Tahoma, Geneva, Helvetica, sans-serif;
color: #565667;
background: #1f60a1 image-url("bg.png") repeat-x;
min-width: 940px;
min-height: 300px;
text-align: center;
height: 100%; }
margin: 0;
padding: 0;
font-family: Tahoma, Geneva, Helvetica, sans-serif;
color: #565667;
background: #1f60a1 image-url("bg.png") repeat-x;
min-width: 940px;
min-height: 300px;
text-align: center;
height: 100%;
}
header, section, footer, aside, nav, article, menu {
display: block; }
display: block;
}
input {
&[type="text"]:focus, &[type="password"]:focus, &:focus {
outline: none; } }
select:focus {
outline: none; }
a img {
border: none; }
input[type="text"]:focus { outline: none; }
input[type="password"]:focus { outline: none; }
input:focus { outline: none; }
select:focus { outline: none; }
a img { border: none; }
.wrap {
width: 940px;
margin: 0 auto;
text-align: center;
min-height: 95%; }
width: 940px;
margin: 0 auto;
text-align: center;
min-height: 95%;
}
.both {
clear: both; }
clear: both;
}
/* Header */
header div {
&.logo {
background: image-url("logo.png") no-repeat 50% 100%;
height: 89px;
width: 233px;
margin: 0 auto;
text-align: center;
padding-top: 12%; }
&.text {
color: #FFF;
font-size: 28px;
width: 800px;
text-align: left;
margin-left: 90px;
margin-top: 50px;
font-family: Arial;
text-shadow: 0px 1px 1px #000000;
filter: dropshadow(color = black, offx = 0, offy = 1);
padding-left: 0px; } }
header div.logo {
background: image-url("logo.png") no-repeat 50% 100%;
height: 89px;
width: 233px;
margin: 0 auto;
text-align: center;
padding-top: 12%;
}
header div.text {
color: #FFF;
font-size: 28px;
width: 800px;
text-align: left;
margin-left: 90px;
margin-top: 50px;
font-family: Arial;
text-shadow: 0px 1px 1px #000000;
filter: dropshadow(color=#000000, offx=0, offy=1);
padding-left: 0px;
}
.niceCheck {
width: 17px;
height: 17px;
display: inline-block;
cursor: pointer;
background: image-url("checkbox.png");
input {
display: none; } }
width: 17px;
height: 17px;
display: inline-block;
cursor: pointer;
background: image-url("checkbox.png");
}
.niceCheck input {
display: none;
}
/* Content */
article {
width: 380px;
height: 254px;
background: #1c394c image-url("bg-signup.png") repeat-x;
border-radius: 5px;
border: 1px solid #38658c;
margin: 0 auto;
text-align: center;
margin-top: 75px;
-webkit-box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.5);
box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.5); }
width: 380px;
height: 254px;
background: #1c394c image-url("bg-signup.png") repeat-x;
border-radius: 5px;
border: 1px solid #38658c;
margin: 0 auto;
text-align: center;
margin-top: 75px;
-webkit-box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.5);
box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.5);
}
a.button, input.button {
background: #125687;
background: image-url("button-green-normal.png");
border-radius: 3px;
color: #FFF;
font-family: Tahoma;
font-size: 12px;
-webkit-font-smoothing: antialiased;
font-weight: normal;
padding: 5px 25px;
text-align: center;
border: none;
height: 25px;
width: 106px;
text-decoration: none; }
article div {
&.left {
float: left;
font-size: 12px;
background: #125687;
background: image-url("button-green-normal.png");
border-radius: 3px;
color: #FFF;
margin-left: 15px;
margin-top: 16px; }
&.right {
float: right;
margin-right: 15px;
padding-bottom: 2px; } }
font-family: Tahoma;
font-size: 12px;
-webkit-font-smoothing: antialiased;
font-weight: normal;
padding: 5px 25px;
text-align: center;
border: none;
height: 25px;
width: 106px;
text-decoration: none;
}
article div.left {
float: left;
font-size: 12px;
color: #FFF;
margin-left: 15px;
margin-top: 16px;
}
article div.right {
float: right;
margin-right: 15px;
padding-bottom: 2px;
}
.first {
padding-top: 5px; }
padding-top: 5px;
}
input.button {
padding: 3px 27px 8px 27px;
height: 25px;
width: auto; }
padding: 3px 27px 8px 27px;
height: 25px;
width: auto;
}
a.button:hover, input.button:hover {
background: #1874b6;
background: image-url("button-green-hover.png");
cursor: pointer; }
background: #1874b6;
background: image-url("button-green-hover.png");
cursor: pointer;
}
a.button:active, input.button:active {
background: image-url("button-green-press.png"); }
a.button:active, input.button:active{
background: image-url("button-green-press.png");
}
a.button {
&:disabled, &.disabled {
a.button:disabled, a.button.disabled, input.button:disabled, input.button.disabled{
background: #125687;
background: image-url("button-green-disabled.png");
cursor: default; } }
input.button {
&:disabled, &.disabled {
background: #125687;
background: image-url("button-green-disabled.png");
cursor: default; } }
background: image-url("button-green-disabled.png");
cursor: default;
}
article h1 {
color: #FFF;
font-size: 18px;
font-weight: normal;
font-family: Tahoma;
margin-bottom: 5px; }
color: #FFF;
font-size: 18px;
font-weight: normal;
font-family: Tahoma;
margin-bottom: 5px;
}
.registartion-input, .registartion-input-focus, .registartion-input-error, .registartion-input-no-focus {
height: 24px;
width: 217px;
border: 1px solid #8199a9;
border-radius: 2px;
color: #cfcfcf;
font-family: Tahoma;
font-size: 12px;
padding-left: 10px;
margin-top: 10px; }
height: 24px;
width: 217px;
border: 1px solid #8199a9;
border-radius: 2px;
color: #cfcfcf;
font-family: Tahoma;
font-size: 12px;
padding-left: 10px;
margin-top: 10px;
}
.registartion-input-focus, .registartion-input-focus-signup {
color: #575756;
-webkit-box-shadow: 0px 0px 7px 2px rgba(126, 183, 237, 0.75);
-moz-box-shadow: 0px 0px 7px 2px rgba(126, 183, 237, 0.75);
box-shadow: 0px 0px 7px 2px rgba(126, 183, 237, 0.75); }
color: #575756;
-webkit-box-shadow: 0px 0px 7px 2px rgba(126, 183, 237, 0.75);
-moz-box-shadow: 0px 0px 7px 2px rgba(126, 183, 237, 0.75);
box-shadow: 0px 0px 7px 2px rgba(126, 183, 237, 0.75);
}
.registartion-input-no-focus, .registartion-input-no-focus-signup {
color: #575756; }
color: #575756;
}
.registartion-input-error, .registartion-input-error-signup {
border: 1px solid #bd4d40;
outline: 1px solid #bd4d40;
outline-offset: -2px; }
border: 1px solid #bd4d40;
outline:1px solid #bd4d40;
outline-offset:-2px;
}
div.in {
float: right;
margin-right: 15px;
margin-top: 12px; }
float: right;
margin-right: 15px;
margin-top: 12px;
}
/* Footer */
footer {
height: 32px;
padding-left: 15px;
width: 900px;
margin: 0 auto;
text-align: center;
ul {
margin: 0;
padding: 0;
list-style: none;
font-size: 12px;
color: #FFF;
padding-top: 10px;
text-align: center;
li {
display: inline;
a {
font-size: 12px;
color: #FFF;
text-decoration: none;
&:hover {
text-decoration: underline; } } } } }
height: 32px;
padding-left: 15px;
width: 900px;
margin: 0 auto;
text-align: center;
}
footer ul {
margin: 0;
padding: 0;
list-style: none;
font-size: 12px;
color: #FFF;
padding-top: 10px;
text-align: center;
}
footer ul li {
display: inline;
}
footer ul li a {
font-size: 12px;
color: #FFF;
text-decoration: none;
}
footer ul li a:hover {
text-decoration: underline;
}
div.error {
background: image-url("error-message.png");
width: 237px;
height: 35px;
font-size: 12px;
position: absolute;
margin-top: -159px;
margin-left: 582px;
//display: none;
p {
margin: 0;
padding: 0;
padding-top: 7px;
text-align: center; }
&.login {
margin-top: -242px;
margin-left: 650px; }
&.name {
margin-top: -202px;
margin-left: 650px; }
&.email {
margin-top: -161px;
margin-left: 650px; }
&.password {
margin-top: -101px;
margin-left: 650px; } }
width: auto;
height: auto;
font-size: 12px;
position: absolute;
margin-top: -159px;
margin-left: 582px;
display: none;
text-align: left;
}
div.error div.img {
background: image-url("error-arrow.png") 0% 5px no-repeat;
width: 19px;
height: 35px;
float: left;
}
div.error div.msg {
background: #ededed;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
width: auto;
height: auto;
float: left;
-webkit-box-shadow: 0px 6px 3px -3px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0px 6px 3px -3px rgba(0, 0, 0, 0.2);
box-shadow: 0px 6px 3px -3px rgba(0, 0, 0, 0.2);
padding: 5px 20px 5px;
}
div.error p{
margin:0;
padding: 0;
text-align: center;
}
div.error.login {
margin-top: -242px;
margin-left: 650px;
}
div.error.name {
margin-top: -202px;
margin-left: 650px;
}
div.error.email {
margin-top: -161px;
margin-left: 650px;
}
div.error.password {
margin-top: -101px;
margin-left: 650px;
}

View File

@ -1,276 +1,3 @@
html, body {
margin: 0;
padding: 0;
font-family: Tahoma, Geneva, Helvetica, sans-serif;
color: #565667;
background: #1f60a1 image-url("bg.png") repeat-x;
min-width: 940px;
min-height: 300px;
text-align: center;
height: 100%; }
@import 'devise/login';
header, section, footer, aside, nav, article, menu {
display: block; }
input {
&[type="text"]:focus, &[type="password"]:focus, &:focus {
outline: none; } }
select:focus {
outline: none; }
a img {
border: none; }
.wrap {
width: 940px;
margin: 0 auto;
text-align: center;
min-height: 95%; }
.both {
clear: both; }
/* Header */
header div {
&.logo {
background: image-url("logo.png") no-repeat 50% 100%;
height: 89px;
width: 233px;
margin: 0 auto;
text-align: center;
padding-top: 12%; }
&.text {
color: #FFF;
font-size: 28px;
width: 800px;
text-align: left;
margin-left: 90px;
margin-top: 50px;
font-family: Arial;
text-shadow: 0px 1px 1px #000000;
filter: dropshadow(color = black, offx = 0, offy = 1);
padding-left: 0px; } }
.niceCheck {
width: 17px;
height: 17px;
display: inline-block;
cursor: pointer;
background: image-url("checkbox.png");
input {
display: none; } }
/* Content */
article {
width: 257px;
height: 227px;
background: #1c394c image-url("bg-signup.png") repeat-x;
border-radius: 5px;
border: 1px solid #38658c;
margin: 0 auto;
text-align: center;
margin-top: 75px;
-webkit-box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.5);
box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.5); }
a.button {
background: #125687;
background: image-url("button-green-normal.png");
border-radius: 3px;
color: #FFF;
font-family: Tahoma;
font-size: 12px;
-webkit-font-smoothing: antialiased;
font-weight: normal;
padding: 5px 25px;
text-align: center;
border: none;
height: 25px;
width: 106px;
text-decoration: none; }
input.button {
background: #125687;
background: image-url("button-green-normal.png");
border-radius: 3px;
color: #FFF;
font-family: Tahoma;
font-size: 12px;
-webkit-font-smoothing: antialiased;
font-weight: normal;
padding: 5px 25px;
text-align: center;
border: none;
height: 25px;
width: 106px;
text-decoration: none;
padding: 3px 27px 8px 27px;
height: 25px;
width: auto; }
a.button:hover, input.button:hover {
background: #1874b6;
background: image-url("button-green-hover.png");
cursor: pointer; }
a.button:active, input.button:active {
background: image-url("button-green-press.png"); }
a.button {
&:disabled, &.disabled {
background: #125687;
background: image-url("button-green-disabled.png");
cursor: default; } }
input.button {
&:disabled, &.disabled {
background: #125687;
background: image-url("button-green-disabled.png");
cursor: default; } }
article h1 {
color: #FFF;
font-size: 18px;
font-weight: normal;
font-family: Tahoma;
margin-bottom: 5px; }
.registartion-input, .registartion-input-focus, .registartion-input-error, .registartion-input-no-focus {
height: 24px;
width: 217px;
border: 1px solid #8199a9;
border-radius: 2px;
color: #cfcfcf;
font-family: Tahoma;
font-size: 12px;
padding-left: 10px;
margin-top: 10px; }
.registartion-input-focus, .registartion-input-focus-signup {
color: #575756;
-webkit-box-shadow: 0px 0px 7px 2px rgba(126, 183, 237, 0.75);
-moz-box-shadow: 0px 0px 7px 2px rgba(126, 183, 237, 0.75);
box-shadow: 0px 0px 7px 2px rgba(126, 183, 237, 0.75); }
.registartion-input-no-focus, .registartion-input-no-focus-signup {
color: #575756; }
.registartion-input-error, .registartion-input-error-signup {
border: 1px solid #bd4d40;
outline: 1px solid #bd4d40;
outline-offset: -2px; }
div {
&.registration div {
&.remember {
color: #FFF;
font-size: 12px;
float: left;
padding-left: 15px;
padding-top: 5px;
div {
&.check {
float: left;
margin-top: 15px;
margin-right: 4px; }
&.text {
float: left;
margin-top: 15px; } } }
&.in {
float: right;
padding-right: 15px;
padding-top: 15px; } }
&.hr {
margin-top: 10px;
height: 1px;
width: 100%;
border-bottom: 1px solid #264862;
border-top: 1px solid #264862; } }
article div.other div {
&.left {
float: left;
font-size: 12px;
color: #FFFFFF;
margin-top: 6px;
margin-left: 15px; }
&.right {
float: right;
margin-right: 15px;
margin-top: 13px; } }
div {
&.forgot {
width: 257px;
text-align: center;
margin: 0 auto; }
&.password {
float: right;
padding-top: 4px;
p {
margin: 0;
padding: 0; }
a {
color: #FFF;
font-size: 12px;
text-decoration: none;
&:hover {
text-decoration: underline; } } } }
nav {
width: 96px;
height: 47px;
background: image-url("registration.png") no-repeat;
float: right;
cursor: pointer;
a {
font-size: 14px;
color: #FFF;
margin: 0;
padding: 0;
padding-top: 10px;
text-decoration: none;} }
div.error {
background: image-url("error-message.png");
width: 237px;
height: 35px;
font-size: 12px;
position: absolute;
margin-top: -159px;
margin-left: 582px;
display: none;
p {
margin: 0;
padding: 0;
padding-top: 7px;
text-align: center; } }
/* Footer */
footer {
height: 32px;
padding-left: 15px;
width: 900px;
margin: 0 auto;
text-align: center;
ul {
margin: 0;
padding: 0;
list-style: none;
font-size: 12px;
color: #FFF;
padding-top: 10px;
text-align: center;
li {
display: inline;
a {
font-size: 12px;
color: #FFF;
text-decoration: none;
&:hover {
text-decoration: underline; } } } } }
nav a { text-decoration: none;}

View File

@ -0,0 +1,21 @@
# -*- encoding : utf-8 -*-
module DeviseHelper
def getDeviseErrors(*name)
res = Array.new(name.count)
resource.errors.each do |attr, message|
if index = name.index(attr)
res[index] = message
end
end
res
end
def showDeviseHintError(name, error, additional_class = '')
if error
"<div id='hint' class='error #{name.to_s} #{additional_class}' style='display: block;'> \
<div class='img'></div> \
<div class='msg'> #{error}</div> \
</div>".html_safe
end
end
end

View File

@ -11,23 +11,19 @@
%h1= title t('devise.passwords.edit')
%br
.content
-password_error = nil
- if resource.errors.present?
- resource.errors.each do |attr, array|
-password_error = array if attr == :password
- password_error, reset_password_token_error = getDeviseErrors(:password, :reset_password_token)
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, :class => "form" }) do |f|
= f.hidden_field :reset_password_token
.left.first=t('activerecord.attributes.user.password')
.right.first
= f.text_field :password, :id => 'pass', :class => "registartion-input #{password_error ? "registartion-input-error" : ''}", :onblur => "if(this.value==''){this.value='';this.className='registartion-input';}else{this.className='registartion-input-no-focus';};", :onfocus => "if(this.value==''){this.value='';this.className='registartion-input-focus';};"
= f.text_field :password, :id => 'password', :class => "registartion-input #{password_error ? 'registartion-input-error' : ''}"
.both
.left=t('activerecord.attributes.user.password_confirm')
.right
= f.text_field :password_confirmation, :id => 'pass2', :class => "registartion-input #{password_error ? "registartion-input-error" : ''}", :onClick => "this.className='registartion-input-focus';disError(this);", :onblur => "if(this.value==''){this.value='';this.className='registartion-input';}else{this.className='registartion-input-no-focus';};buttonCheck();", :onfocus => "if(this.value==''){this.value='';this.className='registartion-input-focus';};", :onkeydown => "buttonCheck();"
= f.text_field :password_confirmation, :id => 'password2', :class => "registartion-input #{password_error ? 'registartion-input-error' : ''}"
.both
%br
=f.submit t("devise.passwords.edit_button"), :class => 'button', :id => 'btnLogin'
- if password_error
#hint.error.reset{:style => 'display: block;'}
%p=password_error
=showDeviseHintError(:password, password_error, 'reset')

View File

@ -3,51 +3,36 @@
%header
.logo
/ Page
- uname_error = name_error = email_error = password_error = password_confirm_error = nil
- if resource.errors.present? # Trash
- resource.errors.each do |attr, array|
-uname_error = array if attr == :uname
-name_error = array if attr == :name
-email_error = array if attr == :email
-password_error = array if attr == :password
-password_confirm_error = array if attr == :password_confirmation
- uname_error, name_error, email_error, password_error = getDeviseErrors(:uname, :name, :email, :password)
%article
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :class => "form" }) do |f|
= hidden_field_tag :invitation_token, @invitation_token
.left.first=t('activerecord.attributes.user.uname')
.right.first
= f.text_field :uname, :id => 'login', :class => "registartion-input #{uname_error ? "registartion-input-error" : ''}", :onblur => "if(this.value==''){this.value='';this.className='registartion-input';}else{this.className='registartion-input-no-focus';};", :onfocus => "if(this.value==''){this.value='';this.className='registartion-input-focus';};"
= f.text_field :uname, :id => 'login', :class => "registartion-input #{uname_error ? 'registartion-input-error' : ''}"
.both
.left=t('activerecord.attributes.user.name')
.right
= f.text_field :name, :id => 'name', :class => "registartion-input #{name_error ? "registartion-input-error" : ''}", :onblur => "if(this.value==''){this.value='';this.className='registartion-input';}else{this.className='registartion-input-no-focus';};", :onfocus => "if(this.value==''){this.value='';this.className='registartion-input-focus';};"
= f.text_field :name, :id => 'name', :class => "registartion-input #{name_error ? 'registartion-input-error' : ''}"
.both
.left=t('activerecord.attributes.user.email')
.right
= f.text_field :email, :id => 'email', :readonly => 'readonly', :class => "registartion-input #{email_error ? "registartion-input-error" : ''}", :onblur => "if(this.value==''){this.value='';this.className='registartion-input';}else{this.className='registartion-input-no-focus';};", :onfocus => "if(this.value==''){this.value='';this.className='registartion-input-focus';};"
= f.text_field :email, :id => 'email', :readonly => 'readonly', :class => "registartion-input #{email_error ? 'registartion-input-error' : ''}"
.both
.left=t('activerecord.attributes.user.password')
.right
= f.text_field :password, :id => 'pass', :class => "registartion-input #{password_error ? "registartion-input-error" : ''}", :onblur => "if(this.value==''){this.value='';this.className='registartion-input';}else{this.className='registartion-input-no-focus';};", :onfocus => "if(this.value==''){this.value='';this.className='registartion-input-focus';};"
= f.text_field :password, :id => 'password', :class => "registartion-input #{password_error ? 'registartion-input-error' : ''}"
.both
.left=t('activerecord.attributes.user.password_confirm')
.right
= f.text_field :password_confirmation, :id => 'pass2', :class => "registartion-input #{password_confirm_error ? "registartion-input-error" : ''}", :onClick => "this.className='registartion-input-focus';disError(this);", :onblur => "if(this.value==''){this.value='';this.className='registartion-input';}else{this.className='registartion-input-no-focus';};buttonCheck();", :onfocus => "if(this.value==''){this.value='';this.className='registartion-input-focus';};", :onkeydown => "buttonCheck();"
= f.text_field :password_confirmation, :id => 'password2', :class => "registartion-input #{password_error ? 'registartion-input-error' : ''}"
.both
.in
=f.submit t("layout.devise.shared_links.sign_up"), :class => 'button', :id => 'btnLogin'
.both
-if uname_error
.error.login#hintLogin
%p=uname_error
-if name_error
.error.name#hintName
%p=name_error
-if email_error
.error.email#hintEmail
%p=email_error
-if password_error
.error.password#hintPassword
%p=password_error
=showDeviseHintError(:login, uname_error)
=showDeviseHintError(:name, name_error)
=showDeviseHintError(:email, email_error)
=showDeviseHintError(:password, password_error)

View File

@ -13,9 +13,9 @@
=hidden_field_tag :password_default, password
= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "form login" }) do |f|
%h1= title t("layout.sessions.sign_in_header")
= f.text_field :login, :class => "registartion-input #{is_error ? "registartion-input-error" : ''}", :onblur => "if(this.value==''){this.value='#{login}';this.className='registartion-input';} else{this.className='registartion-input-no-focus';};buttonCheck();", :onfocus => "if(this.value=='#{login}'){this.value='';this.className='registartion-input-focus';};", :onkeydown => "buttonCheck();", :type => "text", :value => login
= f.text_field :login, :class => "registartion-input #{is_error ? "registartion-input-error" : ''}", :value => login
%br/
= f.password_field :password, :class => "registartion-input #{is_error ? "registartion-input-error" : ''}", :onblur => "if(this.value==''){this.value='#{password}';this.className='registartion-input';}else{this.className='registartion-input-no-focus';};buttonCheck();", :onfocus => "if(this.value=='#{password}'){this.value='';this.className='registartion-input-focus';};", :onkeydown => "buttonCheck();", :type => "password", :value => password
= f.password_field :password, :class => "registartion-input #{is_error ? "registartion-input-error" : ''}", :value => password
%br/
.registration
.remember
@ -23,12 +23,11 @@
%span#niceCheckbox1.niceCheck{:onclick => "changeCheck(this)"}
= f.check_box :remember_me
.text=t('devise.sessions.remember_me')
.in=f.submit t('layout.devise.shared_links.sign_in'), :class => 'button disabled', :id => 'btnLogin'
.in=f.submit t('layout.devise.shared_links.sign_in'), :class => 'button', :id => 'btnLogin'
%div{:style => "clear: both;"}
.hr
.both
#hint.error{:style => is_error ? 'display: block;' : ''}
%p=t('devise.failure.invalid')
.forgot
.password
%p= link_to t("layout.devise.shared_links.forgot_password"), new_password_path(resource_name)
%p= link_to t("layout.devise.shared_links.forgot_password"), new_password_path(resource_name)
=showDeviseHintError(:login_error, is_error ? t('devise.failure.invalid') : false)

View File

@ -5,10 +5,10 @@
= display_meta_tags :site => APP_CONFIG['project_name']
- if controller_name == 'sessions' && action_name == 'new'
= stylesheet_link_tag "login"
= javascript_include_tag "login"
- elsif ['registrations', 'passwords'].include?(controller_name) && ['new', 'create', 'edit', 'update'].include?(action_name)
= stylesheet_link_tag "reg_session"
= csrf_meta_tag
= javascript_include_tag "login"
%body
-# render :partial => "layouts/flashes"

View File

@ -9,11 +9,6 @@ en:
one: "1 error prohibited this %{resource} from being saved:"
other: "%{count} errors prohibited this %{resource} from being saved:"
activerecord:
errors:
messages:
confirmation: "passwords doesn't match"
devise:
failure:
already_authenticated: 'You are already signed in.'
@ -38,6 +33,7 @@ en:
forgot: 'Forgot password'
send: 'Send'
edit_button: 'Change'
new_password: 'New password'
confirmations:
send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.'

View File

@ -11,11 +11,6 @@ ru:
many: "%{resource}: сохранение не удалось из-за %{count} ошибок"
other: "%{resource}: сохранение не удалось из-за %{count} ошибки"
activerecord:
errors:
messages:
confirmation: "пароли не совпадают"
devise:
failure:
already_authenticated: 'Вы уже вошли в систему.'
@ -40,6 +35,7 @@ ru:
forgot: 'Забыли пароль'
send: 'Послать'
edit_button: 'Изменить'
new_password: 'Новый пароль'
confirmations:
send_instructions: "В течение нескольких минут вы получите e-mail с инструкциями по подтверждению вашей учётной записи."
send_paranoid_instructions: 'Если Ваш e-mail существует, то в течение нескольких минут вы получите e-mail с инструкциями по подтверждению вашей учётной записи.'