##// END OF EJS Templates
Added a plugin hook :routes that plugins can use to add and even override routes...
Eric Davis -
r1934:68109727626c
parent child
Show More
@@ -1,46 +1,49
1 1 ActionController::Routing::Routes.draw do |map|
2 2 # Add your own custom routes here.
3 3 # The priority is based upon order of creation: first created -> highest priority.
4 4
5 5 # Here's a sample route:
6 6 # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
7 7 # Keep in mind you can assign values other than :controller and :action
8 8
9 # Allow Redmine plugins to map routes and potentially override them
10 Redmine::Hook.call_hook :routes, :map => map
11
9 12 map.home '', :controller => 'welcome'
10 13 map.signin 'login', :controller => 'account', :action => 'login'
11 14 map.signout 'logout', :controller => 'account', :action => 'logout'
12 15
13 16 map.connect 'wiki/:id/:page/:action', :controller => 'wiki', :page => nil
14 17 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow'
15 18 map.connect 'help/:ctrl/:page', :controller => 'help'
16 19 #map.connect ':controller/:action/:id/:sort_key/:sort_order'
17 20
18 21 map.connect 'issues/:issue_id/relations/:action/:id', :controller => 'issue_relations'
19 22 map.connect 'projects/:project_id/issues/:action', :controller => 'issues'
20 23 map.connect 'projects/:project_id/news/:action', :controller => 'news'
21 24 map.connect 'projects/:project_id/documents/:action', :controller => 'documents'
22 25 map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards'
23 26 map.connect 'projects/:project_id/timelog/:action/:id', :controller => 'timelog', :project_id => /.+/
24 27 map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages'
25 28
26 29 map.with_options :controller => 'repositories' do |omap|
27 30 omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse'
28 31 omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes'
29 32 omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff'
30 33 omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry'
31 34 omap.repositories_entry 'repositories/annotate/:id/*path', :action => 'annotate'
32 35 omap.repositories_revision 'repositories/revision/:id/:rev', :action => 'revision'
33 36 end
34 37
35 38 map.connect 'attachments/:id', :controller => 'attachments', :action => 'show', :id => /\d+/
36 39 map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/
37 40 map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/
38 41
39 42 # Allow downloading Web Service WSDL as a file with an extension
40 43 # instead of a file named 'wsdl'
41 44 map.connect ':controller/service.wsdl', :action => 'wsdl'
42 45
43 46
44 47 # Install the default route as the lowest priority.
45 48 map.connect ':controller/:action/:id'
46 49 end
General Comments 0
You need to be logged in to leave comments. Login now