2008-06-16 16:13:33 +02:00
|
|
|
ActionController::Routing::Routes.draw do |map|
|
|
|
|
|
map.resources :users,
|
2010-07-30 21:06:12 +02:00
|
|
|
:member => {:change_password => :get, :update_password => :post,
|
|
|
|
|
:change_auth_type => :get, :update_auth_type => :post, :complete => :get,
|
|
|
|
|
:refresh_token => :post }
|
2011-07-09 18:47:30 +02:00
|
|
|
|
2011-05-01 12:48:32 +02:00
|
|
|
map.with_options :controller => :users do |users|
|
2008-06-16 16:13:33 +02:00
|
|
|
users.signup 'signup', :action => "new"
|
|
|
|
|
end
|
|
|
|
|
|
2011-06-20 06:50:25 +02:00
|
|
|
map.resources :contexts, :collection => {:order => :post, :done => :get}, :member => {:done_todos => :get, :all_done_todos => :get} do |contexts|
|
2008-06-16 16:13:33 +02:00
|
|
|
contexts.resources :todos, :name_prefix => "context_"
|
|
|
|
|
end
|
|
|
|
|
|
2011-09-28 13:54:50 +02:00
|
|
|
map.resources :projects,
|
|
|
|
|
:collection => {:order => :post, :alphabetize => :post, :actionize => :post, :done => :get},
|
2011-09-28 15:34:15 +02:00
|
|
|
:member => {:done_todos => :get, :all_done_todos => :get, :set_reviewed => :get} do |projects|
|
2011-09-28 13:54:50 +02:00
|
|
|
projects.resources :todos, :name_prefix => "project_"
|
2008-09-23 17:06:14 -03:00
|
|
|
end
|
2011-07-09 18:47:30 +02:00
|
|
|
|
2011-09-28 13:54:50 +02:00
|
|
|
map.with_options :controller => :projects do |projects|
|
|
|
|
|
projects.review 'review', :action => :review
|
|
|
|
|
end
|
2011-09-16 15:07:58 -04:00
|
|
|
|
2010-07-30 21:06:12 +02:00
|
|
|
map.resources :notes
|
|
|
|
|
|
2008-06-16 16:13:33 +02:00
|
|
|
map.resources :todos,
|
2012-01-16 11:46:49 -06:00
|
|
|
:member => {:toggle_check => :put, :toggle_star => :put, :defer => :put},
|
2011-06-17 13:33:54 +02:00
|
|
|
:collection => {:check_deferred => :post, :filter_to_context => :post, :filter_to_project => :post, :done => :get, :all_done => :get
|
2011-06-12 05:38:45 +02:00
|
|
|
}
|
2011-05-01 12:48:32 +02:00
|
|
|
|
|
|
|
|
map.with_options :controller => :todos do |todos|
|
2008-06-16 16:13:33 +02:00
|
|
|
todos.home '', :action => "index"
|
2011-06-17 13:33:54 +02:00
|
|
|
todos.tickler 'tickler.:format', :action => "list_deferred"
|
2008-06-16 16:13:33 +02:00
|
|
|
todos.mobile_tickler 'tickler.m', :action => "list_deferred", :format => 'm'
|
2011-07-09 18:47:30 +02:00
|
|
|
|
2008-06-16 16:13:33 +02:00
|
|
|
# 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.
|
2011-09-30 12:06:43 +02:00
|
|
|
todos.mobile_tag 'todos/tag/:name.m', :action => "tag", :format => 'm'
|
2011-10-31 14:39:52 +01:00
|
|
|
todos.text_tag 'todos/tag/:name.txt', :action => "tag", :format => 'txt'
|
2008-06-16 16:13:33 +02:00
|
|
|
todos.tag 'todos/tag/:name', :action => "tag", :name => /.*/
|
2011-06-26 23:05:33 +02:00
|
|
|
todos.done_tag 'todos/done/tag/:name', :action => "done_tag"
|
|
|
|
|
todos.all_done_tag 'todos/all_done/tag/:name', :action => "all_done_tag"
|
2010-04-02 13:23:24 -04:00
|
|
|
|
|
|
|
|
todos.tags 'tags.autocomplete', :action => "tags", :format => 'autocomplete'
|
|
|
|
|
todos.auto_complete_for_predecessor 'auto_complete_for_predecessor', :action => 'auto_complete_for_predecessor'
|
2011-07-09 18:47:30 +02:00
|
|
|
|
2008-10-03 22:44:58 +02:00
|
|
|
todos.calendar 'calendar.ics', :action => "calendar", :format => 'ics'
|
2011-07-09 18:47:30 +02:00
|
|
|
todos.calendar 'calendar.xml', :action => "calendar", :format => 'xml'
|
2008-10-02 17:28:49 +02:00
|
|
|
todos.calendar 'calendar', :action => "calendar"
|
2011-07-09 18:47:30 +02:00
|
|
|
|
|
|
|
|
todos.hidden 'hidden.xml', :action => "list_hidden", :format => 'xml'
|
|
|
|
|
|
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'
|
2010-08-03 22:27:54 +02:00
|
|
|
|
|
|
|
|
todos.mobile_todo_show_notes 'todos/notes/:id.m', :action => "show_notes", :format => 'm'
|
|
|
|
|
todos.todo_show_notes 'todos/notes/:id', :action => "show_notes"
|
2011-06-12 05:38:45 +02:00
|
|
|
todos.done_todos 'todos/done', :action => :done
|
|
|
|
|
todos.all_done_todos 'todos/all_done', :action => :all_done
|
2008-06-16 16:13:33 +02:00
|
|
|
end
|
2008-12-08 00:52:57 -05:00
|
|
|
map.root :controller => 'todos' # Make OpenID happy because it needs #root_url defined
|
2010-07-30 21:06:12 +02:00
|
|
|
|
2011-06-20 06:50:25 +02:00
|
|
|
map.resources :recurring_todos, :collection => {:done => :get},
|
2010-07-30 21:06:12 +02:00
|
|
|
:member => {:toggle_check => :put, :toggle_star => :put}
|
2011-06-12 05:38:45 +02:00
|
|
|
map.with_options :controller => :recurring_todos do |rt|
|
|
|
|
|
rt.recurring_todos 'recurring_todos', :action => 'index'
|
|
|
|
|
end
|
2010-07-30 21:06:12 +02:00
|
|
|
|
2011-06-12 05:38:45 +02:00
|
|
|
map.with_options :controller => :login do |login|
|
2010-07-30 21:06:12 +02:00
|
|
|
login.login 'login', :action => 'login'
|
|
|
|
|
login.login_cas 'login_cas', :action => 'login_cas'
|
|
|
|
|
login.formatted_login 'login.:format', :action => 'login'
|
|
|
|
|
login.logout 'logout', :action => 'logout'
|
|
|
|
|
login.formatted_logout 'logout.:format', :action => 'logout'
|
|
|
|
|
end
|
|
|
|
|
|
2011-06-12 05:38:45 +02:00
|
|
|
map.with_options :controller => :feedlist do |fl|
|
2010-07-30 21:06:12 +02:00
|
|
|
fl.mobile_feeds 'feeds.m', :action => 'index', :format => 'm'
|
|
|
|
|
fl.feeds 'feeds', :action => 'index'
|
|
|
|
|
end
|
2011-07-09 18:47:30 +02:00
|
|
|
|
2011-06-12 05:38:45 +02:00
|
|
|
map.with_options :controller => :integrations do |i|
|
2010-07-30 21:06:12 +02:00
|
|
|
i.integrations 'integrations', :action => 'index'
|
|
|
|
|
i.rest_api_docs 'integrations/rest_api', :action => "rest_api"
|
2011-10-04 20:14:36 +02:00
|
|
|
i.search_plugin 'integrations/search_plugin.xml', :action => 'search_plugin', :format => 'xml'
|
|
|
|
|
i.google_gadget 'integrations/google_gadget.xml', :action => 'google_gadget', :format => 'xml'
|
|
|
|
|
i.cloudmailin 'integrations/cloudmailin', :action => 'cloudmailin'
|
2008-10-02 20:25:58 -04:00
|
|
|
end
|
|
|
|
|
|
2011-08-17 22:51:02 +02:00
|
|
|
map.with_options :controller => :preferences do |p|
|
|
|
|
|
p.preferences 'preferences', :action => 'index'
|
|
|
|
|
p.preferences_date_format 'preferences/render_date_format', :action => 'render_date_format'
|
|
|
|
|
end
|
2011-07-09 18:47:30 +02:00
|
|
|
|
2011-05-03 19:14:30 +02:00
|
|
|
map.with_options :controller => :stats do |stats|
|
2011-06-12 04:53:49 +02:00
|
|
|
stats.stats 'stats', :action => 'index'
|
2011-05-03 19:14:30 +02:00
|
|
|
stats.done_overview 'done', :action => 'done'
|
|
|
|
|
end
|
2011-07-09 18:47:30 +02:00
|
|
|
|
2010-07-30 21:06:12 +02:00
|
|
|
map.search 'search', :controller => 'search', :action => 'index'
|
|
|
|
|
map.data 'data', :controller => 'data', :action => 'index'
|
2008-06-16 16:13:33 +02:00
|
|
|
|
2011-02-13 13:06:10 +01:00
|
|
|
Translate::Routes.translation_ui(map) if Rails.env != "production"
|
2008-07-19 20:27:45 +02:00
|
|
|
|
2008-06-16 16:13:33 +02:00
|
|
|
# Install the default route as the lowest priority.
|
|
|
|
|
map.connect ':controller/:action/:id'
|
|
|
|
|
|
|
|
|
|
end
|