foodsoft/config/routes.rb

205 lines
4.8 KiB
Ruby
Raw Normal View History

Foodsoft::Application.routes.draw do
2011-06-19 20:47:27 +02:00
get "order_comments/new"
get "comments/new"
get "sessions/new"
2015-01-02 17:40:21 +01:00
root to: 'sessions#redirect_to_foodcoop', as: nil
scope '/:foodcoop' do
# Root path
2015-01-02 17:40:21 +01:00
root to: 'home#index'
########### Sessions
2015-01-02 17:40:21 +01:00
get '/login' => 'sessions#new', as: 'login'
get '/logout' => 'sessions#destroy', as: 'logout'
get '/login/forgot_password' => 'login#forgot_password', as: :forgot_password
post '/login/reset_password' => 'login#reset_password', as: :reset_password
get '/login/new_password' => 'login#new_password', as: :new_password
patch '/login/update_password' => 'login#update_password', as: :update_password
match '/login/accept_invitation/:token' => 'login#accept_invitation', as: :accept_invitation, via: [:get, :post]
2015-01-02 17:40:21 +01:00
resources :sessions, only: [:new, :create, :destroy]
2015-01-02 17:40:21 +01:00
get '/foodcoop.css' => 'styles#foodcoop', as: 'foodcoop_css'
2014-08-22 12:06:35 +02:00
########### User specific
2009-01-06 11:49:19 +01:00
2015-01-02 17:40:21 +01:00
get '/home/profile', as: 'my_profile'
patch '/home/update_profile', as: 'update_profile'
get '/home/ordergroup' => 'home#ordergroup', as: 'my_ordergroup'
post '/home/cancel_membership' => 'home#cancel_membership', as: 'cancel_membership'
############ Orders, ordering
resources :orders do
member do
post :finish
post :add_comment
2013-12-18 21:06:05 +01:00
get :receive
post :receive
get :receive_on_order_article_create
get :receive_on_order_article_update
end
resources :order_articles
end
resources :group_orders do
2015-01-02 17:40:21 +01:00
get :archive, on: :collection
end
resources :group_order_articles
2015-01-02 17:40:21 +01:00
resources :order_comments, only: [:new, :create]
2011-06-19 20:47:27 +02:00
############ Foodcoop orga
2015-01-02 17:40:21 +01:00
resources :invites, only: [:new, :create]
resources :tasks do
collection do
get :user
get :archive
get :workgroup
end
2012-10-08 21:52:03 +02:00
member do
post :accept
post :reject
post :set_done
end
end
namespace :foodcoop do
2015-01-02 17:40:21 +01:00
root to: 'users#index'
2015-01-02 17:40:21 +01:00
resources :users, only: [:index]
2015-01-02 17:40:21 +01:00
resources :ordergroups, only: [:index]
2009-01-06 11:49:19 +01:00
2015-01-02 17:40:21 +01:00
resources :workgroups, only: [:index, :edit, :update]
end
########### Article management
resources :stock_takings do
collection do
get :fill_new_stock_article_form
post :add_stock_article
end
end
2015-01-02 17:40:21 +01:00
resources :stock_articles, controller: 'stockit' do
get :copy
collection do
get :derive
get :index_on_stock_article_create
get :index_on_stock_article_update
get :show_on_stock_article_update
end
end
resources :suppliers do
2015-01-02 17:40:21 +01:00
get :shared_suppliers, on: :collection
resources :deliveries do
collection do
post :add_stock_change
get :form_on_stock_article_create
get :form_on_stock_article_update
end
end
resources :articles do
collection do
post :update_selected
get :edit_all
post :update_all
get :upload
post :parse_upload
post :create_from_upload
get :shared
get :import
post :sync
post :update_synchronized
end
end
2011-05-11 14:21:06 +02:00
end
2011-05-11 14:21:06 +02:00
resources :article_categories
2011-05-11 14:21:06 +02:00
########### Finance
2011-05-11 14:21:06 +02:00
namespace :finance do
2015-01-02 17:40:21 +01:00
root to: 'base#index'
2012-05-12 10:55:20 +02:00
resources :order, controller: 'balancing', path: 'balancing' do
member do
get :update_summary
2012-05-12 10:55:20 +02:00
get :edit_note
put :update_note
get :confirm
patch :close
patch :close_direct
get :new_on_order_article_create
get :new_on_order_article_update
2012-05-12 10:55:20 +02:00
end
end
resources :invoices do
get :form_on_supplier_id_change, on: :collection
end
2015-01-02 17:40:21 +01:00
resources :ordergroups, only: [:index] do
resources :financial_transactions, as: :transactions
end
2014-05-06 19:02:01 +02:00
get 'transactions' => 'financial_transactions#index_collection'
2015-01-02 17:40:21 +01:00
get 'transactions/new_collection' => 'financial_transactions#new_collection', as: 'new_transaction_collection'
post 'transactions/create_collection' => 'financial_transactions#create_collection', as: 'create_transaction_collection'
2011-05-11 14:21:06 +02:00
end
2011-05-11 14:21:06 +02:00
########### Administration
2011-05-11 14:21:06 +02:00
namespace :admin do
2015-01-02 17:40:21 +01:00
root to: 'base#index'
2014-10-18 17:52:06 +02:00
resources :users do
post :restore, on: :member
2015-01-02 17:40:21 +01:00
post :sudo, on: :member
2014-10-18 17:52:06 +02:00
end
2011-05-11 14:21:06 +02:00
resources :workgroups do
2015-01-02 17:40:21 +01:00
get :memberships, on: :member
2011-05-11 14:21:06 +02:00
end
2011-05-11 14:21:06 +02:00
resources :ordergroups do
2015-01-02 17:40:21 +01:00
get :memberships, on: :member
end
2014-03-16 02:08:15 +01:00
2015-01-02 17:40:21 +01:00
resource :config, only: [:show, :update] do
2014-03-16 02:08:15 +01:00
get :list
end
end
############## Feedback
2015-01-02 17:40:21 +01:00
resource :feedback, only: [:new, :create], controller: 'feedback'
############## The rest
2015-01-02 17:40:21 +01:00
resources :users, only: [:index]
end # End of /:foodcoop scope
2009-01-06 11:49:19 +01:00
end