X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0b42688ae2cbbb74e7ecff4309fdf2e74859df88..fa51bcbcb2868486a584a4cb4928a02899623d79:/config/routes.rb diff --git a/config/routes.rb b/config/routes.rb index 0467c59c8..479d35346 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -80,13 +80,12 @@ OpenStreetMap::Application.routes.draw do end end - resources :messages, :path => "user/messages", :constraints => { :id => /\d+/ }, :only => [:create, :show, :update, :destroy] do - collection do - get "inbox" - get "outbox" - end + resources :messages, :path => "user/messages", :constraints => { :id => /\d+/ }, :only => [:create, :show, :update, :destroy] + namespace :messages, :path => "user/messages" do + resource :inbox, :only => :show + resource :outbox, :only => :show end - post "/user/messages/:id" => "messages#update" + post "/user/messages/:id" => "messages#update", :as => nil resources :traces, :path => "gpx", :only => [:create, :show, :update, :destroy], :id => /\d+/ do scope :module => :traces do @@ -126,7 +125,8 @@ OpenStreetMap::Application.routes.draw do get "/relation/:id/history" => "old_relations#index", :id => /\d+/, :as => :relation_history resources :old_relations, :path => "/relation/:id/history", :id => /\d+/, :version => /\d+/, :param => :version, :only => :show resources :changesets, :path => "changeset", :id => /\d+/, :only => :show do - match :subscribe, :unsubscribe, :on => :member, :via => [:get, :post] + match :subscribe, :on => :member, :via => [:get, :post] + match :unsubscribe, :on => :member, :via => [:get, :post] namespace :changeset_comments, :as => :comments, :path => :comments do resource :feed, :only => :show, :defaults => { :format => "rss" } @@ -182,11 +182,7 @@ OpenStreetMap::Application.routes.draw do get "/key" => "site#key" get "/id" => "site#id" get "/query" => "browse#query" - get "/user/new" => "users#new" - post "/user/new" => "users#create" - get "/user/terms" => "users#terms" - post "/user/save" => "users#save" - get "/user/:display_name/confirm/resend" => "confirmations#confirm_resend", :as => :user_confirm_resend + 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] match "/user/confirm-email" => "confirmations#confirm_email", :via => [:get, :post] @@ -257,7 +253,8 @@ OpenStreetMap::Application.routes.draw do scope "/user/:display_name" do resources :diary_entries, :path => "diary", :only => [:edit, :update, :show], :id => /\d+/ do member do - post :hide, :unhide + post :hide + post :unhide end end end @@ -268,17 +265,24 @@ OpenStreetMap::Application.routes.draw do post "/diary_comments/:comment/unhide" => "diary_comments#unhide", :comment => /\d+/, :as => :unhide_diary_comment # user pages - resources :users, :path => "user", :param => :display_name, :only => [:show, :destroy] do + 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 + resource :issued_blocks, :path => "blocks_by", :only => :show + resource :received_blocks, :path => "blocks", :only => [:show, :edit, :destroy] + end end 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 :profile, :only => [:edit, :update] @@ -306,21 +310,22 @@ OpenStreetMap::Application.routes.draw do get "/export/embed" => "export#embed" # messages - resources :messages, :only => [:create, :show, :destroy] do + resources :messages, :path_names => { :new => "new/:display_name" }, :id => /\d+/, :only => [:new, :create, :show, :destroy] do post :mark patch :unmute - match :reply, :via => [:get, :post] - collection do - get :inbox - get :muted - get :outbox - end + resource :reply, :module => :messages, :path_names => { :new => "new" }, :only => :new + end + namespace :messages, :path => "/messages" do + resource :inbox, :only => :show + resource :muted_inbox, :path => "muted", :only => :show + resource :outbox, :only => :show end get "/user/:display_name/inbox", :to => redirect(:path => "/messages/inbox") get "/user/:display_name/outbox", :to => redirect(:path => "/messages/outbox") - get "/message/new/:display_name" => "messages#new", :as => "new_message" + 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 @@ -329,11 +334,7 @@ OpenStreetMap::Application.routes.draw do resources :user_mutes, :only => [:index] # banning pages - get "/user/:display_name/blocks" => "user_blocks#blocks_on", :as => "user_blocks_on" - get "/user/:display_name/blocks_by" => "user_blocks#blocks_by", :as => "user_blocks_by" - get "/blocks/new/:display_name" => "user_blocks#new", :as => "new_user_block" - resources :user_blocks, :except => :new - match "/user/:display_name/blocks/revoke_all" => "user_blocks#revoke_all", :via => [:get, :post], :as => "revoke_all_user_blocks" + resources :user_blocks, :path_names => { :new => "new/:display_name" } # issues and reports resources :issues do