BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
labels_helper.rb
app/helpers/labels_helper.rb
+1
-1
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
def
label_css_class
(
name
)
klass
=
Gitlab
::
IssuesLabels
case
name
case
name
.
downcase
when
*
klass
.
warning_labels
'label-warning'
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