summaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-01-18 07:11:47 +0000
committerGo MAEDA <maeda@farend.jp>2021-01-18 07:11:47 +0000
commit6bca099013adcc5f2fd2828e5538892827932a42 (patch)
treea143c91d458631307a85c0950273671c5ee11171 /app/views
parent4d3dec2dc0156369b789c8c51557c2c7001854ed (diff)
downloadredmine-6bca099013adcc5f2fd2828e5538892827932a42.tar.gz
redmine-6bca099013adcc5f2fd2828e5538892827932a42.zip
Some fixes for r20321:
* Include only visible issues in subtasks stats * Get subtasks using only one query * Show all subtasks count as badge * Add tests Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@20718 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r--app/views/issues/show.html.erb14
1 files changed, 2 insertions, 12 deletions
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index f40f206d7..3a4e1b40f 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -109,18 +109,8 @@ end %>
<%= link_to_new_subtask(@issue) if User.current.allowed_to?(:manage_subtasks, @project) %>
</div>
<p>
-<strong><%=l(:label_subtask_plural)%></strong>
-<% if !@issue.leaf? %>
- (<%= link_to(l(:label_x_issues, :count => @issue.descendants.count),
- issues_path(:parent_id => "~#{@issue.id}", :set_filter => true, :status_id => '*')) %>
- : <%= link_to_if( @issue.descendants.select(&:closed?).count > 0,
- l(:label_x_closed_issues_abbr, :count => @issue.descendants.select(&:closed?).count ),
- issues_path(:parent_id => "~#{@issue.id}", :set_filter => true, :status_id => 'c')) %>
- &#8212;
- <%= link_to_if( @issue.descendants.open.count > 0,
- l(:label_x_open_issues_abbr, :count => @issue.descendants.open.count ),
- issues_path(:parent_id => "~#{@issue.id}", :set_filter => true, :status_id => 'o')) %>)
-<% end %>
+ <strong><%=l(:label_subtask_plural)%></strong>
+ <%= render_descendants_stats(@issue) unless @issue.leaf? %>
</p>
<%= form_tag({}, :data => {:cm_url => issues_context_menu_path}) do %>
<%= render_descendants_tree(@issue) unless @issue.leaf? %>