OSDN Git Service

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