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 %>