innitial by tag / by user code

This commit is contained in:
Steve Coast 2006-12-08 18:00:56 +00:00
parent e5f292cf21
commit 374d9ea486
2 changed files with 15 additions and 3 deletions

View file

@ -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

View file

@ -34,9 +34,11 @@ ActionController::Routing::Routes.draw do |map|
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'