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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
365d96ca
Commit
365d96ca
authored
Jan 25, 2016
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add labels tab to milestone detail view.
parent
c4c919e5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
0 deletions
+23
-0
app/assets/stylesheets/pages/labels.scss
app/assets/stylesheets/pages/labels.scss
+4
-0
app/controllers/projects/milestones_controller.rb
app/controllers/projects/milestones_controller.rb
+1
-0
app/models/label.rb
app/models/label.rb
+4
-0
app/models/milestone.rb
app/models/milestone.rb
+1
-0
app/views/projects/milestones/show.html.haml
app/views/projects/milestones/show.html.haml
+13
-0
No files found.
app/assets/stylesheets/pages/labels.scss
View file @
365d96ca
...
@@ -19,3 +19,7 @@
...
@@ -19,3 +19,7 @@
.color-label
{
.color-label
{
padding
:
3px
4px
;
padding
:
3px
4px
;
}
}
#tab-labels
.issues-count
{
margin-left
:
30px
;
}
app/controllers/projects/milestones_controller.rb
View file @
365d96ca
...
@@ -34,6 +34,7 @@ class Projects::MilestonesController < Projects::ApplicationController
...
@@ -34,6 +34,7 @@ class Projects::MilestonesController < Projects::ApplicationController
@issues
=
@milestone
.
issues
@issues
=
@milestone
.
issues
@users
=
@milestone
.
participants
.
uniq
@users
=
@milestone
.
participants
.
uniq
@merge_requests
=
@milestone
.
merge_requests
@merge_requests
=
@milestone
.
merge_requests
@labels
=
@milestone
.
labels
end
end
def
create
def
create
...
...
app/models/label.rb
View file @
365d96ca
...
@@ -85,6 +85,10 @@ class Label < ActiveRecord::Base
...
@@ -85,6 +85,10 @@ class Label < ActiveRecord::Base
issues
.
opened
.
count
issues
.
opened
.
count
end
end
def
closed_issues_count
issues
.
closed
.
count
end
def
template?
def
template?
template
template
end
end
...
...
app/models/milestone.rb
View file @
365d96ca
...
@@ -27,6 +27,7 @@ class Milestone < ActiveRecord::Base
...
@@ -27,6 +27,7 @@ class Milestone < ActiveRecord::Base
belongs_to
:project
belongs_to
:project
has_many
:issues
has_many
:issues
has_many
:labels
,
through: :issues
has_many
:merge_requests
has_many
:merge_requests
has_many
:participants
,
through: :issues
,
source: :assignee
has_many
:participants
,
through: :issues
,
source: :assignee
...
...
app/views/projects/milestones/show.html.haml
View file @
365d96ca
...
@@ -70,6 +70,10 @@
...
@@ -70,6 +70,10 @@
=
link_to
'#tab-participants'
,
'data-toggle'
=>
'tab'
do
=
link_to
'#tab-participants'
,
'data-toggle'
=>
'tab'
do
Participants
Participants
%span
.badge
=
@users
.
count
%span
.badge
=
@users
.
count
%li
=
link_to
'#tab-labels'
,
'data-toggle'
=>
'tab'
do
Labels
%span
.badge
=
@labels
.
count
.tab-content
.tab-content
.tab-pane.active
#tab-issues
.tab-pane.active
#tab-issues
...
@@ -128,3 +132,12 @@
...
@@ -128,3 +132,12 @@
%strong
=
truncate
(
user
.
name
,
lenght:
40
)
%strong
=
truncate
(
user
.
name
,
lenght:
40
)
%br
%br
%small
.cgray
=
user
.
username
%small
.cgray
=
user
.
username
.tab-pane
#tab-labels
%ul
.bordered-list.manage-labels-list
-
@labels
.
each
do
|
label
|
%li
=
render_colored_label
(
label
)
.pull-right
%span
.issues-count
=
pluralize
label
.
open_issues_count
,
'open issue'
%span
.issues-count
=
pluralize
label
.
closed_issues_count
,
'closed 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