summaryrefslogtreecommitdiff
path: root/app/views/devise
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-07 17:07:36 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-07 17:07:36 -0800
commitd02a22ba21f91d2aa4f9cf716dc3aefcf7e7495e (patch)
treee2c08769992618a72e83c7c7584613ba1e00fc3c /app/views/devise
parent757df0142f521380b92d28a721a7fd2bd8aa382f (diff)
downloadgitlab-ce-d02a22ba21f91d2aa4f9cf716dc3aefcf7e7495e.tar.gz
Redesign signin/singup pages
Diffstat (limited to 'app/views/devise')
-rw-r--r--app/views/devise/sessions/_new_base.html.haml2
-rw-r--r--app/views/devise/sessions/_new_ldap.html.haml1
-rw-r--r--app/views/devise/sessions/new.html.haml52
-rw-r--r--app/views/devise/shared/_oauth_box.html.haml (renamed from app/views/devise/sessions/_oauth_providers.html.haml)4
-rw-r--r--app/views/devise/shared/_signin_box.html.haml25
-rw-r--r--app/views/devise/shared/_signup_box.html.haml17
6 files changed, 57 insertions, 44 deletions
diff --git a/app/views/devise/sessions/_new_base.html.haml b/app/views/devise/sessions/_new_base.html.haml
index e819847e5ea..ab9085f0ba7 100644
--- a/app/views/devise/sessions/_new_base.html.haml
+++ b/app/views/devise/sessions/_new_base.html.haml
@@ -2,7 +2,7 @@
= f.text_field :login, class: "form-control top", placeholder: "Username or Email", autofocus: "autofocus"
= f.password_field :password, class: "form-control bottom", placeholder: "Password"
- if devise_mapping.rememberable?
- .clearfix.append-bottom-10
+ .remember-me
%label.checkbox.remember_me{for: "user_remember_me"}
= f.check_box :remember_me
%span Remember me
diff --git a/app/views/devise/sessions/_new_ldap.html.haml b/app/views/devise/sessions/_new_ldap.html.haml
index bf8a593c254..e986989a728 100644
--- a/app/views/devise/sessions/_new_ldap.html.haml
+++ b/app/views/devise/sessions/_new_ldap.html.haml
@@ -1,5 +1,4 @@
= form_tag(user_omniauth_callback_path(provider), id: 'new_ldap_user' ) do
= text_field_tag :username, nil, {class: "form-control top", placeholder: "LDAP Login", autofocus: "autofocus"}
= password_field_tag :password, nil, {class: "form-control bottom", placeholder: "Password"}
- %br/
= button_tag "LDAP Sign in", class: "btn-save btn"
diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml
index ca7e9570b43..5e31d8e818a 100644
--- a/app/views/devise/sessions/new.html.haml
+++ b/app/views/devise/sessions/new.html.haml
@@ -1,43 +1,15 @@
-.login-box
- .login-heading
- %h3 Sign in
- .login-body
- - if ldap_enabled?
- %ul.nav.nav-tabs
- - @ldap_servers.each_with_index do |server, i|
- %li{class: (:active if i.zero?)}
- = link_to server['label'], "#tab-#{server['provider_name']}", 'data-toggle' => 'tab'
- - if gitlab_config.signin_enabled
- %li
- = link_to 'Standard', '#tab-signin', 'data-toggle' => 'tab'
- .tab-content
- - @ldap_servers.each_with_index do |server, i|
- %div.tab-pane{id: "tab-#{server['provider_name']}", class: (:active if i.zero?)}
- = render 'devise/sessions/new_ldap', provider: server['provider_name']
- - if gitlab_config.signin_enabled
- %div#tab-signin.tab-pane
- = render 'devise/sessions/new_base'
+%div
+ = render 'devise/shared/signin_box'
- - elsif gitlab_config.signin_enabled
- = render 'devise/sessions/new_base'
- - else
- %div
- No authentication methods configured.
+ - if Gitlab.config.omniauth.enabled && devise_mapping.omniauthable?
+ .prepend-top-20
+ = render 'devise/shared/oauth_box'
- = render 'devise/sessions/oauth_providers' if Gitlab.config.omniauth.enabled && devise_mapping.omniauthable?
+ - if gitlab_config.signup_enabled
+ .prepend-top-20
+ = render 'devise/shared/signup_box'
- .login-footer
- - if gitlab_config.signup_enabled
- %p
- %span.light
- Don't have an account?
- %strong
- = link_to "Sign up", new_registration_path(resource_name)
-
- %p
- %span.light Did not receive confirmation email?
- = link_to "Send again", new_confirmation_path(resource_name)
-
- - if extra_config.has_key?('sign_in_text')
- %hr
- = markdown(extra_config.sign_in_text)
+.clearfix.prepend-top-20
+ %p
+ %span.light Did not receive confirmation email?
+ = link_to "Send again", new_confirmation_path(resource_name)
diff --git a/app/views/devise/sessions/_oauth_providers.html.haml b/app/views/devise/shared/_oauth_box.html.haml
index 8d6aaefb9ff..c2e1373de30 100644
--- a/app/views/devise/sessions/_oauth_providers.html.haml
+++ b/app/views/devise/shared/_oauth_box.html.haml
@@ -1,7 +1,7 @@
- providers = additional_providers
- if providers.present?
- .bs-callout.bs-callout-info{:'data-no-turbolink' => 'data-no-turbolink'}
- %span Sign in with: &nbsp;
+ .login-box{:'data-no-turbolink' => 'data-no-turbolink'}
+ %span Sign in with &nbsp;
- providers.each do |provider|
%span
- if default_providers.include?(provider)
diff --git a/app/views/devise/shared/_signin_box.html.haml b/app/views/devise/shared/_signin_box.html.haml
new file mode 100644
index 00000000000..3f2161ff6a4
--- /dev/null
+++ b/app/views/devise/shared/_signin_box.html.haml
@@ -0,0 +1,25 @@
+.login-box
+ .login-heading
+ %h3 Sign in
+ .login-body
+ - if ldap_enabled?
+ %ul.nav.nav-tabs
+ - @ldap_servers.each_with_index do |server, i|
+ %li{class: (:active if i.zero?)}
+ = link_to server['label'], "#tab-#{server['provider_name']}", 'data-toggle' => 'tab'
+ - if gitlab_config.signin_enabled
+ %li
+ = link_to 'Standard', '#tab-signin', 'data-toggle' => 'tab'
+ .tab-content
+ - @ldap_servers.each_with_index do |server, i|
+ %div.tab-pane{id: "tab-#{server['provider_name']}", class: (:active if i.zero?)}
+ = render 'devise/sessions/new_ldap', provider: server['provider_name']
+ - if gitlab_config.signin_enabled
+ %div#tab-signin.tab-pane
+ = render 'devise/sessions/new_base'
+
+ - elsif gitlab_config.signin_enabled
+ = render 'devise/sessions/new_base'
+ - else
+ %div
+ No authentication methods configured.
diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml
new file mode 100644
index 00000000000..5709c661288
--- /dev/null
+++ b/app/views/devise/shared/_signup_box.html.haml
@@ -0,0 +1,17 @@
+.login-box
+ .login-heading
+ %h3 Sign up
+ .login-body
+ = form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
+ .devise-errors
+ = devise_error_messages!
+ %div
+ = f.text_field :name, class: "form-control top", placeholder: "Name", required: true
+ %div
+ = f.text_field :username, class: "form-control middle", placeholder: "Username", required: true
+ %div
+ = f.email_field :email, class: "form-control middle", placeholder: "Email", required: true
+ .form-group#password-strength
+ = f.password_field :password, class: "form-control bottom", id: "user_password_sign_up", placeholder: "Password", required: true
+ %div
+ = f.submit "Sign up", class: "btn-create btn"