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
map.connect '/traces/page/:page', :controller => 'trace', :action => 'list'
map.connect '/traces/mine', :controller => 'trace', :action => 'mine'
map.connect '/traces/rss', :controller => 'trace', :action => 'georss'
+ map.connect '/traces/user/:display_name/', :controller => 'trace', :action => 'list', :id => nil
map.connect '/traces/user/:display_name/:id', :controller => 'trace', :action => 'view', :id => nil
map.connect '/traces/user/:display_name/:id/picture', :controller => 'trace', :action => 'picture', :id => nil
map.connect '/traces/user/:display_name/:id/icon', :controller => 'trace', :action => 'icon', :id => nil
+ map.connect '/traces/tag/:tag/', :controller => 'trace', :action => 'list', :id => nil
# fall through
map.connect ':controller/:action/:id'