diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb
index 2592421a6..56dc0839f 100644
--- a/app/controllers/pull_requests_controller.rb
+++ b/app/controllers/pull_requests_controller.rb
@@ -95,7 +95,7 @@ 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 = @g.merge_request_comments(@project.gpid, params[:id]).reverse
@comments_count = @comments.count
@limit = 10
@@ -178,7 +178,7 @@ class PullRequestsController < ApplicationController
# Gitlab.merge_request_comments(5, 1)
def pull_request_comments
begin
- @comments = @g.merge_request_comments(@project.gpid, params[:id])
+ @comments = @g.merge_request_comments(@project.gpid, params[:id]).reverse
@comments_count = @comments.count
@limit = 10
@@ -198,6 +198,7 @@ class PullRequestsController < ApplicationController
# merge_request_id (required) - The ID of MR
def pull_request_commits
begin
+ @type = params[:type]
@commits = @g.merge_request_commits(@project.gpid, params[:id])
@commits_count = @commits.count
@@ -218,6 +219,7 @@ class PullRequestsController < ApplicationController
# merge_request_id (required) - The ID of MR
def pull_request_changes
begin
+ @type = params[:type]
@changes = @g.merge_request_changes(@project.gpid, params[:id]).try(:changes)
@changes_count = @changes.count
diff --git a/app/views/pull_requests/_pull_request_changes.html.erb b/app/views/pull_requests/_pull_request_changes.html.erb
index d56702533..07e891ec6 100644
--- a/app/views/pull_requests/_pull_request_changes.html.erb
+++ b/app/views/pull_requests/_pull_request_changes.html.erb
@@ -1,4 +1,4 @@
-<% unless @changes.blank? %>
+<% if !@changes.blank? && @type == "3" %>
<% @changes.each do |cd| %>
<%= 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.created_at) %>前
diff --git a/app/views/pull_requests/_pull_request_commits.html.erb b/app/views/pull_requests/_pull_request_commits.html.erb
index 44670f91f..0351f6919 100644
--- a/app/views/pull_requests/_pull_request_commits.html.erb
+++ b/app/views/pull_requests/_pull_request_commits.html.erb
@@ -1,29 +1,32 @@
根据最近提交时间排列
-<% @commits.each do |commit| %>
-
-
-
<%= format_date(commit.created_at) %>
-
-
<%= link_to commit.author_name, user_path(get_user_by_mail(commit.author_email)), :class => "link-blue" %> 创建于<%= time_tag(commit.created_at) %>前
-
-
-
<%= commit.title %>
+<% if !@commits.blank? && @type == "2" %>
+ <% @commits.each do |commit| %>
+
+
+
<%= format_date(commit.created_at) %>
+
+
<%= link_to commit.author_name, user_path(get_user_by_mail(commit.author_email)), :class => "link-blue" %> 创建于<%= time_tag(commit.created_at) %>前
+
+
+ <%= commit.title %>
-
-
+
+
<%= link_to truncate(commit.short_id, :length => 20), {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank" %>
+
+
+
+ <% end %>
+
+
+
+ <%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
+
+
+
-
-
<% end %>
-
-
-
- <%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
-
-
-
-
+
diff --git a/app/views/pull_requests/_show.html.erb b/app/views/pull_requests/_show.html.erb
index d792dc823..3edb9c874 100644
--- a/app/views/pull_requests/_show.html.erb
+++ b/app/views/pull_requests/_show.html.erb
@@ -40,19 +40,22 @@
- - <%= 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 %>
+ - <%= link_to "留言#{@comments_count}".html_safe, pull_request_comments_project_pull_request_path(@request.id, :project_id => @project.id, :type => "1"), :remote => true, :class => "active" %>
+ - <%= link_to "提交#{@commits_count}".html_safe, pull_request_commits_project_pull_request_path(@request.id, :project_id => @project.id, :type => "2"), :remote => true %>
+ - <%= link_to "改动#{@changes_count}".html_safe, pull_request_changes_project_pull_request_path(@request.id, :project_id => @project.id, :type => "3"), :remote => true %>
-
- <%= render :partial => "pull_requests/pull_request_comments" %>
-
+ <% if @type == nil || @type == "1" %>
+
+ <%= render :partial => "pull_requests/pull_request_comments" %>
+
+ <% end %>
<%= render :partial => "pull_requests/pull_request_commits" %>
<%= render :partial => "pull_requests/pull_request_changes" %>
+
<% end %>