1 OpenStreetMap::Application.routes.draw do
3 get "api/capabilities" => "api#capabilities"
4 get "api/0.6/capabilities" => "api#capabilities"
5 get "api/0.6/permissions" => "api#permissions"
7 put "api/0.6/changeset/create" => "changeset#create"
8 post "api/0.6/changeset/:id/upload" => "changeset#upload", :id => /\d+/
9 get "api/0.6/changeset/:id/download" => "changeset#download", :as => :changeset_download, :id => /\d+/
10 post "api/0.6/changeset/:id/expand_bbox" => "changeset#expand_bbox", :id => /\d+/
11 get "api/0.6/changeset/:id" => "changeset#read", :as => :changeset_read, :id => /\d+/
12 post "api/0.6/changeset/:id/subscribe" => "changeset#subscribe", :as => :changeset_subscribe, :id => /\d+/
13 post "api/0.6/changeset/:id/unsubscribe" => "changeset#unsubscribe", :as => :changeset_unsubscribe, :id => /\d+/
14 put "api/0.6/changeset/:id" => "changeset#update", :id => /\d+/
15 put "api/0.6/changeset/:id/close" => "changeset#close", :id => /\d+/
16 get "api/0.6/changesets" => "changeset#query"
17 post "api/0.6/changeset/:id/comment" => "changeset#comment", :as => :changeset_comment, :id => /\d+/
18 post "api/0.6/changeset/comment/:id/hide" => "changeset#hide_comment", :as => :changeset_comment_hide, :id => /\d+/
19 post "api/0.6/changeset/comment/:id/unhide" => "changeset#unhide_comment", :as => :changeset_comment_unhide, :id => /\d+/
21 put "api/0.6/node/create" => "node#create"
22 get "api/0.6/node/:id/ways" => "way#ways_for_node", :id => /\d+/
23 get "api/0.6/node/:id/relations" => "relation#relations_for_node", :id => /\d+/
24 get "api/0.6/node/:id/history" => "old_node#history", :id => /\d+/
25 post "api/0.6/node/:id/:version/redact" => "old_node#redact", :version => /\d+/, :id => /\d+/
26 get "api/0.6/node/:id/:version" => "old_node#version", :id => /\d+/, :version => /\d+/
27 get "api/0.6/node/:id" => "node#read", :id => /\d+/
28 put "api/0.6/node/:id" => "node#update", :id => /\d+/
29 delete "api/0.6/node/:id" => "node#delete", :id => /\d+/
30 get "api/0.6/nodes" => "node#nodes"
32 put "api/0.6/way/create" => "way#create"
33 get "api/0.6/way/:id/history" => "old_way#history", :id => /\d+/
34 get "api/0.6/way/:id/full" => "way#full", :id => /\d+/
35 get "api/0.6/way/:id/relations" => "relation#relations_for_way", :id => /\d+/
36 post "api/0.6/way/:id/:version/redact" => "old_way#redact", :version => /\d+/, :id => /\d+/
37 get "api/0.6/way/:id/:version" => "old_way#version", :id => /\d+/, :version => /\d+/
38 get "api/0.6/way/:id" => "way#read", :id => /\d+/
39 put "api/0.6/way/:id" => "way#update", :id => /\d+/
40 delete "api/0.6/way/:id" => "way#delete", :id => /\d+/
41 get "api/0.6/ways" => "way#ways"
43 put "api/0.6/relation/create" => "relation#create"
44 get "api/0.6/relation/:id/relations" => "relation#relations_for_relation", :id => /\d+/
45 get "api/0.6/relation/:id/history" => "old_relation#history", :id => /\d+/
46 get "api/0.6/relation/:id/full" => "relation#full", :id => /\d+/
47 post "api/0.6/relation/:id/:version/redact" => "old_relation#redact", :version => /\d+/, :id => /\d+/
48 get "api/0.6/relation/:id/:version" => "old_relation#version", :id => /\d+/, :version => /\d+/
49 get "api/0.6/relation/:id" => "relation#read", :id => /\d+/
50 put "api/0.6/relation/:id" => "relation#update", :id => /\d+/
51 delete "api/0.6/relation/:id" => "relation#delete", :id => /\d+/
52 get "api/0.6/relations" => "relation#relations"
54 get "api/0.6/map" => "api#map"
56 get "api/0.6/trackpoints" => "api#trackpoints"
58 get "api/0.6/changes" => "api#changes"
60 get "api/0.6/search" => "search#search_all"
61 get "api/0.6/ways/search" => "search#search_ways"
62 get "api/0.6/relations/search" => "search#search_relations"
63 get "api/0.6/nodes/search" => "search#search_nodes"
65 get "api/0.6/user/:id" => "user#api_read", :id => /\d+/
66 get "api/0.6/user/details" => "user#api_details"
67 get "api/0.6/user/gpx_files" => "user#api_gpx_files"
69 get "api/0.6/user/preferences" => "user_preference#read"
70 get "api/0.6/user/preferences/:preference_key" => "user_preference#read_one"
71 put "api/0.6/user/preferences" => "user_preference#update"
72 put "api/0.6/user/preferences/:preference_key" => "user_preference#update_one"
73 delete "api/0.6/user/preferences/:preference_key" => "user_preference#delete_one"
75 post "api/0.6/gpx/create" => "trace#api_create"
76 get "api/0.6/gpx/:id" => "trace#api_read", :id => /\d+/
77 put "api/0.6/gpx/:id" => "trace#api_update", :id => /\d+/
78 delete "api/0.6/gpx/:id" => "trace#api_delete", :id => /\d+/
79 get "api/0.6/gpx/:id/details" => "trace#api_read", :id => /\d+/
80 get "api/0.6/gpx/:id/data" => "trace#api_data"
82 # AMF (ActionScript) API
83 post "api/0.6/amf/read" => "amf#amf_read"
84 post "api/0.6/amf/write" => "amf#amf_write"
85 get "api/0.6/swf/trackpoints" => "swf#trackpoints"
89 resources :notes, :except => [:new, :edit, :update], :constraints => { :id => /\d+/ }, :defaults => { :format => "xml" } do
92 get "feed", :defaults => { :format => "rss" }
102 post "notes/addPOIexec" => "notes#create"
103 post "notes/closePOIexec" => "notes#close"
104 post "notes/editPOIexec" => "notes#comment"
105 get "notes/getGPX" => "notes#index", :format => "gpx"
106 get "notes/getRSSfeed" => "notes#feed", :format => "rss"
110 get "/way/:id" => "browse#way", :id => /\d+/, :as => :way
111 get "/way/:id/history" => "browse#way_history", :id => /\d+/
112 get "/node/:id" => "browse#node", :id => /\d+/, :as => :node
113 get "/node/:id/history" => "browse#node_history", :id => /\d+/
114 get "/relation/:id" => "browse#relation", :id => /\d+/, :as => :relation
115 get "/relation/:id/history" => "browse#relation_history", :id => /\d+/
116 get "/changeset/:id" => "browse#changeset", :as => :changeset, :id => /\d+/
117 get "/changeset/:id/comments/feed" => "changeset#comments_feed", :as => :changeset_comments_feed, :id => /\d*/, :defaults => { :format => "rss" }
118 get "/note/:id" => "browse#note", :id => /\d+/, :as => "browse_note"
119 get "/note/new" => "browse#new_note"
120 get "/user/:display_name/history" => "changeset#list"
121 get "/user/:display_name/history/feed" => "changeset#feed", :defaults => { :format => :atom }
122 get "/user/:display_name/notes" => "notes#mine"
123 get "/history/friends" => "changeset#list", :friends => true, :as => "friend_changesets", :defaults => { :format => :html }
124 get "/history/nearby" => "changeset#list", :nearby => true, :as => "nearby_changesets", :defaults => { :format => :html }
126 get "/browse/way/:id", :to => redirect(:path => "/way/%{id}")
127 get "/browse/way/:id/history", :to => redirect(:path => "/way/%{id}/history")
128 get "/browse/node/:id", :to => redirect(:path => "/node/%{id}")
129 get "/browse/node/:id/history", :to => redirect(:path => "/node/%{id}/history")
130 get "/browse/relation/:id", :to => redirect(:path => "/relation/%{id}")
131 get "/browse/relation/:id/history", :to => redirect(:path => "/relation/%{id}/history")
132 get "/browse/changeset/:id", :to => redirect(:path => "/changeset/%{id}")
133 get "/browse/note/:id", :to => redirect(:path => "/note/%{id}")
134 get "/user/:display_name/edits", :to => redirect(:path => "/user/%{display_name}/history")
135 get "/user/:display_name/edits/feed", :to => redirect(:path => "/user/%{display_name}/history/feed")
136 get "/browse/friends", :to => redirect(:path => "/history/friends")
137 get "/browse/nearby", :to => redirect(:path => "/history/nearby")
138 get "/browse/changesets/feed", :to => redirect(:path => "/history/feed")
139 get "/browse/changesets", :to => redirect(:path => "/history")
140 get "/browse", :to => redirect(:path => "/history")
143 root :to => "site#index", :via => [:get, :post]
144 get "/edit" => "site#edit", :as => :edit
145 get "/copyright/:copyright_locale" => "site#copyright"
146 get "/copyright" => "site#copyright"
147 get "/welcome" => "site#welcome", :as => :welcome
148 get "/fixthemap" => "site#fixthemap", :as => :fixthemap
149 get "/help" => "site#help", :as => :help
150 get "/about" => "site#about", :as => :about
151 get "/history" => "changeset#list"
152 get "/history/feed" => "changeset#feed", :defaults => { :format => :atom }
153 get "/history/comments/feed" => "changeset#comments_feed", :as => :changesets_comments_feed, :defaults => { :format => "rss" }
154 get "/export" => "site#export"
155 match "/login" => "user#login", :via => [:get, :post]
156 match "/logout" => "user#logout", :via => [:get, :post]
157 get "/offline" => "site#offline"
158 get "/key" => "site#key"
159 get "/id" => "site#id"
160 get "/query" => "browse#query"
161 get "/user/new" => "user#new"
162 post "/user/new" => "user#create"
163 get "/user/terms" => "user#terms"
164 post "/user/save" => "user#save"
165 get "/user/:display_name/confirm/resend" => "user#confirm_resend"
166 match "/user/:display_name/confirm" => "user#confirm", :via => [:get, :post]
167 match "/user/confirm" => "user#confirm", :via => [:get, :post]
168 match "/user/confirm-email" => "user#confirm_email", :via => [:get, :post]
169 post "/user/go_public" => "user#go_public"
170 match "/user/reset-password" => "user#reset_password", :via => [:get, :post]
171 match "/user/forgot-password" => "user#lost_password", :via => [:get, :post]
172 get "/user/suspended" => "user#suspended"
174 get "/index.html", :to => redirect(:path => "/")
175 get "/create-account.html", :to => redirect(:path => "/user/new")
176 get "/forgot-password.html", :to => redirect(:path => "/user/forgot-password")
179 get "/auth/failure" => "user#auth_failure"
180 match "/auth/:provider/callback" => "user#auth_success", :via => [:get, :post], :as => :auth_success
181 match "/auth/:provider" => "user#auth", :via => [:get, :post], :as => :auth
184 get "/go/:code" => "site#permalink", :code => /[a-zA-Z0-9_@~]+[=-]*/
187 post "/preview/:type" => "site#preview", :as => :preview
190 get "/user/:display_name/traces/tag/:tag/page/:page" => "trace#list", :page => /[1-9][0-9]*/
191 get "/user/:display_name/traces/tag/:tag" => "trace#list"
192 get "/user/:display_name/traces/page/:page" => "trace#list", :page => /[1-9][0-9]*/
193 get "/user/:display_name/traces" => "trace#list"
194 get "/user/:display_name/traces/tag/:tag/rss" => "trace#georss", :defaults => { :format => :rss }
195 get "/user/:display_name/traces/rss" => "trace#georss", :defaults => { :format => :rss }
196 get "/user/:display_name/traces/:id" => "trace#view"
197 get "/user/:display_name/traces/:id/picture" => "trace#picture"
198 get "/user/:display_name/traces/:id/icon" => "trace#icon"
199 get "/traces/tag/:tag/page/:page" => "trace#list", :page => /[1-9][0-9]*/
200 get "/traces/tag/:tag" => "trace#list"
201 get "/traces/page/:page" => "trace#list", :page => /[1-9][0-9]*/
202 get "/traces" => "trace#list"
203 get "/traces/tag/:tag/rss" => "trace#georss", :defaults => { :format => :rss }
204 get "/traces/rss" => "trace#georss", :defaults => { :format => :rss }
205 get "/traces/mine/tag/:tag/page/:page" => "trace#mine", :page => /[1-9][0-9]*/
206 get "/traces/mine/tag/:tag" => "trace#mine"
207 get "/traces/mine/page/:page" => "trace#mine"
208 get "/traces/mine" => "trace#mine"
209 match "/trace/create" => "trace#create", :via => [:get, :post]
210 get "/trace/:id/data" => "trace#data", :id => /\d+/, :as => "trace_data"
211 match "/trace/:id/edit" => "trace#edit", :via => [:get, :post], :id => /\d+/, :as => "trace_edit"
212 post "/trace/:id/delete" => "trace#delete", :id => /\d+/
215 match "/diary/new" => "diary_entry#new", :via => [:get, :post]
216 get "/diary/friends" => "diary_entry#list", :friends => true, :as => "friend_diaries"
217 get "/diary/nearby" => "diary_entry#list", :nearby => true, :as => "nearby_diaries"
218 get "/user/:display_name/diary/rss" => "diary_entry#rss", :defaults => { :format => :rss }
219 get "/diary/:language/rss" => "diary_entry#rss", :defaults => { :format => :rss }
220 get "/diary/rss" => "diary_entry#rss", :defaults => { :format => :rss }
221 get "/user/:display_name/diary/comments/:page" => "diary_entry#comments", :page => /[1-9][0-9]*/
222 get "/user/:display_name/diary/comments/" => "diary_entry#comments"
223 get "/user/:display_name/diary" => "diary_entry#list"
224 get "/diary/:language" => "diary_entry#list"
225 get "/diary" => "diary_entry#list"
226 get "/user/:display_name/diary/:id" => "diary_entry#view", :id => /\d+/
227 post "/user/:display_name/diary/:id/newcomment" => "diary_entry#comment", :id => /\d+/
228 match "/user/:display_name/diary/:id/edit" => "diary_entry#edit", :via => [:get, :post], :id => /\d+/
229 post "/user/:display_name/diary/:id/hide" => "diary_entry#hide", :id => /\d+/, :as => :hide_diary_entry
230 post "/user/:display_name/diary/:id/hidecomment/:comment" => "diary_entry#hidecomment", :id => /\d+/, :comment => /\d+/, :as => :hide_diary_comment
231 post "/user/:display_name/diary/:id/subscribe" => "diary_entry#subscribe", :as => :diary_entry_subscribe, :id => /\d+/
232 post "/user/:display_name/diary/:id/unsubscribe" => "diary_entry#unsubscribe", :as => :diary_entry_unsubscribe, :id => /\d+/
235 get "/user/:display_name" => "user#view", :as => "user"
236 match "/user/:display_name/make_friend" => "user#make_friend", :via => [:get, :post], :as => "make_friend"
237 match "/user/:display_name/remove_friend" => "user#remove_friend", :via => [:get, :post], :as => "remove_friend"
238 match "/user/:display_name/account" => "user#account", :via => [:get, :post]
239 get "/user/:display_name/set_status" => "user#set_status", :as => :set_status_user
240 get "/user/:display_name/delete" => "user#delete", :as => :delete_user
243 match "/users" => "user#list", :via => [:get, :post]
244 match "/users/:status" => "user#list", :via => [:get, :post]
247 get "/search" => "geocoder#search", :as => :search
248 get "/geocoder/search_latlon" => "geocoder#search_latlon"
249 get "/geocoder/search_ca_postcode" => "geocoder#search_ca_postcode"
250 get "/geocoder/search_osm_nominatim" => "geocoder#search_osm_nominatim"
251 get "/geocoder/search_geonames" => "geocoder#search_geonames"
252 get "/geocoder/search_osm_nominatim_reverse" => "geocoder#search_osm_nominatim_reverse"
253 get "/geocoder/search_geonames_reverse" => "geocoder#search_geonames_reverse"
256 get "/directions" => "directions#search", :as => :directions
259 post "/export/finish" => "export#finish"
260 get "/export/embed" => "export#embed"
263 get "/user/:display_name/inbox" => "message#inbox", :as => "inbox"
264 get "/user/:display_name/outbox" => "message#outbox", :as => "outbox"
265 match "/message/new/:display_name" => "message#new", :via => [:get, :post], :as => "new_message"
266 get "/message/read/:message_id" => "message#read", :as => "read_message"
267 post "/message/mark/:message_id" => "message#mark", :as => "mark_message"
268 match "/message/reply/:message_id" => "message#reply", :via => [:get, :post], :as => "reply_message"
269 post "/message/delete/:message_id" => "message#delete", :as => "delete_message"
271 # oauth admin pages (i.e: for setting up new clients, etc...)
272 scope "/user/:display_name" do
273 resources :oauth_clients
275 match "/oauth/revoke" => "oauth#revoke", :via => [:get, :post]
276 match "/oauth/authorize" => "oauth#authorize", :via => [:get, :post], :as => :authorize
277 get "/oauth/token" => "oauth#token", :as => :token
278 match "/oauth/request_token" => "oauth#request_token", :via => [:get, :post], :as => :request_token
279 match "/oauth/access_token" => "oauth#access_token", :via => [:get, :post], :as => :access_token
280 get "/oauth/test_request" => "oauth#test_request", :as => :test_request
282 # roles and banning pages
283 post "/user/:display_name/role/:role/grant" => "user_roles#grant", :as => "grant_role"
284 post "/user/:display_name/role/:role/revoke" => "user_roles#revoke", :as => "revoke_role"
285 get "/user/:display_name/blocks" => "user_blocks#blocks_on"
286 get "/user/:display_name/blocks_by" => "user_blocks#blocks_by"
287 get "/blocks/new/:display_name" => "user_blocks#new", :as => "new_user_block"
288 resources :user_blocks
289 match "/blocks/:id/revoke" => "user_blocks#revoke", :via => [:get, :post], :as => "revoke_user_block"
292 resources :redactions