Commit be68cc46 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

add Gitlab::Label class and different color labels for default labels set

parent 9d668750
...@@ -88,4 +88,19 @@ module IssuesHelper ...@@ -88,4 +88,19 @@ module IssuesHelper
"" ""
end end
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 end
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
.issue-labels .issue-labels
- issue.labels.each do |label| - issue.labels.each do |label|
%span.label.label-info %span{class: "label #{label_css_class(label.name)}"}
%i.icon-tag %i.icon-tag
= label.name = label.name
......
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment