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
be68cc46
Commit
be68cc46
authored
May 07, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Gitlab::Label class and different color labels for default labels set
parent
9d668750
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
1 deletion
+45
-1
issues_helper.rb
app/helpers/issues_helper.rb
+15
-0
_issue.html.haml
app/views/issues/_issue.html.haml
+1
-1
labels.rb
lib/gitlab/labels.rb
+29
-0
No files found.
app/helpers/issues_helper.rb
View file @
be68cc46
...
...
@@ -88,4 +88,19 @@ module IssuesHelper
""
end
end
def
label_css_class
(
name
)
case
name
when
*
warning_labels
'label-warning'
when
*
neutral_labels
'label-inverse'
when
*
positive_labels
'label-success'
when
*
important_labels
'label-important'
else
'label-info'
end
end
end
app/views/issues/_issue.html.haml
View file @
be68cc46
...
...
@@ -27,7 +27,7 @@
.issue-labels
-
issue
.
labels
.
each
do
|
label
|
%span
.label.label-info
%span
{
class:
"label #{label_css_class(label.name)}"
}
%i
.icon-tag
=
label
.
name
...
...
lib/gitlab/labels.rb
0 → 100644
View file @
be68cc46
module
Gitlab
class
Labels
class
<<
self
def
important_labels
%w(bug critical confirmed)
end
def
warning_labels
%w(documentation support)
end
def
neutral_labels
%w(discussion suggestion)
end
def
positive_labels
%w(feature enhancement)
end
def
self
.
generate
(
project
)
labels
=
important_labels
+
warning_labels
+
neutral_labels
+
positive_labels
labels
.
each
do
|
label_name
|
# create tag for project
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