diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-10-22 11:29:03 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-10-22 11:29:03 +0000 |
commit | 1eb4f20ca1487948fda6a6e8b80fa719d16febbd (patch) | |
tree | 9a3237754a17eac2edf964f258a005ffdedc7fb1 | |
parent | 7dd21a8bfd418705c26fcc9e081450ef6f4aae86 (diff) | |
parent | 57046eb0abf280594d6625db3429f13d45499c83 (diff) | |
download | gitlab-ce-1eb4f20ca1487948fda6a6e8b80fa719d16febbd.tar.gz |
Merge branch 'ldap-login-styles' into 'master'
Support LDAP login tabs wrapping to second line (and a few other login fixes)
## What does this MR do?
Fixes some regressions introduced for customers with multiple servers configured for login and/or long label names.
Also, improves styling for the login page on small screens.
## Are there points in the code the reviewer needs to double check?
## Why was this MR needed?
See the bad behavior here: https://gitlab.com/gitlab-org/gitlab-ce/issues/23435#note_17117893
## Screenshots (if relevant)
![2016-10-19_16.34.00](/uploads/2816545b4db60ddb6430c458c2c41582/2016-10-19_16.34.00.gif)
![2016-10-19_18.07.26](/uploads/53340d5894db6441cc82b182fb47cf18/2016-10-19_18.07.26.gif)
## Does this MR meet the acceptance criteria?
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
https://gitlab.com/gitlab-org/gitlab-ce/issues/23435#note_17117677
See merge request !6993
-rw-r--r-- | app/assets/stylesheets/pages/login.scss | 34 | ||||
-rw-r--r-- | app/views/devise/sessions/two_factor.html.haml | 2 | ||||
-rw-r--r-- | app/views/devise/shared/_tabs_ldap.html.haml | 2 |
3 files changed, 35 insertions, 3 deletions
diff --git a/app/assets/stylesheets/pages/login.scss b/app/assets/stylesheets/pages/login.scss index bdb13bee178..9496234c773 100644 --- a/app/assets/stylesheets/pages/login.scss +++ b/app/assets/stylesheets/pages/login.scss @@ -143,6 +143,7 @@ &:not(.active) { background-color: $gray-light; + border-left: 1px solid $border-color; } a { @@ -170,6 +171,31 @@ } } + // Ldap configurations may need more tabs & the tab labels are user generated (arbitrarily long). + // These styles prevent this from breaking the layout, and only applied when providers are configured. + + .new-session-tabs.custom-provider-tabs { + flex-wrap: wrap; + + li { + min-width: 85px; + flex-basis: auto; + + // This styles tab elements that have wrapped to a second line. We cannot easily predict when this will happen. + // We are making somewhat of an assumption about the configuration here: that users do not have more than + // 3 LDAP servers configured (in addition to standard login) and they are not using especially long names for any + // of them. If either condition is false, this will work as expected. If both are true, there may be a missing border + // above one of the bottom row elements. If you know a better way, please implement it! + &:nth-child(n+5) { + border-top: 1px solid $border-color; + } + } + + a { + font-size: 16px; + } + } + .form-control { &:active, &:focus { @@ -203,6 +229,7 @@ .login-page { .col-sm-5.pull-right { float: none !important; + margin-bottom: 45px; } } } @@ -244,7 +271,11 @@ } .navless-container { - padding: 65px; // height of footer + bottom padding of email confirmation link + padding: 65px 15px; // height of footer + bottom padding of email confirmation link + + @media (max-width: $screen-xs-max) { + padding: 0 15px 65px; + } } } @@ -263,3 +294,4 @@ bottom: 0; } } + diff --git a/app/views/devise/sessions/two_factor.html.haml b/app/views/devise/sessions/two_factor.html.haml index 0e865b807c1..fd77cdbee2e 100644 --- a/app/views/devise/sessions/two_factor.html.haml +++ b/app/views/devise/sessions/two_factor.html.haml @@ -10,7 +10,7 @@ = form_for(resource, as: resource_name, url: session_path(resource_name), method: :post, html: { class: 'edit_user show-gl-field-errors' }) do |f| - resource_params = params[resource_name].presence || params = f.hidden_field :remember_me, value: resource_params.fetch(:remember_me, 0) - .form-group + %div = f.label 'Two-Factor Authentication code', name: :otp_attempt = f.text_field :otp_attempt, class: 'form-control', required: true, autofocus: true, autocomplete: 'off', title: 'This field is required.' %p.help-block.hint Enter the code from the two-factor app on your mobile device. If you've lost your device, you may enter one of your recovery codes. diff --git a/app/views/devise/shared/_tabs_ldap.html.haml b/app/views/devise/shared/_tabs_ldap.html.haml index a057f126c45..1e957f0935f 100644 --- a/app/views/devise/shared/_tabs_ldap.html.haml +++ b/app/views/devise/shared/_tabs_ldap.html.haml @@ -1,4 +1,4 @@ -%ul.new-session-tabs.nav-links.nav-tabs +%ul.new-session-tabs.nav-links.nav-tabs{ class: ('custom-provider-tabs' if form_based_providers.any?) } - if crowd_enabled? %li.active = link_to "Crowd", "#crowd", 'data-toggle' => 'tab' |