From d9189487e36415b14f3079ff2e21309263ab2b49 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 27 Oct 2016 11:15:28 +0800
Subject: [PATCH] =?UTF-8?q?Isuue=E6=96=B0=E5=BB=BA=E9=87=8C=E7=A8=8B?=
=?UTF-8?q?=E7=A2=91=E5=BC=B9=E6=A1=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/versions_controller.rb | 8 +
app/views/issues/_form.html.erb | 12 +-
app/views/issues/_versions_choise.html.erb | 7 +
app/views/issues/index.html.erb | 188 ---------------------
app/views/versions/_new_milestone.html.erb | 2 +-
app/views/versions/create.js.erb | 3 +-
app/views/versions/new.js.erb | 8 +-
7 files changed, 29 insertions(+), 199 deletions(-)
create mode 100644 app/views/issues/_versions_choise.html.erb
diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb
index 2cd49d0a8..0c5057a40 100644
--- a/app/controllers/versions_controller.rb
+++ b/app/controllers/versions_controller.rb
@@ -147,7 +147,9 @@ class VersionsController < ApplicationController
# @version.safe_attributes = params[:version]
#
respond_to do |format|
+ @is_issue = params[:is_issue]
@is_create = params[:is_create]
+ #@@issue = Issue.find(params[:issue].to_i)
format.js{
unless @is_create
redirect_to settings_project_url(@project, :tab => 'versions')
@@ -157,7 +159,13 @@ class VersionsController < ApplicationController
end
def create
+ # 项目配置中新建
+ @is_setting = params[:is_setting]
+ @is_issue = params[:is_issue]
+ @is_create = params[:is_create]
+
@version = @project.versions.build
+
if params[:version]
attributes = params[:version].dup
attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing'])
diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb
index 6ce19f222..ed6d5e9fd 100644
--- a/app/views/issues/_form.html.erb
+++ b/app/views/issues/_form.html.erb
@@ -88,10 +88,11 @@
<%= @issue.assigned_to.nil? ? "未指派" : "已指派" %>
-
- <%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
- {:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
- {:onchange => "change_milestone_tip();",:class => "w150"} %>
+
+ <%#= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
+ {:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
+ {:onchange => "change_milestone_tip();",:class => "w150"} %>
+ <%= render :partial => 'issues/versions_choise' %>
<%#= link_to(image_tag('add.png', :style => 'vertical-align: middle;'),
new_project_version_path(@issue.project),
:remote => true,
@@ -102,7 +103,8 @@
<%= @issue.fixed_version.nil? ? "无里程碑" : "已指派里程碑" %>
- <%= link_to "", new_project_version_path(@issue.project), :class => "pic_add mt5 ml5 fr", :target => "_blank" %>
+ <%= link_to "", new_project_version_path(@project, :is_issue => true, :issue => @issue), :class => "pic_add mt5 ml5 fr", :remote => true %>
+
<% if @issue.safe_attribute? 'start_date' %>
diff --git a/app/views/issues/_versions_choise.html.erb b/app/views/issues/_versions_choise.html.erb
new file mode 100644
index 000000000..b91e2310f
--- /dev/null
+++ b/app/views/issues/_versions_choise.html.erb
@@ -0,0 +1,7 @@
+<%#= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
+ {:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
+ {:onchange => "change_milestone_tip();",:class => "w150"} %>
+
+<%= select :fixed_version_id, :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
+ {:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
+ {:onchange => "change_milestone_tip();",:class => "w150"}%>
\ No newline at end of file
diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb
index a7d7711eb..5b1e689d9 100644
--- a/app/views/issues/index.html.erb
+++ b/app/views/issues/index.html.erb
@@ -330,191 +330,3 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/views/versions/_new_milestone.html.erb b/app/views/versions/_new_milestone.html.erb
index 8021e4f64..902f4b912 100644
--- a/app/views/versions/_new_milestone.html.erb
+++ b/app/views/versions/_new_milestone.html.erb
@@ -8,7 +8,7 @@