OSDN Git Service

fix manifest
[pettanr/pettanr.git] / config / routes.rb
index 604cd7b..36da091 100644 (file)
@@ -4,13 +4,31 @@ Pettanr::Application.routes.draw do
   devise_for :admins
   devise_for :demand_users
   
-  Pettanr::Application.manifest.system_resources.license_groups.each do |klass, name|
-    mount Module.const_get(klass)::Engine => "/#{name}"
-  end
-  Pettanr::Application.manifest.system_resources.speech_balloon_templates.each do |klass , name|
-    mount Module.const_get(klass)::Engine => "/#{name}"
+  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|
+        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 :show
+      get :count
+      post :create
+    end
+    member do
+      get :edit
+      put :update
+      delete :destroy
+    end
+  end
   resources :scrolls do
     new do
       get :new
@@ -22,10 +40,10 @@ Pettanr::Application.routes.draw do
       post :create
     end
     member do
-      get :scroll_panels
-      get :panels
       get :by_author
       get :by_panel
+      get :count_by_author
+      get :count_by_panel
       get :play
       get :edit
       put :update
@@ -40,11 +58,16 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
       post :create
     end
     member do
       get :by_panel
       get :by_scroll
+      get :by_author
+      get :count_by_panel
+      get :count_by_scroll
+      get :count_by_author
       get :edit
       put :update
       delete :destroy
@@ -61,14 +84,38 @@ Pettanr::Application.routes.draw do
       post :create
     end
     member do
-      get :stories
       get :by_author
+      get :by_story
+      get :count_by_author
+      get :count_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
+      get :count
+      post :create
+    end
+    member do
+      get :by_comic
+      get :by_story
+      get :by_author
+      get :count_by_comic
+      get :count_by_story
+      get :count_by_author
+      get :edit
+      put :update
+      delete :destroy
+    end
+  end
   resources :stories do
     new do
       get :new
@@ -76,13 +123,16 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
       post :create
     end
     member do
-      get :story_sheets
-      get :sheets
+      get :by_comic
       get :by_sheet
       get :by_author
+      get :count_by_comic
+      get :count_by_sheet
+      get :count_by_author
       get :play
       get :edit
       put :update
@@ -96,11 +146,16 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
       post :create
     end
     member do
       get :by_story
       get :by_sheet
+      get :by_author
+      get :count_by_story
+      get :count_by_sheet
+      get :count_by_author
       get :edit
       put :update
       delete :destroy
@@ -124,6 +179,9 @@ Pettanr::Application.routes.draw do
       get :by_story
       get :by_panel
       get :by_author
+      get :count_by_story
+      get :count_by_panel
+      get :count_by_author
       get :play
       get :edit
       put :update
@@ -137,11 +195,16 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
       post :create
     end
     member do
       get :by_sheet
       get :by_panel
+      get :by_author
+      get :count_by_sheet
+      get :count_by_panel
+      get :count_by_author
       get :edit
       put :update
       delete :destroy
@@ -158,17 +221,14 @@ Pettanr::Application.routes.draw do
       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 :by_speech_balloon_template
+      get :count_by_scroll
+      get :count_by_sheet
+      get :count_by_author
+      get :count_by_speech_balloon_template
       get :catch
       get :edit
       put :update
@@ -182,11 +242,14 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
       post :create
     end
     member do
       get :by_panel
       get :by_author
+      get :count_by_panel
+      get :count_by_author
       get :edit
       put :update
       delete :destroy
@@ -199,11 +262,16 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
       post :create
     end
     member do
       get :by_panel
       get :by_author
+      get :by_speech_balloon_template
+      get :count_by_panel
+      get :count_by_author
+      get :count_by_speech_balloon_template
       get :edit
       put :update
       delete :destroy
@@ -213,18 +281,26 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
     end
     member do
-      #get :by_system_picture
+      get :by_author
+      get :count_by_author
+      get :edit
+      put :update
     end
   end
   resources :speeches do
     collection do
       get :index
       get :show
+      get :count
     end
     member do
-      get :by_writing_format
+      get :by_author
+      get :count_by_author
+      get :edit
+      put :update
     end
   end
   resources :ground_pictures do
@@ -234,10 +310,13 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
     end
     member do
       get :by_panel
       get :by_author
+      get :count_by_panel
+      get :count_by_author
       get :edit
       put :update
       delete :destroy
@@ -250,10 +329,13 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
     end
     member do
       get :by_panel
       get :by_author
+      get :count_by_panel
+      get :count_by_author
       get :edit
       put :update
       delete :destroy
@@ -266,6 +348,7 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
       post :create
     end
     member do
@@ -277,28 +360,32 @@ Pettanr::Application.routes.draw do
   end
   resources :pictures do
     collection do
+      get :index
       get :show
+      get :count
       get :credit
       get :search
-      get :list
     end
     member do
+      get :by_artist
+      get :count_by_artist
       get :credit
-      get :browse
     end
   end
   resources :resource_pictures do
     collection do
       get :index
       get :show
+      get :count
       get :new
       post :create
       get :count
     end
     member do
       get :by_license
-        get :by_license_group
-      get :artist
+      get :by_artist
+      get :count_by_license
+      get :count_by_artist
       delete :destroy
       get :credit
     end
@@ -307,11 +394,15 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
+      post :create
     end
     member do
-      get :speech_balloons
-      get :panels
+      get :by_panel
       get :by_system_picture
+      get :count_by_system_picture
+      get :count_by_panel
+      put :update
       delete :destroy
     end
   end
@@ -319,19 +410,29 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
+      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
+      get :count
+      post :create
     end
     member do
       get :licenses
+      get :licenses_count
+      put :update
       delete :destroy
     end
   end
@@ -339,12 +440,19 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
       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
@@ -358,18 +466,6 @@ Pettanr::Application.routes.draw do
       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 :edit
       put :update
       delete :destroy
@@ -386,7 +482,6 @@ Pettanr::Application.routes.draw do
       post :create
     end
     member do
-      get :resource_pictures
       get :edit
       put :update
       delete :destroy
@@ -396,11 +491,14 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
     end
     member do
       #get :balloons
       get :speech_balloon_templates
       get :licenses
+      get :speech_balloon_templates_count
+      get :licenses_count
       delete :destroy
     end
   end
@@ -492,8 +590,10 @@ 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'