X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f5777a881f6f612712c8aa8fb88f6a09b3906a6c..7f1691e878e76aafc6de537fadbdcb3f8f4aaaff:/app/controllers/trace_controller.rb diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index 3769202da..3c16b9a80 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -81,11 +81,15 @@ class TraceController < ApplicationController conditions[0] += " AND gpx_files.visible = ?" conditions << true - @trace_pages, @traces = paginate(:traces, - :include => [:user, :tags], - :conditions => conditions, - :order => "gpx_files.timestamp DESC", - :per_page => 20) + @page = (params[:page] || 1).to_i + @page_size = 20 + + @traces = Trace.find(:all, + :include => [:user, :tags], + :conditions => conditions, + :order => "gpx_files.timestamp DESC", + :offset => (@page - 1) * @page_size, + :limit => @page_size) # put together SET of tags across traces, for related links tagset = Hash.new @@ -229,7 +233,7 @@ class TraceController < ApplicationController rss = OSM::GeoRSS.new traces.each do |trace| - rss.add(trace.latitude, trace.longitude, trace.name, trace.user.display_name, url_for({:controller => 'trace', :action => 'view', :id => trace.id, :display_name => trace.user.display_name}), " 'icon', :id => trace.id, :user_login => trace.user.display_name})}'> GPX file with #{trace.size} points from #{trace.user.display_name}", trace.timestamp) + rss.add(trace.latitude, trace.longitude, trace.name, trace.user.display_name, url_for({:controller => 'trace', :action => 'view', :id => trace.id, :display_name => trace.user.display_name}), " 'icon', :id => trace.id, :display_name => trace.user.display_name})}'> GPX file with #{trace.size} points from #{trace.user.display_name}", trace.timestamp) end render :text => rss.to_s, :content_type => "application/rss+xml"