]> git.openstreetmap.org Git - rails.git/blob - config/routes.rb
Merge branch 'master' into openstreetbugs
[rails.git] / config / routes.rb
1 ActionController::Routing::Routes.draw do |map|
2   # API
3   map.connect "api/capabilities", :controller => 'api', :action => 'capabilities'
4   map.connect "api/#{API_VERSION}/capabilities", :controller => 'api', :action => 'capabilities'
5
6   map.connect "api/#{API_VERSION}/changeset/create", :controller => 'changeset', :action => 'create'
7   map.connect "api/#{API_VERSION}/changeset/:id/upload", :controller => 'changeset', :action => 'upload', :id => /\d+/
8   map.changeset_download "api/#{API_VERSION}/changeset/:id/download", :controller => 'changeset', :action => 'download', :id => /\d+/
9   map.connect "api/#{API_VERSION}/changeset/:id/expand_bbox", :controller => 'changeset', :action => 'expand_bbox', :id => /\d+/
10   map.changeset_read "api/#{API_VERSION}/changeset/:id", :controller => 'changeset', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
11   map.connect "api/#{API_VERSION}/changeset/:id", :controller => 'changeset', :action => 'update', :id => /\d+/, :conditions => { :method => :put }
12   map.connect "api/#{API_VERSION}/changeset/:id/close", :controller => 'changeset', :action => 'close', :id =>/\d+/
13   map.connect "api/#{API_VERSION}/changesets", :controller => 'changeset', :action => 'query'
14   
15   map.connect "api/#{API_VERSION}/node/create", :controller => 'node', :action => 'create'
16   map.connect "api/#{API_VERSION}/node/:id/ways", :controller => 'way', :action => 'ways_for_node', :id => /\d+/
17   map.connect "api/#{API_VERSION}/node/:id/relations", :controller => 'relation', :action => 'relations_for_node', :id => /\d+/
18   map.connect "api/#{API_VERSION}/node/:id/history", :controller => 'old_node', :action => 'history', :id => /\d+/
19   map.connect "api/#{API_VERSION}/node/:id/:version", :controller => 'old_node', :action => 'version', :id => /\d+/, :version => /\d+/
20   map.connect "api/#{API_VERSION}/node/:id", :controller => 'node', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
21   map.connect "api/#{API_VERSION}/node/:id", :controller => 'node', :action => 'update', :id => /\d+/, :conditions => { :method => :put }
22   map.connect "api/#{API_VERSION}/node/:id", :controller => 'node', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete }
23   map.connect "api/#{API_VERSION}/nodes", :controller => 'node', :action => 'nodes', :id => nil
24   
25   map.connect "api/#{API_VERSION}/way/create", :controller => 'way', :action => 'create'
26   map.connect "api/#{API_VERSION}/way/:id/history", :controller => 'old_way', :action => 'history', :id => /\d+/
27   map.connect "api/#{API_VERSION}/way/:id/full", :controller => 'way', :action => 'full', :id => /\d+/
28   map.connect "api/#{API_VERSION}/way/:id/relations", :controller => 'relation', :action => 'relations_for_way', :id => /\d+/
29   map.connect "api/#{API_VERSION}/way/:id/:version", :controller => 'old_way', :action => 'version', :id => /\d+/, :version => /\d+/
30   map.connect "api/#{API_VERSION}/way/:id", :controller => 'way', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
31   map.connect "api/#{API_VERSION}/way/:id", :controller => 'way', :action => 'update', :id => /\d+/, :conditions => { :method => :put }
32   map.connect "api/#{API_VERSION}/way/:id", :controller => 'way', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete }
33   map.connect "api/#{API_VERSION}/ways", :controller => 'way', :action => 'ways', :id => nil
34
35   map.connect "api/#{API_VERSION}/relation/create", :controller => 'relation', :action => 'create'
36   map.connect "api/#{API_VERSION}/relation/:id/relations", :controller => 'relation', :action => 'relations_for_relation', :id => /\d+/
37   map.connect "api/#{API_VERSION}/relation/:id/history", :controller => 'old_relation', :action => 'history', :id => /\d+/
38   map.connect "api/#{API_VERSION}/relation/:id/full", :controller => 'relation', :action => 'full', :id => /\d+/
39   map.connect "api/#{API_VERSION}/relation/:id/:version", :controller => 'old_relation', :action => 'version', :id => /\d+/, :version => /\d+/
40   map.connect "api/#{API_VERSION}/relation/:id", :controller => 'relation', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
41   map.connect "api/#{API_VERSION}/relation/:id", :controller => 'relation', :action => 'update', :id => /\d+/, :conditions => { :method => :put }
42   map.connect "api/#{API_VERSION}/relation/:id", :controller => 'relation', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete }
43   map.connect "api/#{API_VERSION}/relations", :controller => 'relation', :action => 'relations', :id => nil
44
45   map.connect "api/#{API_VERSION}/map", :controller => 'api', :action => 'map'
46   
47   map.connect "api/#{API_VERSION}/trackpoints", :controller => 'api', :action => 'trackpoints'
48
49   map.connect "api/#{API_VERSION}/changes", :controller => 'api', :action => 'changes'
50   
51   map.connect "api/#{API_VERSION}/search", :controller => 'search', :action => 'search_all'
52   map.connect "api/#{API_VERSION}/ways/search", :controller => 'search', :action => 'search_ways'
53   map.connect "api/#{API_VERSION}/relations/search", :controller => 'search', :action => 'search_relations'
54   map.connect "api/#{API_VERSION}/nodes/search", :controller => 'search', :action => 'search_nodes'
55   
56   map.connect "api/#{API_VERSION}/user/details", :controller => 'user', :action => 'api_details'
57   map.connect "api/#{API_VERSION}/user/preferences", :controller => 'user_preference', :action => 'read', :conditions => { :method => :get }
58   map.connect "api/#{API_VERSION}/user/preferences/:preference_key", :controller => 'user_preference', :action => 'read_one', :conditions => { :method => :get }
59   map.connect "api/#{API_VERSION}/user/preferences", :controller => 'user_preference', :action => 'update', :conditions => { :method => :put }
60   map.connect "api/#{API_VERSION}/user/preferences/:preference_key", :controller => 'user_preference', :action => 'update_one', :conditions => { :method => :put }
61   map.connect "api/#{API_VERSION}/user/preferences/:preference_key", :controller => 'user_preference', :action => 'delete_one', :conditions => { :method => :delete }
62   map.connect "api/#{API_VERSION}/user/gpx_files", :controller => 'user', :action => 'api_gpx_files'
63  
64   map.connect "api/#{API_VERSION}/gpx/create", :controller => 'trace', :action => 'api_create'
65   map.connect "api/#{API_VERSION}/gpx/:id/details", :controller => 'trace', :action => 'api_details'
66   map.connect "api/#{API_VERSION}/gpx/:id/data", :controller => 'trace', :action => 'api_data'
67   
68   # AMF (ActionScript) API
69   
70   map.connect "api/#{API_VERSION}/amf/read", :controller =>'amf', :action =>'amf_read'
71   map.connect "api/#{API_VERSION}/amf/write", :controller =>'amf', :action =>'amf_write'
72   map.connect "api/#{API_VERSION}/swf/trackpoints", :controller =>'swf', :action =>'trackpoints'
73
74   # Map Bugs API  
75   map.connect "api/#{API_VERSION}/bugs/getBugs", :controller =>'map_bugs', :action =>'get_bugs'
76   map.connect "api/#{API_VERSION}/bugs/addPOIexec", :controller =>'map_bugs', :action =>'add_bug'
77   map.connect "api/#{API_VERSION}/bugs/closePOIexec", :controller =>'map_bugs', :action =>'close_bug'
78   map.connect "api/#{API_VERSION}/bugs/editPOIexec", :controller =>'map_bugs', :action =>'edit_bug'
79   map.connect "api/#{API_VERSION}/bugs/getGPX", :controller =>'map_bugs', :action =>'gpx_bugs'
80   map.connect "api/#{API_VERSION}/bugs/getRSSfeed", :controller =>'map_bugs', :action =>'rss'
81
82   map.connect "api/#{API_VERSION}/bugs", :controller => 'map_bugs', :action => 'get_bugs'
83   map.connect "api/#{API_VERSION}/bugs/search", :controller => 'map_bugs', :action => 'search'
84   map.connect "api/#{API_VERSION}/bugs/rss", :controller =>'map_bugs', :action =>'rss'
85   map.connect "api/#{API_VERSION}/bug/create", :controller => 'map_bugs', :action => 'add_bug'
86   map.connect "api/#{API_VERSION}/bug/:id/comment", :controller => 'map_bugs', :action => 'edit_bug', :id => /\d+/
87   map.connect "api/#{API_VERSION}/bug/:id/close", :controller => 'map_bugs', :action => 'close_bug', :id => /\d+/
88   map.connect "api/#{API_VERSION}/bug/:id", :controller => 'map_bugs', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
89   map.connect "api/#{API_VERSION}/bug/:id", :controller => 'map_bugs', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete }
90
91   map.connect '/user/:display_name/bugs', :controller => 'map_bugs', :action => 'my_bugs'
92   
93
94   
95   # Data browsing
96   map.connect '/browse', :controller => 'changeset', :action => 'list'
97   map.connect '/browse/start', :controller => 'browse', :action => 'start'
98   map.connect '/browse/way/:id', :controller => 'browse', :action => 'way', :id => /\d+/
99   map.connect '/browse/way/:id/history', :controller => 'browse', :action => 'way_history', :id => /\d+/
100   map.connect '/browse/node/:id', :controller => 'browse', :action => 'node', :id => /\d+/
101   map.connect '/browse/node/:id/history', :controller => 'browse', :action => 'node_history', :id => /\d+/
102   map.connect '/browse/relation/:id', :controller => 'browse', :action => 'relation', :id => /\d+/
103   map.connect '/browse/relation/:id/history', :controller => 'browse', :action => 'relation_history', :id => /\d+/
104   map.changeset '/browse/changeset/:id', :controller => 'browse', :action => 'changeset', :id => /\d+/
105   map.connect '/browse/changesets', :controller => 'changeset', :action => 'list'
106   map.connect '/browse/changesets/feed', :controller => 'changeset', :action => 'list', :format => :atom
107   map.connect '/browse/bug/:id', :controller => 'browse', :action => 'bug', :id => /\d+/
108   
109   # web site
110   map.root :controller => 'site', :action => 'index'
111   map.connect '/', :controller => 'site', :action => 'index'
112   map.connect '/edit', :controller => 'site', :action => 'edit'
113   map.connect '/copyright', :controller => 'site', :action => 'copyright'
114   map.connect '/copyright/:copyright_locale', :controller => 'site', :action => 'copyright'
115   map.connect '/history', :controller => 'changeset', :action => 'list'
116   map.connect '/history/feed', :controller => 'changeset', :action => 'list', :format => :atom
117   map.connect '/export', :controller => 'site', :action => 'export'
118   map.connect '/login', :controller => 'user', :action => 'login'
119   map.connect '/logout', :controller => 'user', :action => 'logout'
120   map.connect '/offline', :controller => 'site', :action => 'offline'
121   map.connect '/key', :controller => 'site', :action => 'key'
122   map.connect '/user/new', :controller => 'user', :action => 'new'
123   map.connect '/user/terms', :controller => 'user', :action => 'terms'
124   map.connect '/user/save', :controller => 'user', :action => 'save'
125   map.connect '/user/confirm', :controller => 'user', :action => 'confirm'
126   map.connect '/user/confirm-email', :controller => 'user', :action => 'confirm_email'
127   map.connect '/user/go_public', :controller => 'user', :action => 'go_public'
128   map.connect '/user/reset-password', :controller => 'user', :action => 'reset_password'
129   map.connect '/user/forgot-password', :controller => 'user', :action => 'lost_password'
130   map.connect '/user/suspended', :controller => 'user', :action => 'suspended'
131
132   map.connect '/index.html', :controller => 'site', :action => 'index'
133   map.connect '/edit.html', :controller => 'site', :action => 'edit'
134   map.connect '/export.html', :controller => 'site', :action => 'export'
135   map.connect '/search.html', :controller => 'way_tag', :action => 'search'
136   map.connect '/login.html', :controller => 'user', :action => 'login'
137   map.connect '/logout.html', :controller => 'user', :action => 'logout'
138   map.connect '/create-account.html', :controller => 'user', :action => 'new'
139   map.connect '/forgot-password.html', :controller => 'user', :action => 'lost_password'
140
141   # permalink
142   map.connect '/go/:code', :controller => 'site', :action => 'permalink', :code => /[a-zA-Z0-9_@]+[=-]*/
143
144   # traces  
145   map.connect '/traces', :controller => 'trace', :action => 'list'
146   map.connect '/traces/page/:page', :controller => 'trace', :action => 'list'
147   map.connect '/traces/rss', :controller => 'trace', :action => 'georss'
148   map.connect '/traces/tag/:tag', :controller => 'trace', :action => 'list'
149   map.connect '/traces/tag/:tag/page/:page', :controller => 'trace', :action => 'list'
150   map.connect '/traces/tag/:tag/rss', :controller => 'trace', :action => 'georss'
151   map.connect '/traces/mine', :controller => 'trace', :action => 'mine'
152   map.connect '/traces/mine/page/:page', :controller => 'trace', :action => 'mine'
153   map.connect '/traces/mine/tag/:tag', :controller => 'trace', :action => 'mine'
154   map.connect '/traces/mine/tag/:tag/page/:page', :controller => 'trace', :action => 'mine'
155   map.connect '/trace/create', :controller => 'trace', :action => 'create'
156   map.connect '/trace/:id/data', :controller => 'trace', :action => 'data'
157   map.connect '/trace/:id/data.:format', :controller => 'trace', :action => 'data'
158   map.connect '/trace/:id/edit', :controller => 'trace', :action => 'edit'
159   map.connect '/trace/:id/delete', :controller => 'trace', :action => 'delete'
160   map.connect '/user/:display_name/traces', :controller => 'trace', :action => 'list'
161   map.connect '/user/:display_name/traces/page/:page', :controller => 'trace', :action => 'list'
162   map.connect '/user/:display_name/traces/rss', :controller => 'trace', :action => 'georss'
163   map.connect '/user/:display_name/traces/tag/:tag', :controller => 'trace', :action => 'list'
164   map.connect '/user/:display_name/traces/tag/:tag/page/:page', :controller => 'trace', :action => 'list'
165   map.connect '/user/:display_name/traces/tag/:tag/rss', :controller => 'trace', :action => 'georss'
166   map.connect '/user/:display_name/traces/:id', :controller => 'trace', :action => 'view'
167   map.connect '/user/:display_name/traces/:id/picture', :controller => 'trace', :action => 'picture'
168   map.connect '/user/:display_name/traces/:id/icon', :controller => 'trace', :action => 'icon'
169
170   # user pages
171   map.connect '/user/:display_name', :controller => 'user', :action => 'view'
172   map.connect '/user/:display_name/edits', :controller => 'changeset', :action => 'list'
173   map.connect '/user/:display_name/edits/feed', :controller => 'changeset', :action => 'list', :format =>:atom
174   map.connect '/user/:display_name/make_friend', :controller => 'user', :action => 'make_friend'
175   map.connect '/user/:display_name/remove_friend', :controller => 'user', :action => 'remove_friend'
176   map.connect '/user/:display_name/diary', :controller => 'diary_entry', :action => 'list'
177   map.connect '/user/:display_name/diary/:id', :controller => 'diary_entry', :action => 'view', :id => /\d+/
178   map.connect '/user/:display_name/diary/:id/newcomment', :controller => 'diary_entry', :action => 'comment', :id => /\d+/
179   map.connect '/user/:display_name/diary/rss', :controller => 'diary_entry', :action => 'rss'
180   map.connect '/user/:display_name/diary/:id/edit', :controller => 'diary_entry', :action => 'edit', :id => /\d+/
181   map.connect '/user/:display_name/diary/:id/hide', :controller => 'diary_entry', :action => 'hide', :id => /\d+/
182   map.connect '/user/:display_name/diary/:id/hidecomment/:comment', :controller => 'diary_entry', :action => 'hidecomment', :id => /\d+/, :comment => /\d+/
183   map.connect '/user/:display_name/account', :controller => 'user', :action => 'account'
184   map.connect '/user/:display_name/set_status', :controller => 'user', :action => 'set_status'
185   map.connect '/user/:display_name/delete', :controller => 'user', :action => 'delete'
186   map.connect '/diary/new', :controller => 'diary_entry', :action => 'new'
187   map.connect '/diary', :controller => 'diary_entry', :action => 'list'
188   map.connect '/diary/rss', :controller => 'diary_entry', :action => 'rss'
189   map.connect '/diary/:language', :controller => 'diary_entry', :action => 'list'
190   map.connect '/diary/:language/rss', :controller => 'diary_entry', :action => 'rss'
191
192   # user lists
193   map.connect '/users', :controller => 'user', :action => 'list'
194   map.connect '/users/:status', :controller => 'user', :action => 'list'
195
196   # test pages
197   map.connect '/test/populate/:table/:from/:count', :controller => 'test', :action => 'populate'
198   map.connect '/test/populate/:table/:count', :controller => 'test', :action => 'populate', :from => 1
199
200   # geocoder
201   map.connect '/geocoder/search', :controller => 'geocoder', :action => 'search'
202   map.connect '/geocoder/search_latlon', :controller => 'geocoder', :action => 'search_latlon'
203   map.connect '/geocoder/search_us_postcode', :controller => 'geocoder', :action => 'search_us_postcode'
204   map.connect '/geocoder/search_uk_postcode', :controller => 'geocoder', :action => 'search_uk_postcode'
205   map.connect '/geocoder/search_ca_postcode', :controller => 'geocoder', :action => 'search_ca_postcode'
206   map.connect '/geocoder/search_osm_namefinder', :controller => 'geocoder', :action => 'search_osm_namefinder'
207   map.connect '/geocoder/search_osm_nominatim', :controller => 'geocoder', :action => 'search_osm_nominatim'
208   map.connect '/geocoder/search_geonames', :controller => 'geocoder', :action => 'search_geonames'
209   map.connect '/geocoder/description', :controller => 'geocoder', :action => 'description'
210   map.connect '/geocoder/description_osm_namefinder', :controller => 'geocoder', :action => 'description_osm_namefinder'
211   map.connect '/geocoder/description_osm_nominatim', :controller => 'geocoder', :action => 'description_osm_nominatim'
212   map.connect '/geocoder/description_geonames', :controller => 'geocoder', :action => 'description_geonames'
213
214   # export
215   map.connect '/export/start', :controller => 'export', :action => 'start'
216   map.connect '/export/finish', :controller => 'export', :action => 'finish'
217
218   # messages
219   map.connect '/user/:display_name/inbox', :controller => 'message', :action => 'inbox'
220   map.connect '/user/:display_name/outbox', :controller => 'message', :action => 'outbox'
221   map.connect '/message/new/:display_name', :controller => 'message', :action => 'new'
222   map.connect '/message/read/:message_id', :controller => 'message', :action => 'read'
223   map.connect '/message/mark/:message_id', :controller => 'message', :action => 'mark'
224   map.connect '/message/reply/:message_id', :controller => 'message', :action => 'reply'
225   map.connect '/message/delete/:message_id', :controller => 'message', :action => 'delete'
226
227   # oauth admin pages (i.e: for setting up new clients, etc...)
228   map.resources :oauth_clients, :path_prefix => '/user/:display_name'
229   map.connect '/oauth/revoke', :controller => 'oauth', :action => 'revoke'
230   map.authorize '/oauth/authorize', :controller => 'oauth', :action => 'oauthorize'
231   map.request_token '/oauth/request_token', :controller => 'oauth', :action => 'request_token'
232   map.access_token '/oauth/access_token', :controller => 'oauth', :action => 'access_token'
233   map.test_request '/oauth/test_request', :controller => 'oauth', :action => 'test_request'
234
235   # roles and banning pages
236   map.connect '/user/:display_name/role/:role/grant', :controller => 'user_roles', :action => 'grant'
237   map.connect '/user/:display_name/role/:role/revoke', :controller => 'user_roles', :action => 'revoke'
238   map.connect '/user/:display_name/blocks', :controller => 'user_blocks', :action => 'blocks_on'
239   map.connect '/user/:display_name/blocks_by', :controller => 'user_blocks', :action => 'blocks_by'
240   map.resources :user_blocks, :as => 'blocks'
241   map.connect '/blocks/:id/revoke', :controller => 'user_blocks', :action => 'revoke'
242   map.connect '/blocks/new/:display_name', :controller => 'user_blocks', :action => 'new'
243
244   # fall through
245   map.connect ':controller/:id/:action'
246   map.connect ':controller/:action'
247 end