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
28f1a5d7
Commit
28f1a5d7
authored
Apr 11, 2014
by
Jeroen van Baarsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Determine label color based on lowercase name
parent
4881d493
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
app/helpers/labels_helper.rb
app/helpers/labels_helper.rb
+1
-1
spec/helpers/labels_helper_spec.rb
spec/helpers/labels_helper_spec.rb
+13
-0
No files found.
app/helpers/labels_helper.rb
View file @
28f1a5d7
...
@@ -12,7 +12,7 @@ module LabelsHelper
...
@@ -12,7 +12,7 @@ module LabelsHelper
def
label_css_class
(
name
)
def
label_css_class
(
name
)
klass
=
Gitlab
::
IssuesLabels
klass
=
Gitlab
::
IssuesLabels
case
name
case
name
.
downcase
when
*
klass
.
warning_labels
when
*
klass
.
warning_labels
'label-warning'
'label-warning'
when
*
klass
.
neutral_labels
when
*
klass
.
neutral_labels
...
...
spec/helpers/labels_helper_spec.rb
0 → 100644
View file @
28f1a5d7
require
'spec_helper'
describe
LabelsHelper
do
describe
'#label_css_class'
do
it
'returns label-danger when given Bug as param'
do
expect
(
label_css_class
(
'bug'
)).
to
eq
(
'label-danger'
)
end
it
'returns label-danger when given Bug as param'
do
expect
(
label_css_class
(
'Bug'
)).
to
eq
(
'label-danger'
)
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