<%= call_hook :view_account_login_top %>

<div id="login-form">
  <%= form_tag(signin_path, onsubmit: 'return keepAnchorOnSignIn(this);') do %>
  <%= back_url_hidden_field_tag %>
  
  <label for="username"><%=l(:field_login)%></label>
  <%= text_field_tag 'username', params[:username], :tabindex => '1' %>
  
  <label for="password">
    <%=l(:field_password)%>
    <%= link_to l(:label_password_lost), lost_password_path, :class => "lost_password" if Setting.lost_password? %>
  </label>
  <%= password_field_tag 'password', nil, :tabindex => '2' %>
  
  <% if Setting.openid? %>
    <label for="openid_url"><%=l(:field_identity_url)%></label>
    <%= text_field_tag "openid_url", nil, :tabindex => '3' %>
  <% end %>
  
  <% if Setting.autologin? %>
    <label for="autologin"><%= check_box_tag 'autologin', 1, false, :tabindex => 4 %> <%= l(:label_stay_logged_in) %></label>
  <% end %>
  
  <input type="submit" name="login" value="<%=l(:button_login)%>" tabindex="5" id="login-submit" />
  <% end %>
</div>

<%= call_hook :view_account_login_bottom %>

<% if params[:username].present? %>
<%= javascript_tag "$('#password').focus();" %>
<% else %>
<%= javascript_tag "$('#username').focus();" %>
<% end %>
