diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 21ee6e1de..de44f44d5 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -271,11 +271,37 @@ update
alias_method :browse, :show
+
+ #add by houxiang
+
+ def get_commits(id)
+ g = Gitlab.client
+ tmp_commit = g.commits(id,page:0)
+ commits = []
+ i=0
+ while tmp_commit!=[]
+ commits = commits+tmp_commit
+ i=i+1
+ tmp_commit = g.commits(id,page:i)
+ end
+ commits_count = commits.length
+
+ return commits_count
+
+ end
+
+
def changes
@entry = @repository.entry(@path, @rev)
(show_error_not_found; return) unless @entry
g = Gitlab.client
- @commits = g.commits(@project.gpid, page:params[:page])
+ limit = 20
+
+
+ @commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s)
+ @commits_count = get_commits(@project.gpid)
+ @commits_pages = Redmine::Pagination::Paginator.new @commits_count,limit,params[:page]
+
@commit = g.commit(@project.gpid,@rev)
# @changesets = g.get ("/projects/#{@project.gpid}/repository/commits?#{@rev}")
#@changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i)
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index 22317dc91..8d371912e 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -20,7 +20,7 @@
<% next if e.forge_act_type.safe_constantize.nil?
act = e.forge_act;
next if act.nil? %>
-
+ \
<% if e.forge_act_type == "Issue" %>
<%= image_tag(url_to_avatar(act.author), :width => "42", :height => "42") %>
@@ -111,4 +111,4 @@
<% end %>
<% end %>
<% end %>
-<%= paginate @events_pages, :left => 3, :right => 3 %>
\ No newline at end of file
+<%= paginate @events_pages, :left => 3, :right => 3 %>
diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb
index 837096c89..50c973fb4 100644
--- a/app/views/repositories/_revisions.html.erb
+++ b/app/views/repositories/_revisions.html.erb
@@ -13,6 +13,7 @@
+
<% show_diff = revisions.size > 1 %>
<% line_num = 1 %>
<% revisions.each do |changeset| %>
@@ -48,4 +49,9 @@
<%#= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %>
+
+ <%= pagination_links_full commits_pages, commits_count, :per_page_links => false, :remote => false, :flag => true%>
+
+
<% end %>
+
diff --git a/app/views/repositories/changes.html.erb b/app/views/repositories/changes.html.erb
index 428799f07..3780df172 100644
--- a/app/views/repositories/changes.html.erb
+++ b/app/views/repositories/changes.html.erb
@@ -14,7 +14,9 @@
<%= render_properties(@properties) %>
- <%= render(:partial => 'revisions', :locals => {:project => @project, :path => @path, :revisions => @commits, :entry => @entry }) unless @commits.empty? %>
+
+ <%= render(:partial => 'revisions', :locals => {:project => @project, :path => @path ,:revisions => @commits, :entry => @entry ,:commits_pages =>@commits_pages , :commits_count => @commits_count}) unless @commits.empty? %>
+
<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb
index 9601e5188..af53d760f 100644
--- a/app/views/repositories/show.html.erb
+++ b/app/views/repositories/show.html.erb
@@ -40,7 +40,7 @@
- <%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev} %> 提交
+ <%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1} %> 提交
<% end %>