OSDN Git Service

fix: any
[pettanr/pettanr.git] / config / routes.rb
index ad38cda..3ccb1e9 100644 (file)
@@ -1,17 +1,33 @@
 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
   
-  Manifest.manifest.system_resources.engine_resources.each do |engine_resource_name, engine_resource|
-    if engine_resource.add_route?
-      engine_resource.resource_items.each do |klass, 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 :folders do
+    new do
+      get :new
+    end
+    collection do
+      get :root
+      get :index
+      get :watch
+      get :show
+      post :create
+    end
+    member do
+      get :edit
+      put :update
+      delete :destroy
+    end
+  end
   resources :scrolls do
     new do
       get :new
@@ -19,23 +35,15 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
-      get :count
       post :create
     end
     member do
-      get :scroll_panels
-      get :panels
       get :by_author
       get :by_panel
-      get :scroll_panels_count
-      get :panels_count
-      get :count_by_author
-      get :count_by_panel
       get :play
       get :edit
       put :update
       delete :destroy
-      get :browse
     end
   end
   resources :scroll_panels do
@@ -50,8 +58,8 @@ Pettanr::Application.routes.draw do
     member do
       get :by_panel
       get :by_scroll
-      get :count_by_panel
-      get :count_by_scroll
+      get :by_author
+      get :play
       get :edit
       put :update
       delete :destroy
@@ -64,22 +72,35 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
-      get :count
       post :create
     end
     member do
-      get :stories
       get :by_author
-      get :by_me
-      get :stories_count
-      get :count_by_author
-      get :count_by_me
+      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
+    end
+  end
   resources :stories do
     new do
       get :new
@@ -90,16 +111,9 @@ Pettanr::Application.routes.draw do
       post :create
     end
     member do
-      get :story_sheets
-      get :sheets
       get :by_comic
       get :by_sheet
       get :by_author
-      get :story_sheets_count
-      get :sheets_count
-      get :count_by_comic
-      get :count_by_sheet
-      get :count_by_author
       get :play
       get :edit
       put :update
@@ -118,8 +132,7 @@ Pettanr::Application.routes.draw do
     member do
       get :by_story
       get :by_sheet
-      get :count_by_story
-      get :count_by_sheet
+      get :by_author
       get :edit
       put :update
       delete :destroy
@@ -132,7 +145,6 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
-      get :count
       post :create
     end
     member do
@@ -143,13 +155,6 @@ Pettanr::Application.routes.draw do
       get :by_story
       get :by_panel
       get :by_author
-      get :story_sheets_count
-      get :stories_count
-      get :sheet_panels_count
-      get :panels_count
-      get :count_by_story
-      get :count_by_panel
-      get :count_by_author
       get :play
       get :edit
       put :update
@@ -168,8 +173,7 @@ Pettanr::Application.routes.draw do
     member do
       get :by_sheet
       get :by_panel
-      get :count_by_sheet
-      get :count_by_panel
+      get :by_author
       get :edit
       put :update
       delete :destroy
@@ -182,33 +186,13 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
-      get :count
       post :create
     end
     member do
-      get :scroll_panels
-      get :scrolls
-      get :sheet_panels
-      get :sheets
-      get :panel_pictures
-      get :speech_balloons
-      get :ground_pictures
-      get :ground_colors
       get :by_scroll
       get :by_sheet
       get :by_author
-      get :scroll_panels_count
-      get :scrolls_count
-      get :sheet_panels_count
-      get :sheets_count
-      get :panel_pictures_count
-      get :speech_balloons_count
-      get :ground_pictures_count
-      get :ground_colors_count
-      get :count_by_scroll
-      get :count_by_sheet
-      get :count_by_author
-      get :catch
+      get :by_speech_balloon_template
       get :edit
       put :update
       delete :destroy
@@ -226,8 +210,6 @@ Pettanr::Application.routes.draw do
     member do
       get :by_panel
       get :by_author
-      get :count_by_panel
-      get :count_by_author
       get :edit
       put :update
       delete :destroy
@@ -245,9 +227,7 @@ Pettanr::Application.routes.draw do
     member do
       get :by_panel
       get :by_author
-      #get :by_speech_balloon_template
-      get :count_by_panel
-      get :count_by_author
+      get :by_speech_balloon_template
       get :edit
       put :update
       delete :destroy
@@ -259,9 +239,10 @@ Pettanr::Application.routes.draw do
       get :show
     end
     member do
+      get :by_author
       get :by_speech_balloon
-      #get :by_system_picture
-      get :count_by_speech_balloon
+      get :by_speech_balloon_template
+      get :by_system_picture
       get :edit
       put :update
     end
@@ -272,10 +253,11 @@ Pettanr::Application.routes.draw do
       get :show
     end
     member do
+      get :by_author
       get :by_speech_balloon
+      get :by_author
+      get :by_speech_balloon_template
       get :by_writing_format
-      get :count_by_speech_balloon
-      get :count_by_writing_format
       get :edit
       put :update
     end
@@ -291,8 +273,6 @@ Pettanr::Application.routes.draw do
     member do
       get :by_panel
       get :by_author
-      get :count_by_panel
-      get :count_by_author
       get :edit
       put :update
       delete :destroy
@@ -309,8 +289,6 @@ Pettanr::Application.routes.draw do
     member do
       get :by_panel
       get :by_author
-      get :count_by_panel
-      get :count_by_author
       get :edit
       put :update
       delete :destroy
@@ -338,11 +316,10 @@ Pettanr::Application.routes.draw do
       get :show
       get :credit
       get :search
-      get :list
     end
     member do
+      get :by_artist
       get :credit
-      get :browse
     end
   end
   resources :resource_pictures do
@@ -351,31 +328,37 @@ Pettanr::Application.routes.draw do
       get :show
       get :new
       post :create
-      get :count
     end
     member do
+      get :by_original_picture
+      get :by_license_group
       get :by_license
-        get :by_license_group
       get :by_artist
-      get :count_by_license
-        get :count_by_license_group
-      get :count_by_artist
       delete :destroy
       get :credit
     end
   end
+  resources :resource_picture_pictures do
+    collection do
+      get :index
+      get :show
+    end
+    member do
+      get :by_original_picture
+      get :by_resource_picture
+      get :by_picture
+    end
+  end
   resources :speech_balloon_templates do
     collection do
       get :index
       get :show
+      post :create
     end
     member do
-      get :speech_balloons
-      get :panels
+      get :by_panel
       get :by_system_picture
-      get :speech_balloons_count
-      get :panels_count
-      get :count_by_system_picture
+      put :update
       delete :destroy
     end
   end
@@ -383,22 +366,25 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      post :create
     end
     member do
       get :speeches
       get :by_system_picture
       get :speeches_count
-      get :count_by_system_picture
+      put :update
+      delete :destroy
     end
   end
   resources :license_groups do
     collection do
       get :index
       get :show
+      post :create
     end
     member do
-      get :licenses
-      get :licenses_count
+      get :by_resource_picture
+      put :update
       delete :destroy
     end
   end
@@ -407,14 +393,15 @@ Pettanr::Application.routes.draw do
       get :index
       get :show
       get :search
+      post :create
     end
     member do
       get :resource_pictures
       get :by_license_group
       get :by_system_picture
       get :resource_pictures_count
-      get :count_by_license_group
-      get :count_by_system_picture
+      put :update
+      delete :destroy
     end
   end
   resources :authors do
@@ -424,34 +411,9 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
-      get :count
       post :create
     end
     member do
-      get :scrolls
-      get :scroll_panels
-      get :comics
-      get :stories
-      get :story_sheets
-      get :sheets
-      get :sheet_panels
-      get :panels
-      get :panel_pictures
-      get :speech_balloons
-      get :ground_pictures
-      get :ground_colors
-      get :scrolls_count
-      get :scroll_panels_count
-      get :comics_count
-      get :stories_count
-      get :story_sheets_count
-      get :sheets_count
-      get :sheet_panels_count
-      get :panels_count
-      get :panel_pictures_count
-      get :speech_balloons_count
-      get :ground_pictures_count
-      get :ground_colors_count
       get :edit
       put :update
       delete :destroy
@@ -464,12 +426,9 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
-      get :count
       post :create
     end
     member do
-      get :resource_pictures
-      get :resource_pictures_count
       get :edit
       put :update
       delete :destroy
@@ -484,8 +443,6 @@ Pettanr::Application.routes.draw do
       #get :balloons
       get :speech_balloon_templates
       get :licenses
-      get :speech_balloon_templates_count
-      get :licenses_count
       delete :destroy
     end
   end
@@ -497,6 +454,14 @@ Pettanr::Application.routes.draw 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
@@ -582,9 +547,9 @@ Pettanr::Application.routes.draw do
   # 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:
@@ -635,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