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" => "traces#api_create"
78 get "gpx/:id" => "traces#api_read", :id => /\d+/
79 put "gpx/:id" => "traces#api_update", :id => /\d+/
80 delete "gpx/:id" => "traces#api_delete", :id => /\d+/
81 get "gpx/:id/details" => "traces#api_read", :id => /\d+/
82 get "gpx/:id/data" => "traces#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" => "traces#list", :page => /[1-9][0-9]*/
192 get "/user/:display_name/traces/tag/:tag" => "traces#list"
193 get "/user/:display_name/traces/page/:page" => "traces#list", :page => /[1-9][0-9]*/
194 get "/user/:display_name/traces" => "traces#list"
195 get "/user/:display_name/traces/tag/:tag/rss" => "traces#georss", :defaults => { :format => :rss }
196 get "/user/:display_name/traces/rss" => "traces#georss", :defaults => { :format => :rss }
197 get "/user/:display_name/traces/:id" => "traces#view"
198 get "/user/:display_name/traces/:id/picture" => "traces#picture"
199 get "/user/:display_name/traces/:id/icon" => "traces#icon"
200 get "/traces/tag/:tag/page/:page" => "traces#list", :page => /[1-9][0-9]*/
201 get "/traces/tag/:tag" => "traces#list"
202 get "/traces/page/:page" => "traces#list", :page => /[1-9][0-9]*/
203 get "/traces" => "traces#list"
204 get "/traces/tag/:tag/rss" => "traces#georss", :defaults => { :format => :rss }
205 get "/traces/rss" => "traces#georss", :defaults => { :format => :rss }
206 get "/traces/mine/tag/:tag/page/:page" => "traces#mine", :page => /[1-9][0-9]*/
207 get "/traces/mine/tag/:tag" => "traces#mine"
208 get "/traces/mine/page/:page" => "traces#mine"
209 get "/traces/mine" => "traces#mine"
210 match "/trace/create" => "traces#create", :via => [:get, :post]
211 get "/trace/:id/data" => "traces#data", :id => /\d+/, :as => "trace_data"
212 match "/trace/:id/edit" => "traces#edit", :via => [:get, :post], :id => /\d+/, :as => "trace_edit"
213 post "/trace/:id/delete" => "traces#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 resources :messages, :only => [:show] do
270 get "/user/:display_name/inbox", :to => redirect(:path => "/messages/inbox")
271 get "/user/:display_name/outbox", :to => redirect(:path => "/messages/outbox")
272 match "/message/new/:display_name" => "messages#new", :via => [:get, :post], :as => "new_message"
273 get "/message/read/:message_id", :to => redirect(:path => "/messages/%{message_id}")
274 post "/message/mark/:message_id" => "messages#mark", :as => "mark_message"
275 match "/message/reply/:message_id" => "messages#reply", :via => [:get, :post], :as => "reply_message"
276 post "/message/delete/:message_id" => "messages#destroy", :as => "destroy_message"
278 # oauth admin pages (i.e: for setting up new clients, etc...)
279 scope "/user/:display_name" do
280 resources :oauth_clients
282 match "/oauth/revoke" => "oauth#revoke", :via => [:get, :post]
283 match "/oauth/authorize" => "oauth#authorize", :via => [:get, :post], :as => :authorize
284 get "/oauth/token" => "oauth#token", :as => :token
285 match "/oauth/request_token" => "oauth#request_token", :via => [:get, :post], :as => :request_token
286 match "/oauth/access_token" => "oauth#access_token", :via => [:get, :post], :as => :access_token
287 get "/oauth/test_request" => "oauth#test_request", :as => :test_request
289 # roles and banning pages
290 post "/user/:display_name/role/:role/grant" => "user_roles#grant", :as => "grant_role"
291 post "/user/:display_name/role/:role/revoke" => "user_roles#revoke", :as => "revoke_role"
292 get "/user/:display_name/blocks" => "user_blocks#blocks_on"
293 get "/user/:display_name/blocks_by" => "user_blocks#blocks_by"
294 get "/blocks/new/:display_name" => "user_blocks#new", :as => "new_user_block"
295 resources :user_blocks
296 match "/blocks/:id/revoke" => "user_blocks#revoke", :via => [:get, :post], :as => "revoke_user_block"
299 resources :redactions