X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/e5f292cf21a5fa72733080a294484e0e4208e0e7..374d9ea486dcf6bb6ad2fe5bb4e5a180a8f556a3:/app/controllers/trace_controller.rb diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index 3f689fd3a..fa062b728 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -4,11 +4,21 @@ class TraceController < ApplicationController def list @page = params[:page].to_i + + opt = Hash.new + opt[:conditions] = ['public = true'] + opt[:order] = 'timestamp DESC' + opt[:limit] = 20 + if @page > 0 - @traces = Trace.find(:all , :conditions => ['public = true'], :order => 'timestamp DESC', :offset => 20*@page, :limit => 20) - else - @traces = Trace.find(:all , :conditions => ['public = true'], :order => 'timestamp DESC', :limit => 20) + opt[:offset => 20*@page] end + + if params[:tag] + + end + + @traces = Trace.find(:all , opt) end def view