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 4aac6193c..dfe187aae 100644 --- a/app/views/pull_requests/_show.html.erb +++ b/app/views/pull_requests/_show.html.erb @@ -9,27 +9,21 @@
<%= @request.title %>

<%= @request.description %>

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

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

-
-
- <% else %> - <% if @request.state == "merged" %> - - - 6666 - <% else %> -
- 请求将 <%= @request.source_branch %> 合并至 <%= @request.target_branch %> -
- <%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :remote => true, :class => "BlueCirBtn" %> -
-
- <% end %> +
+ 请求将 <%= @request.source_branch %> 合并至 <%= @request.target_branch %> +
+<% if @commits_count == 0 && @changes_count == 0 %> + <%= @request.source_branch %>没有新内容可以合并至<%= @request.target_branch %>
+

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

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

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

+ <% else %> + <%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn" %> + <% end %> +
+