X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/32f13f5d68c785d78ec2c7b414e65bb5b407de91..e5dff869eacae808cc7e2bfe801597d0ab64c262:/config/routes.rb diff --git a/config/routes.rb b/config/routes.rb index d00664832..c832cbb35 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -25,7 +25,7 @@ OpenStreetMap::Application.routes.draw do post "changeset/:id/unsubscribe" => "changesets#unsubscribe", :as => :api_changeset_unsubscribe, :id => /\d+/ put "changeset/:id" => "changesets#update", :id => /\d+/ put "changeset/:id/close" => "changesets#close", :as => :changeset_close, :id => /\d+/ - get "changesets" => "changesets#query" + get "changesets" => "changesets#index" post "changeset/:id/comment" => "changeset_comments#create", :as => :changeset_comment, :id => /\d+/ post "changeset/comment/:id/hide" => "changeset_comments#destroy", :as => :changeset_comment_hide, :id => /\d+/ post "changeset/comment/:id/unhide" => "changeset_comments#restore", :as => :changeset_comment_unhide, :id => /\d+/ @@ -84,9 +84,11 @@ OpenStreetMap::Application.routes.draw do delete "gpx/:id" => "traces#destroy", :id => /\d+/ get "gpx/:id/details" => "traces#show", :id => /\d+/ get "gpx/:id/data" => "traces#data", :as => :api_trace_data + end + namespace :api, :path => "api/0.6" do # Map notes API - resources :notes, :except => [:new, :edit, :update], :constraints => { :id => /\d+/ }, :controller => "notes", :as => :api_notes do + resources :notes, :except => [:new, :edit, :update], :id => /\d+/, :controller => "notes" do collection do get "search" get "feed", :defaults => { :format => "rss" } @@ -99,13 +101,7 @@ OpenStreetMap::Application.routes.draw do end end - post "notes/addPOIexec" => "notes#create" - post "notes/closePOIexec" => "notes#close" - post "notes/editPOIexec" => "notes#comment" - get "notes/getGPX" => "notes#index", :format => "gpx" - get "notes/getRSSfeed" => "notes#feed", :format => "rss" - - resources :user_blocks, :only => [:show], :constraints => { :id => /\d+/ }, :controller => "user_blocks", :as => :api_user_blocks + resources :user_blocks, :only => :show, :id => /\d+/, :controller => "user_blocks" end # Data browsing @@ -122,7 +118,7 @@ OpenStreetMap::Application.routes.draw do match :subscribe, :unsubscribe, :on => :member, :via => [:get, :post] end get "/changeset/:id/comments/feed" => "changeset_comments#index", :as => :changeset_comments_feed, :id => /\d*/, :defaults => { :format => "rss" } - resources :notes, :path => "note", :only => [:show, :new] + resources :notes, :path => "note", :id => /\d+/, :only => [:show, :new] get "/user/:display_name/history" => "changesets#index" get "/user/:display_name/history/feed" => "changesets#feed", :defaults => { :format => :atom } @@ -237,19 +233,19 @@ OpenStreetMap::Application.routes.draw do get "/diary/:language/rss" => "diary_entries#rss", :defaults => { :format => :rss } get "/diary/rss" => "diary_entries#rss", :defaults => { :format => :rss } get "/user/:display_name/diary/comments/:page", :page => /[1-9][0-9]*/, :to => redirect(:path => "/user/%{display_name}/diary/comments") - get "/user/:display_name/diary/comments" => "diary_entries#comments", :as => :diary_comments + get "/user/:display_name/diary/comments" => "diary_comments#index", :as => :diary_comments get "/user/:display_name/diary" => "diary_entries#index" get "/diary/:language" => "diary_entries#index" scope "/user/:display_name" do resources :diary_entries, :path => "diary", :only => [:edit, :update, :show], :id => /\d+/ end - post "/user/:display_name/diary/:id/newcomment" => "diary_entries#comment", :id => /\d+/, :as => :comment_diary_entry 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 match "/user/:display_name/diary/:id/subscribe" => "diary_entries#subscribe", :via => [:get, :post], :as => :diary_entry_subscribe, :id => /\d+/ match "/user/:display_name/diary/:id/unsubscribe" => "diary_entries#unsubscribe", :via => [:get, :post], :as => :diary_entry_unsubscribe, :id => /\d+/ + post "/user/:display_name/diary/:id/comments" => "diary_comments#create", :id => /\d+/, :as => :comment_diary_entry + post "/user/:display_name/diary/:id/comments/:comment/hide" => "diary_comments#hide", :id => /\d+/, :comment => /\d+/, :as => :hide_diary_comment + post "/user/:display_name/diary/:id/comments/:comment/unhide" => "diary_comments#unhide", :id => /\d+/, :comment => /\d+/, :as => :unhide_diary_comment # user pages resources :users, :path => "user", :param => :display_name, :only => [:show, :destroy] @@ -347,6 +343,7 @@ OpenStreetMap::Application.routes.draw do resources :redactions # errors + match "/400", :to => "errors#bad_request", :via => :all match "/403", :to => "errors#forbidden", :via => :all match "/404", :to => "errors#not_found", :via => :all match "/500", :to => "errors#internal_server_error", :via => :all