From 187a96b251bd5c93e8d58165b3ebed7cff303183 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 25 Oct 2016 15:34:32 +0800 Subject: [PATCH] =?UTF-8?q?pull=20request=E8=AF=84=E8=AE=BA=E5=B1=80?= =?UTF-8?q?=E9=83=A8=E5=88=B7=E6=96=B0=E5=8F=8A=E6=A0=B7=E5=BC=8F?= 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/_show.html.erb | 3 --- app/views/pull_requests/show.html.erb | 5 +++-- app/views/pull_requests/show.js.erb | 3 ++- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index a3320724c..c8ad92f22 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -179,7 +179,7 @@ class PullRequestsController < ApplicationController begin @comments = @g.create_merge_request_comment(@project.gpid, params[:id], content, User.current.gid) respond_to do |format| - format.html{redirect_to project_pull_request_path(params[:id], :project_id => @project.id)} + format.js{redirect_to project_pull_request_path(params[:id], :project_id => @project.id)} end rescue Exception => e @message = e.message diff --git a/app/views/pull_requests/_show.html.erb b/app/views/pull_requests/_show.html.erb index 0773435cc..15728046d 100644 --- a/app/views/pull_requests/_show.html.erb +++ b/app/views/pull_requests/_show.html.erb @@ -33,15 +33,12 @@ diff --git a/app/views/pull_requests/show.html.erb b/app/views/pull_requests/show.html.erb index cf344d32c..632d910a9 100644 --- a/app/views/pull_requests/show.html.erb +++ b/app/views/pull_requests/show.html.erb @@ -1,2 +1,3 @@ -<%= render :partial => "pull_requests/pull_request_container" %> -<%= render :partial => "pull_requests/show" %> +
+ <%= render :partial => "pull_requests/show" %> +
diff --git a/app/views/pull_requests/show.js.erb b/app/views/pull_requests/show.js.erb index 0a64c51a8..32d356cd7 100644 --- a/app/views/pull_requests/show.js.erb +++ b/app/views/pull_requests/show.js.erb @@ -1,3 +1,4 @@ -<%# 详情页面和新建页面都会跳入,所以用两种局部刷新 %> +<%# 新建页面局部替换 %> $("#pull_request_new_form").html('<%= escape_javascript(render :partial => "pull_requests/show") %>'); +<%# 详情页面局部替换 %> $("#pull_request_show").html('<%= escape_javascript(render :partial => "pull_requests/show") %>'); \ No newline at end of file