]> git.openstreetmap.org Git - rails.git/blobdiff - config/routes.rb
Merge remote-tracking branch 'upstream/pull/2267'
[rails.git] / config / routes.rb
index 32cd397aadd8e3e68f16cdd295b5608c2a0207a2..7689b506da0a9dad5a16827684f33c7dc0113894 100644 (file)
@@ -66,10 +66,10 @@ OpenStreetMap::Application.routes.draw do
     get "relations/search" => "api/search#search_relations"
     get "nodes/search" => "api/search#search_nodes"
 
-    get "user/:id" => "api/users#api_read", :id => /\d+/
-    get "user/details" => "api/users#api_details"
-    get "user/gpx_files" => "api/users#api_gpx_files"
-    get "users" => "api/users#api_users", :as => :api_users
+    get "user/:id" => "api/users#show", :id => /\d+/
+    get "user/details" => "api/users#details"
+    get "user/gpx_files" => "api/users#gpx_files"
+    get "users" => "api/users#index", :as => :api_users
 
     get "user/preferences" => "api/user_preferences#read"
     get "user/preferences/:preference_key" => "api/user_preferences#read_one"
@@ -77,17 +77,16 @@ OpenStreetMap::Application.routes.draw do
     put "user/preferences/:preference_key" => "api/user_preferences#update_one"
     delete "user/preferences/:preference_key" => "api/user_preferences#delete_one"
 
-    post "gpx/create" => "api/traces#api_create"
-    get "gpx/:id" => "api/traces#api_read", :id => /\d+/
-    put "gpx/:id" => "api/traces#api_update", :id => /\d+/
-    delete "gpx/:id" => "api/traces#api_delete", :id => /\d+/
-    get "gpx/:id/details" => "api/traces#api_read", :id => /\d+/
-    get "gpx/:id/data" => "api/traces#api_data"
+    post "gpx/create" => "api/traces#create"
+    get "gpx/:id" => "api/traces#show", :id => /\d+/
+    put "gpx/:id" => "api/traces#update", :id => /\d+/
+    delete "gpx/:id" => "api/traces#destroy", :id => /\d+/
+    get "gpx/:id/details" => "api/traces#show", :id => /\d+/
+    get "gpx/:id/data" => "api/traces#data"
 
     # AMF (ActionScript) API
     post "amf/read" => "api/amf#amf_read"
     post "amf/write" => "api/amf#amf_write"
-    get "swf/trackpoints" => "api/swf#trackpoints"
 
     # Map notes API
     resources :notes, :except => [:new, :edit, :update], :constraints => { :id => /\d+/ }, :defaults => { :format => "xml" }, :controller => "api/notes" do
@@ -216,9 +215,12 @@ OpenStreetMap::Application.routes.draw do
   post "/trace/:id/delete" => "traces#delete", :id => /\d+/
 
   # diary pages
-  match "/diary/new" => "diary_entries#new", :via => [:get, :post]
-  get "/diary/friends" => "diary_entries#index", :friends => true, :as => "friend_diaries"
-  get "/diary/nearby" => "diary_entries#index", :nearby => true, :as => "nearby_diaries"
+  resources :diary_entries, :path => "diary", :only => [:new, :create, :index] do
+    collection do
+      get "friends" => "diary_entries#index", :friends => true
+      get "nearby" => "diary_entries#index", :nearby => true
+    end
+  end
   get "/user/:display_name/diary/rss" => "diary_entries#rss", :defaults => { :format => :rss }
   get "/diary/:language/rss" => "diary_entries#rss", :defaults => { :format => :rss }
   get "/diary/rss" => "diary_entries#rss", :defaults => { :format => :rss }
@@ -226,12 +228,14 @@ OpenStreetMap::Application.routes.draw do
   get "/user/:display_name/diary/comments/" => "diary_entries#comments"
   get "/user/:display_name/diary" => "diary_entries#index"
   get "/diary/:language" => "diary_entries#index"
-  get "/diary" => "diary_entries#index"
-  get "/user/:display_name/diary/:id" => "diary_entries#show", :id => /\d+/, :as => :diary_entry
+  scope "/user/:display_name" do
+    resources :diary_entries, :path => "diary", :only => [:edit, :update, :show]
+  end
   post "/user/:display_name/diary/:id/newcomment" => "diary_entries#comment", :id => /\d+/
-  match "/user/:display_name/diary/:id/edit" => "diary_entries#edit", :via => [:get, :post], :id => /\d+/
   post "/user/:display_name/diary/:id/hide" => "diary_entries#hide", :id => /\d+/, :as => :hide_diary_entry
+  post "/user/:display_name/diary/:id/unhide" => "diary_entries#unhide", :id => /\d+/, :as => :unhide_diary_entry
   post "/user/:display_name/diary/:id/hidecomment/:comment" => "diary_entries#hidecomment", :id => /\d+/, :comment => /\d+/, :as => :hide_diary_comment
+  post "/user/:display_name/diary/:id/unhidecomment/:comment" => "diary_entries#unhidecomment", :id => /\d+/, :comment => /\d+/, :as => :unhide_diary_comment
   post "/user/:display_name/diary/:id/subscribe" => "diary_entries#subscribe", :as => :diary_entry_subscribe, :id => /\d+/
   post "/user/:display_name/diary/:id/unsubscribe" => "diary_entries#unsubscribe", :as => :diary_entry_unsubscribe, :id => /\d+/