From b86b2299a70ee89f545c42e87657d39d7ab2627a Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 5 Aug 2016 11:10:39 +0800 Subject: [PATCH] =?UTF-8?q?fork=E5=88=86=E6=94=AF=E9=80=89=E6=8B=A9=20js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/pull_requests_controller.rb | 2 +- app/views/pull_requests/_form.html.erb | 10 ++++++---- public/javascripts/project.js | 6 ++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index 00ba47dec..2a88e4dcb 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -60,7 +60,7 @@ class PullRequestsController < ApplicationController target_branch = params[:target_branch] begin # 如果传送了目标项目ID,则PR请求发至目标项目 - if params[:target_project_id] + if params[:forked_project_id] target_project_id = params[:target_project_id] request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch, :target_project_id => target_project_id) else diff --git a/app/views/pull_requests/_form.html.erb b/app/views/pull_requests/_form.html.erb index c7e21a7b9..67f99c275 100644 --- a/app/views/pull_requests/_form.html.erb +++ b/app/views/pull_requests/_form.html.erb @@ -14,16 +14,18 @@
目标分支
<% if @forked_project.nil? %> - <%= select_tag :branch, options_for_select(@source_project_name), :name => "target_project", :value => "target_project", - :class => "ml30 fontGrey3 fb fl", :style => "padding:5px 0 5px 5px;", :id => "targetProject" %>\ <%= select_tag :branch, options_for_select(@source_rev), :name => "target_branch", :value => "target_branch", :class => "ml30 fontGrey3 fb fl", :style => "padding:5px 0 5px 5px;", :id => "targetBranch" %> <% else %> - - + <%#= select_tag :branch, options_for_select([@source_project_name, @forked_project_name]), :name => "target_project", :value => "target_project", :class => "ml30 fontGrey3 fb fl", :style => "padding:5px 0 5px 5px;", :id => "targetProject" %> <%#= select_tag :branch, options_for_select(@source_rev), :name => "target_branch", :value => "target_branch", diff --git a/public/javascripts/project.js b/public/javascripts/project.js index 3918c116d..13ed76aa4 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -663,20 +663,18 @@ function search_tag_attachment(url,tag_name,q,course_id,sort) function choice_branch(name, branch, source_rev, forked_rev) { switch (name) { case "source_project_name" : - alert(source_rev); var branchOptions = source_rev; break; case "forked_project_name" : - alert(forked_rev); var branchOptions = forked_rev; break; default: - var branchOptions = new Array(""); + var branchOptions = source_rev; break; } branch.options.length = 0; for (var i = 0; i < branchOptions.length; i++) { - branch.options[i] = new Option(branchOptions[i], branchOptions[i]); + branch.options[i] = new Option(branchOptions[i]); } } \ No newline at end of file