X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/925d12cc8176414d0f9531832862a5825783d132..53817fa9e8d955df0891d156f21b7269b4ed08fc:/config/routes.rb diff --git a/config/routes.rb b/config/routes.rb index 415f8a01b..af5730d21 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,6 +5,8 @@ OpenStreetMap::Application.routes.draw do :authorized_applications => "oauth2_authorized_applications" end + use_doorkeeper_openid_connect :scope => "oauth2" if Settings.key?(:doorkeeper_signing_key) + # API namespace :api do get "capabilities" => "capabilities#show" # Deprecated, remove when 0.6 support is removed @@ -19,8 +21,8 @@ OpenStreetMap::Application.routes.draw do post "changeset/:id/upload" => "api/changesets#upload", :as => :changeset_upload, :id => /\d+/ get "changeset/:id/download" => "api/changesets#download", :as => :changeset_download, :id => /\d+/ get "changeset/:id" => "api/changesets#show", :as => :changeset_show, :id => /\d+/ - post "changeset/:id/subscribe" => "api/changesets#subscribe", :as => :changeset_subscribe, :id => /\d+/ - post "changeset/:id/unsubscribe" => "api/changesets#unsubscribe", :as => :changeset_unsubscribe, :id => /\d+/ + post "changeset/:id/subscribe" => "api/changesets#subscribe", :as => :api_changeset_subscribe, :id => /\d+/ + post "changeset/:id/unsubscribe" => "api/changesets#unsubscribe", :as => :api_changeset_unsubscribe, :id => /\d+/ put "changeset/:id" => "api/changesets#update", :id => /\d+/ put "changeset/:id/close" => "api/changesets#close", :as => :changeset_close, :id => /\d+/ get "changesets" => "api/changesets#query" @@ -102,15 +104,20 @@ OpenStreetMap::Application.routes.draw do post "notes/editPOIexec" => "api/notes#comment" get "notes/getGPX" => "api/notes#index", :format => "gpx" get "notes/getRSSfeed" => "api/notes#feed", :format => "rss" + + resources :user_blocks, :only => [:show], :constraints => { :id => /\d+/ }, :controller => "api/user_blocks", :as => :api_user_blocks end # Data browsing get "/way/:id" => "browse#way", :id => /\d+/, :as => :way get "/way/:id/history" => "browse#way_history", :id => /\d+/, :as => :way_history + resources :old_ways, :path => "/way/:id/history", :id => /\d+/, :version => /\d+/, :param => :version, :only => :show get "/node/:id" => "browse#node", :id => /\d+/, :as => :node get "/node/:id/history" => "browse#node_history", :id => /\d+/, :as => :node_history + resources :old_nodes, :path => "/node/:id/history", :id => /\d+/, :version => /\d+/, :param => :version, :only => :show get "/relation/:id" => "browse#relation", :id => /\d+/, :as => :relation get "/relation/:id/history" => "browse#relation_history", :id => /\d+/, :as => :relation_history + resources :old_relations, :path => "/relation/:id/history", :id => /\d+/, :version => /\d+/, :param => :version, :only => :show get "/changeset/:id" => "browse#changeset", :as => :changeset, :id => /\d+/ get "/changeset/:id/comments/feed" => "changeset_comments#index", :as => :changeset_comments_feed, :id => /\d*/, :defaults => { :format => "rss" } resources :notes, :path => "note", :only => [:show, :new] @@ -120,6 +127,8 @@ OpenStreetMap::Application.routes.draw do get "/user/:display_name/notes" => "notes#index", :as => :user_notes get "/history/friends" => "changesets#index", :friends => true, :as => "friend_changesets", :defaults => { :format => :html } get "/history/nearby" => "changesets#index", :nearby => true, :as => "nearby_changesets", :defaults => { :format => :html } + match "/changeset/:id/subscribe" => "changesets#subscribe", :via => [:get, :post], :as => "changeset_subscribe" + match "/changeset/:id/unsubscribe" => "changesets#unsubscribe", :via => [:get, :post], :as => "changeset_unsubscribe" get "/browse/way/:id", :to => redirect(:path => "/way/%{id}") get "/browse/way/:id/history", :to => redirect(:path => "/way/%{id}/history") @@ -168,8 +177,12 @@ OpenStreetMap::Application.routes.draw do match "/user/confirm" => "confirmations#confirm", :via => [:get, :post] match "/user/confirm-email" => "confirmations#confirm_email", :via => [:get, :post] post "/user/go_public" => "users#go_public" - match "/user/reset-password" => "passwords#reset_password", :via => [:get, :post], :as => :user_reset_password - match "/user/forgot-password" => "passwords#lost_password", :via => [:get, :post], :as => :user_forgot_password + scope :user, :as => "user" do + get "forgot-password" => "passwords#new" + post "forgot-password" => "passwords#create" + get "reset-password" => "passwords#edit" + post "reset-password" => "passwords#update" + end get "/user/suspended" => "users#suspended" get "/index.html", :to => redirect(:path => "/") @@ -233,8 +246,8 @@ OpenStreetMap::Application.routes.draw do 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+/ + 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+/ # user pages resources :users, :path => "user", :param => :display_name, :only => [:show, :destroy] @@ -274,9 +287,12 @@ OpenStreetMap::Application.routes.draw do # messages resources :messages, :only => [:create, :show, :destroy] do post :mark + patch :unmute + match :reply, :via => [:get, :post] collection do get :inbox + get :muted get :outbox end end @@ -285,6 +301,12 @@ OpenStreetMap::Application.routes.draw do get "/message/new/:display_name" => "messages#new", :as => "new_message" get "/message/read/:message_id", :to => redirect(:path => "/messages/%{message_id}") + # muting users + scope "/user/:display_name" do + resource :user_mute, :only => [:create, :destroy], :path => "mute" + end + resources :user_mutes, :only => [:index] + # oauth admin pages (i.e: for setting up new clients, etc...) scope "/user/:display_name" do resources :oauth_clients @@ -304,6 +326,7 @@ OpenStreetMap::Application.routes.draw do get "/blocks/new/:display_name" => "user_blocks#new", :as => "new_user_block" resources :user_blocks match "/blocks/:id/revoke" => "user_blocks#revoke", :via => [:get, :post], :as => "revoke_user_block" + match "/user/:display_name/blocks/revoke_all" => "user_blocks#revoke_all", :via => [:get, :post], :as => "revoke_all_user_blocks" # issues and reports resources :issues do