From 196d3b31a161b0b8c8c81202a2b95b5ac666c432 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 22 Nov 2016 14:29:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E5=AE=8C=20=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/projects_helper.rb | 9 +++++++++ app/views/issues/_form.html.erb | 6 +----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 3dff9c414..b2eb6fd0e 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -267,6 +267,15 @@ module ProjectsHelper project_name = versions.blank? ? "" : versions.first.project.name grouped = Hash.new {|h,k| h[k] = []} grouped[project_name] << ["请选择里程碑", 0] + + unless selected.nil? + if (params[:action] == "show" ) && Version.find(selected.id).status == "closed" + version_name = Version.find(selected.id).name + grouped[project_name] << [version_name, selected.id] + end + end + + versions.each do |version| grouped[version.project.name] << [version.name, version.id] end diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index 02ae7f677..13bde48a5 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -160,9 +160,5 @@ } // 里程碑添加默认选项 $("#issue_fixed_version_id option[value='']").remove(); - <%# if params[:action] == "new" %> -// $('#issue_fixed_version_id').prepend(""); - <%# else %> -// $('#issue_fixed_version_id').prepend(""); - <%# end %> +