diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index d65c00722..f498e91e7 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -97,6 +97,13 @@ class PullRequestsController < ApplicationController @changes_count = @changes.count @comments = @g.merge_request_comments(@project.gpid, params[:id]) @comments_count = @comments.count + + @limit = 10 + @is_remote = true + @count = @comments_count + @pages = Paginator.new @count, @limit, params['page'] || 1 + @offset ||= @pages.offset + @comments = paginateHelper @comments, 10 end # Accept a merge request. @@ -171,6 +178,14 @@ class PullRequestsController < ApplicationController def pull_request_comments begin @comments = @g.merge_request_comments(@project.gpid, params[:id]) + @comments_count = @comments.count + + @limit = 10 + @is_remote = true + @count = @comments_count + @pages = Paginator.new @count, @limit, params['page'] || 1 + @offset ||= @pages.offset + @comments = paginateHelper @comments, 10 rescue Exception => e @message = e.message end @@ -184,6 +199,13 @@ class PullRequestsController < ApplicationController begin @commits = @g.merge_request_commits(@project.gpid, params[:id]) @commits_count = @commits.count + + @limit = 10 + @is_remote = true + @count = @commits_count + @pages = Paginator.new @count, @limit, params['page'] || 1 + @offset ||= @pages.offset + @commits = paginateHelper @commits, 10 rescue Exception => e @message = e.message end @@ -197,6 +219,13 @@ class PullRequestsController < ApplicationController begin @changes = @g.merge_request_changes(@project.gpid, params[:id]).try(:changes) @changes_count = @changes.count + + @limit = 10 + @is_remote = true + @count = @changes_count + @pages = Paginator.new @count, @limit, params['page'] || 1 + @offset ||= @pages.offset + @changes = paginateHelper @changes, 10 rescue Exception => e @message = e.message end diff --git a/app/views/pull_requests/_pull_request_changes.html.erb b/app/views/pull_requests/_pull_request_changes.html.erb index f8c423504..d56702533 100644 --- a/app/views/pull_requests/_pull_request_changes.html.erb +++ b/app/views/pull_requests/_pull_request_changes.html.erb @@ -29,5 +29,13 @@ <% end %> +
+
+ +
+
+
<% end %> diff --git a/app/views/pull_requests/_pull_request_comments.html.erb b/app/views/pull_requests/_pull_request_comments.html.erb index 5d1c2e6ad..01cfe7cf2 100644 --- a/app/views/pull_requests/_pull_request_comments.html.erb +++ b/app/views/pull_requests/_pull_request_comments.html.erb @@ -1,4 +1,11 @@ -<% @comments.each do |comment| %> +
+ <%= 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.reverse.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)) %>前 @@ -6,12 +13,13 @@
<%= comment.note %>
<% end %> -
- <%= 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 %> +
+
+
    + <%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%> +
+
+