Don't allow paging of the changeset atom feed

Make any request for a changeset feed with a page argument redirect
to the version with no page argument and ensure that any RSS links on
the HTML version of the changeset list don't have a page argument.
This commit is contained in:
Tom Hughes 2010-08-09 13:47:21 +01:00
parent 838b1ee7e9
commit 2adcfc1a72
2 changed files with 65 additions and 61 deletions

View file

@ -254,6 +254,9 @@ class ChangesetController < ApplicationController
##
# list edits (open changesets) in reverse chronological order
def list
if request.format == :atom and params[:page]
redirect_to params.merge({ :page => nil }), :status => :moved_permanently
else
conditions = conditions_nonempty
if params[:display_name]
@ -316,6 +319,7 @@ class ChangesetController < ApplicationController
:offset => (@page - 1) * @page_size,
:limit => @page_size)
end
end
private
#------------------------------------------------------------

View file

@ -5,8 +5,8 @@
<%= render :partial => 'changesets', :locals => { :showusername => !params.has_key?(:display_name) } %>
<%= render :partial => 'changeset_paging_nav' %>
<%= atom_link_to params.merge({ :format => :atom }) %>
<%= atom_link_to params.merge({ :page => nil, :format => :atom }) %>
<% content_for :head do %>
<%= auto_discovery_link_tag :atom, params.merge({ :format => :atom }) %>
<%= auto_discovery_link_tag :atom, params.merge({ :page => nil, :format => :atom }) %>
<% end %>