X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=config%2Froutes.rb;h=3ccb1e9402622856a09aeb0c9eb4d0a63f3c9673;hb=0bdfae60dc58932c99849c31d36ee5d7715db782;hp=ec569e81383f905e4bf6c1ae4259bca795bb90b5;hpb=6c938eed3fda5fc01d2af0ea771a0b219b243e8b;p=pettanr%2Fpettanr.git diff --git a/config/routes.rb b/config/routes.rb index ec569e81..3ccb1e94 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,58 +1,68 @@ Pettanr::Application.routes.draw do - - devise_for :users + devise_for :users, controllers: {sessions: 'user_sessions', omniauth_callbacks: "omniauth_callbacks"} devise_for :admins devise_for :demand_users - Pettanr::Application.licenses.each do |name, klass| - mount Module.const_get(klass)::Engine => "/#{name}" - end - Pettanr::Application.speech_balloons.each do |klass , name| - mount Module.const_get(klass)::Engine => "/#{name}" + Manifest.manifest.system_resources.templates.each do |template_name, template| + if template.add_route? + template.template_items.each do |klass, name| + mount Module.const_get(klass)::Engine => "/#{name}" + end + end end - resources :authors do + resources :folders do new do get :new end collection do + get :root get :index + get :watch get :show - get :count post :create - get :list end member do get :edit put :update delete :destroy - get :browse - get :comics - get :stories - get :panels - get :panel_pictures - get :speech_balloons - get :ground_pictures - get :ground_colors end end - resources :artists do + resources :scrolls do new do get :new end collection do get :index get :show - get :count post :create - get :list end member do + get :by_author + get :by_panel + get :play + get :edit + put :update + delete :destroy + end + end + resources :scroll_panels do + new do + get :new + end + collection do + get :index + get :show + post :create + end + member do + get :by_panel + get :by_scroll + get :by_author + get :play get :edit put :update delete :destroy - get :browse - get :resource_pictures end end resources :comics do @@ -62,15 +72,33 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create - get :list end member do + get :by_author + get :by_story + get :play + get :edit + put :update + delete :destroy + end + end + resources :comic_stories do + new do + get :new + end + collection do + get :index + get :show + post :create + end + member do + get :by_comic + get :by_story + get :by_author get :edit put :update delete :destroy - get :browse end end resources :stories do @@ -81,35 +109,36 @@ Pettanr::Application.routes.draw do get :index get :show post :create - get :list end member do + get :by_comic + get :by_sheet + get :by_author + get :play get :edit - get :comic put :update delete :destroy - get :browse end end - resources :scrolls do + resources :story_sheets do new do get :new end collection do get :index get :show - get :count post :create - get :list end member do + get :by_story + get :by_sheet + get :by_author get :edit put :update delete :destroy - get :browse end end - resources :scroll_panels do + resources :sheets do new do get :new end @@ -117,14 +146,37 @@ Pettanr::Application.routes.draw do get :index get :show post :create - get :list end member do + get :story_sheets + get :stories + get :sheet_panels + get :panels + get :by_story + get :by_panel + get :by_author + get :play + get :edit + put :update + delete :destroy + end + end + resources :sheet_panels do + new do + get :new + end + collection do + get :index + get :show + post :create + end + member do + get :by_sheet + get :by_panel + get :by_author get :edit - get :scroll put :update delete :destroy - get :browse end end resources :panels do @@ -134,16 +186,16 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create - get :list end member do - get :catch + get :by_scroll + get :by_sheet + get :by_author + get :by_speech_balloon_template get :edit put :update delete :destroy - get :browse end end resources :panel_pictures do @@ -154,13 +206,13 @@ Pettanr::Application.routes.draw do get :index get :show post :create - get :list end member do + get :by_panel + get :by_author get :edit put :update delete :destroy - get :browse end end resources :speech_balloons do @@ -171,36 +223,46 @@ Pettanr::Application.routes.draw do get :index get :show post :create - get :list end member do + get :by_panel + get :by_author + get :by_speech_balloon_template get :edit put :update delete :destroy - get :browse end end resources :balloons do collection do get :index get :show - get :list end member do - get :browse + get :by_author + get :by_speech_balloon + get :by_speech_balloon_template + get :by_system_picture + get :edit + put :update end end resources :speeches do collection do get :index get :show - get :list end member do - get :browse + get :by_author + get :by_speech_balloon + get :by_author + get :by_speech_balloon_template + get :by_writing_format + get :edit + put :update end end - resources :ground_colors do + resources :ground_pictures do new do get :new end @@ -209,13 +271,14 @@ Pettanr::Application.routes.draw do get :show end member do + get :by_panel + get :by_author get :edit put :update delete :destroy - get :browse end end - resources :ground_pictures do + resources :ground_colors do new do get :new end @@ -224,10 +287,11 @@ Pettanr::Application.routes.draw do get :show end member do + get :by_panel + get :by_author get :edit put :update delete :destroy - get :browse end end resources :original_pictures do @@ -238,14 +302,24 @@ Pettanr::Application.routes.draw do get :index get :show post :create - get :list end member do get :edit put :update delete :destroy get :history - get :browse + end + end + resources :pictures do + collection do + get :index + get :show + get :credit + get :search + end + member do + get :by_artist + get :credit end end resources :resource_pictures do @@ -254,35 +328,63 @@ Pettanr::Application.routes.draw do get :show get :new post :create - get :count - get :list end member do + get :by_original_picture + get :by_license_group + get :by_license + get :by_artist delete :destroy get :credit - get :browse end end - resources :pictures do + resources :resource_picture_pictures do collection do + get :index get :show - get :credit - get :search - get :list end member do - get :credit - get :browse + get :by_original_picture + get :by_resource_picture + get :by_picture end end resources :speech_balloon_templates do collection do get :index get :show - get :list + post :create end member do - get :browse + get :by_panel + get :by_system_picture + put :update + delete :destroy + end + end + resources :writing_formats do + collection do + get :index + get :show + post :create + end + member do + get :speeches + get :by_system_picture + get :speeches_count + put :update + delete :destroy + end + end + resources :license_groups do + collection do + get :index + get :show + post :create + end + member do + get :by_resource_picture + put :update delete :destroy end end @@ -291,42 +393,75 @@ Pettanr::Application.routes.draw do get :index get :show get :search - get :list + post :create end member do - get :browse + get :resource_pictures + get :by_license_group + get :by_system_picture + get :resource_pictures_count + put :update + delete :destroy end end - resources :license_groups do + resources :authors do + new do + get :new + end collection do get :index get :show - get :list + post :create end member do - get :browse + get :edit + put :update delete :destroy end end - resources :original_picture_license_groups do + resources :artists do new do - post :new + get :new end collection do + get :index + get :show post :create end + member do + get :edit + put :update + delete :destroy + end end resources :system_pictures do collection do get :index get :show - get :list end member do - get :browse + #get :balloons + get :speech_balloon_templates + get :licenses delete :destroy end end + resources :original_picture_license_groups do + new do + post :new + end + collection do + post :create + end + end + resources :original_picture_licenses do + new do + post :new + end + collection do + post :create + end + end resources :provider_sources do collection do get :index @@ -407,12 +542,14 @@ 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 'resource_pictures/:subdir/:id(.:format)/' => 'resource_pictures#show' - match 'pictures/:subdir/:id(.:format)/' => 'pictures#show' + + # resource_pictures/1.png?subdir=full + # match 'resource_pictures/full/:id(.:format)/' => 'resource_pictures#show' + # match 'pictures/:subdir/:id(.:format)/' => 'pictures#show' #match 'scroll_panels/scroll/:id(.:format)' => 'scroll_panels#scroll' - match 'top/(:action)', :controller => 'top' - match 'home/(:action)', :controller => 'home' - match 'system/(:action)', :controller => 'system' + match 'top/(:action)', :controller => 'top', via: [:get] + match 'home/(:action)', :controller => 'home', via: [:get] + match 'system/(:action)', :controller => 'system', via: [:get, :post] #match 'authors/(:action(/:id))', :controller => 'authors' # Sample of named route: @@ -463,5 +600,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)))', via: [:get, :post] end