Reuse existing milestones counting.

This commit is contained in:
Marin Jankovski 2014-06-26 09:41:36 +02:00
parent 58570880f0
commit 8e8c074205
3 changed files with 4 additions and 6 deletions

View file

@ -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

View file

@ -1,6 +1,6 @@
%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

View file

@ -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)