From 363cec9c0c254fbcf653de4a4349954c4f0e8b8a Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Wed, 13 Jan 2010 23:16:11 -0300 Subject: [PATCH] Better style for several login/logout stuff --- app/views/account/login.rhtml | 39 ++++++++++++++------------------------- app/views/account/login_block.rhtml | 16 +++++----------- app/views/layouts/application-ng.rhtml | 5 ++--- app/views/shared/user_menu.rhtml | 5 ++--- public/designs/themes/base/blocks.css | 6 ------ public/stylesheets/button.css | 2 +- public/stylesheets/forms.css | 2 +- public/stylesheets/login-box.css | 11 +++++++---- 8 files changed, 32 insertions(+), 54 deletions(-) diff --git a/app/views/account/login.rhtml b/app/views/account/login.rhtml index c7db164..b3897bc 100644 --- a/app/views/account/login.rhtml +++ b/app/views/account/login.rhtml @@ -3,40 +3,29 @@

<%= _('Login') %>

<% @user ||= User.new %> +<% is_thickbox ||= false %> <% labelled_form_for :user, @user, :url => login_url, :html => { :help => _('If you are a registered user, enter your username and password to be authenticated.')+'

'+_('To join on this environment, click on "I want to be an user!".')+'

'+_('If you forgot your password, click on "I forgot my password!" link.') } do |f| %> - <%= f.text_field :login, - :id => ( lightbox? ? 'lightbox_' : '' ) + 'user_login', - :help => _('Here goes the nickname that you give on the registration.'), - :onchange => 'this.value = convToValidLogin( this.value )' %> + <%= f.text_field :login, :id => 'main_user_login', :onchange => 'this.value = convToValidLogin( this.value )' %> - <%= f.password_field :password, - :id => ( lightbox? ? 'lightbox_' : '' ) + 'user_password', - :help => _('your password is personal, protect it.') %> + <%= f.password_field :password %> - <% button_bar do %> - <%= submit_button( 'login', _('Log in') )%> - <%= lightbox_close_button(_('Cancel')) if lightbox? %> - <% end %> -<% end %> + <% button_bar do %> + <%= submit_button( 'login', _('Log in') )%> + <% if is_thickbox %> + <%= thickbox_close_button(_('Cancel')) %> + <% end %> + <% end %> -

-<%= link_to _("I forgot my password!"), :controller => 'account', :action => 'forgot_password' %> -

+<% end %> -

-<%= link_to _("I want to participate!"), :controller => 'account', :action => 'signup' %> -

+<% button_bar do %> + <%= button :add, _("New user"), :controller => 'account', :action => 'signup' %> + <%= button :help, _("I forgot my password!"), :controller => 'account', :action => 'forgot_password' %> +<% end %> -<% if lightbox? %> - -<% end %> - -<%# = generate_form :user, @user, {...} %> diff --git a/app/views/account/login_block.rhtml b/app/views/account/login_block.rhtml index 7697f60..6c6e30c 100644 --- a/app/views/account/login_block.rhtml +++ b/app/views/account/login_block.rhtml @@ -10,30 +10,24 @@ %> <% labelled_form_for :user, @user, - :html => { :help => _('If you are a registered user, enter your username and password to be authenticated.')+'

'+_('To join on this environment, click on "New user".')+'

'+_('If you forgot your password, click on "I forgot my password!" link.') }, :url => login_url do |f| %> -<%= f.text_field :login, - :help => _('Here goes the nickname that you give on the registration.'), - :onchange => 'this.value = convToValidLogin( this.value )' %> + <%= f.text_field :login, :onchange => 'this.value = convToValidLogin( this.value )' %> -<%= f.password_field :password, - :help => _('your password is personal, protect it.') %> + <%= f.password_field :password %> <% button_bar do %> <%= submit_button( 'login', _('Log in') )%> <%= link_to content_tag( 'span', _('New user') ), { :controller => 'account', :action => 'signup' }, - :help => _('Click here to join to this environment, if you is not already an user.'), :class => 'button with-text icon-add' %> <% end %> <% end %> -

- <%= link_to _("I forgot my password!"), - :controller => 'account', :action => 'forgot_password' %> -
+ <% button_bar(:style => 'margin: 0px;') do %> + <%= button :help, _("I forgot my password!"), :controller => 'account', :action => 'forgot_password' %> + <% end %> diff --git a/app/views/layouts/application-ng.rhtml b/app/views/layouts/application-ng.rhtml index d23b396..3e1e747 100644 --- a/app/views/layouts/application-ng.rhtml +++ b/app/views/layouts/application-ng.rhtml @@ -67,10 +67,9 @@ <% end %> <%= link_to('' + _('Logout') + '', { :controller => 'account', :action => 'logout'} , :id => "logout", :title => _("Leave the system")) %> <% else %> - <%= _('%s or %s') % [thickbox_inline_popup_link('' + _('Login') + '', login_url, 'inlineLoginBox', :id => 'link_login', :help => _('Click here to enter your username and password and be recognized by the system.')), link_to('' + _('Register') + '', :controller => 'account', :action => 'signup') ] %> + <%= _('%s or %s') % [thickbox_inline_popup_link('' + _('Login') + '', login_url, 'inlineLoginBox', :id => 'link_login'), link_to('' + _('Register') + '', :controller => 'account', :action => 'signup') ] %> <% end %> diff --git a/app/views/shared/user_menu.rhtml b/app/views/shared/user_menu.rhtml index 916894c..d6b4c6e 100644 --- a/app/views/shared/user_menu.rhtml +++ b/app/views/shared/user_menu.rhtml @@ -62,10 +62,9 @@ <% if theme_option( :menu_login ) == 'full_form' %> <%= render :file => 'account/login_block' %> <% else %> - <%= thickbox_inline_popup_link(''+ _('Login'), login_url, 'inlineLoginBox', :id => 'link_login', :help => _('Click here to enter your username and password and be recognized by the system.')) %> + <%= thickbox_inline_popup_link(''+ _('Login'), login_url, 'inlineLoginBox', :id => 'link_login') %> <% end %> <% end %> diff --git a/public/designs/themes/base/blocks.css b/public/designs/themes/base/blocks.css index 4ac8c12..4242790 100644 --- a/public/designs/themes/base/blocks.css +++ b/public/designs/themes/base/blocks.css @@ -30,11 +30,6 @@ .login-box { padding: 0px; - font-size: 10px; -} - -#content .login-box-content a.button { - font-size: 11px; } .login-box-content { @@ -54,7 +49,6 @@ .login-box form { margin: 0px; - padding: 0px 0px 0px 0px; } .msie7 .login-box form { padding: 0px 10px 0px 0px; diff --git a/public/stylesheets/button.css b/public/stylesheets/button.css index b52f377..66e713d 100644 --- a/public/stylesheets/button.css +++ b/public/stylesheets/button.css @@ -40,7 +40,7 @@ input.button.with-text { height: 20px; } input.button.with-text { - font-size: 14px; + font-size: 12px; height: 22px; padding: 0px 2px 2px 20px; background-position: 3px 50%; diff --git a/public/stylesheets/forms.css b/public/stylesheets/forms.css index c80124e..67c5a76 100644 --- a/public/stylesheets/forms.css +++ b/public/stylesheets/forms.css @@ -10,7 +10,7 @@ .formlabel { /* font-size: 11px; */ display: block; - padding: 2px 5px; + padding: 2px 0px; } .formfield input, diff --git a/public/stylesheets/login-box.css b/public/stylesheets/login-box.css index 9395cf9..adaa982 100644 --- a/public/stylesheets/login-box.css +++ b/public/stylesheets/login-box.css @@ -1,10 +1,9 @@ .login-box { padding: 3px 20px 8px 20px; - font-size: 10px; } -#lightbox .login-box { - width: 50%; +#TB_window .login-box { + width: 80%; margin: auto; } @@ -26,6 +25,10 @@ width: 99%; } +#TB_window .login-box .formfieldline input { + width: 150px; +} + .login-box form { margin: 0px; padding: 0px 0px 10px 0px; @@ -40,7 +43,7 @@ margin: 0px; padding: 0px; } -#lightbox .login-box h2 { +#TB_window .login-box h2 { font-size: 20px; color: #000; } -- libgit2 0.21.2