2008-06-16 16:13:33 +02:00
|
|
|
ActionController::Routing::Routes.draw do |map|
|
|
|
|
|
map.with_options :controller => 'login' do |login|
|
|
|
|
|
login.login 'login', :action => 'login'
|
2009-12-29 12:22:44 -08:00
|
|
|
login.login_cas 'login_cas', :action => 'login_cas'
|
2008-06-16 16:13:33 +02:00
|
|
|
login.formatted_login 'login.:format', :action => 'login'
|
|
|
|
|
login.logout 'logout', :action => 'logout'
|
|
|
|
|
login.formatted_logout 'logout.:format', :action => 'logout'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
map.resources :users,
|
|
|
|
|
:member => {:change_password => :get, :update_password => :post,
|
|
|
|
|
:change_auth_type => :get, :update_auth_type => :post, :complete => :get,
|
|
|
|
|
:refresh_token => :post }
|
|
|
|
|
map.with_options :controller => "users" do |users|
|
|
|
|
|
users.signup 'signup', :action => "new"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
map.resources :contexts, :collection => {:order => :post} do |contexts|
|
|
|
|
|
contexts.resources :todos, :name_prefix => "context_"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
map.resources :projects, :collection => {:order => :post, :alphabetize => :post} do |projects|
|
|
|
|
|
projects.resources :todos, :name_prefix => "project_"
|
|
|
|
|
end
|
|
|
|
|
|
2008-09-23 17:06:14 -03:00
|
|
|
map.resources :projects, :collection => {:order => :post, :actionize => :post} do |projects|
|
|
|
|
|
projects.resources :todos, :name_prefix => "project_"
|
|
|
|
|
end
|
|
|
|
|
|
2008-06-16 16:13:33 +02:00
|
|
|
map.resources :todos,
|
|
|
|
|
:member => {:toggle_check => :put, :toggle_star => :put},
|
|
|
|
|
:collection => {:check_deferred => :post, :filter_to_context => :post, :filter_to_project => :post}
|
|
|
|
|
map.with_options :controller => "todos" do |todos|
|
|
|
|
|
todos.home '', :action => "index"
|
|
|
|
|
todos.tickler 'tickler', :action => "list_deferred"
|
|
|
|
|
todos.mobile_tickler 'tickler.m', :action => "list_deferred", :format => 'm'
|
|
|
|
|
todos.done 'done', :action => "completed"
|
|
|
|
|
todos.done_archive 'done/archive', :action => "completed_archive"
|
|
|
|
|
|
|
|
|
|
# This route works for tags with dots like /todos/tag/version1.5
|
|
|
|
|
# please note that this pattern consumes everything after /todos/tag
|
|
|
|
|
# so /todos/tag/version1.5.xml will result in :name => 'version1.5.xml'
|
|
|
|
|
# UPDATE: added support for mobile view. All tags ending on .m will be
|
|
|
|
|
# routed to mobile view of tags.
|
2008-10-02 21:43:38 -04:00
|
|
|
todos.tag 'todos/tag/:name.m', :action => "tag", :format => 'm'
|
2008-06-16 16:13:33 +02:00
|
|
|
todos.tag 'todos/tag/:name', :action => "tag", :name => /.*/
|
|
|
|
|
|
2008-10-03 22:44:58 +02:00
|
|
|
todos.calendar 'calendar.ics', :action => "calendar", :format => 'ics'
|
2008-10-02 17:28:49 +02:00
|
|
|
todos.calendar 'calendar', :action => "calendar"
|
|
|
|
|
|
2008-06-16 16:13:33 +02:00
|
|
|
todos.mobile 'mobile', :action => "index", :format => 'm'
|
|
|
|
|
todos.mobile_abbrev 'm', :action => "index", :format => 'm'
|
|
|
|
|
todos.mobile_abbrev_new 'm/new', :action => "new", :format => 'm'
|
|
|
|
|
end
|
2008-12-08 00:52:57 -05:00
|
|
|
map.root :controller => 'todos' # Make OpenID happy because it needs #root_url defined
|
2008-06-16 16:13:33 +02:00
|
|
|
|
|
|
|
|
map.resources :notes
|
|
|
|
|
map.feeds 'feeds', :controller => 'feedlist', :action => 'index'
|
|
|
|
|
map.feeds 'feeds.m', :controller => 'feedlist', :action => 'index', :format => 'm'
|
|
|
|
|
|
2008-10-02 20:25:58 -04:00
|
|
|
if Rails.env == 'test'
|
|
|
|
|
map.connect '/selenium_helper/login', :controller => 'selenium_helper', :action => 'login'
|
|
|
|
|
end
|
|
|
|
|
|
2008-06-16 16:13:33 +02:00
|
|
|
map.preferences 'preferences', :controller => 'preferences', :action => 'index'
|
|
|
|
|
map.integrations 'integrations', :controller => 'integrations', :action => 'index'
|
2008-12-10 21:30:43 +01:00
|
|
|
map.search_plugin '/integrations/search_plugin.xml', :controller => 'integrations', :action => 'search_plugin', :format => 'xml'
|
2009-08-04 10:27:20 +02:00
|
|
|
map.google_gadget '/integrations/google_gadget.xml', :controller => 'integrations', :action => 'google_gadget', :format => 'xml'
|
|
|
|
|
map.stats 'stats', :controller => 'stats', :action => 'index'
|
2008-06-16 16:13:33 +02:00
|
|
|
|
2008-07-19 20:27:45 +02:00
|
|
|
map.resources :recurring_todos,
|
|
|
|
|
:member => {:toggle_check => :put, :toggle_star => :put}
|
|
|
|
|
map.recurring_todos 'recurring_todos', :controller => 'recurring_todos', :action => 'index'
|
|
|
|
|
|
2008-06-16 16:13:33 +02:00
|
|
|
# Install the default route as the lowest priority.
|
|
|
|
|
map.connect ':controller/:action/:id'
|
|
|
|
|
|
|
|
|
|
end
|