OSDN Git Service

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