|
|
|
@ -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?
|
|
|
|
|