diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb
index 8d11e7279..f63f1dc17 100644
--- a/app/controllers/pull_requests_controller.rb
+++ b/app/controllers/pull_requests_controller.rb
@@ -1,7 +1,7 @@
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]
+ before_filter :connect_gitlab, :only => [:index, :show, :create, :accept_pull_request, :pull_request_commits, :pull_request_changes, :new, :update_pull_request, :pull_request_comments]
layout "base_projects"
include PullRequestsHelper
include ApplicationHelper
@@ -87,6 +87,8 @@ class PullRequestsController < ApplicationController
@commits_count = @commits.count
@changes = @g.merge_request_changes(@project.gpid, params[:id]).try(:changes)
@changes_count = @changes.count
+ @comments = @g.merge_request_comments(@project.gpid, params[:id])
+ @comments_count = @comments.count
end
# Accept a merge request.
@@ -170,6 +172,7 @@ class PullRequestsController < ApplicationController
def pull_request_commits
begin
@commits = @g.merge_request_commits(@project.gpid, params[:id])
+ @commits_count = @commits.count
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
new file mode 100644
index 000000000..e5fa3a052
--- /dev/null
+++ b/app/views/pull_requests/_pull_request_comments.html.erb
@@ -0,0 +1,19 @@
+
+
+
+
+
+<% @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" %>
+
<%#= time_tag(comment.author.try(:created_at)) %>前
+
+
<%= comment.note %>
+
+<% end %>
+
+
\ 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 ce0c633c6..31d337faf 100644
--- a/app/views/pull_requests/_show.html.erb
+++ b/app/views/pull_requests/_show.html.erb
@@ -7,13 +7,13 @@
<%= get_state(@request.state) %>合并请求 由 <%= link_to @request.author.try(:username), user_path(get_user_by_login_and(@request.author.try(:username))), :class => "link-blue" %> 于 <%= time_tag(@request.created_at) %> 前提交 · 最后编辑时间 <%= time_tag(@request.updated_at) %> 前
<% unless @request.state == "merged" %>
<%= link_to "#{@request.state == 'closed' ? '重新打开' : '关闭'}", update_pull_request_project_pull_request_path(@request.id, :project_id => @project.id, :state => @request.state =="closed" ? "reopen" : "close"), :class => "BlueCirBtn fr" %>
- <% end %>
+ <% end %>
<%= @request.title %><%= @request.description %>
+
请求将
<%= @request.source_branch %> 合并至
<%= @request.target_branch %>
-
<% if @commits_count == 0 && @changes_count == 0 %>
<%= @request.source_branch %>没有新内容可以合并至<%= @request.target_branch %>
@@ -33,28 +33,15 @@
<% end %>
<% end %>
-
+
- - <%= link_to "留言#{@commits_count}".html_safe, :class => "active" %>
- - <%= link_to "提交#{@commits_count}".html_safe, pull_request_commits_project_pull_request_path(@request.id, :project_id => @project.id, :type => 1), :remote => true %>
- - <%= link_to "改动#{@changes_count}".html_safe, pull_request_changes_project_pull_request_path(@request.id, :project_id => @project.id, :type => 2), :remote => true %>
+ - <%= link_to "留言#{@comments_count}".html_safe, pull_request_comments_project_pull_request_path(@request.id, :project_id => @project.id), :remote => true, :class => "active" %>
+ - <%= link_to "提交#{@commits_count}".html_safe, pull_request_commits_project_pull_request_path(@request.id, :project_id => @project.id), :remote => true %>
+ - <%= link_to "改动#{@changes_count}".html_safe, pull_request_changes_project_pull_request_path(@request.id, :project_id => @project.id), :remote => true %>
-
-
Hjqreturn20小时前
-
-
回复内容
-
-
-
Hjqreturn20小时前
-
-
已关闭请求/重新审核请求
-
-
+ <%= render :partial => "pull_requests/pull_request_comments" %>
<%= render :partial => "pull_requests/pull_request_commits" %>
diff --git a/app/views/pull_requests/pull_request_changes.js.erb b/app/views/pull_requests/pull_request_changes.js.erb
index 2b3d77537..d1cf90c2f 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_1").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", :locals => {:type => @type} ) %>');
\ No newline at end of file
diff --git a/app/views/pull_requests/pull_request_comments.js.erb b/app/views/pull_requests/pull_request_comments.js.erb
new file mode 100644
index 000000000..5a7e6683c
--- /dev/null
+++ b/app/views/pull_requests/pull_request_comments.js.erb
@@ -0,0 +1 @@
+$("#merge_record_0").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_comments") %>');
\ 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 0833b1e8a..217198291 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_0").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", :locals => {:type => @type} ) %>');
\ No newline at end of file