login page is more elegant

This commit is contained in:
Daniel Vincent Grippi 2010-09-08 11:37:54 -07:00
parent d25327d32d
commit 36730978ca
5 changed files with 71 additions and 49 deletions

View file

@ -25,7 +25,6 @@ class User
before_validation :do_bad_things
def self.find_for_authentication(conditions={})
puts conditions
if conditions[:username] =~ /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i # email regex
conditions[:email] = conditions.delete(:username)
end

View file

@ -1,7 +1,14 @@
= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
%p
#user
%p.username
= f.label :username
= f.text_field :username
%p.user_network
@tom.joindiaspora.com
%p
= f.label :password
= f.password_field :password

View file

@ -23,7 +23,6 @@
%body
.container
:plain
<!--[if lt IE 8]>
<div style='border: 1px solid #F7941D; background: #FEEFDA; text-align: center; clear: both; height: 75px; position: relative;'>

View file

@ -19,22 +19,14 @@ body
input
:font
:size 30px
:text
:align center
:width 300px
:width 200px
:margin
:bottom 0
:top 0
.container
:top 30%
:text
:align center
form p
:position relative
:padding 0
:margin-left 32.8%
label
:color #999
@ -52,7 +44,7 @@ input[type='password']
:size 14px
:padding 0.3em
:display block
:width 50%
:width 395px
:box-shadow 0 2px 0px #fff
:-webkit-box-shadow 0 2px 0px #fff
:-moz-box-shadow 0 2px 0px #fff
@ -61,3 +53,20 @@ input[type='password']
:border-radius 3px
:-moz-border-radius 3px
#user
:display inline
:width 500px
.username
:width 200px
:display inline
input
:display inline
:width 200px
.user_network
:width 200px
:display inline
:font
:size 18px

View file

@ -15,19 +15,13 @@ body {
input {
font-size: 30px;
text-align: center;
width: 300px;
width: 200px;
margin-bottom: 0;
margin-top: 0; }
.container {
top: 30%;
text-align: center; }
form p {
position: relative;
padding: 0;
margin-left: 32.8%; }
padding: 0; }
label {
color: #999999;
@ -43,7 +37,7 @@ input[type='password'] {
font-size: 14px;
padding: 0.3em;
display: block;
width: 50%;
width: 395px;
box-shadow: 0 2px 0px white;
-webkit-box-shadow: 0 2px 0px white;
-moz-box-shadow: 0 2px 0px white;
@ -51,3 +45,17 @@ input[type='password'] {
height: auto;
border-radius: 3px;
-moz-border-radius: 3px; }
#user {
display: inline;
width: 500px; }
#user .username {
width: 200px;
display: inline; }
#user .username input {
display: inline;
width: 200px; }
#user .user_network {
width: 200px;
display: inline;
font-size: 18px; }