Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
a3645b5b
Commit
a3645b5b
authored
May 24, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restyle login page for LDAP/regular login
parent
7cb86eb3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
69 additions
and
60 deletions
+69
-60
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+0
-4
app/helpers/oauth_helper.rb
app/helpers/oauth_helper.rb
+13
-0
app/views/devise/sessions/_new_base.html.haml
app/views/devise/sessions/_new_base.html.haml
+13
-0
app/views/devise/sessions/_new_ldap.html.haml
app/views/devise/sessions/_new_ldap.html.haml
+2
-26
app/views/devise/sessions/_oauth_providers.html.haml
app/views/devise/sessions/_oauth_providers.html.haml
+10
-0
app/views/devise/sessions/new.html.haml
app/views/devise/sessions/new.html.haml
+29
-30
config/gitlab.yml.example
config/gitlab.yml.example
+2
-0
No files found.
app/helpers/application_helper.rb
View file @
a3645b5b
...
@@ -119,10 +119,6 @@ module ApplicationHelper
...
@@ -119,10 +119,6 @@ module ApplicationHelper
Emoji
.
names
.
to_s
Emoji
.
names
.
to_s
end
end
def
ldap_enable?
Devise
.
omniauth_providers
.
include?
(
:ldap
)
end
def
app_theme
def
app_theme
Gitlab
::
Theme
.
css_class_by_id
(
current_user
.
try
(
:theme_id
))
Gitlab
::
Theme
.
css_class_by_id
(
current_user
.
try
(
:theme_id
))
end
end
...
...
app/helpers/oauth_helper.rb
0 → 100644
View file @
a3645b5b
module
OauthHelper
def
ldap_enabled?
Devise
.
omniauth_providers
.
include?
(
:ldap
)
end
def
default_providers
[
:twitter
,
:github
,
:google_oauth2
,
:ldap
]
end
def
enabled_oauth_providers
Devise
.
omniauth_providers
end
end
app/views/devise/sessions/_new_base.html.haml
0 → 100644
View file @
a3645b5b
=
form_for
(
resource
,
as:
resource_name
,
url:
session_path
(
resource_name
))
do
|
f
|
=
f
.
text_field
:login
,
class:
"text top"
,
placeholder:
"Username or Email"
,
autofocus:
"autofocus"
=
f
.
password_field
:password
,
class:
"text bottom"
,
placeholder:
"Password"
-
if
devise_mapping
.
rememberable?
.clearfix.inputs-list
%label
.checkbox.remember_me
{
for:
"user_remember_me"
}
=
f
.
check_box
:remember_me
%span
Remember me
=
f
.
submit
"Sign in"
,
class:
"btn-create btn"
.pull-right
=
link_to
"Forgot your password?"
,
new_password_path
(
resource_name
),
class:
"btn"
app/views/devise/sessions/_new_ldap.html.haml
View file @
a3645b5b
=
form_tag
(
user_omniauth_callback_path
(
:ldap
),
class:
"login-box"
,
id:
'new_ldap_user'
)
do
=
form_tag
(
user_omniauth_callback_path
(
:ldap
),
id:
'new_ldap_user'
)
do
=
image_tag
"login-logo.png"
,
width:
"304"
,
height:
"66"
,
class:
"login-logo"
,
alt:
"Login Logo"
=
text_field_tag
:username
,
nil
,
{
class:
"text top"
,
placeholder:
"LDAP Login"
,
autofocus:
"autofocus"
}
=
text_field_tag
:username
,
nil
,
{
class:
"text top"
,
placeholder:
"LDAP Login"
,
autofocus:
"autofocus"
}
=
password_field_tag
:password
,
nil
,
{
class:
"text bottom"
,
placeholder:
"Password"
}
=
password_field_tag
:password
,
nil
,
{
class:
"text bottom"
,
placeholder:
"Password"
}
%br
/
%br
/
=
submit_tag
"LDAP Sign in"
,
class:
"btn-primary btn"
=
submit_tag
"LDAP Sign in"
,
class:
"btn-create btn"
-
if
devise_mapping
.
omniauthable?
-
(
resource_class
.
omniauth_providers
-
[
:ldap
]).
each
do
|
provider
|
%hr
/
=
link_to
"Sign in with
#{
provider
.
to_s
.
titleize
}
"
,
omniauth_authorize_path
(
resource_name
,
provider
),
class:
"btn btn-primary"
%br
/
%hr
/
%a
#other_form_toggle
{
href:
"#"
,
onclick:
"javascript:$('#new_user').toggle();"
}
Other Sign in
:javascript
$
(
function
()
{
$
(
'
#new_user
'
).
toggle
();
});
=
form_for
(
resource
,
as:
resource_name
,
url:
session_path
(
resource_name
),
html:
{
class:
"login-box"
})
do
|
f
|
=
f
.
text_field
:login
,
class:
"text top"
,
placeholder:
"Username or Email"
,
autofocus:
"autofocus"
=
f
.
password_field
:password
,
class:
"text bottom"
,
placeholder:
"Password"
-
if
devise_mapping
.
rememberable?
.clearfix.inputs-list
%label
.checkbox.remember_me
{
for:
"user_remember_me"
}
=
f
.
check_box
:remember_me
%span
Remember me
%br
/
=
f
.
submit
"Sign in"
,
class:
"btn-primary btn"
.pull-right
=
render
partial:
"devise/shared/links"
app/views/devise/sessions/_oauth_providers.html.haml
0 → 100644
View file @
a3645b5b
-
if
enabled_oauth_providers
.
present?
%hr
%div
{
:'data-no-turbolink'
=>
'data-no-turbolink'
}
%span
Sign in with:
-
(
enabled_oauth_providers
-
[
:ldap
]).
each
do
|
provider
|
%span
-
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"
app/views/devise/sessions/new.html.haml
View file @
a3645b5b
-
if
ldap_enable?
.login-box
=
render
partial:
'devise/sessions/new_ldap'
=
image_tag
"login-logo.png"
,
width:
"304"
,
height:
"66"
,
class:
"login-logo"
,
alt:
"Login Logo"
-
else
=
form_for
(
resource
,
as:
resource_name
,
url:
session_path
(
resource_name
),
html:
{
class:
"login-box"
})
do
|
f
|
-
if
ldap_enabled?
=
image_tag
"login-logo.png"
,
width:
"304"
,
height:
"66"
,
class:
"login-logo"
,
alt:
"Login Logo"
%ul
.nav.nav-tabs
=
f
.
text_field
:login
,
class:
"text top"
,
placeholder:
"Username or Email"
,
autofocus:
"autofocus"
%li
.active
=
f
.
password_field
:password
,
class:
"text bottom"
,
placeholder:
"Password"
=
link_to
'LDAP'
,
'#tab-ldap'
,
'data-toggle'
=>
'tab'
-
if
devise_mapping
.
rememberable?
%li
.clearfix.inputs-list
=
link_to
'Ordinary'
,
'#tab-signin'
,
'data-toggle'
=>
'tab'
%label
.checkbox.remember_me
{
for:
"user_remember_me"
}
.tab-content
=
f
.
check_box
:remember_me
%div
#tab-ldap
.tab-pane.active
%span
Remember me
=
render
partial:
'devise/sessions/new_ldap'
%br
/
%div
#tab-signin
.tab-pane
=
f
.
submit
"Sign in"
,
class:
"btn-create btn"
=
render
partial:
'devise/sessions/new_base'
.pull-right
=
link_to
"Forgot your password?"
,
new_password_path
(
resource_name
),
class:
"btn"
-
else
%br
/
=
render
partial:
'devise/sessions/new_base'
-
if
Gitlab
.
config
.
gitlab
.
signup_enabled
%hr
/
=
render
'devise/sessions/oauth_providers'
if
devise_mapping
.
omniauthable?
-
if
Gitlab
.
config
.
gitlab
.
signup_enabled
%hr
%div
Don't have an account?
Don't have an account?
=
link_to
"Sign up"
,
new_registration_path
(
resource_name
)
%strong
-
if
devise_mapping
.
omniauthable?
&&
resource_class
.
omniauth_providers
.
present?
=
link_to
"Sign up"
,
new_registration_path
(
resource_name
)
%hr
%div
%span
Sign in with:
-
resource_class
.
omniauth_providers
.
each
do
|
provider
|
%span
=
link_to
authbutton
(
provider
,
32
),
omniauth_authorize_path
(
resource_name
,
provider
)
-
if
extra_config
.
has_key?
(
'sign_in_text'
)
-
if
extra_config
.
has_key?
(
'sign_in_text'
)
%hr
%hr
=
markdown
(
extra_config
.
sign_in_text
)
=
markdown
(
extra_config
.
sign_in_text
)
config/gitlab.yml.example
View file @
a3645b5b
...
@@ -34,6 +34,8 @@ production: &base
...
@@ -34,6 +34,8 @@ production: &base
## Project settings
## Project settings
default_projects_limit: 10
default_projects_limit: 10
## Users management
# signup_enabled: true # default: false - Account passwords are not sent via the email if signup is enabled.
# signup_enabled: true # default: false - Account passwords are not sent via the email if signup is enabled.
# username_changing_enabled: false # default: true - User can change her username/namespace
# username_changing_enabled: false # default: true - User can change her username/namespace
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment