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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
b92449c7
Commit
b92449c7
authored
Jan 24, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Predefine colors for project identicons
parent
70c44a0d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
11 deletions
+20
-11
app/assets/stylesheets/generic/avatar.scss
app/assets/stylesheets/generic/avatar.scss
+2
-2
app/assets/stylesheets/sections/dashboard.scss
app/assets/stylesheets/sections/dashboard.scss
+1
-1
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+13
-4
app/views/dashboard/_project.html.haml
app/views/dashboard/_project.html.haml
+2
-2
app/views/groups/_projects.html.haml
app/views/groups/_projects.html.haml
+2
-2
No files found.
app/assets/stylesheets/generic/avatar.scss
View file @
b92449c7
...
...
@@ -29,10 +29,10 @@
vertical-align
:
top
;
&
.s16
{
font-size
:
12px
;
line-height
:
1
.33
;
}
&
.s24
{
font-size
:
1
8px
;
line-height
:
1
.33
;
}
&
.s24
{
font-size
:
1
4px
;
line-height
:
1
.8
;
}
&
.s26
{
font-size
:
20px
;
line-height
:
1
.33
;
}
&
.s32
{
font-size
:
24px
;
line-height
:
1
.33
;
}
&
.s60
{
font-size
:
45px
;
line-height
:
1
.33
;
}
&
.s90
{
font-size
:
68px
;
line-height
:
1
.33
;
}
&
.s160
{
font-size
:
120px
;
line-height
:
1
.33
;
}
}
\ No newline at end of file
}
app/assets/stylesheets/sections/dashboard.scss
View file @
b92449c7
...
...
@@ -100,7 +100,7 @@
}
.dash-project-access-icon
{
float
:
left
;
margin-right
:
3
px
;
margin-right
:
5
px
;
width
:
16px
;
}
...
...
app/helpers/application_helper.rb
View file @
b92449c7
...
...
@@ -64,13 +64,22 @@ module ApplicationHelper
end
def
project_identicon
(
project
,
options
=
{})
allowed_colors
=
{
red:
'FFEBEE'
,
purple:
'F3E5F5'
,
indigo:
'E8EAF6'
,
blue:
'E3F2FD'
,
teal:
'E0F2F1'
,
orange:
'FBE9E7'
,
gray:
'EEEEEE'
}
options
[
:class
]
||=
''
options
[
:class
]
<<
' identicon'
bg_color
=
Digest
::
MD5
.
hexdigest
(
project
.
name
)[
0
,
6
]
brightness
=
bg_color
[
0
,
2
].
hex
+
bg_color
[
2
,
2
].
hex
+
bg_color
[
4
,
2
].
hex
text_color
=
(
brightness
>
375
)
?
'#000'
:
'#fff'
bg_key
=
project
.
id
%
7
content_tag
(
:div
,
class:
options
[
:class
],
style:
"background-color: #
#{
bg_color
}
; color:
#{
text_color
}
"
)
do
style:
"background-color: #
#{
allowed_colors
.
values
[
bg_key
]
}
; color: #555
"
)
do
project
.
name
[
0
,
1
].
upcase
end
end
...
...
app/views/dashboard/_project.html.haml
View file @
b92449c7
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
.dash-project-avatar
=
project_icon
(
project
.
to_param
,
alt:
''
,
class:
'avatar s24'
)
.dash-project-access-icon
=
visibility_level_icon
(
project
.
visibility_level
)
.dash-project-avatar
=
project_icon
(
project
.
to_param
,
alt:
''
,
class:
'avatar s24'
)
%span
.str-truncated
%span
.namespace-name
-
if
project
.
namespace
...
...
app/views/groups/_projects.html.haml
View file @
b92449c7
...
...
@@ -12,10 +12,10 @@
-
projects
.
each
do
|
project
|
%li
.project-row
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
.dash-project-avatar
=
project_icon
(
project
.
to_param
,
alt:
''
,
class:
'avatar s24'
)
.dash-project-access-icon
=
visibility_level_icon
(
project
.
visibility_level
)
.dash-project-avatar
=
project_icon
(
project
.
to_param
,
alt:
''
,
class:
'avatar s24'
)
%span
.str-truncated
%span
.project-name
=
project
.
name
...
...
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