34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
# File 'lib/cms/routes.rb', line 34
def routes_for_browser_cms
namespace(:cms) do |cms|
cms.home '/', :controller => 'home'
cms.logout '/logout', :controller => 'sessions', :action => 'destroy'
cms.login '/login', :controller => 'sessions', :action => 'new', :conditions => { :method => :get }
cms.connect '/login', :controller => 'sessions', :action => 'create', :conditions => { :method => :post }
cms.dashboard '/dashboard', :controller => 'dashboard'
cms.sitemap '/sitemap', :controller => 'section_nodes'
cms.content_types '/content_types', :controller => 'content_types'
cms.resources :connectors, :member => {
:move_up => :put,
:move_down => :put,
:move_to_bottom => :put,
:move_to_top => :put
}
cms.resources :links
cms.resources :pages, :member => {
:archive => :put,
:hide => :put,
:publish => :put,
:versions => :get
}, :collection => {
:publish => :put
}, :has_many => [:tasks]
version_cms_page '/cms/pages/:id/version/:version', :controller => 'cms/pages', :action => 'version', :conditions => {:method => :get}
revert_to_cms_page '/cms/pages/:id/revert_to/:version', :controller => 'cms/pages', :action => 'revert_to', :conditions => {:method => :put}
cms.file_browser '/sections/file_browser.xml', :controller => 'sections', :action => 'file_browser', :format => "xml"
cms.resources :sections, :has_many => [:links, :pages]
cms.resources :section_nodes, :member => {
:move_before => :put,
:move_after => :put,
:move_to_beginning => :put,
:move_to_end => :put,
:move_to_root => :put
}
cms.attachment '/attachments/:id', :controller => 'attachments', :action => 'show'
cms.resources :tasks, :member => {:complete => :put}, :collection => {:complete => :put}
cms.toolbar '/toolbar', :controller => 'toolbar'
cms.content_library '/content_library', :controller => 'html_blocks'
cms.content_blocks :html_blocks
cms.content_blocks :portlets, :member => {:usages => :get}
cms.handler "/portlet/:id/:handler",
:controller => "portlet",
:action => "execute_handler",
:conditions => {:method => :post}
cms.content_blocks :file_blocks
cms.content_blocks :image_blocks
cms.content_blocks :category_types
cms.content_blocks :categories
cms.content_blocks :tags
cms.administration '/administration', :controller => 'users'
cms.with_options :controller => "cache" do |cache|
cache.cache "/cache", :action => "show", :conditions => {:method => :get}
cache.connect "/cache", :action => "destroy", :conditions => {:method => :delete}
end
cms.resources :email_messages
cms.resources :groups
cms.resources :redirects
cms.resources :page_partials, :controller => 'dynamic_views'
cms.resources :page_templates, :controller => 'dynamic_views'
cms.resources :page_routes do |pr|
pr.resources :conditions, :controller => "page_route_conditions"
pr.resources :requirements, :controller => "page_route_requirements"
end
cms.routes "/routes", :controller => "routes"
cms.resources :users, :member => {
:change_password => :get,
:update_password => :put,
:disable => :put,
:enable => :put
}
if RAILS_ENV == "test" && File.expand_path(RAILS_ROOT) == File.expand_path(File.dirname(__FILE__) + "/../..")
cms.content_blocks :content_block
end
end
if PageRoute.table_exists?
PageRoute.all(:order => "page_routes.name").each do |r|
send((r.route_name || 'connect').to_sym, r.pattern, r.options_map)
end
end
connect '*path', :controller => 'cms/content', :action => 'show'
end
|