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 before_validation :do_bad_things
def self.find_for_authentication(conditions={}) def self.find_for_authentication(conditions={})
puts conditions
if conditions[:username] =~ /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i # email regex if conditions[:username] =~ /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i # email regex
conditions[:email] = conditions.delete(:username) conditions[:email] = conditions.delete(:username)
end end

View file

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

View file

@ -23,7 +23,6 @@
%body %body
.container
:plain :plain
<!--[if lt IE 8]> <!--[if lt IE 8]>
<div style='border: 1px solid #F7941D; background: #FEEFDA; text-align: center; clear: both; height: 75px; position: relative;'> <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 input
:font :font
:size 30px :size 30px
:text :width 200px
:align center
:width 300px
:margin :margin
:bottom 0 :bottom 0
:top 0 :top 0
.container
:top 30%
:text
:align center
form p form p
:position relative :position relative
:padding 0 :padding 0
:margin-left 32.8%
label label
:color #999 :color #999
@ -52,7 +44,7 @@ input[type='password']
:size 14px :size 14px
:padding 0.3em :padding 0.3em
:display block :display block
:width 50% :width 395px
:box-shadow 0 2px 0px #fff :box-shadow 0 2px 0px #fff
:-webkit-box-shadow 0 2px 0px #fff :-webkit-box-shadow 0 2px 0px #fff
:-moz-box-shadow 0 2px 0px #fff :-moz-box-shadow 0 2px 0px #fff
@ -61,3 +53,20 @@ input[type='password']
:border-radius 3px :border-radius 3px
:-moz-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 { input {
font-size: 30px; font-size: 30px;
text-align: center; width: 200px;
width: 300px;
margin-bottom: 0; margin-bottom: 0;
margin-top: 0; } margin-top: 0; }
.container {
top: 30%;
text-align: center; }
form p { form p {
position: relative; position: relative;
padding: 0; padding: 0; }
margin-left: 32.8%; }
label { label {
color: #999999; color: #999999;
@ -43,7 +37,7 @@ input[type='password'] {
font-size: 14px; font-size: 14px;
padding: 0.3em; padding: 0.3em;
display: block; display: block;
width: 50%; width: 395px;
box-shadow: 0 2px 0px white; box-shadow: 0 2px 0px white;
-webkit-box-shadow: 0 2px 0px white; -webkit-box-shadow: 0 2px 0px white;
-moz-box-shadow: 0 2px 0px white; -moz-box-shadow: 0 2px 0px white;
@ -51,3 +45,17 @@ input[type='password'] {
height: auto; height: auto;
border-radius: 3px; border-radius: 3px;
-moz-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; }