2011-05-11 12:21:21 +02:00
|
|
|
Foodsoft::Application.routes.draw do
|
2010-03-20 02:26:30 +01:00
|
|
|
|
2011-05-11 13:38:46 +02:00
|
|
|
get "sessions/new"
|
|
|
|
|
2010-03-20 13:45:58 +01:00
|
|
|
# Use routing filter to select foodcoop config and datbase
|
2011-05-11 12:21:21 +02:00
|
|
|
# filter :foodcoop
|
2009-01-29 01:57:51 +01:00
|
|
|
|
2011-05-11 13:38:46 +02:00
|
|
|
root :to => redirect("/#{Foodsoft.env}")
|
|
|
|
|
2011-05-11 12:21:21 +02:00
|
|
|
scope '/:foodcoop', :defaults => { :foodcoop => Foodsoft.env } 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'
|
|
|
|
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'
|
|
|
|
|
2011-05-11 13:38:46 +02:00
|
|
|
|
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
|
|
|
|
match '/wiki/:permalink' => 'pages#show', :constraints => {:permalink => /[^\s]+/}, :as => 'wiki_page'
|
|
|
|
match '/wiki' => 'pages#show', :defaults => {:permalink => 'Home'}, :as => 'wiki'
|
|
|
|
|
|
|
|
############ Orders, ordering
|
|
|
|
|
|
|
|
resources :orders do
|
|
|
|
member do
|
|
|
|
post :finish
|
|
|
|
post :add_comment
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
match '/ordering/myOrders' => 'ordering#myOrders', :as => 'my_orders'
|
|
|
|
match '/ordering' => 'ordering#index', :as => 'ordering'
|
|
|
|
|
|
|
|
############ Foodcoop orga
|
|
|
|
|
|
|
|
resources :invites, :only => [:new, :create]
|
|
|
|
|
|
|
|
resources :tasks do
|
|
|
|
collection do
|
|
|
|
get :user
|
|
|
|
get :archive
|
|
|
|
get :workgroup
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
resources :messages, :only => [:index, :show, :new, :create] do
|
|
|
|
member do
|
|
|
|
get :reply
|
|
|
|
get :user
|
|
|
|
get :group
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
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-11 12:21:21 +02:00
|
|
|
resources :workgroups, :only => [:index, :edit, :update] do
|
|
|
|
get :memberships, :on => :member
|
|
|
|
end
|
|
|
|
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
|
|
|
|
get :auto_complete_for_article_name
|
|
|
|
get :fill_new_stock_article_form
|
|
|
|
end
|
|
|
|
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
|
|
|
|
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
|
|
|
|
root :to => 'balancing#index'
|
|
|
|
match 'balancing/list' => 'balancing#list', :as => 'balancing'
|
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-05-11 14:21:06 +02:00
|
|
|
resources :transactions do
|
|
|
|
collection do
|
|
|
|
get :new_collection
|
|
|
|
post :create_collection
|
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
|
|
|
########### 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
|
|
|
|
|
|
|
|
match '/:controller(/:action(/:id))'
|
|
|
|
|
|
|
|
end # End of /:foodcoop scope
|
2009-01-06 11:49:19 +01:00
|
|
|
end
|