修正了路线图已完成项目的显示问题

This commit is contained in:
zhangyang 2013-08-07 09:21:05 +08:00
parent 4835cab6e4
commit 1ed9089212
2 changed files with 7 additions and 6 deletions

View File

@ -41,16 +41,17 @@ class VersionsController < ApplicationController
@versions += @project.rolled_up_versions.visible if @with_subprojects @versions += @project.rolled_up_versions.visible if @with_subprojects
#added by young #added by young
@versions = @versions.uniq.reverse#Modified 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}) @offset, @limit = api_offset_and_limit({:limit => 4})
@versions_count = @versions.count @versions_count = @versions.count
@versions_pages = Paginator.new @versions_count, @limit, params['page'] @versions_pages = Paginator.new @versions_count, @limit, params['page']
@offset ||= @versions_pages.offset @offset ||= @versions_pages.offset
@versions = @versions.slice(@offset, @limit) @versions = @versions.slice(@offset, @limit)
#end by young #end by young
unless params[:completed]
@completed_versions = @versions.select {|version| version.closed? || version.completed? }
@versions -= @completed_versions
end
@issues_by_version = {} @issues_by_version = {}
if @selected_tracker_ids.any? && @versions.any? if @selected_tracker_ids.any? && @versions.any?

View File

@ -30,7 +30,7 @@
'$("#toggle-completed-versions").toggleClass("collapsed"); $("#completed-versions").toggle()', '$("#toggle-completed-versions").toggleClass("collapsed"); $("#completed-versions").toggle()',
:id => 'toggle-completed-versions', :class => 'collapsible collapsed' %><br /> :id => 'toggle-completed-versions', :class => 'collapsible collapsed' %><br />
<span id="completed-versions" style="display:none;"> <span id="completed-versions" style="display:none;">
<%= @completed_versions.map {|version| link_to format_version_name(version), version_path(version)}.join("<br />\n").html_safe %> <%= @completed_versions.map {|version| link_to format_version_name(version), version_path(version)}.join("&nbsp\n").html_safe %><!--Modified by young-->
</span> </span>
</p> </p>
<% end %> <% end %>