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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
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
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
1 deletion
+45
-1
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+15
-0
app/views/issues/_issue.html.haml
app/views/issues/_issue.html.haml
+1
-1
lib/gitlab/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
...
@@ -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
app/views/issues/_issue.html.haml
View file @
be68cc46
...
@@ -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
...
...
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