Commit 50dabb5452e86bfe056c4e1d54abd2dc7c1a8463

Authored by jdamick
1 parent eb00cb69

customizing the user login screen for primarily ldap authentication

Showing 1 changed file with 30 additions and 4 deletions   Show diff stats
app/views/devise/sessions/new.html.erb
  1 +<% if ldap_enable? -%>
  2 + <%= form_for(resource, :as => resource_name, :url => user_omniauth_callback_path(:ldap), :html => { :class => "login-box", :id => 'new_ldap_user' }) do |f| %>
  3 + <%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %>
  4 +
  5 + <%= text_field_tag :username, nil, {:class => "text top", :placeholder => "LDAP Login"} %>
  6 + <%= password_field_tag :password, nil, {:class => "text bottom", :placeholder => "Password"} %>
  7 +
  8 + <% if devise_mapping.rememberable? -%>
  9 + <div class="clearfix inputs-list"> <label class="checkbox remember_me" for="user_remember_me"><%= f.check_box :remember_me %><span>Remember me</span></label></div>
  10 + <% end -%>
  11 + <br/>
  12 + <%= f.submit "LDAP Sign in", :class => "primary btn" %>
  13 + <hr/>
  14 + <a href="#" id="admin_form_toggle" onclick="javascript:$('#new_user').toggle();">Admin Sign in</a>
  15 + <!-- inline right just to illustrate -->
  16 + <script type="text/javascript">
  17 + $(function() {
  18 + $('#new_user').toggle();
  19 + });
  20 + </script>
  21 + <% end %>
  22 +<% end %>
  23 +
1 <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "login-box" }) do |f| %> 24 <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "login-box" }) do |f| %>
2 - <%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %> 25 + <% unless ldap_enable? %>
  26 + <%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %>
  27 + <% else %>
  28 + <!-- <a href="#" id="ldap_form_toggle" onclick="javascript:$('#new_ldap_user').toggle();">LDAP Sign in</a> -->
  29 + <% end %>
  30 +
3 <%= f.text_field :email, :class => "text top", :placeholder => "Email" %> 31 <%= f.text_field :email, :class => "text top", :placeholder => "Email" %>
4 <%= f.password_field :password, :class => "text bottom", :placeholder => "Password" %> 32 <%= f.password_field :password, :class => "text bottom", :placeholder => "Password" %>
5 33
@@ -16,7 +44,5 @@ @@ -16,7 +44,5 @@
16 <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), :class => "btn primary" %><br /> 44 <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), :class => "btn primary" %><br />
17 <% end -%> 45 <% end -%>
18 <% end -%> 46 <% end -%>
19 - <% if ldap_enable? -%>  
20 - <p><%= link_to "via LDAP", user_omniauth_authorize_path(:ldap)%></p>  
21 - <% end -%> 47 +
22 <% end %> 48 <% end %>