]> git.openstreetmap.org Git - rails.git/blob - config/routes.rb
2c7f4d0fcab5628479fda2e52d10ac35190e9e0c
[rails.git] / config / routes.rb
1 ActionController::Routing::Routes.draw do |map|
2
3   # API
4   map.connect "api/#{API_VERSION}/changeset/create", :controller => 'changeset', :action => 'create'
5   map.connect "api/#{API_VERSION}/changeset/upload", :controller => 'changeset', :action => 'upload'
6   map.connect "api/#{API_VERSION}/changeset/:id", :controller => 'changeset', :action => 'read'
7   map.connect "api/#{API_VERSION}/changeset/:id/close", :controller => 'changeset', :action => 'close'
8   
9   map.connect "api/#{API_VERSION}/node/create", :controller => 'node', :action => 'create'
10   map.connect "api/#{API_VERSION}/node/:id/ways", :controller => 'way', :action => 'ways_for_node', :id => /\d+/
11   map.connect "api/#{API_VERSION}/node/:id/relations", :controller => 'relation', :action => 'relations_for_node', :id => /\d+/
12   map.connect "api/#{API_VERSION}/node/:id/history", :controller => 'old_node', :action => 'history', :id => /\d+/
13   map.connect "api/#{API_VERSION}/node/:id", :controller => 'node', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
14   map.connect "api/#{API_VERSION}/node/:id", :controller => 'node', :action => 'update', :id => /\d+/, :conditions => { :method => :put }
15   map.connect "api/#{API_VERSION}/node/:id", :controller => 'node', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete }
16   map.connect "api/#{API_VERSION}/nodes", :controller => 'node', :action => 'nodes', :id => nil
17   
18   map.connect "api/#{API_VERSION}/way/create", :controller => 'way', :action => 'create'
19   map.connect "api/#{API_VERSION}/way/:id/history", :controller => 'old_way', :action => 'history', :id => /\d+/
20   map.connect "api/#{API_VERSION}/way/:id/full", :controller => 'way', :action => 'full', :id => /\d+/
21   map.connect "api/#{API_VERSION}/way/:id/relations", :controller => 'relation', :action => 'relations_for_way', :id => /\d+/
22   map.connect "api/#{API_VERSION}/way/:id", :controller => 'way', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
23   map.connect "api/#{API_VERSION}/way/:id", :controller => 'way', :action => 'update', :id => /\d+/, :conditions => { :method => :put }
24   map.connect "api/#{API_VERSION}/way/:id", :controller => 'way', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete }
25   map.connect "api/#{API_VERSION}/ways", :controller => 'way', :action => 'ways', :id => nil
26
27   map.connect "api/#{API_VERSION}/capabilities", :controller => 'api', :action => 'capabilities'
28   map.connect "api/#{API_VERSION}/relation/create", :controller => 'relation', :action => 'create'
29   map.connect "api/#{API_VERSION}/relation/:id/relations", :controller => 'relation', :action => 'relations_for_relation', :id => /\d+/
30   map.connect "api/#{API_VERSION}/relation/:id/history", :controller => 'old_relation', :action => 'history', :id => /\d+/
31   map.connect "api/#{API_VERSION}/relation/:id/full", :controller => 'relation', :action => 'full', :id => /\d+/
32   map.connect "api/#{API_VERSION}/relation/:id", :controller => 'relation', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
33   map.connect "api/#{API_VERSION}/relation/:id", :controller => 'relation', :action => 'update', :id => /\d+/, :conditions => { :method => :put }
34   map.connect "api/#{API_VERSION}/relation/:id", :controller => 'relation', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete }
35   map.connect "api/#{API_VERSION}/relations", :controller => 'relation', :action => 'relations', :id => nil
36
37   map.connect "api/#{API_VERSION}/map", :controller => 'api', :action => 'map'
38   
39   map.connect "api/#{API_VERSION}/trackpoints", :controller => 'api', :action => 'trackpoints'
40
41   map.connect "api/#{API_VERSION}/changes", :controller => 'api', :action => 'changes'
42   
43   map.connect "api/#{API_VERSION}/search", :controller => 'search', :action => 'search_all'
44   map.connect "api/#{API_VERSION}/ways/search", :controller => 'search', :action => 'search_ways'
45   map.connect "api/#{API_VERSION}/relations/search", :controller => 'search', :action => 'search_relations'
46   map.connect "api/#{API_VERSION}/nodes/search", :controller => 'search', :action => 'search_nodes'
47   
48   map.connect "api/#{API_VERSION}/user/details", :controller => 'user', :action => 'api_details'
49   map.connect "api/#{API_VERSION}/user/preferences", :controller => 'user_preference', :action => 'read', :conditions => { :method => :get }
50   map.connect "api/#{API_VERSION}/user/preferences/:preference_key", :controller => 'user_preference', :action => 'read_one', :conditions => { :method => :get }
51   map.connect "api/#{API_VERSION}/user/preferences", :controller => 'user_preference', :action => 'update', :conditions => { :method => :put }
52   map.connect "api/#{API_VERSION}/user/preferences/:preference_key", :controller => 'user_preference', :action => 'update_one', :conditions => { :method => :put }
53   map.connect "api/#{API_VERSION}/user/preferences/:preference_key", :controller => 'user_preference', :action => 'delete_one', :conditions => { :method => :delete }
54   map.connect "api/#{API_VERSION}/user/gpx_files", :controller => 'user', :action => 'api_gpx_files'
55  
56   map.connect "api/#{API_VERSION}/gpx/create", :controller => 'trace', :action => 'api_create'
57   map.connect "api/#{API_VERSION}/gpx/:id/details", :controller => 'trace', :action => 'api_details'
58   map.connect "api/#{API_VERSION}/gpx/:id/data", :controller => 'trace', :action => 'api_data'
59   
60   # Potlatch API
61   
62   map.connect "api/#{API_VERSION}/amf", :controller =>'amf', :action =>'talk'
63   map.connect "api/#{API_VERSION}/swf/trackpoints", :controller =>'swf', :action =>'trackpoints'
64   
65   # web site
66
67   map.connect '/', :controller => 'site', :action => 'index'
68   map.connect '/edit', :controller => 'site', :action => 'edit'
69   map.connect '/export', :controller => 'site', :action => 'export'
70   map.connect '/login', :controller => 'user', :action => 'login'
71   map.connect '/logout', :controller => 'user', :action => 'logout'
72   map.connect '/user/new', :controller => 'user', :action => 'new'
73   map.connect '/user/save', :controller => 'user', :action => 'save'
74   map.connect '/user/confirm', :controller => 'user', :action => 'confirm'
75   map.connect '/user/go_public', :controller => 'user', :action => 'go_public'
76   map.connect '/user/reset-password', :controller => 'user', :action => 'reset_password'
77   map.connect '/user/upload-image', :controller => 'user', :action => 'upload_image'
78   map.connect '/user/forgot-password', :controller => 'user', :action => 'lost_password'
79
80   map.connect '/index.html', :controller => 'site', :action => 'index'
81   map.connect '/edit.html', :controller => 'site', :action => 'edit'
82   map.connect '/export.html', :controller => 'site', :action => 'export'
83   map.connect '/search.html', :controller => 'way_tag', :action => 'search'
84   map.connect '/login.html', :controller => 'user', :action => 'login'
85   map.connect '/logout.html', :controller => 'user', :action => 'logout'
86   map.connect '/create-account.html', :controller => 'user', :action => 'new'
87   map.connect '/forgot-password.html', :controller => 'user', :action => 'lost_password'
88
89   # traces  
90   map.connect '/traces', :controller => 'trace', :action => 'list'
91   map.connect '/traces/page/:page', :controller => 'trace', :action => 'list'
92   map.connect '/traces/rss', :controller => 'trace', :action => 'georss'
93   map.connect '/traces/tag/:tag', :controller => 'trace', :action => 'list'
94   map.connect '/traces/tag/:tag/page/:page', :controller => 'trace', :action => 'list'
95   map.connect '/traces/tag/:tag/rss', :controller => 'trace', :action => 'georss'
96   map.connect '/traces/mine', :controller => 'trace', :action => 'mine'
97   map.connect '/traces/mine/page/:page', :controller => 'trace', :action => 'mine'
98   map.connect '/traces/mine/tag/:tag', :controller => 'trace', :action => 'mine'
99   map.connect '/traces/mine/tag/:tag/page/:page', :controller => 'trace', :action => 'mine'
100   map.connect '/trace/create', :controller => 'trace', :action => 'create'
101   map.connect '/trace/:id/data', :controller => 'trace', :action => 'data'
102   map.connect '/trace/:id/data.:format', :controller => 'trace', :action => 'data'
103   map.connect '/trace/:id/edit', :controller => 'trace', :action => 'edit'
104   map.connect '/trace/:id/delete', :controller => 'trace', :action => 'delete'
105   map.connect '/trace/:id/make_public', :controller => 'trace', :action => 'make_public'
106   map.connect '/user/:display_name/traces', :controller => 'trace', :action => 'list'
107   map.connect '/user/:display_name/traces/page/:page', :controller => 'trace', :action => 'list'
108   map.connect '/user/:display_name/traces/rss', :controller => 'trace', :action => 'georss'
109   map.connect '/user/:display_name/traces/tag/:tag', :controller => 'trace', :action => 'list'
110   map.connect '/user/:display_name/traces/tag/:tag/page/:page', :controller => 'trace', :action => 'list'
111   map.connect '/user/:display_name/traces/tag/:tag/rss', :controller => 'trace', :action => 'georss'
112   map.connect '/user/:display_name/traces/:id', :controller => 'trace', :action => 'view'
113   map.connect '/user/:display_name/traces/:id/picture', :controller => 'trace', :action => 'picture'
114   map.connect '/user/:display_name/traces/:id/icon', :controller => 'trace', :action => 'icon'
115
116   # user pages
117   map.connect '/user/:display_name', :controller => 'user', :action => 'view'
118   map.connect '/user/:display_name/make_friend', :controller => 'user', :action => 'make_friend'
119   map.connect '/user/:display_name/remove_friend', :controller => 'user', :action => 'remove_friend'
120   map.connect '/user/:display_name/diary', :controller => 'diary_entry', :action => 'list'
121   map.connect '/user/:display_name/diary/:id', :controller => 'diary_entry', :action => 'view', :id => /\d+/
122   map.connect '/user/:display_name/diary/:id/newcomment', :controller => 'diary_entry', :action => 'comment', :id => /\d+/
123   map.connect '/user/:display_name/diary/rss', :controller => 'diary_entry', :action => 'rss'
124   map.connect '/user/:display_name/diary/newpost', :controller => 'diary_entry', :action => 'new'
125   map.connect '/user/:display_name/account', :controller => 'user', :action => 'account'
126   map.connect '/user/:display_name/set_home', :controller => 'user', :action => 'set_home'
127   map.connect '/diary', :controller => 'diary_entry', :action => 'list'
128   map.connect '/diary/rss', :controller => 'diary_entry', :action => 'rss'
129   map.connect '/diary/:language', :controller => 'diary_entry', :action => 'list'
130   map.connect '/diary/:language/rss', :controller => 'diary_entry', :action => 'rss'
131
132   # test pages
133   map.connect '/test/populate/:table/:from/:count', :controller => 'test', :action => 'populate'
134   map.connect '/test/populate/:table/:count', :controller => 'test', :action => 'populate', :from => 1
135
136   # geocoder
137   map.connect '/geocoder/search', :controller => 'geocoder', :action => 'search'
138   map.connect '/geocoder/description', :controller => 'geocoder', :action => 'description'
139
140   # export
141   map.connect '/export/start', :controller => 'export', :action => 'start'
142   map.connect '/export/finish', :controller => 'export', :action => 'finish'
143
144   # messages
145
146   map.connect '/user/:display_name/inbox', :controller => 'message', :action => 'inbox'
147   map.connect '/user/:display_name/outbox', :controller => 'message', :action => 'outbox'
148   map.connect '/message/new/:user_id', :controller => 'message', :action => 'new'
149   map.connect '/message/read/:message_id', :controller => 'message', :action => 'read'
150   map.connect '/message/mark/:message_id', :controller => 'message', :action => 'mark'
151   map.connect '/message/reply/:message_id', :controller => 'message', :action => 'reply'
152   map.connect '/message/delete/:message_id', :controller => 'message', :action => 'destroy'
153
154   # fall through
155   map.connect ':controller/:id/:action'
156   map.connect ':controller/:action'
157 end