@entry = @repository.scm.entry(@path, @rev)
show_error and return unless @entry
end
- @changesets = @repository.changesets_for_path(@path)
+ @repository.changesets_with_path @path do
+ @changeset_count = @repository.changesets.count
+ @changeset_pages = Paginator.new self, @changeset_count,
+ 25,
+ params['page']
+ @changesets = @repository.changesets.find(:all,
+ :limit => @changeset_pages.items_per_page,
+ :offset => @changeset_pages.current.offset)
+ end
+ render :action => "revisions", :layout => false if request.xhr?
end
def entry
super if root_url.blank?
end
+ def changesets_with_path(path="")
+ path = "/#{path}%"
+ path = url.gsub(/^#{root_url}/, '') + path if root_url && root_url != url
+ path.squeeze!("/")
+ Changeset.with_scope(:find => { :include => :changes, :conditions => ["#{Change.table_name}.path LIKE ?", path] }) do
+ yield
+ end
+ end
+
def changesets_for_path(path="")
path = "/#{path}%"
path = url.gsub(/^#{root_url}/, '') + path if root_url && root_url != url
<h3>Revisions</h3>
<%= render :partial => 'revisions', :locals => {:project => @project, :path => @path, :changesets => @changesets, :entry => @entry }%>
-<p><%= lwr(:label_modification, @changesets.length) %></p>
+
+<p><%= pagination_links_full @changeset_pages %>
+[ <%= @changeset_pages.current.first_item %> - <%= @changeset_pages.current.last_item %> / <%= @changeset_count %> ]</p>
<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>