X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/13994ca6caa0e253856126fc8029d0e3140f1bfd..0ab8d954ad6d6e4cee5c1238973b8f693c788fcb:/config/routes.rb?ds=sidebyside diff --git a/config/routes.rb b/config/routes.rb index e623a0738..9cb3a63ed 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -66,14 +66,14 @@ OpenStreetMap::Application.routes.draw do get "map" => "map#index" get "trackpoints" => "tracepoints#index" - - get "user/:id" => "users#show", :id => /\d+/, :as => :api_user - get "user/details" => "users#details" - get "user/gpx_files" => "users#gpx_files" - get "users" => "users#index", :as => :api_users end namespace :api, :path => "api/0.6" do + resources :users, :only => :index + resources :users, :path => "user", :id => /\d+/, :only => :show + resources :user_traces, :path => "user/gpx_files", :module => :users, :controller => :traces, :only => :index + get "user/details" => "users#details" + resources :user_preferences, :except => [:new, :create, :edit], :param => :preference_key, :path => "user/preferences" do collection do put "" => "user_preferences#update_all", :as => "" @@ -182,8 +182,6 @@ OpenStreetMap::Application.routes.draw do get "/key" => "site#key" get "/id" => "site#id" get "/query" => "browse#query" - get "/user/terms" => "users#terms" - post "/user/save" => "users#save" post "/user/:display_name/confirm/resend" => "confirmations#confirm_resend", :as => :user_confirm_resend match "/user/:display_name/confirm" => "confirmations#confirm", :via => [:get, :post] match "/user/confirm" => "confirmations#confirm", :via => [:get, :post] @@ -267,6 +265,7 @@ OpenStreetMap::Application.routes.draw do post "/diary_comments/:comment/unhide" => "diary_comments#unhide", :comment => /\d+/, :as => :unhide_diary_comment # user pages + get "/user/terms", :to => redirect(:path => "/account/terms") resources :users, :path => "user", :param => :display_name, :only => [:new, :create, :show, :destroy] do resource :role, :controller => "user_roles", :path => "roles/:role", :only => [:create, :destroy] scope :module => :users do @@ -277,13 +276,16 @@ OpenStreetMap::Application.routes.draw do get "/user/:display_name/account", :to => redirect(:path => "/account/edit") post "/user/:display_name/set_status" => "users#set_status", :as => :set_status_user - resource :account, :only => [:edit, :update, :destroy] - - namespace :account do - resource :deletion, :only => [:show] + resource :account, :only => [:edit, :update, :destroy] do + scope :module => :accounts do + resource :terms, :only => [:show, :update] + resource :deletion, :only => :show + end end + resource :dashboard, :only => [:show] - resource :preferences, :only => [:show, :edit, :update] + resource :preferences, :only => [:show, :update] + get "/preferences/edit", :to => redirect(:path => "/preferences") resource :profile, :only => [:edit, :update] # friendships @@ -313,7 +315,7 @@ OpenStreetMap::Application.routes.draw do post :mark patch :unmute - match :reply, :via => [:get, :post] + resource :reply, :module => :messages, :path_names => { :new => "new" }, :only => :new end namespace :messages, :path => "/messages" do resource :inbox, :only => :show @@ -324,6 +326,7 @@ OpenStreetMap::Application.routes.draw do get "/user/:display_name/outbox", :to => redirect(:path => "/messages/outbox") get "/message/new/:display_name", :to => redirect(:path => "/messages/new/%{display_name}") get "/message/read/:message_id", :to => redirect(:path => "/messages/%{message_id}") + get "/messages/:message_id/reply", :to => redirect(:path => "/messages/%{message_id}/reply/new") # muting users scope "/user/:display_name" do