diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb
index f63f1dc17..7dc6b7b53 100644
--- a/app/controllers/pull_requests_controller.rb
+++ b/app/controllers/pull_requests_controller.rb
@@ -1,7 +1,8 @@
class PullRequestsController < ApplicationController
before_filter :find_project_and_repository
- before_filter :connect_gitlab, :only => [:index, :show, :create, :accept_pull_request, :pull_request_commits, :pull_request_changes, :new, :update_pull_request, :pull_request_comments]
+ before_filter :connect_gitlab, :only => [:index, :show, :create, :accept_pull_request, :pull_request_commits, :pull_request_changes, :new,
+ :update_pull_request, :pull_request_comments, :create_pull_request_comment]
layout "base_projects"
include PullRequestsHelper
include ApplicationHelper
@@ -145,9 +146,12 @@ class PullRequestsController < ApplicationController
# Gitlab.create_merge_request(5, 'New merge request',
# :source_branch => 'source_branch', :target_branch => 'target_branch', :assignee_id => 42)
def create_pull_request_comment
- content = params[:content]
+ content = params[:pull_request_comment]
begin
@comments = @g.create_merge_request_comment(@project.gpid, params[:id], content)
+ respond_to do |format|
+ format.html{redirect_to project_pull_request_path(params[:id], :project_id => @project.id)}
+ end
rescue Exception => e
@message = e.message
end
diff --git a/app/views/pull_requests/_pull_request_comments.html.erb b/app/views/pull_requests/_pull_request_comments.html.erb
index e5fa3a052..5d1c2e6ad 100644
--- a/app/views/pull_requests/_pull_request_comments.html.erb
+++ b/app/views/pull_requests/_pull_request_comments.html.erb
@@ -1,8 +1,3 @@
-
-
-
-
-
<% @comments.each do |comment| %>
<%= link_to comment.author.try(:username), user_path(get_user_by_login_and(comment.author.try(:username))), :class => "link-blue mr15 fl" %>
@@ -11,9 +6,36 @@
<%= comment.note %>
<% end %>
-
\ No newline at end of file
+ <%= form_tag(url_for(:controller => 'pull_requests', :action => 'create_pull_request_comment', :project_id => @project.id), :id => 'pull_request_comment_form', :method => "post", :remote => true) do %>
+
+
+ 提交请求
+ <% end %>
+
+
+
\ No newline at end of file
diff --git a/app/views/pull_requests/pull_request_changes.js.erb b/app/views/pull_requests/pull_request_changes.js.erb
index d1cf90c2f..9021c498d 100644
--- a/app/views/pull_requests/pull_request_changes.js.erb
+++ b/app/views/pull_requests/pull_request_changes.js.erb
@@ -1 +1 @@
-$("#merge_record_2").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_changes", :locals => {:type => @type} ) %>');
\ No newline at end of file
+$("#merge_record_2").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_changes") %>');
\ No newline at end of file
diff --git a/app/views/pull_requests/pull_request_commits.js.erb b/app/views/pull_requests/pull_request_commits.js.erb
index 217198291..cc0a82010 100644
--- a/app/views/pull_requests/pull_request_commits.js.erb
+++ b/app/views/pull_requests/pull_request_commits.js.erb
@@ -1 +1 @@
-$("#merge_record_1").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_commits", :locals => {:type => @type} ) %>');
\ No newline at end of file
+$("#merge_record_1").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_commits") %>');
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index b50ee9c65..58a48ebad 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -818,6 +818,7 @@ RedmineApp::Application.routes.draw do
get 'pull_request_changes'
get 'update_pull_request'
get 'pull_request_comments'
+ post 'create_pull_request_comment'
end
end
diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css
index 3653cf799..6b5bdffdb 100644
--- a/public/stylesheets/css/project.css
+++ b/public/stylesheets/css/project.css
@@ -545,4 +545,4 @@ a:hover.upload_btn_grey{background:#8a8a8a;}
.merge-discussion-detail {font-size:13px; line-height:1.5em; color:#484848; margin-top:10px;}
.merge-discussion-automatic {background-color:#fdfdfd;}
.merge-discussion-input {margin:0 -10px; padding:10px; background-color:#f8f8f8;}
-.merge-discussion-input textarea {width:720px; height:80px; font-size:13px; line-height:16px; color:#484848; margin-bottom:10px; padding:5px;}
\ No newline at end of file
+.merge-discussion-input textarea {width:720px; height:80px; font-size:13px; line-height:16px; color:#484848; padding:5px;}
\ No newline at end of file