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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
8e8c0742
Commit
8e8c0742
authored
Jun 26, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reuse existing milestones counting.
parent
58570880
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
6 deletions
+4
-6
app/services/milestones/group_service.rb
app/services/milestones/group_service.rb
+2
-2
app/views/groups/milestones/index.html.haml
app/views/groups/milestones/index.html.haml
+1
-1
app/views/layouts/nav/_group.html.haml
app/views/layouts/nav/_group.html.haml
+1
-3
No files found.
app/services/milestones/group_service.rb
View file @
8e8c0742
...
@@ -44,11 +44,11 @@ module Milestones
...
@@ -44,11 +44,11 @@ module Milestones
end
end
def
open_items_count
def
open_items_count
open_issues_count
.
merge
(
open_mr_count
){
|
title
,
issue
,
mr
|
issue
+
mr
}
@project_milestones
.
merge
(
@project_milestones
){
|
title
,
milestone
|
milestone
.
map
{
|
m
|
m
.
open_items_count
}.
sum
}
end
end
def
closed_items_count
def
closed_items_count
closed_issues_count
.
merge
(
close_mr_count
){
|
title
,
issue
,
mr
|
issue
+
mr
}
@project_milestones
.
merge
(
@project_milestones
){
|
title
,
milestone
|
milestone
.
map
{
|
m
|
m
.
closed_items_count
}.
sum
}
end
end
def
total_items_count
def
total_items_count
...
...
app/views/groups/milestones/index.html.haml
View file @
8e8c0742
%h3
.page-title
%h3
.page-title
Milestones
Milestones
%span
.pull-right
milestones
%span
.pull-right
#{
@group_milestones
.
titles
.
count
}
milestones
%p
.light
%p
.light
Only milestones from
Only milestones from
...
...
app/views/layouts/nav/_group.html.haml
View file @
8e8c0742
...
@@ -13,10 +13,8 @@
...
@@ -13,10 +13,8 @@
-
if
current_user
-
if
current_user
%span
.count
=
current_user
.
cared_merge_requests
.
opened
.
of_group
(
@group
).
count
%span
.count
=
current_user
.
cared_merge_requests
.
opened
.
of_group
(
@group
).
count
=
nav_link
(
path:
'groups#milestones'
)
do
=
nav_link
(
path:
'groups#milestones'
)
do
=
link_to
merge_requests_group
_path
(
@group
)
do
=
link_to
group_milestones
_path
(
@group
)
do
Milestones
Milestones
-
if
current_user
%span
.count
=
current_user
.
cared_merge_requests
.
opened
.
of_group
(
@group
).
count
=
nav_link
(
path:
'groups#members'
)
do
=
nav_link
(
path:
'groups#members'
)
do
=
link_to
"Members"
,
members_group_path
(
@group
)
=
link_to
"Members"
,
members_group_path
(
@group
)
...
...
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