From 966722b920c0e48b939f396c3d580cadda8bd28f Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 13 Aug 2016 16:43:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=92=8C=E6=89=93?= =?UTF-8?q?=E5=BC=80=E7=9A=84=E6=97=B6=E5=80=99=E6=98=BE=E7=A4=BAroot?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/pull_requests_controller.rb | 2 +- lib/gitlab-cli/lib/gitlab/client/merge_requests.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index 56dc0839f..5e21f9af0 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -144,7 +144,7 @@ class PullRequestsController < ApplicationController # @return [Gitlab::ObjectifiedHash] Information about updated merge request. def update_pull_request begin - @g.update_merge_request(@project.gpid, params[:id], :state_event => params[:state]) + @g.update_merge_request(@project.gpid, params[:id], User.current.gid, :state_event => params[:state]) respond_to do |format| format.html{redirect_to project_pull_request_path(params[:id], :project_id => @project.id)} end diff --git a/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb b/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb index b6a9ed051..0ac95b391 100644 --- a/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb +++ b/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb @@ -64,8 +64,8 @@ class Gitlab::Client # @option options [Integer] :assignee_id The ID of a user to assign merge request. # @option options [String] :state_event New state (close|reopen|merge). # @return [Gitlab::ObjectifiedHash] Information about updated merge request. - def update_merge_request(project, id, options={}) - put("/projects/#{project}/merge_request/#{id}", :body => options) + def update_merge_request(project, id, gid, options={}) + put("/projects/#{project}/merge_request/#{id}?user_id=#{gid}", :body => options) end # Adds a comment to a merge request. From 3ce088002a191bc7bd4d7c3112b719a0a4ddd030 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 13 Aug 2016 16:53:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=95=99=E8=A8=80=E5=92=8C=E5=B7=B2?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=B5=81=E7=A8=8B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/pull_requests/_pull_request_comments.html.erb | 2 +- app/views/pull_requests/_show.html.erb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/pull_requests/_pull_request_comments.html.erb b/app/views/pull_requests/_pull_request_comments.html.erb index 9208a13ad..dfc1dda05 100644 --- a/app/views/pull_requests/_pull_request_comments.html.erb +++ b/app/views/pull_requests/_pull_request_comments.html.erb @@ -2,7 +2,7 @@ <%= 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 %> <% @comments.each do |comment| %> diff --git a/app/views/pull_requests/_show.html.erb b/app/views/pull_requests/_show.html.erb index 3edb9c874..b750728a4 100644 --- a/app/views/pull_requests/_show.html.erb +++ b/app/views/pull_requests/_show.html.erb @@ -33,7 +33,11 @@ <% else %> <% if is_project_manager?(User.current.id, @project.id) %>
- <%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn", :remote => true %> + <% if @request.state == "closed" %> + 该请求已被关闭 + <% else %> + <%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn", :remote => true %> + <% end %>
<% end %> <% end %>