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
076956cb
Commit
076956cb
authored
Mar 02, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue_13501' into 'master'
Add link to open merge requests on label index Closes #13501 See merge request !3057
parents
1fe9b933
c5df14ff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
label.rb
app/models/label.rb
+5
-0
_label.html.haml
app/views/projects/labels/_label.html.haml
+4
-0
No files found.
app/models/label.rb
View file @
076956cb
...
...
@@ -27,6 +27,7 @@ class Label < ActiveRecord::Base
belongs_to
:project
has_many
:label_links
,
dependent: :destroy
has_many
:issues
,
through: :label_links
,
source: :target
,
source_type:
'Issue'
has_many
:merge_requests
,
through: :label_links
,
source: :target
,
source_type:
'MergeRequest'
validates
:color
,
color:
true
,
allow_blank:
false
validates
:project
,
presence:
true
,
unless:
Proc
.
new
{
|
service
|
service
.
template?
}
...
...
@@ -90,6 +91,10 @@ class Label < ActiveRecord::Base
issues
.
closed
.
count
end
def
open_merge_requests_count
merge_requests
.
opened
.
count
end
def
template?
template
end
...
...
app/views/projects/labels/_label.html.haml
View file @
076956cb
...
...
@@ -3,6 +3,10 @@
.pull-right
%strong
.append-right-20
=
link_to_label
(
label
,
type: :merge_request
)
do
=
pluralize
label
.
open_merge_requests_count
,
'open merge request'
%strong
.append-right-20
=
link_to_label
(
label
)
do
=
pluralize
label
.
open_issues_count
,
'open issue'
...
...
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