2005-07-20 05:21:20 +02:00
|
|
|
# Create a route to DEFAULT_WEB, if such is specified; also register a generic route
|
|
|
|
def connect_to_web(map, generic_path, generic_routing_options)
|
|
|
|
if defined? DEFAULT_WEB
|
2005-07-21 03:16:06 +02:00
|
|
|
explicit_path = generic_path.gsub(/:web\/?/, '')
|
2005-07-20 05:21:20 +02:00
|
|
|
explicit_routing_options = generic_routing_options.merge(:web => DEFAULT_WEB)
|
|
|
|
map.connect(explicit_path, explicit_routing_options)
|
|
|
|
end
|
|
|
|
map.connect(generic_path, generic_routing_options)
|
|
|
|
end
|
|
|
|
|
2005-07-20 03:36:58 +02:00
|
|
|
ActionController::Routing::Routes.draw do |map|
|
2005-02-15 23:41:58 +01:00
|
|
|
map.connect 'create_system', :controller => 'admin', :action => 'create_system'
|
|
|
|
map.connect 'create_web', :controller => 'admin', :action => 'create_web'
|
|
|
|
map.connect 'remove_orphaned_pages', :controller => 'admin', :action => 'remove_orphaned_pages'
|
2005-07-20 05:21:20 +02:00
|
|
|
map.connect 'web_list', :controller => 'wiki', :action => 'web_list'
|
2005-02-15 23:41:58 +01:00
|
|
|
|
2005-07-20 05:21:20 +02:00
|
|
|
connect_to_web map, ':web/edit_web', :controller => 'admin', :action => 'edit_web'
|
2005-11-13 14:37:47 +01:00
|
|
|
connect_to_web map, ':web/files/:id', :controller => 'file', :action => 'file'
|
2005-07-20 05:21:20 +02:00
|
|
|
connect_to_web map, ':web/import/:id', :controller => 'file', :action => 'import'
|
|
|
|
connect_to_web map, ':web/login', :controller => 'wiki', :action => 'login'
|
|
|
|
connect_to_web map, ':web/web_list', :controller => 'wiki', :action => 'web_list'
|
2006-03-11 23:10:32 +01:00
|
|
|
connect_to_web map, ':web/show/diff/:id', :controller => 'wiki', :action => 'show', :mode => 'diff'
|
|
|
|
connect_to_web map, ':web/revision/diff/:id', :controller => 'wiki', :action => 'revision', :mode => 'diff'
|
2006-04-02 07:11:17 +02:00
|
|
|
connect_to_web map, ':web/list', :controller => 'wiki', :action => 'list'
|
|
|
|
connect_to_web map, ':web/list/:category', :controller => 'wiki', :action => 'list'
|
|
|
|
connect_to_web map, ':web/recently_revised', :controller => 'wiki', :action => 'recently_revised'
|
|
|
|
connect_to_web map, ':web/recently_revised/:category', :controller => 'wiki', :action => 'recently_revised'
|
2005-07-20 05:21:20 +02:00
|
|
|
connect_to_web map, ':web/:action/:id', :controller => 'wiki'
|
|
|
|
connect_to_web map, ':web/:action', :controller => 'wiki'
|
|
|
|
connect_to_web map, ':web', :controller => 'wiki', :action => 'index'
|
2005-02-15 23:41:58 +01:00
|
|
|
|
2005-07-20 05:21:20 +02:00
|
|
|
if defined? DEFAULT_WEB
|
|
|
|
map.connect '', :controller => 'wiki', :web => DEFAULT_WEB, :action => 'index'
|
|
|
|
else
|
|
|
|
map.connect '', :controller => 'wiki', :action => 'index'
|
|
|
|
end
|
2005-02-15 23:41:58 +01:00
|
|
|
end
|