里程碑issue统计,加入未指派,调整total位置,并按成员issue的数量排序

This commit is contained in:
huang 2016-11-25 14:50:23 +08:00
parent bff5a36577
commit b15fd1607f
3 changed files with 11 additions and 10 deletions

View File

@ -125,7 +125,8 @@ class VersionsController < ApplicationController
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1 @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
# @offset ||= @issue_pages.offset # @offset ||= @issue_pages.offset
@issues = paginateHelper @version_issues, @limit @issues = paginateHelper @version_issues, @limit
@version_issue_assigned_name = @version_issues.group_by(&:assigned_to_id) @version_issue_assigned_name = @version_issues.sort_by{ |i| Issue.where(:project_id => @project.id ,
:assigned_to_id => i.assigned_to_id, :fixed_version_id => @version.id).count }.reverse.group_by(&:assigned_to_id)
format.html { format.html {
# @issues = @version.fixed_issues.visible. # @issues = @version.fixed_issues.visible.
# includes(:status, :tracker, :priority). # includes(:status, :tracker, :priority).

View File

@ -9,21 +9,21 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<td>合计</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>
<% @version_issue_assigned_name.each do | assigned | %> <% @version_issue_assigned_name.each do | assigned | %>
<tr> <tr>
<td><%= User.find(assigned[0]).try(:show_name) %></td> <td><%= User.find(assigned[0]).try(:show_name).nil? ? "未指派" : User.find(assigned[0]).try(: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]).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 => 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 => 5).count %></td>
<td><%= Issue.where(fixed_version_id: @version.id, assigned_to_id: assigned[0], status_id: [1,2,4]).count %></td> <td><%= Issue.where(fixed_version_id: @version.id, assigned_to_id: assigned[0], status_id: [1,2,4]).count %></td>
</tr> </tr>
<% end %> <% 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> </tbody>
</table> </table>

View File

@ -14,7 +14,7 @@
<li class="mb10 clear"> <li class="mb10 clear">
<label><span class="c_red f12">*</span>&nbsp;名称&nbsp;&nbsp;:&nbsp;</label> <label><span class="c_red f12">*</span>&nbsp;名称&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :name, :maxlength => 60, :class=>"w650", :style=>"height: 28px;", :id => "popub_setting_version_name", :no_label => true %> <%= f.text_field :name, :maxlength => 60, :class=>"w650", :style=>"height: 28px;", :id => "popub_setting_version_name", :no_label => true %>
<p class="c_orange ml100" style="display: none" id="pupub_project_setting_version_title">标题不能为空</p> <p class="c_orange ml100" style=" margin-left:50px;display: none" id="pupub_project_setting_version_title">标题不能为空</p>
</li> </li>
<li class="mb10 clear"> <li class="mb10 clear">
<label class="ml5">&nbsp;描述&nbsp;&nbsp;:&nbsp;</label> <label class="ml5">&nbsp;描述&nbsp;&nbsp;:&nbsp;</label>