From 33467d3152132d2ff3bc2c128bc0a132c0016b1a Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 4 Aug 2016 15:04:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=B2=E5=A4=84=E7=90=86=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=EF=BC=9B=E6=96=B0=E5=BB=BA=E6=97=B6=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E9=A1=B9=E7=9B=AE=E5=88=B7=E6=96=B0=E5=88=86=E6=94=AF?= =?UTF-8?q?js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/pull_requests/_form.html.erb | 9 ++++++++- app/views/pull_requests/_show.html.erb | 26 ++++++++++---------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/app/views/pull_requests/_form.html.erb b/app/views/pull_requests/_form.html.erb index 1366ef466..01b21106b 100644 --- a/app/views/pull_requests/_form.html.erb +++ b/app/views/pull_requests/_form.html.erb @@ -13,7 +13,8 @@
目标分支
- <%= select_tag :branch, options_for_select(@rev), :name => "target_branch", :value => "target_branch", :class => "ml30 fontGrey3 fb fl", :style => "padding:5px 0 5px 5px;" %> + <%= select_tag :branch, options_for_select(@rev), :name => "target_branch", :value => "target_branch", :class => "ml30 fontGrey3 fb fl", :style => "padding:5px 0 5px 5px;", :id => "targetProject" %> + <%= select_tag :branch, options_for_select(@rev), :name => "target_branch", :value => "target_branch", :class => "ml30 fontGrey3 fb fl", :style => "padding:5px 0 5px 5px;", :id => "targetBranch" %>

修改分支

@@ -50,4 +51,10 @@ $("#pull_request_form").submit(); } } + + //切换项目时,替换分支 + $("#targetProject").change(function(){ + var defaultBranch = $("#targetBranch option:first-child").val(); + $("#targetBranch").val(defaultBranch); + }); \ No newline at end of file diff --git a/app/views/pull_requests/_show.html.erb b/app/views/pull_requests/_show.html.erb index 0ba02d9b4..e1c1a8810 100644 --- a/app/views/pull_requests/_show.html.erb +++ b/app/views/pull_requests/_show.html.erb @@ -4,27 +4,21 @@
<%= @request.title %>

<%= @request.description %>

+
+ 请求将 <%= @request.source_branch %> 合并至 <%= @request.target_branch %> +
<% if @commits_count == 0 && @changes_count == 0 %> -
- 请求将 <%= @request.source_branch %> 合并至 <%= @request.target_branch %> -
- <%= @request.source_branch %>没有新内容可以合并至<%= @request.target_branch %>
-

请将新改动提交至源分支或者切换到其它目标分支

-
-
+ <%= @request.source_branch %>没有新内容可以合并至<%= @request.target_branch %>
+

请将新改动提交至源分支或者切换到其它目标分支

<% else %> <% if @request.state == "merged" %> - - - 6666 + Hjqreturn于两小时前合并
+

改动已合并至<%= @request.target_branch %>

<% else %> -
- 请求将 <%= @request.source_branch %> 合并至 <%= @request.target_branch %> -
- <%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn" %> -
-
+ <%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn" %> <% end %> +
+