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