login_block.rhtml
928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<div class="login-box">
<% unless logged_in? %>
<h2><span><%= _('Login') %></span></h2>
<div class="login-box-content">
<%
@user = User.new if ! @user
%>
<% labelled_form_for :user, @user,
:url => login_url do |f| %>
<%= f.text_field :login, :onchange => 'this.value = convToValidLogin( this.value )' %>
<%= f.password_field :password %>
<% button_bar do %>
<%= submit_button( 'login', _('Log in') )%>
<%= link_to content_tag( 'span', _('New user') ),
{ :controller => 'account', :action => 'signup' },
:class => 'button with-text icon-add' %>
<% end %>
<% end %>
<p class="forgot-passwd">
<%= link_to _("I forgot my password!"), :controller => 'account', :action => 'forgot_password' %>
</p>
</div>
<% else %>
<h2><%= user.identifier %></h2>
<% end %>
</div><!-- end id="login-box" -->