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
6ee15819
Commit
6ee15819
authored
Sep 06, 2017
by
Annabel Dunstone Gray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add previews in preferences
parent
7b567597
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
4 deletions
+75
-4
app/assets/stylesheets/pages/profiles/preferences.scss
app/assets/stylesheets/pages/profiles/preferences.scss
+64
-0
app/views/profiles/preferences/show.html.haml
app/views/profiles/preferences/show.html.haml
+9
-2
lib/gitlab/themes.rb
lib/gitlab/themes.rb
+1
-1
spec/lib/gitlab/themes_spec.rb
spec/lib/gitlab/themes_spec.rb
+1
-1
No files found.
app/assets/stylesheets/pages/profiles/preferences.scss
View file @
6ee15819
@mixin
application-theme-preview
(
$color-1
,
$color-2
,
$color-3
,
$color-4
)
{
.one
{
background-color
:
$color-1
;
border-top-left-radius
:
$border-radius-default
;
}
.two
{
background-color
:
$color-2
;
border-top-right-radius
:
$border-radius-default
;
}
.three
{
background-color
:
$color-3
;
border-bottom-left-radius
:
$border-radius-default
;
}
.four
{
background-color
:
$color-4
;
border-bottom-right-radius
:
$border-radius-default
;
}
}
.application-theme
{
label
{
margin-right
:
20px
;
text-align
:
center
;
}
.preview
{
font-size
:
0
;
margin-bottom
:
10px
;
&
.indigo
{
@include
application-theme-preview
(
$indigo-900
,
$indigo-700
,
$indigo-800
,
$indigo-500
);
}
&
.dark
{
@include
application-theme-preview
(
$theme-gray-900
,
$theme-gray-700
,
$theme-gray-800
,
$theme-gray-600
);
}
&
.light
{
@include
application-theme-preview
(
$theme-gray-600
,
$theme-gray-200
,
$theme-gray-400
,
$theme-gray-100
);
}
&
.blue
{
@include
application-theme-preview
(
$theme-blue-900
,
$theme-blue-700
,
$theme-blue-800
,
$theme-blue-500
);
}
&
.green
{
@include
application-theme-preview
(
$theme-green-900
,
$theme-green-700
,
$theme-green-800
,
$theme-green-500
);
}
}
.preview-row
{
display
:
block
;
}
.quadrant
{
display
:
inline-block
;
height
:
50px
;
width
:
80px
;
}
}
.syntax-theme
{
.syntax-theme
{
label
{
label
{
margin-right
:
20px
;
margin-right
:
20px
;
...
...
app/views/profiles/preferences/show.html.haml
View file @
6ee15819
...
@@ -5,11 +5,18 @@
...
@@ -5,11 +5,18 @@
=
form_for
@user
,
url:
profile_preferences_path
,
remote:
true
,
method: :put
,
html:
{
class:
'row prepend-top-default js-preferences-form'
}
do
|
f
|
=
form_for
@user
,
url:
profile_preferences_path
,
remote:
true
,
method: :put
,
html:
{
class:
'row prepend-top-default js-preferences-form'
}
do
|
f
|
.col-lg-4.application-theme
.col-lg-4.application-theme
%h4
.prepend-top-0
%h4
.prepend-top-0
GitLab theme
GitLab navigation theme
%p
Customize the appearance of the application header and navigation sidebar.
.col-lg-8.application-theme
.col-lg-8.application-theme
-
Gitlab
::
Themes
.
each
do
|
theme
|
-
Gitlab
::
Themes
.
each
do
|
theme
|
=
label_tag
do
=
label_tag
do
.preview
{
class:
theme
.
css_class
}
.preview
{
class:
theme
.
name
.
downcase
}
.preview-row
.quadrant.one
.quadrant.two
.preview-row
.quadrant.three
.quadrant.four
=
f
.
radio_button
:theme_id
,
theme
.
id
=
f
.
radio_button
:theme_id
,
theme
.
id
=
theme
.
name
=
theme
.
name
...
...
lib/gitlab/themes.rb
View file @
6ee15819
...
@@ -16,7 +16,7 @@ module Gitlab
...
@@ -16,7 +16,7 @@ module Gitlab
Theme
.
new
(
2
,
'Dark'
,
'ui_dark'
),
Theme
.
new
(
2
,
'Dark'
,
'ui_dark'
),
Theme
.
new
(
3
,
'Light'
,
'ui_light'
),
Theme
.
new
(
3
,
'Light'
,
'ui_light'
),
Theme
.
new
(
4
,
'Blue'
,
'ui_blue'
),
Theme
.
new
(
4
,
'Blue'
,
'ui_blue'
),
Theme
.
new
(
5
,
'Green'
,
'ui_green'
)
,
Theme
.
new
(
5
,
'Green'
,
'ui_green'
)
].
freeze
].
freeze
# Convenience method to get a space-separated String of all the theme
# Convenience method to get a space-separated String of all the theme
...
...
spec/lib/gitlab/themes_spec.rb
View file @
6ee15819
...
@@ -14,7 +14,7 @@ describe Gitlab::Themes, lib: true do
...
@@ -14,7 +14,7 @@ describe Gitlab::Themes, lib: true do
describe
'.by_id'
do
describe
'.by_id'
do
it
'returns a Theme by its ID'
do
it
'returns a Theme by its ID'
do
expect
(
described_class
.
by_id
(
1
).
name
).
to
eq
'Indigo'
expect
(
described_class
.
by_id
(
1
).
name
).
to
eq
'Indigo'
expect
(
described_class
.
by_id
(
3
).
name
).
to
eq
'
Blue
'
expect
(
described_class
.
by_id
(
3
).
name
).
to
eq
'
Light
'
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