Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

This commit is contained in:
cxt 2016-08-13 17:04:16 +08:00
commit a4a0ef139b
4 changed files with 9 additions and 5 deletions

View File

@ -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

View File

@ -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 %>
<textarea id="pull_request_comment" name="pull_request_comment"></textarea>
<span id ="pr_comment_tip" class="fontGrey2 c_red" style="display: none">内容不能为空</span>
<a href="javascript:void(0);" class="BlueCirBtn mt10" onclick="pull_request_commit()">提交请求</a>
<a href="javascript:void(0);" class="BlueCirBtn mt10" onclick="pull_request_commit()">留言</a>
<% end %>
</div>
<% @comments.each do |comment| %>

View File

@ -33,7 +33,11 @@
<% else %>
<% if is_project_manager?(User.current.id, @project.id) %>
<div class="merge-commit-option mt15">
<%= 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 %>
</div>
<% end %>
<% end %>

View File

@ -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.