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