From 1ed90892129a6280cc1a7d639319ee67a1715c1c Mon Sep 17 00:00:00 2001 From: zhangyang Date: Wed, 7 Aug 2013 09:21:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86=E8=B7=AF=E7=BA=BF?= =?UTF-8?q?=E5=9B=BE=E5=B7=B2=E5=AE=8C=E6=88=90=E9=A1=B9=E7=9B=AE=E7=9A=84?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/versions_controller.rb | 11 ++++++----- app/views/versions/index.html.erb | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index 277f4cfd4..18371f9f8 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -38,19 +38,20 @@ class VersionsController < ApplicationController project_ids = @with_subprojects ? @project.self_and_descendants.collect(&:id) : [@project.id] @versions = @project.shared_versions || [] - @versions += @project.rolled_up_versions.visible if @with_subprojects + @versions += @project.rolled_up_versions.visible if @with_subprojects #added by young @versions = @versions.uniq.reverse#Modified by young + unless params[:completed] + @completed_versions = @versions.select {|version| version.closed? || version.completed? } + @versions -= @completed_versions + end @offset, @limit = api_offset_and_limit({:limit => 4}) @versions_count = @versions.count @versions_pages = Paginator.new @versions_count, @limit, params['page'] @offset ||= @versions_pages.offset @versions = @versions.slice(@offset, @limit) #end by young - unless params[:completed] - @completed_versions = @versions.select {|version| version.closed? || version.completed? } - @versions -= @completed_versions - end + @issues_by_version = {} if @selected_tracker_ids.any? && @versions.any? diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb index bc0c11902..ef066e9da 100644 --- a/app/views/versions/index.html.erb +++ b/app/views/versions/index.html.erb @@ -30,7 +30,7 @@ '$("#toggle-completed-versions").toggleClass("collapsed"); $("#completed-versions").toggle()', :id => 'toggle-completed-versions', :class => 'collapsible collapsed' %>

<% end %>