routes: add sections

This commit is contained in:
Pierre de La Morinerie 2018-07-31 11:48:58 +02:00
parent 54bfb3ec98
commit b14bba70a0

View file

@ -1,4 +1,8 @@
Rails.application.routes.draw do Rails.application.routes.draw do
#
# Manager
#
get 'manager/sign_in' => 'administrations/sessions#new' get 'manager/sign_in' => 'administrations/sessions#new'
delete 'manager/sign_out' => 'administrations/sessions#destroy' delete 'manager/sign_out' => 'administrations/sessions#destroy'
namespace :manager do namespace :manager do
@ -38,8 +42,16 @@ Rails.application.routes.draw do
root to: "administrateurs#index" root to: "administrateurs#index"
end end
#
# Monitoring
#
get "/ping" => "ping#index", :constraints => { :ip => /127.0.0.1/ } get "/ping" => "ping#index", :constraints => { :ip => /127.0.0.1/ }
#
# Authentication
#
devise_for :administrations, devise_for :administrations,
skip: [:password, :registrations, :sessions], skip: [:password, :registrations, :sessions],
controllers: { controllers: {
@ -77,6 +89,10 @@ Rails.application.routes.draw do
get '/administrateurs/sign_in/demo' => redirect("/users/sign_in") get '/administrateurs/sign_in/demo' => redirect("/users/sign_in")
end end
#
# Main routes
#
root 'root#index' root 'root#index'
get 'users' => 'users#index' get 'users' => 'users#index'
@ -95,6 +111,17 @@ Rails.application.routes.draw do
get ':champ_id/siret' => 'siret#index', as: 'siret' get ':champ_id/siret' => 'siret#index', as: 'siret'
end end
namespace :commencer do
get '/test/:procedure_path' => '/users/dossiers#commencer_test', as: :test
get '/:procedure_path' => '/users/dossiers#commencer'
end
get "patron" => "root#patron"
#
# Deprecated UI
#
namespace :users do namespace :users do
namespace :dossiers do namespace :dossiers do
resources :invites, only: [:index, :show] resources :invites, only: [:index, :show]
@ -206,6 +233,10 @@ Rails.application.routes.draw do
resources :gestionnaires, only: [:index, :create, :destroy] resources :gestionnaires, only: [:index, :create, :destroy]
end end
#
# Addresses
#
namespace :ban do namespace :ban do
get 'search' => 'search#get' get 'search' => 'search#get'
get 'address_point' => 'search#get_address_point' get 'address_point' => 'search#get_address_point'
@ -215,6 +246,10 @@ Rails.application.routes.draw do
post 'dossier/:dossier_id' => '/invites#create', as: 'dossier' post 'dossier/:dossier_id' => '/invites#create', as: 'dossier'
end end
#
# API
#
namespace :api do namespace :api do
namespace :v1 do namespace :v1 do
resources :procedures, only: [:index, :show] do resources :procedures, only: [:index, :show] do
@ -227,12 +262,9 @@ Rails.application.routes.draw do
end end
end end
namespace :commencer do #
get '/test/:procedure_path' => '/users/dossiers#commencer_test', as: :test # User
get '/:procedure_path' => '/users/dossiers#commencer' #
end
get "patron" => "root#patron"
scope module: 'new_user' do scope module: 'new_user' do
resources :dossiers, only: [:index, :update] do resources :dossiers, only: [:index, :update] do
@ -252,6 +284,10 @@ Rails.application.routes.draw do
end end
end end
#
# Gestionnaire
#
scope module: 'new_gestionnaire', as: 'gestionnaire' do scope module: 'new_gestionnaire', as: 'gestionnaire' do
resources :procedures, only: [:index, :show], param: :procedure_id do resources :procedures, only: [:index, :show], param: :procedure_id do
member do member do
@ -301,6 +337,10 @@ Rails.application.routes.draw do
get "recherche" => "recherche#index" get "recherche" => "recherche#index"
end end
#
# Administrateur
#
scope module: 'new_administrateur' do scope module: 'new_administrateur' do
resources :procedures, only: [] do resources :procedures, only: [] do
member do member do
@ -317,7 +357,10 @@ Rails.application.routes.draw do
apipie apipie
#
# Legacy routes # Legacy routes
#
get 'backoffice' => redirect('/procedures') get 'backoffice' => redirect('/procedures')
get 'backoffice/sign_in' => redirect('/users/sign_in') get 'backoffice/sign_in' => redirect('/users/sign_in')
get 'backoffice/dossiers/procedure/:procedure_id' => redirect('/procedures/%{procedure_id}') get 'backoffice/dossiers/procedure/:procedure_id' => redirect('/procedures/%{procedure_id}')