OSDN Git Service

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