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
iv
gitlab-ce
Commits
f06f69b9
Commit
f06f69b9
authored
Dec 14, 2014
by
Drew Blessing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add theme type css class
parent
be206a51
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
33 additions
and
15 deletions
+33
-15
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+4
-0
app/views/layouts/admin.html.haml
app/views/layouts/admin.html.haml
+1
-1
app/views/layouts/application.html.haml
app/views/layouts/application.html.haml
+1
-1
app/views/layouts/errors.html.haml
app/views/layouts/errors.html.haml
+1
-1
app/views/layouts/explore.html.haml
app/views/layouts/explore.html.haml
+1
-1
app/views/layouts/group.html.haml
app/views/layouts/group.html.haml
+1
-1
app/views/layouts/navless.html.haml
app/views/layouts/navless.html.haml
+1
-1
app/views/layouts/profile.html.haml
app/views/layouts/profile.html.haml
+1
-1
app/views/layouts/project_settings.html.haml
app/views/layouts/project_settings.html.haml
+1
-1
app/views/layouts/projects.html.haml
app/views/layouts/projects.html.haml
+1
-1
app/views/layouts/public_group.html.haml
app/views/layouts/public_group.html.haml
+1
-1
app/views/layouts/public_projects.html.haml
app/views/layouts/public_projects.html.haml
+1
-1
app/views/layouts/public_users.html.haml
app/views/layouts/public_users.html.haml
+1
-1
app/views/layouts/search.html.haml
app/views/layouts/search.html.haml
+1
-1
app/views/profiles/update.js.erb
app/views/profiles/update.js.erb
+2
-2
lib/gitlab/theme.rb
lib/gitlab/theme.rb
+14
-0
No files found.
app/helpers/application_helper.rb
View file @
f06f69b9
...
@@ -114,6 +114,10 @@ module ApplicationHelper
...
@@ -114,6 +114,10 @@ module ApplicationHelper
Gitlab
::
Theme
.
css_class_by_id
(
current_user
.
try
(
:theme_id
))
Gitlab
::
Theme
.
css_class_by_id
(
current_user
.
try
(
:theme_id
))
end
end
def
theme_type
Gitlab
::
Theme
.
type_css_class_by_id
(
current_user
.
try
(
:theme_id
))
end
def
user_color_scheme_class
def
user_color_scheme_class
COLOR_SCHEMES
[
current_user
.
try
(
:color_scheme_id
)]
if
defined?
(
current_user
)
COLOR_SCHEMES
[
current_user
.
try
(
:color_scheme_id
)]
if
defined?
(
current_user
)
end
end
...
...
app/views/layouts/admin.html.haml
View file @
f06f69b9
!!! 5
!!! 5
%html
{
lang:
"en"
}
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
"Admin area"
=
render
"layouts/head"
,
title:
"Admin area"
%body
{
class:
"#{app_theme} admin"
,
:'data-page'
=>
body_data_page
}
%body
{
class:
"#{app_theme}
#{theme_type}
admin"
,
:'data-page'
=>
body_data_page
}
=
render
"layouts/broadcast"
=
render
"layouts/broadcast"
=
render
"layouts/head_panel"
,
title:
"Admin area"
=
render
"layouts/head_panel"
,
title:
"Admin area"
%nav
.main-nav.navbar-collapse.collapse
%nav
.main-nav.navbar-collapse.collapse
...
...
app/views/layouts/application.html.haml
View file @
f06f69b9
!!! 5
!!! 5
%html
{
lang:
"en"
}
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
"Dashboard"
=
render
"layouts/head"
,
title:
"Dashboard"
%body
{
class:
"#{app_theme} application"
,
:'data-page'
=>
body_data_page
}
%body
{
class:
"#{app_theme}
#{theme_type}
application"
,
:'data-page'
=>
body_data_page
}
=
render
"layouts/broadcast"
=
render
"layouts/broadcast"
=
render
"layouts/head_panel"
,
title:
"Dashboard"
=
render
"layouts/head_panel"
,
title:
"Dashboard"
%nav
.main-nav.navbar-collapse.collapse
%nav
.main-nav.navbar-collapse.collapse
...
...
app/views/layouts/errors.html.haml
View file @
f06f69b9
!!! 5
!!! 5
%html
{
lang:
"en"
}
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
"Error"
=
render
"layouts/head"
,
title:
"Error"
%body
{
class:
"#{app_theme} application"
}
%body
{
class:
"#{app_theme}
#{theme_type}
application"
}
=
render
"layouts/head_panel"
,
title:
""
if
current_user
=
render
"layouts/head_panel"
,
title:
""
if
current_user
.container.navless-container
.container.navless-container
=
render
"layouts/flash"
=
render
"layouts/flash"
...
...
app/views/layouts/explore.html.haml
View file @
f06f69b9
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
!!! 5
!!! 5
%html
{
lang:
"en"
}
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
page_title
=
render
"layouts/head"
,
title:
page_title
%body
{
class:
"#{app_theme} application"
,
:'data-page'
=>
body_data_page
}
%body
{
class:
"#{app_theme}
#{theme_type}
application"
,
:'data-page'
=>
body_data_page
}
=
render
"layouts/broadcast"
=
render
"layouts/broadcast"
-
if
current_user
-
if
current_user
=
render
"layouts/head_panel"
,
title:
page_title
=
render
"layouts/head_panel"
,
title:
page_title
...
...
app/views/layouts/group.html.haml
View file @
f06f69b9
!!! 5
!!! 5
%html
{
lang:
"en"
}
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
group_head_title
=
render
"layouts/head"
,
title:
group_head_title
%body
{
class:
"#{app_theme} application"
,
:'data-page'
=>
body_data_page
}
%body
{
class:
"#{app_theme}
#{theme_type}
application"
,
:'data-page'
=>
body_data_page
}
=
render
"layouts/broadcast"
=
render
"layouts/broadcast"
=
render
"layouts/head_panel"
,
title:
"group:
#{
@group
.
name
}
"
=
render
"layouts/head_panel"
,
title:
"group:
#{
@group
.
name
}
"
%nav
.main-nav.navbar-collapse.collapse
%nav
.main-nav.navbar-collapse.collapse
...
...
app/views/layouts/navless.html.haml
View file @
f06f69b9
!!! 5
!!! 5
%html
{
lang:
"en"
}
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
@title
=
render
"layouts/head"
,
title:
@title
%body
{
class:
"#{app_theme} application"
,
:'data-page'
=>
body_data_page
}
%body
{
class:
"#{app_theme}
#{theme_type}
application"
,
:'data-page'
=>
body_data_page
}
=
render
"layouts/broadcast"
=
render
"layouts/broadcast"
=
render
"layouts/head_panel"
,
title:
@title
=
render
"layouts/head_panel"
,
title:
@title
.container.navless-container
.container.navless-container
...
...
app/views/layouts/profile.html.haml
View file @
f06f69b9
!!! 5
!!! 5
%html
{
lang:
"en"
}
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
"Profile"
=
render
"layouts/head"
,
title:
"Profile"
%body
{
class:
"#{app_theme} profile"
,
:'data-page'
=>
body_data_page
}
%body
{
class:
"#{app_theme}
#{theme_type}
profile"
,
:'data-page'
=>
body_data_page
}
=
render
"layouts/broadcast"
=
render
"layouts/broadcast"
=
render
"layouts/head_panel"
,
title:
"Profile"
=
render
"layouts/head_panel"
,
title:
"Profile"
%nav
.main-nav.navbar-collapse.collapse
%nav
.main-nav.navbar-collapse.collapse
...
...
app/views/layouts/project_settings.html.haml
View file @
f06f69b9
!!! 5
!!! 5
%html
{
lang:
"en"
}
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
@project
.
name_with_namespace
=
render
"layouts/head"
,
title:
@project
.
name_with_namespace
%body
{
class:
"#{app_theme} project"
,
:'data-page'
=>
body_data_page
,
:'data-project-id'
=>
@project
.
id
}
%body
{
class:
"#{app_theme}
#{theme_type}
project"
,
:'data-page'
=>
body_data_page
,
:'data-project-id'
=>
@project
.
id
}
=
render
"layouts/broadcast"
=
render
"layouts/broadcast"
=
render
"layouts/head_panel"
,
title:
project_title
(
@project
)
=
render
"layouts/head_panel"
,
title:
project_title
(
@project
)
=
render
"layouts/init_auto_complete"
=
render
"layouts/init_auto_complete"
...
...
app/views/layouts/projects.html.haml
View file @
f06f69b9
!!! 5
!!! 5
%html
{
lang:
"en"
}
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
project_head_title
=
render
"layouts/head"
,
title:
project_head_title
%body
{
class:
"#{app_theme} project"
,
:'data-page'
=>
body_data_page
,
:'data-project-id'
=>
@project
.
id
}
%body
{
class:
"#{app_theme}
#{theme_type}
project"
,
:'data-page'
=>
body_data_page
,
:'data-project-id'
=>
@project
.
id
}
=
render
"layouts/broadcast"
=
render
"layouts/broadcast"
=
render
"layouts/head_panel"
,
title:
project_title
(
@project
)
=
render
"layouts/head_panel"
,
title:
project_title
(
@project
)
=
render
"layouts/init_auto_complete"
=
render
"layouts/init_auto_complete"
...
...
app/views/layouts/public_group.html.haml
View file @
f06f69b9
!!! 5
!!! 5
%html
{
lang:
"en"
}
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
group_head_title
=
render
"layouts/head"
,
title:
group_head_title
%body
{
class:
"#{app_theme} application"
,
:'data-page'
=>
body_data_page
}
%body
{
class:
"#{app_theme}
#{theme_type}
application"
,
:'data-page'
=>
body_data_page
}
=
render
"layouts/broadcast"
=
render
"layouts/broadcast"
=
render
"layouts/public_head_panel"
,
title:
"group:
#{
@group
.
name
}
"
=
render
"layouts/public_head_panel"
,
title:
"group:
#{
@group
.
name
}
"
%nav
.main-nav.navbar-collapse.collapse
%nav
.main-nav.navbar-collapse.collapse
...
...
app/views/layouts/public_projects.html.haml
View file @
f06f69b9
!!! 5
!!! 5
%html
{
lang:
"en"
}
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
@project
.
name_with_namespace
=
render
"layouts/head"
,
title:
@project
.
name_with_namespace
%body
{
class:
"#{app_theme} application"
,
:'data-page'
=>
body_data_page
}
%body
{
class:
"#{app_theme}
#{theme_type}
application"
,
:'data-page'
=>
body_data_page
}
=
render
"layouts/broadcast"
=
render
"layouts/broadcast"
=
render
"layouts/public_head_panel"
,
title:
project_title
(
@project
)
=
render
"layouts/public_head_panel"
,
title:
project_title
(
@project
)
%nav
.main-nav.navbar-collapse.collapse
%nav
.main-nav.navbar-collapse.collapse
...
...
app/views/layouts/public_users.html.haml
View file @
f06f69b9
!!! 5
!!! 5
%html
{
lang:
"en"
}
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
@title
=
render
"layouts/head"
,
title:
@title
%body
{
class:
"#{app_theme} application"
,
:'data-page'
=>
body_data_page
}
%body
{
class:
"#{app_theme}
#{theme_type}
application"
,
:'data-page'
=>
body_data_page
}
=
render
"layouts/broadcast"
=
render
"layouts/broadcast"
=
render
"layouts/public_head_panel"
,
title:
@title
=
render
"layouts/public_head_panel"
,
title:
@title
.container.navless-container
.container.navless-container
...
...
app/views/layouts/search.html.haml
View file @
f06f69b9
!!! 5
!!! 5
%html
{
lang:
"en"
}
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
"Search"
=
render
"layouts/head"
,
title:
"Search"
%body
{
class:
"#{app_theme} application"
,
:'data-page'
=>
body_data_page
}
%body
{
class:
"#{app_theme}
#{theme_type}
application"
,
:'data-page'
=>
body_data_page
}
=
render
"layouts/broadcast"
=
render
"layouts/broadcast"
=
render
"layouts/head_panel"
,
title:
"Search"
=
render
"layouts/head_panel"
,
title:
"Search"
.container.navless-container
.container.navless-container
...
...
app/views/profiles/update.js.erb
View file @
f06f69b9
// Remove body class for any previous theme, re-add current one
// Remove body class for any previous theme, re-add current one
$('body').removeClass('ui_basic ui_mars ui_modern ui_gray ui_color')
$('body').removeClass('ui_basic ui_mars ui_modern ui_gray ui_color
light_theme dark_theme
')
$('body').addClass('
<%=
app_theme
%>
')
$('body').addClass('
<%=
app_theme
%>
<%=
theme_type
%>
')
// Re-render the header to reflect the new theme
// Re-render the header to reflect the new theme
$('header').html('
<%=
escape_javascript
(
render
(
"layouts/head_panel"
,
title:
"Profile"
))
%>
')
$('header').html('
<%=
escape_javascript
(
render
(
"layouts/head_panel"
,
title:
"Profile"
))
%>
')
...
...
lib/gitlab/theme.rb
View file @
f06f69b9
...
@@ -19,5 +19,19 @@ module Gitlab
...
@@ -19,5 +19,19 @@ module Gitlab
return
themes
[
id
]
return
themes
[
id
]
end
end
def
self
.
type_css_class_by_id
(
id
)
types
=
{
BASIC
=>
'light_theme'
,
MARS
=>
'dark_theme'
,
MODERN
=>
'dark_theme'
,
GRAY
=>
'dark_theme'
,
COLOR
=>
'dark_theme'
}
id
||=
Gitlab
.
config
.
gitlab
.
default_theme
types
[
id
]
end
end
end
end
end
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