Index: app/helpers/application_helper.rb =================================================================== --- app/helpers/application_helper.rb (revision 2675) +++ app/helpers/application_helper.rb (working copy) @@ -197,7 +197,7 @@ path.to_s.split(%r{[/\\]}).select {|p| !p.blank?} end - def pagination_links_full(paginator, count=nil, options={}) + def pagination_links_full(paginator, count=nil, options={:update => 'content'}) page_param = options.delete(:page_param) || :page url_param = params.dup # don't reuse params if filters are present @@ -205,7 +205,7 @@ html = '' html << link_to_remote(('« ' + l(:label_previous)), - {:update => 'content', + {:update => options[:update], :url => url_param.merge(page_param => paginator.current.previous), :complete => 'window.scrollTo(0,0)'}, {:href => url_for(:params => url_param.merge(page_param => paginator.current.previous))}) + ' ' if paginator.current.previous @@ -213,30 +213,30 @@ html << (pagination_links_each(paginator, options) do |n| link_to_remote(n.to_s, {:url => {:params => url_param.merge(page_param => n)}, - :update => 'content', + :update => options[:update], :complete => 'window.scrollTo(0,0)'}, {:href => url_for(:params => url_param.merge(page_param => n))}) end || '') html << ' ' + link_to_remote((l(:label_next) + ' »'), - {:update => 'content', + {:update => options[:update], :url => url_param.merge(page_param => paginator.current.next), :complete => 'window.scrollTo(0,0)'}, {:href => url_for(:params => url_param.merge(page_param => paginator.current.next))}) if paginator.current.next unless count.nil? - html << [" (#{paginator.current.first_item}-#{paginator.current.last_item}/#{count})", per_page_links(paginator.items_per_page)].compact.join(' | ') + html << [" (#{paginator.current.first_item}-#{paginator.current.last_item}/#{count})", per_page_links(paginator.items_per_page, options[:update])].compact.join(' | ') end html end - def per_page_links(selected=nil) + def per_page_links(selected=nil, update = "content") url_param = params.dup url_param.clear if url_param.has_key?(:set_filter) links = Setting.per_page_options_array.collect do |n| - n == selected ? n : link_to_remote(n, {:update => "content", :url => params.dup.merge(:per_page => n)}, + n == selected ? n : link_to_remote(n, {:update => update, :url => params.dup.merge(:per_page => n)}, {:href => url_for(url_param.merge(:per_page => n))}) end links.size > 1 ? l(:label_display_per_page, links.join(', ')) : nil Index: app/controllers/repositories_controller.rb =================================================================== --- app/controllers/repositories_controller.rb (revision 2675) +++ app/controllers/repositories_controller.rb (working copy) @@ -75,9 +75,26 @@ end def browse + @changeset_count = @repository.changesets.count + @changeset_pages = Paginator.new self, @changeset_count, + per_page_option, + params['revisions_page'] + @entries = @repository.entries(@path, @rev) + path = @repository.url[/#{@repository.root_url}(.*)/,1] + (@path.starts_with?('/') ? @path : "/#{@path}") + "%" + @changesets = @repository.changesets.find(:all, + :joins => "INNER JOIN changes on changes.changeset_id = changesets.id", + :group => "changesets.id", + :conditions => ["changes.path like ?", path], + :limit => @changeset_pages.items_per_page, + :offset => @changeset_pages.current.offset, + :order => "changesets.committed_on DESC") if request.xhr? - @entries ? render(:partial => 'dir_list_content') : render(:nothing => true) + if params['revisions_page'] or params['per_page'] + render(:partial => 'path_revisions') + else + @entries ? render(:partial => 'dir_list_content') : render(:nothing => true) + end else show_error_not_found and return unless @entries @properties = @repository.properties(@path, @rev) Index: app/views/repositories/_path_revisions.rhtml =================================================================== --- app/views/repositories/_path_revisions.rhtml (revision 0) +++ app/views/repositories/_path_revisions.rhtml (revision 0) @@ -0,0 +1,8 @@ +<% if !@changesets.empty? && authorize_for('repositories', 'revisions') %> +

<%= l(:label_latest_revision_plural) %>

+ <%= render :partial => 'revisions', :locals => {:project => @project, :path => '', :revisions => @changesets, :entry => nil }%> + +

<%= pagination_links_full @changeset_pages,@changeset_count, {:page_param => 'revisions_page' ,:update => 'revisions'} %>

+ +

<%= link_to l(:label_view_revisions), :action => 'revisions', :id => @project %>

+<% end %> \ No newline at end of file Index: app/views/repositories/browse.rhtml =================================================================== --- app/views/repositories/browse.rhtml (revision 2675) +++ app/views/repositories/browse.rhtml (working copy) @@ -12,3 +12,6 @@ <% content_for :header_tags do %> <%= stylesheet_link_tag "scm" %> <% end %> +
+<%= render :partial => 'path_revisions' %> +
\ No newline at end of file