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"
70 get "users" => "user#api_users", :as => :api_users
72 get "user/preferences" => "user_preferences#read"
73 get "user/preferences/:preference_key" => "user_preferences#read_one"
74 put "user/preferences" => "user_preferences#update"
75 put "user/preferences/:preference_key" => "user_preferences#update_one"
76 delete "user/preferences/:preference_key" => "user_preferences#delete_one"
78 post "gpx/create" => "traces#api_create"
79 get "gpx/:id" => "traces#api_read", :id => /\d+/
80 put "gpx/:id" => "traces#api_update", :id => /\d+/
81 delete "gpx/:id" => "traces#api_delete", :id => /\d+/
82 get "gpx/:id/details" => "traces#api_read", :id => /\d+/
83 get "gpx/:id/data" => "traces#api_data"
85 # AMF (ActionScript) API
86 post "amf/read" => "amf#amf_read"
87 post "amf/write" => "amf#amf_write"
88 get "swf/trackpoints" => "swf#trackpoints"
91 resources :notes, :except => [:new, :edit, :update], :constraints => { :id => /\d+/ }, :defaults => { :format => "xml" } do
94 get "feed", :defaults => { :format => "rss" }
104 post "notes/addPOIexec" => "notes#create"
105 post "notes/closePOIexec" => "notes#close"
106 post "notes/editPOIexec" => "notes#comment"
107 get "notes/getGPX" => "notes#index", :format => "gpx"
108 get "notes/getRSSfeed" => "notes#feed", :format => "rss"
112 get "/way/:id" => "browse#way", :id => /\d+/, :as => :way
113 get "/way/:id/history" => "browse#way_history", :id => /\d+/
114 get "/node/:id" => "browse#node", :id => /\d+/, :as => :node
115 get "/node/:id/history" => "browse#node_history", :id => /\d+/
116 get "/relation/:id" => "browse#relation", :id => /\d+/, :as => :relation
117 get "/relation/:id/history" => "browse#relation_history", :id => /\d+/
118 get "/changeset/:id" => "browse#changeset", :as => :changeset, :id => /\d+/
119 get "/changeset/:id/comments/feed" => "changeset#comments_feed", :as => :changeset_comments_feed, :id => /\d*/, :defaults => { :format => "rss" }
120 get "/note/:id" => "browse#note", :id => /\d+/, :as => "browse_note"
121 get "/note/new" => "browse#new_note"
122 get "/user/:display_name/history" => "changeset#list"
123 get "/user/:display_name/history/feed" => "changeset#feed", :defaults => { :format => :atom }
124 get "/user/:display_name/notes" => "notes#mine"
125 get "/history/friends" => "changeset#list", :friends => true, :as => "friend_changesets", :defaults => { :format => :html }
126 get "/history/nearby" => "changeset#list", :nearby => true, :as => "nearby_changesets", :defaults => { :format => :html }
128 get "/browse/way/:id", :to => redirect(:path => "/way/%{id}")
129 get "/browse/way/:id/history", :to => redirect(:path => "/way/%{id}/history")
130 get "/browse/node/:id", :to => redirect(:path => "/node/%{id}")
131 get "/browse/node/:id/history", :to => redirect(:path => "/node/%{id}/history")
132 get "/browse/relation/:id", :to => redirect(:path => "/relation/%{id}")
133 get "/browse/relation/:id/history", :to => redirect(:path => "/relation/%{id}/history")
134 get "/browse/changeset/:id", :to => redirect(:path => "/changeset/%{id}")
135 get "/browse/note/:id", :to => redirect(:path => "/note/%{id}")
136 get "/user/:display_name/edits", :to => redirect(:path => "/user/%{display_name}/history")
137 get "/user/:display_name/edits/feed", :to => redirect(:path => "/user/%{display_name}/history/feed")
138 get "/browse/friends", :to => redirect(:path => "/history/friends")
139 get "/browse/nearby", :to => redirect(:path => "/history/nearby")
140 get "/browse/changesets/feed", :to => redirect(:path => "/history/feed")
141 get "/browse/changesets", :to => redirect(:path => "/history")
142 get "/browse", :to => redirect(:path => "/history")
145 root :to => "site#index", :via => [:get, :post]
146 get "/edit" => "site#edit"
147 get "/copyright/:copyright_locale" => "site#copyright"
148 get "/copyright" => "site#copyright"
149 get "/welcome" => "site#welcome"
150 get "/fixthemap" => "site#fixthemap"
151 get "/help" => "site#help"
152 get "/about" => "site#about"
153 get "/history" => "changeset#list"
154 get "/history/feed" => "changeset#feed", :defaults => { :format => :atom }
155 get "/history/comments/feed" => "changeset#comments_feed", :as => :changesets_comments_feed, :defaults => { :format => "rss" }
156 get "/export" => "site#export"
157 match "/login" => "user#login", :via => [:get, :post]
158 match "/logout" => "user#logout", :via => [:get, :post]
159 get "/offline" => "site#offline"
160 get "/key" => "site#key"
161 get "/id" => "site#id"
162 get "/query" => "browse#query"
163 get "/user/new" => "user#new"
164 post "/user/new" => "user#create"
165 get "/user/terms" => "user#terms"
166 post "/user/save" => "user#save"
167 get "/user/:display_name/confirm/resend" => "user#confirm_resend"
168 match "/user/:display_name/confirm" => "user#confirm", :via => [:get, :post]
169 match "/user/confirm" => "user#confirm", :via => [:get, :post]
170 match "/user/confirm-email" => "user#confirm_email", :via => [:get, :post]
171 post "/user/go_public" => "user#go_public"
172 match "/user/reset-password" => "user#reset_password", :via => [:get, :post]
173 match "/user/forgot-password" => "user#lost_password", :via => [:get, :post]
174 get "/user/suspended" => "user#suspended"
176 get "/index.html", :to => redirect(:path => "/")
177 get "/create-account.html", :to => redirect(:path => "/user/new")
178 get "/forgot-password.html", :to => redirect(:path => "/user/forgot-password")
181 get "/auth/failure" => "user#auth_failure"
182 match "/auth/:provider/callback" => "user#auth_success", :via => [:get, :post], :as => :auth_success
183 match "/auth/:provider" => "user#auth", :via => [:get, :post], :as => :auth
186 get "/go/:code" => "site#permalink", :code => /[a-zA-Z0-9_@~]+[=-]*/
189 post "/preview/:type" => "site#preview", :as => :preview
192 get "/user/:display_name/traces/tag/:tag/page/:page" => "traces#list", :page => /[1-9][0-9]*/
193 get "/user/:display_name/traces/tag/:tag" => "traces#list"
194 get "/user/:display_name/traces/page/:page" => "traces#list", :page => /[1-9][0-9]*/
195 get "/user/:display_name/traces" => "traces#list"
196 get "/user/:display_name/traces/tag/:tag/rss" => "traces#georss", :defaults => { :format => :rss }
197 get "/user/:display_name/traces/rss" => "traces#georss", :defaults => { :format => :rss }
198 get "/user/:display_name/traces/:id" => "traces#view"
199 get "/user/:display_name/traces/:id/picture" => "traces#picture"
200 get "/user/:display_name/traces/:id/icon" => "traces#icon"
201 get "/traces/tag/:tag/page/:page" => "traces#list", :page => /[1-9][0-9]*/
202 get "/traces/tag/:tag" => "traces#list"
203 get "/traces/page/:page" => "traces#list", :page => /[1-9][0-9]*/
204 get "/traces" => "traces#list"
205 get "/traces/tag/:tag/rss" => "traces#georss", :defaults => { :format => :rss }
206 get "/traces/rss" => "traces#georss", :defaults => { :format => :rss }
207 get "/traces/mine/tag/:tag/page/:page" => "traces#mine", :page => /[1-9][0-9]*/
208 get "/traces/mine/tag/:tag" => "traces#mine"
209 get "/traces/mine/page/:page" => "traces#mine"
210 get "/traces/mine" => "traces#mine"
211 resources :traces, :only => [:new, :create]
212 post "/trace/create" => "traces#create" # remove after deployment
213 get "/trace/create", :to => redirect(:path => "/traces/new")
214 get "/trace/:id/data" => "traces#data", :id => /\d+/, :as => "trace_data"
215 match "/trace/:id/edit" => "traces#edit", :via => [:get, :post], :id => /\d+/, :as => "trace_edit"
216 post "/trace/:id/delete" => "traces#delete", :id => /\d+/
219 match "/diary/new" => "diary_entry#new", :via => [:get, :post]
220 get "/diary/friends" => "diary_entry#list", :friends => true, :as => "friend_diaries"
221 get "/diary/nearby" => "diary_entry#list", :nearby => true, :as => "nearby_diaries"
222 get "/user/:display_name/diary/rss" => "diary_entry#rss", :defaults => { :format => :rss }
223 get "/diary/:language/rss" => "diary_entry#rss", :defaults => { :format => :rss }
224 get "/diary/rss" => "diary_entry#rss", :defaults => { :format => :rss }
225 get "/user/:display_name/diary/comments/:page" => "diary_entry#comments", :page => /[1-9][0-9]*/
226 get "/user/:display_name/diary/comments/" => "diary_entry#comments"
227 get "/user/:display_name/diary" => "diary_entry#list"
228 get "/diary/:language" => "diary_entry#list"
229 get "/diary" => "diary_entry#list"
230 get "/user/:display_name/diary/:id" => "diary_entry#view", :id => /\d+/, :as => :diary_entry
231 post "/user/:display_name/diary/:id/newcomment" => "diary_entry#comment", :id => /\d+/
232 match "/user/:display_name/diary/:id/edit" => "diary_entry#edit", :via => [:get, :post], :id => /\d+/
233 post "/user/:display_name/diary/:id/hide" => "diary_entry#hide", :id => /\d+/, :as => :hide_diary_entry
234 post "/user/:display_name/diary/:id/hidecomment/:comment" => "diary_entry#hidecomment", :id => /\d+/, :comment => /\d+/, :as => :hide_diary_comment
235 post "/user/:display_name/diary/:id/subscribe" => "diary_entry#subscribe", :as => :diary_entry_subscribe, :id => /\d+/
236 post "/user/:display_name/diary/:id/unsubscribe" => "diary_entry#unsubscribe", :as => :diary_entry_unsubscribe, :id => /\d+/
239 get "/user/:display_name" => "user#view", :as => "user"
240 match "/user/:display_name/make_friend" => "user#make_friend", :via => [:get, :post], :as => "make_friend"
241 match "/user/:display_name/remove_friend" => "user#remove_friend", :via => [:get, :post], :as => "remove_friend"
242 match "/user/:display_name/account" => "user#account", :via => [:get, :post]
243 get "/user/:display_name/set_status" => "user#set_status", :as => :set_status_user
244 get "/user/:display_name/delete" => "user#delete", :as => :delete_user
247 match "/users" => "user#list", :via => [:get, :post]
248 match "/users/:status" => "user#list", :via => [:get, :post]
251 get "/search" => "geocoder#search"
252 get "/geocoder/search_latlon" => "geocoder#search_latlon"
253 get "/geocoder/search_ca_postcode" => "geocoder#search_ca_postcode"
254 get "/geocoder/search_osm_nominatim" => "geocoder#search_osm_nominatim"
255 get "/geocoder/search_geonames" => "geocoder#search_geonames"
256 get "/geocoder/search_osm_nominatim_reverse" => "geocoder#search_osm_nominatim_reverse"
257 get "/geocoder/search_geonames_reverse" => "geocoder#search_geonames_reverse"
260 get "/directions" => "directions#search"
263 post "/export/finish" => "export#finish"
264 get "/export/embed" => "export#embed"
267 resources :messages, :only => [:show] do
273 get "/user/:display_name/inbox", :to => redirect(:path => "/messages/inbox")
274 get "/user/:display_name/outbox", :to => redirect(:path => "/messages/outbox")
275 match "/message/new/:display_name" => "messages#new", :via => [:get, :post], :as => "new_message"
276 get "/message/read/:message_id", :to => redirect(:path => "/messages/%{message_id}")
277 post "/message/mark/:message_id" => "messages#mark", :as => "mark_message"
278 match "/message/reply/:message_id" => "messages#reply", :via => [:get, :post], :as => "reply_message"
279 post "/message/delete/:message_id" => "messages#destroy", :as => "destroy_message"
281 # oauth admin pages (i.e: for setting up new clients, etc...)
282 scope "/user/:display_name" do
283 resources :oauth_clients
285 match "/oauth/revoke" => "oauth#revoke", :via => [:get, :post]
286 match "/oauth/authorize" => "oauth#authorize", :via => [:get, :post], :as => :authorize
287 get "/oauth/token" => "oauth#token", :as => :token
288 match "/oauth/request_token" => "oauth#request_token", :via => [:get, :post], :as => :request_token
289 match "/oauth/access_token" => "oauth#access_token", :via => [:get, :post], :as => :access_token
290 get "/oauth/test_request" => "oauth#test_request", :as => :test_request
292 # roles and banning pages
293 post "/user/:display_name/role/:role/grant" => "user_roles#grant", :as => "grant_role"
294 post "/user/:display_name/role/:role/revoke" => "user_roles#revoke", :as => "revoke_role"
295 get "/user/:display_name/blocks" => "user_blocks#blocks_on"
296 get "/user/:display_name/blocks_by" => "user_blocks#blocks_by"
297 get "/blocks/new/:display_name" => "user_blocks#new", :as => "new_user_block"
298 resources :user_blocks
299 match "/blocks/:id/revoke" => "user_blocks#revoke", :via => [:get, :post], :as => "revoke_user_block"
303 resources :comments, :controller => :issue_comments
315 resources :redactions