Commit 50f157d5039762c6ff9f8cee6bdc502d9a1cb49a

Authored by AntonioTerceiro
1 parent 1ec7f711

ActionItem114: reorganizing routes



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@824 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing 1 changed file with 16 additions and 16 deletions   Show diff stats
config/routes.rb
... ... @@ -11,6 +11,10 @@ ActionController::Routing::Routes.draw do |map|
11 11 # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
12 12 # This route can be invoked with purchase_url(:id => product.id)
13 13  
  14 + ######################################################
  15 + ## Public controllers
  16 + ######################################################
  17 +
14 18 # You can have the root of your site routed by hooking up ''
15 19 # -- just remember to delete public/index.html.
16 20 map.connect '', :controller => "home"
... ... @@ -18,16 +22,8 @@ ActionController::Routing::Routes.draw do |map|
18 22 # documentation browser
19 23 map.connect 'doc', :controller => 'doc'
20 24  
21   - ######################################################
22   - ## Controllers that are used by environment admin
23   - ######################################################
24   - # administrative tasks for a environment
25   - map.admin 'admin', :controller => 'admin_panel'
26   - map.admin 'admin/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_in_directory('environment_admin')
27   -
28 25 # user account controller
29 26 map.connect 'account/new_password/:code', :controller => 'account', :action => 'new_password'
30   -
31 27 map.connect 'account/:action', :controller => 'account'
32 28  
33 29 # enterprise registration
... ... @@ -35,6 +31,10 @@ ActionController::Routing::Routes.draw do |map|
35 31  
36 32 # search
37 33 map.connect 'search', :controller => 'search'
  34 +
  35 + # categories controller
  36 + map.connect 'cat', :controller => 'category', :action => 'index'
  37 + map.category 'cat/*path', :controller => 'category', :action => 'view'
38 38  
39 39 ######################################################
40 40 ## Controllers that are profile-specific (for profile admins )
... ... @@ -42,7 +42,14 @@ ActionController::Routing::Routes.draw do |map|
42 42 # profile customization - "My profile"
43 43 map.myprofile 'myprofile/:profile', :controller => 'profile_editor', :action => 'index'
44 44 map.myprofile 'myprofile/:profile/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_in_directory('profile_admin')
45   - # content administration
  45 +
  46 +
  47 + ######################################################
  48 + ## Controllers that are used by environment admin
  49 + ######################################################
  50 + # administrative tasks for a environment
  51 + map.admin 'admin', :controller => 'admin_panel'
  52 + map.admin 'admin/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_in_directory('environment_admin')
46 53  
47 54  
48 55 ######################################################
... ... @@ -59,13 +66,6 @@ ActionController::Routing::Routes.draw do |map|
59 66 ######################################################
60 67 map.connect 'test/:controller/:action/:id', :controller => /.*test.*/
61 68  
62   - ######################################################
63   - ## Public controllers
64   - ######################################################
65   -
66   - map.connect 'cat', :controller => 'category', :action => 'index'
67   - map.category 'cat/*path', :controller => 'category', :action => 'view'
68   -
69 69 # *content viewing*
70 70 # XXX this route must come last so other routes have priority over it.
71 71 map.homepage ':profile/*page', :controller => 'content_viewer', :action => 'view_page'
... ...