diff options
author | Rémy Coutable <remy@rymai.me> | 2016-10-18 19:15:48 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-10-18 19:15:48 +0300 |
commit | 24b73bc921fa2a47c42a1718a666459cf3bcb505 (patch) | |
tree | f171d26169f5e23bed2a24433d4632a2a7691186 /app/views | |
parent | ec7b6b9f6c39c87ad9482849b5d27928104981d1 (diff) | |
parent | 9a6f73a6338a8ca6262bf5fff31042ad84569613 (diff) |
Merge branch 'login-fixups' into 'master'
LDAP login style fixups
## What does this MR do?
* Addresses regression found here: https://gitlab.com/gitlab-org/gitlab-ce/issues/23435
* Adds border radius to left/right tabs
## Are there points in the code the reviewer needs to double check?
So you know what you're seeing, there are three types of fixes going on here:
1. Template syntax errors that were displaying template-like language in the DOM (specifically with ldap and crowd username labels
2. Aesthetic problems in tabs that arise with more than 2 tabs
3. LDAP and crowd tab functionality. I had to move each panel into its own login box, to ensure that each panel's id synced with its associated tab's href, and that each panel was at an equal depth within the DOM. I assumed bootstrap tabs would look deeper into the login-box to find panels that matched the tabs. This is not true. The reason I didn't catch this is that in development I was just manually changing template flags to force rendering. I didn't realize I could enable ldap in CE within the gitlab.yml file :face_palm:
See merge request !6947
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/devise/sessions/_new_crowd.html.haml | 4 | ||||
-rw-r--r-- | app/views/devise/sessions/_new_ldap.html.haml | 4 | ||||
-rw-r--r-- | app/views/devise/shared/_signin_box.html.haml | 29 | ||||
-rw-r--r-- | app/views/devise/shared/_tabs_ldap.html.haml | 6 |
4 files changed, 23 insertions, 20 deletions
diff --git a/app/views/devise/sessions/_new_crowd.html.haml b/app/views/devise/sessions/_new_crowd.html.haml index e82a08cdb0c..1d381ad7893 100644 --- a/app/views/devise/sessions/_new_crowd.html.haml +++ b/app/views/devise/sessions/_new_crowd.html.haml @@ -1,6 +1,6 @@ = 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 + = 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 @@ -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" diff --git a/app/views/devise/sessions/_new_ldap.html.haml b/app/views/devise/sessions/_new_ldap.html.haml index b26efbb4535..c18bc2ac413 100644 --- a/app/views/devise/sessions/_new_ldap.html.haml +++ b/app/views/devise/sessions/_new_ldap.html.haml @@ -1,6 +1,6 @@ = 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']} Username" = 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" diff --git a/app/views/devise/shared/_signin_box.html.haml b/app/views/devise/shared/_signin_box.html.haml index 810dd5ab687..86edaf14e43 100644 --- a/app/views/devise/shared/_signin_box.html.haml +++ b/app/views/devise/shared/_signin_box.html.haml @@ -1,15 +1,18 @@ -#login-pane.login-box{ role: 'tabpanel', class: 'tab-pane active' } - .login-body - - if form_based_providers.any? - - 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' +- 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' + - @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? +- elsif signin_enabled? + .login-box.tab-pane.active{id: 'login-pane', role: 'tabpanel'} + .login-body = render 'devise/sessions/new_base' diff --git a/app/views/devise/shared/_tabs_ldap.html.haml b/app/views/devise/shared/_tabs_ldap.html.haml index e276e91433a..a057f126c45 100644 --- a/app/views/devise/shared/_tabs_ldap.html.haml +++ b/app/views/devise/shared/_tabs_ldap.html.haml @@ -1,10 +1,10 @@ %ul.new-session-tabs.nav-links.nav-tabs - if crowd_enabled? %li.active - = link_to "Crowd", "#tab-crowd", 'data-toggle' => 'tab' + = link_to "Crowd", "#crowd", 'data-toggle' => 'tab' - @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' + = link_to server['label'], "##{server['provider_name']}", 'data-toggle' => 'tab' - if signin_enabled? %li - = link_to 'Standard', '#tab-signin', 'data-toggle' => 'tab' + = link_to 'Standard', '#ldap-standard', 'data-toggle' => 'tab' |