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