Commit 93bbc1f9 authored by Rémy Coutable's avatar Rémy Coutable

Fix sign-in box and Kerberos login

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent d572f492
......@@ -131,8 +131,14 @@
flex: 1;
text-align: center;
&:first-of-type {
border-top-left-radius: 2px;
}
&:last-of-type {
border-left: 1px solid $border-color;
border-top-left-radius: $border-radius-default;
border-top-right-radius: $border-radius-default;
}
&:not(.active) {
......
= form_tag(omniauth_authorize_path(:user, :crowd), id: 'new_crowd_user', class: 'show-gl-field-errors') do
.form-group
= label_tag 'Username or email', for: :username
= text_field_tag :username, nil, {class: "form-control top", title: "This field is required", autofocus: "autofocus", required: true }
= label_tag :username, 'Username or email'
= text_field_tag :username, nil, { class: "form-control top", title: "This field is required", autofocus: "autofocus", required: true }
.form-group
= label_tag :password
= password_field_tag :password, nil, { class: "form-control bottom", title: "This field is required.", required: true }
......@@ -10,4 +10,4 @@
%label{for: "remember_me"}
= check_box_tag :remember_me, '1', false, id: 'remember_me'
%span Remember me
= button_tag "Sign in", class: "btn-save btn"
= submit_tag "Sign in", class: "btn-save btn"
= form_tag(user_omniauth_callback_path(provider), id: 'new_kerberos_user' ) do
= text_field_tag :username, nil, {class: "form-control top", placeholder: "Kerberos Login", autofocus: "autofocus"}
= password_field_tag :password, nil, {class: "form-control bottom", placeholder: "Password"}
%br/
= button_tag "Kerberos Sign in", class: "btn-save btn"
\ No newline at end of file
= form_tag(omniauth_callback_path(:user, :kerberos), id: 'new_kerberos_user', class: 'show-gl-field-errors') do
.form-group
= label_tag :username, 'Username or email'
= text_field_tag :username, nil, { class: "form-control top", placeholder: "Kerberos Login", autofocus: "autofocus" }
.form-group
= label_tag :password
= password_field_tag :password, nil, { class: "form-control bottom", placeholder: "Password" }
= submit_tag "Kerberos Sign in", class: "btn-save btn"
= form_tag(omniauth_callback_path(:user, server['provider_name']), id: 'new_ldap_user', class: "show-gl-field-errors") do
.form-group
= label_tag "#{server['label']} Login", for: :username
= label_tag :username, "#{server['label']} Login"
= text_field_tag :username, nil, {class: "form-control top", title: "This field is required.", autofocus: "autofocus", required: true }
.form-group
= label_tag :password
......@@ -10,4 +10,4 @@
%label{for: "remember_me"}
= check_box_tag :remember_me, '1', false, id: 'remember_me'
%span Remember me
= button_tag "Sign in", class: "btn-save btn"
= submit_tag "Sign in", class: "btn-save btn"
#login-pane.login-box{ role: 'tabpanel', class: 'tab-pane active' }
.login-body
- if form_based_providers.any?
<<<<<<< HEAD
%ul.nav-links
- if kerberos_enabled?
%li{class: (:active unless crowd_enabled? || ldap_enabled?)}
= link_to "Kerberos", "#tab-kerberos", 'data-toggle' => 'tab'
- if crowd_enabled?
%li.active
= link_to "Crowd", "#tab-crowd", 'data-toggle' => 'tab'
- if ldap_enabled?
- @ldap_servers.each_with_index do |server, i|
%li{class: (:active if i.zero? && !crowd_enabled?)}
= link_to server['label'], "#tab-#{server['provider_name']}", 'data-toggle' => 'tab'
- if signin_enabled?
%li
= link_to 'Standard', '#tab-signin', 'data-toggle' => 'tab'
.tab-content
- if kerberos_enabled?
%div#tab-kerberos.tab-pane{class: (:active unless crowd_enabled? || ldap_enabled?)}
= render 'devise/sessions/new_kerberos', provider: :kerberos
- if crowd_enabled?
%div.tab-pane.active{id: "tab-crowd"}
= render 'devise/sessions/new_crowd'
- if ldap_enabled?
- @ldap_servers.each_with_index do |server, i|
%div.tab-pane{id: "tab-#{server['provider_name']}", class: (:active if i.zero? && !crowd_enabled?)}
= render 'devise/sessions/new_ldap', server: server
- if signin_enabled?
%div#tab-signin.tab-pane
= render 'devise/sessions/new_base'
=======
- if crowd_enabled?
%div.tab-pane.active{id: "tab-crowd"}
= render 'devise/sessions/new_crowd'
- @ldap_servers.each_with_index do |server, i|
%div.tab-pane{id: "tab-#{server['provider_name']}", class: (:active if i.zero? && !crowd_enabled?)}
= render 'devise/sessions/new_ldap', server: server
- if signin_enabled?
%div#tab-signin.tab-pane
= render 'devise/sessions/new_base'
>>>>>>> ce/master
- if form_based_providers.any?
- if crowd_enabled?
.login-box.tab-pane.active{id: "crowd", role: 'tabpanel', class: 'tab-pane'}
.login-body
= render 'devise/sessions/new_crowd'
- elsif signin_enabled?
= render 'devise/sessions/new_base'
- if kerberos_enabled?
.login-box.tab-pane{id: "kerberos", role: 'tabpanel', class: (:active unless crowd_enabled? || ldap_enabled?)}
.login-body
= render 'devise/sessions/new_kerberos'
- @ldap_servers.each_with_index do |server, i|
.login-box.tab-pane{id: "#{server['provider_name']}", role: 'tabpanel', class: (:active if i.zero? && !crowd_enabled?)}
.login-body
= render 'devise/sessions/new_ldap', server: server
- if signin_enabled?
.login-box.tab-pane{id: 'ldap-standard', role: 'tabpanel'}
.login-body
= render 'devise/sessions/new_base'
- elsif signin_enabled?
= render 'devise/sessions/new_base'
......@@ -12,13 +12,13 @@ describe 'devise/shared/_signin_box' do
render
expect(rendered).to have_selector('#tab-crowd form')
expect(rendered).to have_selector('#crowd form')
end
it 'is not shown when Crowd is disabled' do
render
expect(rendered).not_to have_selector('#tab-crowd')
expect(rendered).not_to have_selector('#crowd')
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment