Commit 363cec9c0c254fbcf653de4a4349954c4f0e8b8a

Authored by Antonio Terceiro
1 parent e425b81a

Better style for several login/logout stuff

app/views/account/login.rhtml
@@ -3,40 +3,29 @@ @@ -3,40 +3,29 @@
3 <h2><%= _('Login') %></h2> 3 <h2><%= _('Login') %></h2>
4 4
5 <% @user ||= User.new %> 5 <% @user ||= User.new %>
  6 +<% is_thickbox ||= false %>
6 7
7 <% labelled_form_for :user, @user, 8 <% labelled_form_for :user, @user,
8 :url => login_url, 9 :url => login_url,
9 :html => { :help => _('If you are a registered user, enter your username and password to be authenticated.')+'<p/>'+_('To join on this environment, click on "<b>I want to be an user!</b>".')+'<p/>'+_('If you forgot your password, click on "<b>I forgot my password!</b>" link.') } do |f| %> 10 :html => { :help => _('If you are a registered user, enter your username and password to be authenticated.')+'<p/>'+_('To join on this environment, click on "<b>I want to be an user!</b>".')+'<p/>'+_('If you forgot your password, click on "<b>I forgot my password!</b>" link.') } do |f| %>
10 11
11 - <%= f.text_field :login,  
12 - :id => ( lightbox? ? 'lightbox_' : '' ) + 'user_login',  
13 - :help => _('Here goes the nickname that you give on the registration.'),  
14 - :onchange => 'this.value = convToValidLogin( this.value )' %> 12 + <%= f.text_field :login, :id => 'main_user_login', :onchange => 'this.value = convToValidLogin( this.value )' %>
15 13
16 - <%= f.password_field :password,  
17 - :id => ( lightbox? ? 'lightbox_' : '' ) + 'user_password',  
18 - :help => _('your password is personal, protect it.') %> 14 + <%= f.password_field :password %>
19 15
20 - <% button_bar do %>  
21 - <%= submit_button( 'login', _('Log in') )%>  
22 - <%= lightbox_close_button(_('Cancel')) if lightbox? %>  
23 - <% end %>  
24 -<% end %> 16 + <% button_bar do %>
  17 + <%= submit_button( 'login', _('Log in') )%>
  18 + <% if is_thickbox %>
  19 + <%= thickbox_close_button(_('Cancel')) %>
  20 + <% end %>
  21 + <% end %>
25 22
26 -<p class="forgot-passwd" help="<%= _('You can recover your password clicking on this link.') %>">  
27 -<%= link_to _("I forgot my password!"), :controller => 'account', :action => 'forgot_password' %>  
28 -</p> 23 +<% end %>
29 24
30 -<p class="want-to-be-an-user" help="<%= _('Click here to join to this environment, if you is not already an user.') %>"><strong>  
31 -<%= link_to _("I want to participate!"), :controller => 'account', :action => 'signup' %>  
32 -</strong></p> 25 +<% button_bar do %>
  26 + <%= button :add, _("New user"), :controller => 'account', :action => 'signup' %>
  27 + <%= button :help, _("I forgot my password!"), :controller => 'account', :action => 'forgot_password' %>
  28 +<% end %>
33 29
34 </div><!-- end class="login-box" --> 30 </div><!-- end class="login-box" -->
35 31
36 -<% if lightbox? %>  
37 - <script type='text/javascript'>  
38 - $("lightbox_user_login").focus();  
39 - </script>  
40 -<% end %>  
41 -  
42 -<%# = generate_form :user, @user, {...} %>  
app/views/account/login_block.rhtml
@@ -10,30 +10,24 @@ @@ -10,30 +10,24 @@
10 %> 10 %>
11 11
12 <% labelled_form_for :user, @user, 12 <% labelled_form_for :user, @user,
13 - :html => { :help => _('If you are a registered user, enter your username and password to be authenticated.')+'<p/>'+_('To join on this environment, click on "<b>New user</b>".')+'<p/>'+_('If you forgot your password, click on "<b>I forgot my password!</b>" link.') },  
14 :url => login_url do |f| %> 13 :url => login_url do |f| %>
15 14
16 -<%= f.text_field :login,  
17 - :help => _('Here goes the nickname that you give on the registration.'),  
18 - :onchange => 'this.value = convToValidLogin( this.value )' %> 15 + <%= f.text_field :login, :onchange => 'this.value = convToValidLogin( this.value )' %>
19 16
20 -<%= f.password_field :password,  
21 - :help => _('your password is personal, protect it.') %> 17 + <%= f.password_field :password %>
22 18
23 <% button_bar do %> 19 <% button_bar do %>
24 <%= submit_button( 'login', _('Log in') )%> 20 <%= submit_button( 'login', _('Log in') )%>
25 <%= link_to content_tag( 'span', _('New user') ), 21 <%= link_to content_tag( 'span', _('New user') ),
26 { :controller => 'account', :action => 'signup' }, 22 { :controller => 'account', :action => 'signup' },
27 - :help => _('Click here to join to this environment, if you is not already an user.'),  
28 :class => 'button with-text icon-add' %> 23 :class => 'button with-text icon-add' %>
29 <% end %> 24 <% end %>
30 25
31 <% end %> 26 <% end %>
32 27
33 - <div class="forgot-passwd" help="<%= _('You can recover your password clicking on this link.') %>">  
34 - <%= link_to _("I forgot my password!"),  
35 - :controller => 'account', :action => 'forgot_password' %>  
36 - </div> 28 + <% button_bar(:style => 'margin: 0px;') do %>
  29 + <%= button :help, _("I forgot my password!"), :controller => 'account', :action => 'forgot_password' %>
  30 + <% end %>
37 31
38 </div> 32 </div>
39 33
app/views/layouts/application-ng.rhtml
@@ -67,10 +67,9 @@ @@ -67,10 +67,9 @@
67 <% end %> 67 <% end %>
68 <%= link_to('<i class="icon-menu-logout"></i><strong>' + _('Logout') + '</strong>', { :controller => 'account', :action => 'logout'} , :id => "logout", :title => _("Leave the system")) %> 68 <%= link_to('<i class="icon-menu-logout"></i><strong>' + _('Logout') + '</strong>', { :controller => 'account', :action => 'logout'} , :id => "logout", :title => _("Leave the system")) %>
69 <% else %> 69 <% else %>
70 - <%= _('%s or %s') % [thickbox_inline_popup_link('<i class="icon-menu-login"></i><strong>' + _('Login') + '</strong>', login_url, 'inlineLoginBox', :id => 'link_login', :help => _('Click here to enter your username and password and be recognized by the system.')), link_to('<strong>' + _('Register') + '</strong>', :controller => 'account', :action => 'signup') ] %> 70 + <%= _('%s or %s') % [thickbox_inline_popup_link('<i class="icon-menu-login"></i><strong>' + _('Login') + '</strong>', login_url, 'inlineLoginBox', :id => 'link_login'), link_to('<strong>' + _('Register') + '</strong>', :controller => 'account', :action => 'signup') ] %>
71 <div id='inlineLoginBox' style='display: none;'> 71 <div id='inlineLoginBox' style='display: none;'>
72 - <%= render :file => 'account/login' %>  
73 - <center><%= thickbox_close_button _('Close') %></center> 72 + <%= render :file => 'account/login', :locals => { :is_thickbox => true } %>
74 </div> 73 </div>
75 <% end %> 74 <% end %>
76 75
app/views/shared/user_menu.rhtml
@@ -62,10 +62,9 @@ @@ -62,10 +62,9 @@
62 <% if theme_option( :menu_login ) == 'full_form' %> 62 <% if theme_option( :menu_login ) == 'full_form' %>
63 <%= render :file => 'account/login_block' %> 63 <%= render :file => 'account/login_block' %>
64 <% else %> 64 <% else %>
65 - <%= thickbox_inline_popup_link('<span class="icon-menu-login"></span>'+ _('Login'), login_url, 'inlineLoginBox', :id => 'link_login', :help => _('Click here to enter your username and password and be recognized by the system.')) %> 65 + <%= thickbox_inline_popup_link('<span class="icon-menu-login"></span>'+ _('Login'), login_url, 'inlineLoginBox', :id => 'link_login') %>
66 <div id='inlineLoginBox' style='display: none;'> 66 <div id='inlineLoginBox' style='display: none;'>
67 - <%= render :file => 'account/login' %>  
68 - <center><%= thickbox_close_button _('Close') %></center> 67 + <%= render :file => 'account/login', :locals => { :is_thickbox => true } %>
69 </div> 68 </div>
70 <% end %> 69 <% end %>
71 <% end %> 70 <% end %>
public/designs/themes/base/blocks.css
@@ -30,11 +30,6 @@ @@ -30,11 +30,6 @@
30 30
31 .login-box { 31 .login-box {
32 padding: 0px; 32 padding: 0px;
33 - font-size: 10px;  
34 -}  
35 -  
36 -#content .login-box-content a.button {  
37 - font-size: 11px;  
38 } 33 }
39 34
40 .login-box-content { 35 .login-box-content {
@@ -54,7 +49,6 @@ @@ -54,7 +49,6 @@
54 49
55 .login-box form { 50 .login-box form {
56 margin: 0px; 51 margin: 0px;
57 - padding: 0px 0px 0px 0px;  
58 } 52 }
59 .msie7 .login-box form { 53 .msie7 .login-box form {
60 padding: 0px 10px 0px 0px; 54 padding: 0px 10px 0px 0px;
public/stylesheets/button.css
@@ -40,7 +40,7 @@ input.button.with-text { @@ -40,7 +40,7 @@ input.button.with-text {
40 height: 20px; 40 height: 20px;
41 } 41 }
42 input.button.with-text { 42 input.button.with-text {
43 - font-size: 14px; 43 + font-size: 12px;
44 height: 22px; 44 height: 22px;
45 padding: 0px 2px 2px 20px; 45 padding: 0px 2px 2px 20px;
46 background-position: 3px 50%; 46 background-position: 3px 50%;
public/stylesheets/forms.css
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 .formlabel { 10 .formlabel {
11 /* font-size: 11px; */ 11 /* font-size: 11px; */
12 display: block; 12 display: block;
13 - padding: 2px 5px; 13 + padding: 2px 0px;
14 } 14 }
15 15
16 .formfield input, 16 .formfield input,
public/stylesheets/login-box.css
1 1
2 .login-box { 2 .login-box {
3 padding: 3px 20px 8px 20px; 3 padding: 3px 20px 8px 20px;
4 - font-size: 10px;  
5 } 4 }
6 -#lightbox .login-box {  
7 - width: 50%; 5 +#TB_window .login-box {
  6 + width: 80%;
8 margin: auto; 7 margin: auto;
9 } 8 }
10 9
@@ -26,6 +25,10 @@ @@ -26,6 +25,10 @@
26 width: 99%; 25 width: 99%;
27 } 26 }
28 27
  28 +#TB_window .login-box .formfieldline input {
  29 + width: 150px;
  30 +}
  31 +
29 .login-box form { 32 .login-box form {
30 margin: 0px; 33 margin: 0px;
31 padding: 0px 0px 10px 0px; 34 padding: 0px 0px 10px 0px;
@@ -40,7 +43,7 @@ @@ -40,7 +43,7 @@
40 margin: 0px; 43 margin: 0px;
41 padding: 0px; 44 padding: 0px;
42 } 45 }
43 -#lightbox .login-box h2 { 46 +#TB_window .login-box h2 {
44 font-size: 20px; 47 font-size: 20px;
45 color: #000; 48 color: #000;
46 } 49 }