Commit e27a1d31e03b086122a9dcb7d2adc237862b7861
Exists in
master
and in
4 other branches
Merge pull request #937 from jdamick/master
Modified the login screen for primarily LDAP authentication
Showing
2 changed files
with
62 additions
and
18 deletions
Show diff stats
@@ -0,0 +1,39 @@ | @@ -0,0 +1,39 @@ | ||
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 | + | ||
4 | + <%= text_field_tag :username, nil, {:class => "text top", :placeholder => "LDAP Login"} %> | ||
5 | + <%= password_field_tag :password, nil, {:class => "text bottom", :placeholder => "Password"} %> | ||
6 | + | ||
7 | + <br/> | ||
8 | + <%= submit_tag "LDAP Sign in", :class => "primary btn" %> | ||
9 | + | ||
10 | + <%- if devise_mapping.omniauthable? %> | ||
11 | + <%- (resource_class.omniauth_providers - [:ldap]).each do |provider| %> | ||
12 | + <hr/> | ||
13 | + <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), :class => "btn primary" %><br /> | ||
14 | + <% end -%> | ||
15 | + <% end -%> | ||
16 | + | ||
17 | + <hr/> | ||
18 | + <a href="#" id="other_form_toggle" onclick="javascript:$('#new_user').toggle();">Other Sign in</a> | ||
19 | + <!-- inline for right now just to illustrate --> | ||
20 | + <script type="text/javascript"> | ||
21 | + $(function() { | ||
22 | + $('#new_user').toggle(); | ||
23 | + }); | ||
24 | + </script> | ||
25 | +<% end %> | ||
26 | + | ||
27 | + | ||
28 | +<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "login-box" }) do |f| %> | ||
29 | + <%= f.text_field :email, :class => "text top", :placeholder => "Email" %> | ||
30 | + <%= f.password_field :password, :class => "text bottom", :placeholder => "Password" %> | ||
31 | + | ||
32 | + <% if devise_mapping.rememberable? -%> | ||
33 | + <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> | ||
34 | + <% end -%> | ||
35 | + <br/> | ||
36 | + <%= f.submit "Sign in", :class => "primary btn" %> | ||
37 | + <div class="right"> <%= render :partial => "devise/shared/links" %></div> | ||
38 | + | ||
39 | +<% end %> |
app/views/devise/sessions/new.html.erb
1 | -<%= 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" %> | ||
3 | - <%= f.text_field :email, :class => "text top", :placeholder => "Email" %> | ||
4 | - <%= f.password_field :password, :class => "text bottom", :placeholder => "Password" %> | 1 | +<% unless ldap_enable? -%> |
5 | 2 | ||
6 | - <% if devise_mapping.rememberable? -%> | ||
7 | - <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> | ||
8 | - <% end -%> | ||
9 | - <br/> | ||
10 | - <%= f.submit "Sign in", :class => "primary btn" %> | ||
11 | - <div class="right"> <%= render :partial => "devise/shared/links" %></div> | 3 | + <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "login-box" }) do |f| %> |
4 | + <%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %> | ||
12 | 5 | ||
13 | - <%- if devise_mapping.omniauthable? %> | ||
14 | - <%- resource_class.omniauth_providers.each do |provider| %> | ||
15 | - <hr/> | ||
16 | - <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), :class => "btn primary" %><br /> | 6 | + <%= f.text_field :email, :class => "text top", :placeholder => "Email" %> |
7 | + <%= f.password_field :password, :class => "text bottom", :placeholder => "Password" %> | ||
8 | + | ||
9 | + <% if devise_mapping.rememberable? -%> | ||
10 | + <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> | ||
11 | + <% end -%> | ||
12 | + <br/> | ||
13 | + <%= f.submit "Sign in", :class => "primary btn" %> | ||
14 | + <div class="right"> <%= render :partial => "devise/shared/links" %></div> | ||
15 | + | ||
16 | + <%- if devise_mapping.omniauthable? %> | ||
17 | + <%- resource_class.omniauth_providers.each do |provider| %> | ||
18 | + <hr/> | ||
19 | + <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), :class => "btn primary" %><br /> | ||
20 | + <% end -%> | ||
17 | <% end -%> | 21 | <% end -%> |
18 | - <% end -%> | ||
19 | - <% if ldap_enable? -%> | ||
20 | - <p><%= link_to "via LDAP", user_omniauth_authorize_path(:ldap)%></p> | ||
21 | - <% end -%> | 22 | + |
23 | + <% end %> | ||
24 | + | ||
25 | +<% else %> | ||
26 | + <%= render :partial => 'devise/sessions/new_ldap' %> | ||
22 | <% end %> | 27 | <% end %> |