foodsoft/config/routes.rb

200 lines
4.7 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"
root :to => redirect("/#{FoodsoftConfig.scope}")
scope '/:foodcoop' do
# Root path
root :to => 'home#index'
########### Sessions
match '/login' => 'sessions#new', :as => 'login'
match '/logout' => 'sessions#destroy', :as => 'logout'
get '/login/new_password' => 'login#new_password', as: :new_password
match '/login/accept_invitation/:token' => 'login#accept_invitation', as: :accept_invitation
resources :sessions, :only => [:new, :create, :destroy]
########### User specific
2009-01-06 11:49:19 +01: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'
############ 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]+/}
match '/wiki' => 'pages#show', :defaults => {:permalink => 'Home'}, :as => 'wiki'
############ Orders, ordering
resources :orders do
member do
post :finish
post :add_comment
end
end
resources :group_orders do
get :archive, :on => :collection
end
2011-06-19 20:47:27 +02:00
resources :order_comments, :only => [:new, :create]
############ 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
end
resources :messages, :only => [:index, :show, :new, :create]
namespace :foodcoop do
root :to => 'users#index'
resources :users, :only => [:index]
resources :ordergroups, :only => [:index]
2009-01-06 11:49:19 +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
resources :stock_article_selections, :controller => 'stockit_selections',
:only => [ :create, :show, :index, :destroy ], :path => "/stock_articles/selections" do
member do
delete 'articles'
end
2013-01-28 20:46:35 +01:00
collection do
delete 'finished'
end
end
resources :stock_articles, :to => 'stockit' do
collection do
get :articles_search
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 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
root :to => 'base#index'
2012-05-12 10:55:20 +02:00
resources :order, controller: 'balancing', path: 'balancing' do
member do
get :edit_note
put :update_note
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
resources :group_order_articles do
member do
put :update_result
end
end
2011-05-11 14:21:06 +02:00
resources :invoices
resources :ordergroups, :only => [:index] do
resources :financial_transactions, :as => :transactions
end
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
root :to => 'base#index'
2011-05-11 14:21:06 +02:00
resources :users
2011-05-11 14:21:06 +02:00
resources :workgroups do
get :memberships, :on => :member
end
2011-05-11 14:21:06 +02:00
resources :ordergroups do
get :memberships, :on => :member
end
end
############## Feedback
resource :feedback, :only => [:new, :create], :controller => 'feedback'
############## The rest
resources :users, :only => [:index]
# 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)'
end # End of /:foodcoop scope
2009-01-06 11:49:19 +01:00
end