2011-05-11 12:21:21 +02:00
|
|
|
Foodsoft::Application.routes.draw do
|
2010-03-20 02:26:30 +01:00
|
|
|
|
2011-06-19 20:47:27 +02:00
|
|
|
get "order_comments/new"
|
|
|
|
|
|
|
|
get "comments/new"
|
|
|
|
|
2011-05-11 13:38:46 +02:00
|
|
|
get "sessions/new"
|
|
|
|
|
2012-08-24 19:52:38 +02:00
|
|
|
root :to => redirect("/#{FoodsoftConfig.scope}")
|
2011-05-11 13:38:46 +02:00
|
|
|
|
2012-08-24 19:52:38 +02:00
|
|
|
scope '/:foodcoop' do
|
2009-01-15 18:26:37 +01:00
|
|
|
|
2011-05-11 12:21:21 +02:00
|
|
|
# Root path
|
|
|
|
root :to => 'home#index'
|
2009-08-02 18:12:13 +02:00
|
|
|
|
2011-05-11 13:38:46 +02:00
|
|
|
########### Sessions
|
|
|
|
|
|
|
|
match '/login' => 'sessions#new', :as => 'login'
|
|
|
|
match '/logout' => 'sessions#destroy', :as => 'logout'
|
2013-03-27 22:12:46 +01:00
|
|
|
get '/login/forgot_password' => 'login#forgot_password', as: :forgot_password
|
2012-10-08 11:51:56 +02:00
|
|
|
get '/login/new_password' => 'login#new_password', as: :new_password
|
|
|
|
match '/login/accept_invitation/:token' => 'login#accept_invitation', as: :accept_invitation
|
2011-05-11 13:38:46 +02:00
|
|
|
resources :sessions, :only => [:new, :create, :destroy]
|
|
|
|
|
2011-05-11 12:21:21 +02:00
|
|
|
########### User specific
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2011-05-11 12:21:21 +02:00
|
|
|
match '/home/profile' => 'home#profile', :as => 'my_profile'
|
|
|
|
match '/home/ordergroup' => 'home#ordergroup', :as => 'my_ordergroup'
|
2012-07-31 18:21:42 +02:00
|
|
|
match '/home/cancel_membership' => 'home#cancel_membership', :as => 'cancel_membership'
|
2011-05-11 12:21:21 +02:00
|
|
|
|
|
|
|
############ Wiki
|
|
|
|
|
|
|
|
resources :pages do
|
|
|
|
get :all, :on => :collection
|
|
|
|
get :version, :on => :member
|
|
|
|
get :revert, :on => :member
|
|
|
|
end
|
2011-05-18 15:25:05 +02:00
|
|
|
match '/wiki/:permalink' => 'pages#show', :as => 'wiki_page' # , :constraints => {:permalink => /[^\s]+/}
|
2011-05-11 12:21:21 +02:00
|
|
|
match '/wiki' => 'pages#show', :defaults => {:permalink => 'Home'}, :as => 'wiki'
|
|
|
|
|
|
|
|
############ Orders, ordering
|
|
|
|
|
|
|
|
resources :orders do
|
|
|
|
member do
|
|
|
|
post :finish
|
|
|
|
post :add_comment
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-08-24 11:11:40 +02:00
|
|
|
resources :group_orders do
|
2011-06-19 15:30:33 +02:00
|
|
|
get :archive, :on => :collection
|
|
|
|
end
|
2011-05-11 12:21:21 +02:00
|
|
|
|
2011-06-19 20:47:27 +02:00
|
|
|
resources :order_comments, :only => [:new, :create]
|
|
|
|
|
2011-05-11 12:21:21 +02:00
|
|
|
############ Foodcoop orga
|
|
|
|
|
|
|
|
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
|
2011-05-11 12:21:21 +02:00
|
|
|
end
|
|
|
|
|
2011-05-18 14:47:17 +02:00
|
|
|
resources :messages, :only => [:index, :show, :new, :create]
|
2011-05-11 12:21:21 +02:00
|
|
|
|
|
|
|
namespace :foodcoop do
|
|
|
|
root :to => 'users#index'
|
|
|
|
|
|
|
|
resources :users, :only => [:index]
|
|
|
|
|
|
|
|
resources :ordergroups, :only => [:index]
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2011-05-16 00:34:43 +02:00
|
|
|
resources :workgroups, :only => [:index, :edit, :update]
|
2011-05-11 12:21:21 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
########### Article management
|
|
|
|
|
|
|
|
resources :stock_takings do
|
|
|
|
collection do
|
|
|
|
get :fill_new_stock_article_form
|
|
|
|
post :add_stock_article
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-05-11 15:14:39 +02:00
|
|
|
resources :stock_articles, :to => 'stockit' do
|
2011-05-11 12:21:21 +02:00
|
|
|
collection do
|
2011-05-27 14:09:01 +02:00
|
|
|
get :articles_search
|
2011-05-11 12:21:21 +02:00
|
|
|
get :fill_new_stock_article_form
|
|
|
|
end
|
2013-07-09 21:46:04 +02:00
|
|
|
|
2013-07-13 09:32:27 +02:00
|
|
|
get :history
|
2011-05-11 12:21:21 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
resources :suppliers do
|
|
|
|
get :shared_suppliers, :on => :collection
|
|
|
|
|
|
|
|
resources :deliveries do
|
|
|
|
post :drop_stock_change, :on => :member
|
|
|
|
post :add_stock_article, :on => :collection
|
|
|
|
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
|
2013-04-08 01:00:49 +02:00
|
|
|
post :update_synchronized
|
2011-05-11 12:21:21 +02:00
|
|
|
end
|
|
|
|
end
|
2011-05-11 14:21:06 +02:00
|
|
|
end
|
2011-05-11 12:21:21 +02:00
|
|
|
|
2011-05-11 14:21:06 +02:00
|
|
|
resources :article_categories
|
2011-05-11 12:21:21 +02:00
|
|
|
|
2011-05-11 14:21:06 +02:00
|
|
|
########### Finance
|
2011-05-11 12:21:21 +02:00
|
|
|
|
2011-05-11 14:21:06 +02:00
|
|
|
namespace :finance do
|
2012-11-10 16:44:05 +01:00
|
|
|
root :to => 'base#index'
|
2012-05-12 10:55:20 +02:00
|
|
|
|
|
|
|
resources :order, controller: 'balancing', path: 'balancing' do
|
|
|
|
member do
|
2013-03-17 15:47:50 +01:00
|
|
|
get :update_summary
|
2012-05-12 10:55:20 +02:00
|
|
|
get :edit_note
|
|
|
|
put :update_note
|
2012-07-27 18:03:46 +02:00
|
|
|
|
|
|
|
get :confirm
|
|
|
|
put :close
|
|
|
|
put :close_direct
|
2012-05-12 10:55:20 +02:00
|
|
|
end
|
2012-06-21 17:19:00 +02:00
|
|
|
|
|
|
|
resources :order_articles
|
2012-05-12 10:55:20 +02:00
|
|
|
end
|
|
|
|
|
2012-07-27 18:03:46 +02:00
|
|
|
resources :group_order_articles do
|
|
|
|
member do
|
|
|
|
put :update_result
|
|
|
|
end
|
|
|
|
end
|
2011-05-11 12:21:21 +02:00
|
|
|
|
2011-05-11 14:21:06 +02:00
|
|
|
resources :invoices
|
2011-05-11 12:21:21 +02:00
|
|
|
|
2011-06-09 21:35:05 +02:00
|
|
|
resources :ordergroups, :only => [:index] do
|
|
|
|
resources :financial_transactions, :as => :transactions
|
2011-05-11 12:21:21 +02:00
|
|
|
end
|
2011-06-09 21:35:05 +02: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 12:21:21 +02:00
|
|
|
|
2011-05-11 14:21:06 +02:00
|
|
|
########### Administration
|
2011-05-11 12:21:21 +02:00
|
|
|
|
2011-05-11 14:21:06 +02:00
|
|
|
namespace :admin do
|
|
|
|
root :to => 'base#index'
|
2011-05-11 12:21:21 +02:00
|
|
|
|
2011-05-11 14:21:06 +02:00
|
|
|
resources :users
|
2011-05-11 12:21:21 +02:00
|
|
|
|
2011-05-11 14:21:06 +02:00
|
|
|
resources :workgroups do
|
|
|
|
get :memberships, :on => :member
|
|
|
|
end
|
2011-05-11 12:21:21 +02:00
|
|
|
|
2011-05-11 14:21:06 +02:00
|
|
|
resources :ordergroups do
|
|
|
|
get :memberships, :on => :member
|
2011-05-11 12:21:21 +02:00
|
|
|
end
|
|
|
|
end
|
2011-05-11 13:38:46 +02:00
|
|
|
|
2011-05-11 15:14:39 +02:00
|
|
|
############## Feedback
|
|
|
|
|
|
|
|
resource :feedback, :only => [:new, :create], :controller => 'feedback'
|
|
|
|
|
2011-05-11 13:38:46 +02:00
|
|
|
############## The rest
|
|
|
|
|
2011-05-14 19:41:46 +02:00
|
|
|
resources :users, :only => [:index]
|
|
|
|
|
2012-10-08 11:51:56 +02:00
|
|
|
# TODO: This is very error prone. Better deactivate this catch all route
|
2012-09-30 21:38:52 +02:00
|
|
|
match ':controller(/:action(/:id))(.:format)'
|
2011-05-11 13:38:46 +02:00
|
|
|
|
|
|
|
end # End of /:foodcoop scope
|
2009-01-06 11:49:19 +01:00
|
|
|
end
|