OSDN Git Service

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