OSDN Git Service

a6af26d5e711d1f58502989ebc0b3b888f5b90bb
[pettanr/pettanr.git] / config / routes.rb
1 Pettanr::Application.routes.draw do
2
3   devise_for :users
4   devise_for :admins
5   devise_for :demand_users
6   
7   Manifest.manifest.system_resources.engine_resources.each do |engine_resource_name, engine_resource|
8     if engine_resource.add_route?
9       engine_resource.resource_items.each do |klass, name|
10         mount Module.const_get(klass)::Engine => "/#{name}"
11       end
12     end
13   end
14   
15   resources :folders do
16     new do
17       get :new
18     end
19     collection do
20       get :root
21       get :index
22       get :show
23       get :count
24       post :create
25     end
26     member do
27       get :edit
28       put :update
29       delete :destroy
30     end
31   end
32   resources :scrolls do
33     new do
34       get :new
35     end
36     collection do
37       get :index
38       get :show
39       get :count
40       post :create
41     end
42     member do
43       get :by_author
44       get :by_panel
45       get :count_by_author
46       get :count_by_panel
47       get :play
48       get :edit
49       put :update
50       delete :destroy
51       get :browse
52     end
53   end
54   resources :scroll_panels do
55     new do
56       get :new
57     end
58     collection do
59       get :index
60       get :show
61       get :count
62       post :create
63     end
64     member do
65       get :by_panel
66       get :by_scroll
67       get :by_author
68       get :count_by_panel
69       get :count_by_scroll
70       get :count_by_author
71       get :edit
72       put :update
73       delete :destroy
74     end
75   end
76   resources :comics do
77     new do
78       get :new
79     end
80     collection do
81       get :index
82       get :show
83       get :count
84       post :create
85     end
86     member do
87       get :by_author
88       get :by_story
89       get :count_by_author
90       get :count_by_story
91       get :play
92       get :edit
93       put :update
94       delete :destroy
95     end
96   end
97   resources :comic_stories do
98     new do
99       get :new
100     end
101     collection do
102       get :index
103       get :show
104       get :count
105       post :create
106     end
107     member do
108       get :by_comic
109       get :by_story
110       get :by_author
111       get :count_by_comic
112       get :count_by_story
113       get :count_by_author
114       get :edit
115       put :update
116       delete :destroy
117     end
118   end
119   resources :stories do
120     new do
121       get :new
122     end
123     collection do
124       get :index
125       get :show
126       get :count
127       post :create
128     end
129     member do
130       get :by_comic
131       get :by_sheet
132       get :by_author
133       get :count_by_comic
134       get :count_by_sheet
135       get :count_by_author
136       get :play
137       get :edit
138       put :update
139       delete :destroy
140     end
141   end
142   resources :story_sheets do
143     new do
144       get :new
145     end
146     collection do
147       get :index
148       get :show
149       get :count
150       post :create
151     end
152     member do
153       get :by_story
154       get :by_sheet
155       get :by_author
156       get :count_by_story
157       get :count_by_sheet
158       get :count_by_author
159       get :edit
160       put :update
161       delete :destroy
162     end
163   end
164   resources :sheets do
165     new do
166       get :new
167     end
168     collection do
169       get :index
170       get :show
171       get :count
172       post :create
173     end
174     member do
175       get :story_sheets
176       get :stories
177       get :sheet_panels
178       get :panels
179       get :by_story
180       get :by_panel
181       get :by_author
182       get :story_sheets_count
183       get :stories_count
184       get :sheet_panels_count
185       get :panels_count
186       get :count_by_story
187       get :count_by_panel
188       get :count_by_author
189       get :play
190       get :edit
191       put :update
192       delete :destroy
193     end
194   end
195   resources :sheet_panels do
196     new do
197       get :new
198     end
199     collection do
200       get :index
201       get :show
202       get :count
203       post :create
204     end
205     member do
206       get :by_sheet
207       get :by_panel
208       get :by_author
209       get :count_by_sheet
210       get :count_by_panel
211       get :count_by_author
212       get :edit
213       put :update
214       delete :destroy
215     end
216   end
217   resources :panels do
218     new do
219       get :new
220     end
221     collection do
222       get :index
223       get :show
224       get :count
225       post :create
226     end
227     member do
228       get :scroll_panels
229       get :scrolls
230       get :sheet_panels
231       get :sheets
232       get :panel_pictures
233       get :speech_balloons
234       get :ground_pictures
235       get :ground_colors
236       get :by_scroll
237       get :by_sheet
238       get :by_author
239       get :scroll_panels_count
240       get :scrolls_count
241       get :sheet_panels_count
242       get :sheets_count
243       get :panel_pictures_count
244       get :speech_balloons_count
245       get :ground_pictures_count
246       get :ground_colors_count
247       get :count_by_scroll
248       get :count_by_sheet
249       get :count_by_author
250       get :catch
251       get :edit
252       put :update
253       delete :destroy
254     end
255   end
256   resources :panel_pictures do
257     new do
258       get :new
259     end
260     collection do
261       get :index
262       get :show
263       get :count
264       post :create
265     end
266     member do
267       get :by_panel
268       get :by_author
269       get :count_by_panel
270       get :count_by_author
271       get :edit
272       put :update
273       delete :destroy
274     end
275   end
276   resources :speech_balloons do
277     new do
278       get :new
279     end
280     collection do
281       get :index
282       get :show
283       get :count
284       post :create
285     end
286     member do
287       get :by_panel
288       get :by_author
289       #get :by_speech_balloon_template
290       get :count_by_panel
291       get :count_by_author
292       get :edit
293       put :update
294       delete :destroy
295     end
296   end
297   resources :balloons do
298     collection do
299       get :index
300       get :show
301       get :count
302     end
303     member do
304       get :by_speech_balloon
305       #get :by_system_picture
306       get :count_by_speech_balloon
307       get :edit
308       put :update
309     end
310   end
311   resources :speeches do
312     collection do
313       get :index
314       get :show
315       get :count
316     end
317     member do
318       get :by_speech_balloon
319       get :by_writing_format
320       get :count_by_speech_balloon
321       get :count_by_writing_format
322       get :edit
323       put :update
324     end
325   end
326   resources :ground_pictures do
327     new do
328       get :new
329     end
330     collection do
331       get :index
332       get :show
333       get :count
334     end
335     member do
336       get :by_panel
337       get :by_author
338       get :count_by_panel
339       get :count_by_author
340       get :edit
341       put :update
342       delete :destroy
343     end
344   end
345   resources :ground_colors do
346     new do
347       get :new
348     end
349     collection do
350       get :index
351       get :show
352       get :count
353     end
354     member do
355       get :by_panel
356       get :by_author
357       get :count_by_panel
358       get :count_by_author
359       get :edit
360       put :update
361       delete :destroy
362     end
363   end
364   resources :original_pictures do
365     new do
366       get :new
367     end
368     collection do
369       get :index
370       get :show
371       get :count
372       post :create
373     end
374     member do
375       get :edit
376       put :update
377       delete :destroy
378       get :history
379     end
380   end
381   resources :pictures do
382     collection do
383       get :index
384       get :show
385       get :count
386       get :credit
387       get :search
388       get :list
389     end
390     member do
391       get :credit
392       get :browse
393     end
394   end
395   resources :resource_pictures do
396     collection do
397       get :index
398       get :show
399       get :count
400       get :new
401       post :create
402       get :count
403     end
404     member do
405       get :by_license
406         get :by_license_group
407       get :by_artist
408       get :count_by_license
409         get :count_by_license_group
410       get :count_by_artist
411       delete :destroy
412       get :credit
413     end
414   end
415   resources :speech_balloon_templates do
416     collection do
417       get :index
418       get :show
419       get :count
420     end
421     member do
422       get :speech_balloons
423       get :panels
424       get :by_system_picture
425       get :speech_balloons_count
426       get :panels_count
427       get :count_by_system_picture
428       delete :destroy
429     end
430   end
431   resources :writing_formats do
432     collection do
433       get :index
434       get :show
435       get :count
436     end
437     member do
438       get :speeches
439       get :by_system_picture
440       get :speeches_count
441       get :count_by_system_picture
442     end
443   end
444   resources :license_groups do
445     collection do
446       get :index
447       get :show
448       get :count
449     end
450     member do
451       get :licenses
452       get :licenses_count
453       delete :destroy
454     end
455   end
456   resources :licenses do
457     collection do
458       get :index
459       get :show
460       get :count
461       get :search
462     end
463     member do
464       get :resource_pictures
465       get :by_license_group
466       get :by_system_picture
467       get :resource_pictures_count
468       get :count_by_license_group
469       get :count_by_system_picture
470     end
471   end
472   resources :authors do
473     new do
474       get :new
475     end
476     collection do
477       get :index
478       get :show
479       get :count
480       post :create
481     end
482     member do
483       get :scrolls
484       get :scroll_panels
485       get :comics
486       get :comic_stories
487       get :stories
488       get :story_sheets
489       get :sheets
490       get :sheet_panels
491       get :panels
492       get :panel_pictures
493       get :speech_balloons
494       get :ground_pictures
495       get :ground_colors
496       get :scrolls_count
497       get :scroll_panels_count
498       get :comics_count
499       get :stories_count
500       get :story_sheets_count
501       get :sheets_count
502       get :sheet_panels_count
503       get :panels_count
504       get :panel_pictures_count
505       get :speech_balloons_count
506       get :ground_pictures_count
507       get :ground_colors_count
508       get :edit
509       put :update
510       delete :destroy
511     end
512   end
513   resources :artists do
514     new do
515       get :new
516     end
517     collection do
518       get :index
519       get :show
520       get :count
521       post :create
522     end
523     member do
524       get :resource_pictures
525       get :resource_pictures_count
526       get :edit
527       put :update
528       delete :destroy
529     end
530   end
531   resources :system_pictures do
532     collection do
533       get :index
534       get :show
535       get :count
536     end
537     member do
538       #get :balloons
539       get :speech_balloon_templates
540       get :licenses
541       get :speech_balloon_templates_count
542       get :licenses_count
543       delete :destroy
544     end
545   end
546   resources :original_picture_license_groups do
547     new do
548       post :new
549     end
550     collection do
551       post :create
552     end
553   end
554   resources :provider_sources do
555     collection do
556       get :index
557       post :import
558       get :list
559       get :browse
560     end
561     member do
562     end
563   end
564   resources :providers do
565     collection do
566       get :index
567       get :show
568       get :list
569       get :browse
570     end
571     member do
572       delete :destroy
573     end
574   end
575   resources :provider_statuses do
576     collection do
577       get :index
578       get :show
579       get :list
580       get :browse
581     end
582     member do
583       get :edit
584       put :update
585       delete :destroy
586       post :licenses_import
587       post :artists_import
588       post :original_pictures_import
589       post :import
590     end
591   end
592   resources :demanders do
593     new do
594       get :new
595     end
596     collection do
597       get :index
598       get :show
599       post :create
600       get :list
601       get :browse
602       post :req
603       get :licenses_export
604       get :artists_export
605       get :original_pictures_export
606       get :pictures_export
607       get :export
608     end
609     member do
610       get :edit
611       put :update
612       delete :destroy
613     end
614   end
615   resources :demander_statuses do
616     collection do
617       get :index
618       get :show
619       get :list
620       get :browse
621     end
622     member do
623       get :edit
624       put :update
625       delete :destroy
626     end
627   end
628   # The priority is based upon order of creation:
629   # first created -> highest priority.
630
631   # Sample of regular route:
632   #   match 'products/:id' => 'catalog#view'
633   # Keep in mind you can assign values other than :controller and :action
634   
635   # resource_pictures/1.png?subdir=full
636   # match 'resource_pictures/full/:id(.:format)/' => 'resource_pictures#show'
637   # match 'pictures/:subdir/:id(.:format)/' => 'pictures#show'
638   #match 'scroll_panels/scroll/:id(.:format)' => 'scroll_panels#scroll'
639   match 'top/(:action)', :controller => 'top'
640   match 'home/(:action)', :controller => 'home'
641   match 'system/(:action)', :controller => 'system'
642   #match 'authors/(:action(/:id))', :controller => 'authors'
643   
644   # Sample of named route:
645   #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
646   # This route can be invoked with purchase_url(:id => product.id)
647
648   # Sample resource route (maps HTTP verbs to controller actions automatically):
649   #   resources :products
650
651   # Sample resource route with options:
652   #   resources :products do
653   #     member do
654   #       get 'short'
655   #       post 'toggle'
656   #     end
657   #
658   #     collection do
659   #       get 'sold'
660   #     end
661   #   end
662
663   # Sample resource route with sub-resources:
664   #   resources :products do
665   #     resources :comments, :sales
666   #     resource :seller
667   #   end
668
669   # Sample resource route with more complex sub-resources
670   #   resources :products do
671   #     resources :comments
672   #     resources :sales do
673   #       get 'recent', :on => :collection
674   #     end
675   #   end
676
677   # Sample resource route within a namespace:
678   #   namespace :admin do
679   #     # Directs /admin/products/* to Admin::ProductsController
680   #     # (app/controllers/admin/products_controller.rb)
681   #     resources :products
682   #   end
683
684   # You can have the root of your site routed with "root"
685   # just remember to delete public/index.html.
686   root :to => 'top#index'
687
688   # See how all your routes lay out with "rake routes"
689
690   # This is a legacy wild controller route that's not recommended for RESTful applications.
691   # Note: This route will make all actions in every controller accessible via GET requests.
692   match ':controller(/:action(/:id(.:format)))'
693 end