diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-02 15:18:59 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-02 15:18:59 -0800 |
commit | 12581f15eeb7b60e966c89642233bb2a1d9306ee (patch) | |
tree | 2d32052d9549c4d290f8b5e4b95050871dc1b260 /app/views | |
parent | e39bf83770fe804112eef6e3d8651994d506a740 (diff) | |
parent | 252ee4e7e51ae18f30f4b9089be850daaca958ac (diff) | |
download | gitlab-ce-12581f15eeb7b60e966c89642233bb2a1d9306ee.tar.gz |
Merge pull request #7473 from sodabrew/patch-1
Improve login screen when only OmniAuth providers are enabled
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/devise/sessions/new.html.haml | 16 | ||||
-rw-r--r-- | app/views/devise/shared/_omniauth_box.html.haml | 10 | ||||
-rw-r--r-- | app/views/devise/shared/_signin_box.html.haml | 16 |
3 files changed, 24 insertions, 18 deletions
diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index fa2460518fc..89e4e229ac0 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,6 +1,18 @@ %div - = render 'devise/shared/signin_box' + - if signin_enabled? || ldap_enabled? + = render 'devise/shared/signin_box' - - if signup_enabled? + -# Omniauth fits between signin/ldap signin and signup and does not have a surrounding box + - if Gitlab.config.omniauth.enabled && devise_mapping.omniauthable? + .clearfix.prepend-top-20 + = render 'devise/shared/omniauth_box' + + -# Signup only makes sense if you can also sign-in + - if signin_enabled? && signup_enabled? .prepend-top-20 = render 'devise/shared/signup_box' + + -# Show a message if none of the mechanisms above are enabled + - if !signin_enabled? && !ldap_enabled? && !(Gitlab.config.omniauth.enabled && devise_mapping.omniauthable?) + %div + No authentication methods configured. diff --git a/app/views/devise/shared/_omniauth_box.html.haml b/app/views/devise/shared/_omniauth_box.html.haml new file mode 100644 index 00000000000..4cd1c303b22 --- /dev/null +++ b/app/views/devise/shared/_omniauth_box.html.haml @@ -0,0 +1,10 @@ +%p + %span.light + Sign in with + - providers = additional_providers + - providers.each do |provider| + %span.light + - if default_providers.include?(provider) + = link_to authbutton(provider, 32), omniauth_authorize_path(resource_name, provider) + - else + = link_to provider.to_s.titleize, omniauth_authorize_path(resource_name, provider), class: "btn" diff --git a/app/views/devise/shared/_signin_box.html.haml b/app/views/devise/shared/_signin_box.html.haml index 805cf816231..8faa6398a60 100644 --- a/app/views/devise/shared/_signin_box.html.haml +++ b/app/views/devise/shared/_signin_box.html.haml @@ -24,19 +24,3 @@ - elsif signin_enabled? = render 'devise/sessions/new_base' - - else - %div - No authentication methods configured. - -- if Gitlab.config.omniauth.enabled && devise_mapping.omniauthable? - .clearfix.prepend-top-20 - %p - %span.light - Sign in with - - providers = additional_providers - - providers.each do |provider| - %span.light - - if default_providers.include?(provider) - = link_to authbutton(provider, 32), omniauth_authorize_path(resource_name, provider) - - else - = link_to provider.to_s.titleize, omniauth_authorize_path(resource_name, provider), class: "btn"
\ No newline at end of file |