From b15fd1607ff7a3bc808b6be159103bbe9bf5a3a7 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 25 Nov 2016 14:50:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8C=E7=A8=8B=E7=A2=91issue=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=EF=BC=8C=E5=8A=A0=E5=85=A5=E6=9C=AA=E6=8C=87=E6=B4=BE?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=95=B4total=E4=BD=8D=E7=BD=AE=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E6=8C=89=E6=88=90=E5=91=98issue=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/versions_controller.rb | 3 ++- app/views/versions/_issue_statistics.html.erb | 16 ++++++++-------- app/views/versions/_new_milestone.html.erb | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index ed9c4638f..7b4695d3c 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -125,7 +125,8 @@ class VersionsController < ApplicationController @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1 # @offset ||= @issue_pages.offset @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 { # @issues = @version.fixed_issues.visible. # includes(:status, :tracker, :priority). diff --git a/app/views/versions/_issue_statistics.html.erb b/app/views/versions/_issue_statistics.html.erb index b8c0ff2e3..47d420a75 100644 --- a/app/views/versions/_issue_statistics.html.erb +++ b/app/views/versions/_issue_statistics.html.erb @@ -9,21 +9,21 @@ + + 合计 + <%= Issue.where(:fixed_version_id => @version.id).count %> + <%= Issue.where(:fixed_version_id => @version.id, :status_id => 3).count %> + <%= Issue.where(:fixed_version_id => @version.id, :status_id => 5).count %> + <%= Issue.where(fixed_version_id: @version.id, status_id: [1,2,4]).count %> + <% @version_issue_assigned_name.each do | assigned | %> - <%= User.find(assigned[0]).try(:show_name) %> + <%= User.find(assigned[0]).try(:show_name).nil? ? "未指派" : User.find(assigned[0]).try(:show_name) %> <%= Issue.where(:fixed_version_id => @version.id, :assigned_to_id => assigned[0]).count %> <%= Issue.where(:fixed_version_id => @version.id, :assigned_to_id => assigned[0], :status_id => 3).count %> <%= Issue.where(:fixed_version_id => @version.id, :assigned_to_id => assigned[0], :status_id => 5).count %> <%= Issue.where(fixed_version_id: @version.id, assigned_to_id: assigned[0], status_id: [1,2,4]).count %> <% end %> - - Total - <%= Issue.where(:fixed_version_id => @version.id).count %> - <%= Issue.where(:fixed_version_id => @version.id, :status_id => 3).count %> - <%= Issue.where(:fixed_version_id => @version.id, :status_id => 5).count %> - <%= Issue.where(fixed_version_id: @version.id, status_id: [1,2,4]).count %> - \ No newline at end of file diff --git a/app/views/versions/_new_milestone.html.erb b/app/views/versions/_new_milestone.html.erb index 40fff71f2..b89936f3e 100644 --- a/app/views/versions/_new_milestone.html.erb +++ b/app/views/versions/_new_milestone.html.erb @@ -14,7 +14,7 @@
  • <%= f.text_field :name, :maxlength => 60, :class=>"w650", :style=>"height: 28px;", :id => "popub_setting_version_name", :no_label => true %> - +