项目里程碑详情页面的issue统计页面

This commit is contained in:
daiao 2016-10-21 19:04:58 +08:00
parent fa453090aa
commit e23b01f90c
3 changed files with 35 additions and 44 deletions

View File

@ -114,15 +114,16 @@ class VersionsController < ApplicationController
def show
respond_to do |format|
@issues = @version.fixed_issues.visible.
@version_issues = @version.fixed_issues.visible.
includes(:status, :tracker, :priority).
reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").
all
@issue_count = @issues.count
@issue_count = @version_issues.count
@limit = 20
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
# @offset ||= @issue_pages.offset
@issues = paginateHelper @issues, @limit
@issues = paginateHelper @version_issues, @limit
@version_issue_assigned_name = @version_issues.group_by(&:assigned_to_id)
format.html {
# @issues = @version.fixed_issues.visible.
# includes(:status, :tracker, :priority).

View File

@ -0,0 +1,29 @@
<table class="new_roadmap_table " cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>指派给</th>
<th>全部</th>
<th>完成</th>
<th>关闭</th>
<th>待完成</th>
</tr>
</thead>
<tbody>
<% @version_issue_assigned_name.each do | assigned | %>
<tr>
<td><%= User.find(assigned[0]).show_name %></td>
<td><%= Issue.where(:fixed_version_id => @version.id,:assigned_to_id => assigned[0]).count %></td>
<td><%= Issue.where(:fixed_version_id => @version.id,:assigned_to_id => assigned[0], :status_id => 3).count %></td>
<td><%= Issue.where(:fixed_version_id => @version.id,:assigned_to_id => assigned[0], :status_id => 5).count %></td>
<td><%= Issue.where(fixed_version_id: @version.id, assigned_to_id: assigned[0], status_id: [1,2,4]).count %></td>
</tr>
<% end %>
<tr>
<td>Total</td>
<td><%= Issue.where(:fixed_version_id => @version.id).count %> </td>
<td><%= Issue.where(:fixed_version_id => @version.id, :status_id => 3).count %></td>
<td><%= Issue.where(:fixed_version_id => @version.id, :status_id => 5).count %></td>
<td><%= Issue.where(fixed_version_id: @version.id, status_id: [1,2,4]).count %></td>
</tr>
</tbody>
</table>

View File

@ -82,47 +82,8 @@
<div id="new_roadmap_content_2" class="undis">
<!--缺陷统计开始-->
<div class=" ml15 mr10 mb15">
<table class="new_roadmap_table " cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>指派给</th>
<th>全部</th>
<th>完成</th>
<th>关闭</th>
<th>待完成</th>
</tr>
</thead>
<tbody>
<tr>
<td>李冰冰</td>
<td>29</td>
<td>5</td>
<td>4</td>
<td>1</td>
</tr>
<tr>
<td>李冰冰</td>
<td>29</td>
<td>5</td>
<td>4</td>
<td>1</td>
</tr>
<tr>
<td>李冰冰</td>
<td>29</td>
<td>5</td>
<td>4</td>
<td>1</td>
</tr>
<tr>
<td>Total</td>
<td>29</td>
<td>5</td>
<td>4</td>
<td>1</td>
</tr>
</tbody>
</table>
<%= render :partial => 'versions/issue_statistics', :locals => {:version => @version} %>
</div>
<!--缺陷列表结束-->