Skip to content
Snippets Groups Projects
Commit be68cc46 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

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

parent 9d668750
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment