Commit 40b949abab1cd3872deae08b0f257189c4b00323

Authored by David Greaves
Committed by Dmitriy Zaporozhets
1 parent b536acc9

Change text_field to :login from :email in line with 9d92433a7c83432657faf4c0283

…9bba1ba6f22ac to allow login as admin or non-ldap user when ldap is enabled
Also change haml style in line with that commit
Showing 1 changed file with 13 additions and 13 deletions   Show diff stats
app/views/devise/sessions/_new_ldap.html.haml
1   -= form_tag(user_omniauth_callback_path(:ldap), :class => "login-box", :id => 'new_ldap_user' ) do
2   - = image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo"
3   - = text_field_tag :username, nil, {:class => "text top", :placeholder => "LDAP Login", :autofocus => "autofocus"}
4   - = password_field_tag :password, nil, {:class => "text bottom", :placeholder => "Password"}
  1 += form_tag(user_omniauth_callback_path(:ldap), class: "login-box", id: 'new_ldap_user' ) do
  2 + = image_tag "login-logo.png", width: "304", height: "66", class: "login-logo", alt: "Login Logo"
  3 + = text_field_tag :username, nil, {class: "text top", placeholder: "LDAP Login", autofocus: "autofocus"}
  4 + = password_field_tag :password, nil, {class: "text bottom", placeholder: "Password"}
5 5 %br/
6   - = submit_tag "LDAP Sign in", :class => "btn-primary btn"
  6 + = submit_tag "LDAP Sign in", class: "btn-primary btn"
7 7 - if devise_mapping.omniauthable?
8 8 - (resource_class.omniauth_providers - [:ldap]).each do |provider|
9 9 %hr/
10   - = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), :class => "btn btn-primary"
  10 + = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), class: "btn btn-primary"
11 11 %br/
12 12 %hr/
13   - %a#other_form_toggle{:href => "#", :onclick => "javascript:$('#new_user').toggle();"} Other Sign in
  13 + %a#other_form_toggle{href: "#", onclick: "javascript:$('#new_user').toggle();"} Other Sign in
14 14 :javascript
15 15 $(function() {
16 16 $('#new_user').toggle();
17 17 });
18   -= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "login-box" }) do |f|
19   - = f.text_field :email, :class => "text top", :placeholder => "Email"
20   - = f.password_field :password, :class => "text bottom", :placeholder => "Password"
  18 += form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: "login-box" }) do |f|
  19 + = f.text_field :login, class: "text top", placeholder: "Username or Email", autofocus: "autofocus"
  20 + = f.password_field :password, class: "text bottom", placeholder: "Password"
21 21 - if devise_mapping.rememberable?
22 22 .clearfix.inputs-list
23   - %label.checkbox.remember_me{:for => "user_remember_me"}
  23 + %label.checkbox.remember_me{for: "user_remember_me"}
24 24 = f.check_box :remember_me
25 25 %span Remember me
26 26 %br/
27   - = f.submit "Sign in", :class => "btn-primary btn"
  27 + = f.submit "Sign in", class: "btn-primary btn"
28 28 .pull-right
29   - = render :partial => "devise/shared/links"
  29 + = render partial: "devise/shared/links"
... ...