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 %> +