X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=config%2Froutes.rb;h=f984d8efb5393d28b3725945bd17b66088d465c5;hb=93b359296a4d2da735cf200bea2476c2dffcee3f;hp=2567080ba6f040851e4257365110ad83e699f55c;hpb=d45ca752c4e6e180bc551a5277710b9e4d4d075f;p=pettanr%2Fpettanr.git diff --git a/config/routes.rb b/config/routes.rb index 2567080b..f984d8ef 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,25 +1,239 @@ Pettanr::Application.routes.draw do + devise_for :users , :controllers => { :registrations => "user_registrations" } devise_for :admins - devise_for :authors - - match 'original_pictures/:id(.:format)/refresh' => 'original_pictures#refresh' - - resources :artists, except: [:new, :edit] - resources :speaches, only: [:index] - resources :balloons, only: [:index] - resources :speach_templates, only: [:index] - resources :balloon_templates, only: [:index] - resources :speach_balloons, except: [:new, :edit] - resources :panel_pictures, only: [:index] - resources :resource_pictures, only: [:index, :show] - resources :original_pictures, except: [:new] - resources :panels, except: [:new, :edit] - resources :comics, except: [:new, :edit] - resources :lisences, only: [:index] - resources :original_lisences - resources :common_lisences - resources :system_pictures, except: [:new, :edit] + + Pettanr::Application.licenses.each do |name, klass| + mount Module.const_get(klass)::Engine => "/#{name}" + end + + resources :authors do + collection do + get :index + get :show + get :count + post :create + get :list + get :browse + end + member do + put :update + delete :destroy + end + end + resources :artists do + collection do + get :index + get :show + get :count + post :create + get :list + get :browse + end + member do + put :update + delete :destroy + end + end + resources :speech_balloon_templates do + collection do + get :index + get :show + get :list + get :browse + end + member do + delete :destroy + end + end + resources :speeches do + collection do + get :list + get :browse + end + member do + end + end + resources :balloons do + collection do + get :list + get :browse + end + member do + end + end + resources :speech_balloons do + collection do + get :list + get :browse + end + member do + end + end + resources :panel_pictures do + collection do + get :index + get :show + get :list + get :browse + end + member do + end + end + resources :pictures do + collection do + get :show + end + member do + get :credit + end + end + resources :resource_pictures do + collection do + get :index + get :new + get :show + post :create + get :count + get :list + get :browse + end + member do + get :credit + end + end + resources :original_pictures do + new do + get :new + end + collection do + get :index + get :show + get :history + post :create + get :list + get :browse + end + member do + get :edit + put :update + delete :destroy + end + end + resources :original_picture_license_groups do + new do + get :new + end + collection do + post :create + end + end + resources :colors do + collection do + get :index + end + member do + end + end + resources :panel_colors do + collection do + get :index + end + member do + end + end + resources :ground_colors do + collection do + get :index + end + member do + end + end + resources :ground_pictures do + collection do + get :index + end + member do + end + end + resources :panels do + new do + get :new + end + collection do + get :index + get :show + get :count + post :create + get :list + get :browse + end + member do + put :update + delete :destroy + end + end + resources :stories do + new do + get :new + end + collection do + get :show + post :create + get :list + get :browse + end + member do + put :update + delete :destroy + end + end + resources :comics do + new do + get :new + end + collection do + get :index + get :show + get :count + post :create + get :list + get :browse + end + member do + put :update + delete :destroy + end + end + resources :licenses do + collection do + get :index + get :show + get :list + get :browse + end + end + resources :license_groups do + collection do + get :index + get :show + get :list + get :browse + end + end + resources :system_pictures do + collection do + get :index + get :show + post :create + get :list + get :browse + end + member do + put :update + delete :destroy + end + end # The priority is based upon order of creation: # first created -> highest priority. @@ -27,16 +241,12 @@ Pettanr::Application.routes.draw do # Sample of regular route: # match 'products/:id' => 'catalog#view' # Keep in mind you can assign values other than :controller and :action - match 'comics/:id(.:format)/play' => 'comics#play' match 'resource_pictures/:subdir/:id(.:format)/' => 'resource_pictures#show' + match 'pictures/:subdir/:id(.:format)/' => 'pictures#show' + match 'stories/comic/:id(.:format)' => 'stories#comic' match 'home/(:action)', :controller => 'home' - match 'help/(:action)', :controller => 'help' match 'system/(:action)', :controller => 'system' -# controller 'system' do -# get 'start' -# get 'index' -## match 'start', :to => 'system#start' -# end + match 'authors/(:action(/:id))', :controller => 'authors' # Sample of named route: # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase @@ -86,5 +296,5 @@ Pettanr::Application.routes.draw do # This is a legacy wild controller route that's not recommended for RESTful applications. # Note: This route will make all actions in every controller accessible via GET requests. -# match ':controller(/:action(/:id(.:format)))' + #match ':controller(/:action(/:id(.:format)))' end