You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

routes.rb 21KB

Converted routing and urls to follow the Rails REST convention. Patch supplied by commits from Gerrit Kaiser on Github. Existing routes will still work (backwards compatible) but any new urls will be generated using the new routing rules. Changes listed below: * made the URLs for some project tabs and project settings follow the new rails RESTful conventions of /collection/:id/subcollection/:sub_id * prettier URL for project roadmap * more nice project URLs * use GET for filtering form * prettified URLs used on issues tab * custom route for activity atom feeds * prettier repository urls * fixed broken route definition * fixed failing tests for issuecontroller that were hardcoding the url string * more RESTful routes for boards and messages * RESTful routes for wiki pages * RESTful routes for documents * moved old routes that are retained for compatibility to the bottom and grouped them together * added RESTful URIs for issues * RESTfulness for the news section * fixed route order * changed hardcoded URLs in tests * fixed badly written tests * fixed forgotten parameter in routes * changed hardcoded URLS to new scheme * changed project add url to the standard POST to collection * create new issue by POSTing to collection * changed hardcoded URLs in integrations tests * made project add form work again * restful routes for project deletion * prettier routes for project (un)archival * made routes table more readable * fixed note quoting * user routing * fixed bug * always sort by GET * Fixed: cross-project issue list should not show issues of projects for which the issue tracking module was disabled. * prettified URLs used on issues tab * urls for time log * fixed reply routing * eliminate revision query paremeter for diff and entry actions * fixed test failures with hard-coded urls * ensure ajax links always use get * refactored ajax link generation into separate method #1901 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2317 e93f8b46-1217-0410-a6f0-8f06a7374b81
15 years ago
Converted routing and urls to follow the Rails REST convention. Patch supplied by commits from Gerrit Kaiser on Github. Existing routes will still work (backwards compatible) but any new urls will be generated using the new routing rules. Changes listed below: * made the URLs for some project tabs and project settings follow the new rails RESTful conventions of /collection/:id/subcollection/:sub_id * prettier URL for project roadmap * more nice project URLs * use GET for filtering form * prettified URLs used on issues tab * custom route for activity atom feeds * prettier repository urls * fixed broken route definition * fixed failing tests for issuecontroller that were hardcoding the url string * more RESTful routes for boards and messages * RESTful routes for wiki pages * RESTful routes for documents * moved old routes that are retained for compatibility to the bottom and grouped them together * added RESTful URIs for issues * RESTfulness for the news section * fixed route order * changed hardcoded URLs in tests * fixed badly written tests * fixed forgotten parameter in routes * changed hardcoded URLS to new scheme * changed project add url to the standard POST to collection * create new issue by POSTing to collection * changed hardcoded URLs in integrations tests * made project add form work again * restful routes for project deletion * prettier routes for project (un)archival * made routes table more readable * fixed note quoting * user routing * fixed bug * always sort by GET * Fixed: cross-project issue list should not show issues of projects for which the issue tracking module was disabled. * prettified URLs used on issues tab * urls for time log * fixed reply routing * eliminate revision query paremeter for diff and entry actions * fixed test failures with hard-coded urls * ensure ajax links always use get * refactored ajax link generation into separate method #1901 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2317 e93f8b46-1217-0410-a6f0-8f06a7374b81
15 years ago
Converted routing and urls to follow the Rails REST convention. Patch supplied by commits from Gerrit Kaiser on Github. Existing routes will still work (backwards compatible) but any new urls will be generated using the new routing rules. Changes listed below: * made the URLs for some project tabs and project settings follow the new rails RESTful conventions of /collection/:id/subcollection/:sub_id * prettier URL for project roadmap * more nice project URLs * use GET for filtering form * prettified URLs used on issues tab * custom route for activity atom feeds * prettier repository urls * fixed broken route definition * fixed failing tests for issuecontroller that were hardcoding the url string * more RESTful routes for boards and messages * RESTful routes for wiki pages * RESTful routes for documents * moved old routes that are retained for compatibility to the bottom and grouped them together * added RESTful URIs for issues * RESTfulness for the news section * fixed route order * changed hardcoded URLs in tests * fixed badly written tests * fixed forgotten parameter in routes * changed hardcoded URLS to new scheme * changed project add url to the standard POST to collection * create new issue by POSTing to collection * changed hardcoded URLs in integrations tests * made project add form work again * restful routes for project deletion * prettier routes for project (un)archival * made routes table more readable * fixed note quoting * user routing * fixed bug * always sort by GET * Fixed: cross-project issue list should not show issues of projects for which the issue tracking module was disabled. * prettified URLs used on issues tab * urls for time log * fixed reply routing * eliminate revision query paremeter for diff and entry actions * fixed test failures with hard-coded urls * ensure ajax links always use get * refactored ajax link generation into separate method #1901 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2317 e93f8b46-1217-0410-a6f0-8f06a7374b81
15 years ago
Converted routing and urls to follow the Rails REST convention. Patch supplied by commits from Gerrit Kaiser on Github. Existing routes will still work (backwards compatible) but any new urls will be generated using the new routing rules. Changes listed below: * made the URLs for some project tabs and project settings follow the new rails RESTful conventions of /collection/:id/subcollection/:sub_id * prettier URL for project roadmap * more nice project URLs * use GET for filtering form * prettified URLs used on issues tab * custom route for activity atom feeds * prettier repository urls * fixed broken route definition * fixed failing tests for issuecontroller that were hardcoding the url string * more RESTful routes for boards and messages * RESTful routes for wiki pages * RESTful routes for documents * moved old routes that are retained for compatibility to the bottom and grouped them together * added RESTful URIs for issues * RESTfulness for the news section * fixed route order * changed hardcoded URLs in tests * fixed badly written tests * fixed forgotten parameter in routes * changed hardcoded URLS to new scheme * changed project add url to the standard POST to collection * create new issue by POSTing to collection * changed hardcoded URLs in integrations tests * made project add form work again * restful routes for project deletion * prettier routes for project (un)archival * made routes table more readable * fixed note quoting * user routing * fixed bug * always sort by GET * Fixed: cross-project issue list should not show issues of projects for which the issue tracking module was disabled. * prettified URLs used on issues tab * urls for time log * fixed reply routing * eliminate revision query paremeter for diff and entry actions * fixed test failures with hard-coded urls * ensure ajax links always use get * refactored ajax link generation into separate method #1901 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2317 e93f8b46-1217-0410-a6f0-8f06a7374b81
15 years ago
Converted routing and urls to follow the Rails REST convention. Patch supplied by commits from Gerrit Kaiser on Github. Existing routes will still work (backwards compatible) but any new urls will be generated using the new routing rules. Changes listed below: * made the URLs for some project tabs and project settings follow the new rails RESTful conventions of /collection/:id/subcollection/:sub_id * prettier URL for project roadmap * more nice project URLs * use GET for filtering form * prettified URLs used on issues tab * custom route for activity atom feeds * prettier repository urls * fixed broken route definition * fixed failing tests for issuecontroller that were hardcoding the url string * more RESTful routes for boards and messages * RESTful routes for wiki pages * RESTful routes for documents * moved old routes that are retained for compatibility to the bottom and grouped them together * added RESTful URIs for issues * RESTfulness for the news section * fixed route order * changed hardcoded URLs in tests * fixed badly written tests * fixed forgotten parameter in routes * changed hardcoded URLS to new scheme * changed project add url to the standard POST to collection * create new issue by POSTing to collection * changed hardcoded URLs in integrations tests * made project add form work again * restful routes for project deletion * prettier routes for project (un)archival * made routes table more readable * fixed note quoting * user routing * fixed bug * always sort by GET * Fixed: cross-project issue list should not show issues of projects for which the issue tracking module was disabled. * prettified URLs used on issues tab * urls for time log * fixed reply routing * eliminate revision query paremeter for diff and entry actions * fixed test failures with hard-coded urls * ensure ajax links always use get * refactored ajax link generation into separate method #1901 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2317 e93f8b46-1217-0410-a6f0-8f06a7374b81
15 years ago
Converted routing and urls to follow the Rails REST convention. Patch supplied by commits from Gerrit Kaiser on Github. Existing routes will still work (backwards compatible) but any new urls will be generated using the new routing rules. Changes listed below: * made the URLs for some project tabs and project settings follow the new rails RESTful conventions of /collection/:id/subcollection/:sub_id * prettier URL for project roadmap * more nice project URLs * use GET for filtering form * prettified URLs used on issues tab * custom route for activity atom feeds * prettier repository urls * fixed broken route definition * fixed failing tests for issuecontroller that were hardcoding the url string * more RESTful routes for boards and messages * RESTful routes for wiki pages * RESTful routes for documents * moved old routes that are retained for compatibility to the bottom and grouped them together * added RESTful URIs for issues * RESTfulness for the news section * fixed route order * changed hardcoded URLs in tests * fixed badly written tests * fixed forgotten parameter in routes * changed hardcoded URLS to new scheme * changed project add url to the standard POST to collection * create new issue by POSTing to collection * changed hardcoded URLs in integrations tests * made project add form work again * restful routes for project deletion * prettier routes for project (un)archival * made routes table more readable * fixed note quoting * user routing * fixed bug * always sort by GET * Fixed: cross-project issue list should not show issues of projects for which the issue tracking module was disabled. * prettified URLs used on issues tab * urls for time log * fixed reply routing * eliminate revision query paremeter for diff and entry actions * fixed test failures with hard-coded urls * ensure ajax links always use get * refactored ajax link generation into separate method #1901 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2317 e93f8b46-1217-0410-a6f0-8f06a7374b81
15 years ago
Converted routing and urls to follow the Rails REST convention. Patch supplied by commits from Gerrit Kaiser on Github. Existing routes will still work (backwards compatible) but any new urls will be generated using the new routing rules. Changes listed below: * made the URLs for some project tabs and project settings follow the new rails RESTful conventions of /collection/:id/subcollection/:sub_id * prettier URL for project roadmap * more nice project URLs * use GET for filtering form * prettified URLs used on issues tab * custom route for activity atom feeds * prettier repository urls * fixed broken route definition * fixed failing tests for issuecontroller that were hardcoding the url string * more RESTful routes for boards and messages * RESTful routes for wiki pages * RESTful routes for documents * moved old routes that are retained for compatibility to the bottom and grouped them together * added RESTful URIs for issues * RESTfulness for the news section * fixed route order * changed hardcoded URLs in tests * fixed badly written tests * fixed forgotten parameter in routes * changed hardcoded URLS to new scheme * changed project add url to the standard POST to collection * create new issue by POSTing to collection * changed hardcoded URLs in integrations tests * made project add form work again * restful routes for project deletion * prettier routes for project (un)archival * made routes table more readable * fixed note quoting * user routing * fixed bug * always sort by GET * Fixed: cross-project issue list should not show issues of projects for which the issue tracking module was disabled. * prettified URLs used on issues tab * urls for time log * fixed reply routing * eliminate revision query paremeter for diff and entry actions * fixed test failures with hard-coded urls * ensure ajax links always use get * refactored ajax link generation into separate method #1901 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2317 e93f8b46-1217-0410-a6f0-8f06a7374b81
15 years ago
Converted routing and urls to follow the Rails REST convention. Patch supplied by commits from Gerrit Kaiser on Github. Existing routes will still work (backwards compatible) but any new urls will be generated using the new routing rules. Changes listed below: * made the URLs for some project tabs and project settings follow the new rails RESTful conventions of /collection/:id/subcollection/:sub_id * prettier URL for project roadmap * more nice project URLs * use GET for filtering form * prettified URLs used on issues tab * custom route for activity atom feeds * prettier repository urls * fixed broken route definition * fixed failing tests for issuecontroller that were hardcoding the url string * more RESTful routes for boards and messages * RESTful routes for wiki pages * RESTful routes for documents * moved old routes that are retained for compatibility to the bottom and grouped them together * added RESTful URIs for issues * RESTfulness for the news section * fixed route order * changed hardcoded URLs in tests * fixed badly written tests * fixed forgotten parameter in routes * changed hardcoded URLS to new scheme * changed project add url to the standard POST to collection * create new issue by POSTing to collection * changed hardcoded URLs in integrations tests * made project add form work again * restful routes for project deletion * prettier routes for project (un)archival * made routes table more readable * fixed note quoting * user routing * fixed bug * always sort by GET * Fixed: cross-project issue list should not show issues of projects for which the issue tracking module was disabled. * prettified URLs used on issues tab * urls for time log * fixed reply routing * eliminate revision query paremeter for diff and entry actions * fixed test failures with hard-coded urls * ensure ajax links always use get * refactored ajax link generation into separate method #1901 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2317 e93f8b46-1217-0410-a6f0-8f06a7374b81
15 years ago
Converted routing and urls to follow the Rails REST convention. Patch supplied by commits from Gerrit Kaiser on Github. Existing routes will still work (backwards compatible) but any new urls will be generated using the new routing rules. Changes listed below: * made the URLs for some project tabs and project settings follow the new rails RESTful conventions of /collection/:id/subcollection/:sub_id * prettier URL for project roadmap * more nice project URLs * use GET for filtering form * prettified URLs used on issues tab * custom route for activity atom feeds * prettier repository urls * fixed broken route definition * fixed failing tests for issuecontroller that were hardcoding the url string * more RESTful routes for boards and messages * RESTful routes for wiki pages * RESTful routes for documents * moved old routes that are retained for compatibility to the bottom and grouped them together * added RESTful URIs for issues * RESTfulness for the news section * fixed route order * changed hardcoded URLs in tests * fixed badly written tests * fixed forgotten parameter in routes * changed hardcoded URLS to new scheme * changed project add url to the standard POST to collection * create new issue by POSTing to collection * changed hardcoded URLs in integrations tests * made project add form work again * restful routes for project deletion * prettier routes for project (un)archival * made routes table more readable * fixed note quoting * user routing * fixed bug * always sort by GET * Fixed: cross-project issue list should not show issues of projects for which the issue tracking module was disabled. * prettified URLs used on issues tab * urls for time log * fixed reply routing * eliminate revision query paremeter for diff and entry actions * fixed test failures with hard-coded urls * ensure ajax links always use get * refactored ajax link generation into separate method #1901 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2317 e93f8b46-1217-0410-a6f0-8f06a7374b81
15 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. ActionController::Routing::Routes.draw do |map|
  2. # Add your own custom routes here.
  3. # The priority is based upon order of creation: first created -> highest priority.
  4. # Here's a sample route:
  5. # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
  6. # Keep in mind you can assign values other than :controller and :action
  7. map.home '', :controller => 'welcome', :conditions => {:method => :get}
  8. map.signin 'login', :controller => 'account', :action => 'login',
  9. :conditions => {:method => [:get, :post]}
  10. map.signout 'logout', :controller => 'account', :action => 'logout',
  11. :conditions => {:method => :get}
  12. map.connect 'account/register', :controller => 'account', :action => 'register',
  13. :conditions => {:method => [:get, :post]}
  14. map.connect 'account/lost_password', :controller => 'account', :action => 'lost_password',
  15. :conditions => {:method => [:get, :post]}
  16. map.connect 'account/activate', :controller => 'account', :action => 'activate',
  17. :conditions => {:method => :get}
  18. map.connect 'projects/:id/wiki', :controller => 'wikis',
  19. :action => 'edit', :conditions => {:method => :post}
  20. map.connect 'projects/:id/wiki/destroy', :controller => 'wikis',
  21. :action => 'destroy', :conditions => {:method => [:get, :post]}
  22. map.with_options :controller => 'messages' do |messages_routes|
  23. messages_routes.with_options :conditions => {:method => :get} do |messages_views|
  24. messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
  25. messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
  26. messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
  27. end
  28. messages_routes.with_options :conditions => {:method => :post} do |messages_actions|
  29. messages_actions.connect 'boards/:board_id/topics/new', :action => 'new'
  30. messages_actions.connect 'boards/:board_id/topics/preview', :action => 'preview'
  31. messages_actions.connect 'boards/:board_id/topics/quote/:id', :action => 'quote'
  32. messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply'
  33. messages_actions.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
  34. messages_actions.connect 'boards/:board_id/topics/:id/destroy', :action => 'destroy'
  35. end
  36. end
  37. # Misc issue routes. TODO: move into resources
  38. map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes',
  39. :action => 'issues', :conditions => { :method => :get }
  40. # TODO: would look nicer as /issues/:id/preview
  41. map.preview_new_issue '/issues/preview/new/:project_id', :controller => 'previews',
  42. :action => 'issue'
  43. map.preview_edit_issue '/issues/preview/edit/:id', :controller => 'previews',
  44. :action => 'issue'
  45. map.issues_context_menu '/issues/context_menu',
  46. :controller => 'context_menus', :action => 'issues'
  47. map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index'
  48. map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new',
  49. :id => /\d+/, :conditions => { :method => :post }
  50. map.connect '/journals/diff/:id', :controller => 'journals', :action => 'diff',
  51. :id => /\d+/, :conditions => { :method => :get }
  52. map.connect '/journals/edit/:id', :controller => 'journals', :action => 'edit',
  53. :id => /\d+/, :conditions => { :method => [:get, :post] }
  54. map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes|
  55. gantts_routes.connect '/projects/:project_id/issues/gantt'
  56. gantts_routes.connect '/projects/:project_id/issues/gantt.:format'
  57. gantts_routes.connect '/issues/gantt.:format'
  58. end
  59. map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes|
  60. calendars_routes.connect '/projects/:project_id/issues/calendar'
  61. calendars_routes.connect '/issues/calendar'
  62. end
  63. map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports|
  64. reports.connect 'projects/:id/issues/report', :action => 'issue_report'
  65. reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details'
  66. end
  67. map.connect 'my/account', :controller => 'my', :action => 'account',
  68. :conditions => {:method => [:get, :post]}
  69. map.connect 'my/account/destroy', :controller => 'my', :action => 'destroy',
  70. :conditions => {:method => [:get, :post]}
  71. map.connect 'my/page', :controller => 'my', :action => 'page',
  72. :conditions => {:method => :get}
  73. # Redirects to my/page
  74. map.connect 'my', :controller => 'my', :action => 'index',
  75. :conditions => {:method => :get}
  76. map.connect 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key',
  77. :conditions => {:method => :post}
  78. map.connect 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key',
  79. :conditions => {:method => :post}
  80. map.connect 'my/password', :controller => 'my', :action => 'password',
  81. :conditions => {:method => [:get, :post]}
  82. map.connect 'my/page_layout', :controller => 'my', :action => 'page_layout',
  83. :conditions => {:method => :get}
  84. map.connect 'my/add_block', :controller => 'my', :action => 'add_block',
  85. :conditions => {:method => :post}
  86. map.connect 'my/remove_block', :controller => 'my', :action => 'remove_block',
  87. :conditions => {:method => :post}
  88. map.connect 'my/order_blocks', :controller => 'my', :action => 'order_blocks',
  89. :conditions => {:method => :post}
  90. map.with_options :controller => 'users' do |users|
  91. users.user_membership 'users/:id/memberships/:membership_id',
  92. :action => 'edit_membership',
  93. :conditions => {:method => :put}
  94. users.connect 'users/:id/memberships/:membership_id',
  95. :action => 'destroy_membership',
  96. :conditions => {:method => :delete}
  97. users.user_memberships 'users/:id/memberships',
  98. :action => 'edit_membership',
  99. :conditions => {:method => :post}
  100. end
  101. map.resources :users
  102. # For nice "roadmap" in the url for the index action
  103. map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index'
  104. map.preview_news '/news/preview', :controller => 'previews', :action => 'news'
  105. map.connect 'news/:id/comments', :controller => 'comments',
  106. :action => 'create', :conditions => {:method => :post}
  107. map.connect 'news/:id/comments/:comment_id', :controller => 'comments',
  108. :action => 'destroy', :conditions => {:method => :delete}
  109. map.connect 'watchers/new', :controller=> 'watchers', :action => 'new',
  110. :conditions => {:method => :get}
  111. map.connect 'watchers', :controller=> 'watchers', :action => 'create',
  112. :conditions => {:method => :post}
  113. map.connect 'watchers/append', :controller=> 'watchers', :action => 'append',
  114. :conditions => {:method => :post}
  115. map.connect 'watchers/destroy', :controller=> 'watchers', :action => 'destroy',
  116. :conditions => {:method => :post}
  117. map.connect 'watchers/watch', :controller=> 'watchers', :action => 'watch',
  118. :conditions => {:method => :post}
  119. map.connect 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch',
  120. :conditions => {:method => :post}
  121. map.connect 'watchers/autocomplete_for_user', :controller=> 'watchers', :action => 'autocomplete_for_user',
  122. :conditions => {:method => :get}
  123. # TODO: port to be part of the resources route(s)
  124. map.with_options :conditions => {:method => :get} do |project_views|
  125. project_views.connect 'projects/:id/settings/:tab',
  126. :controller => 'projects', :action => 'settings'
  127. project_views.connect 'projects/:project_id/issues/:copy_from/copy',
  128. :controller => 'issues', :action => 'new'
  129. end
  130. map.resources :projects, :member => {
  131. :copy => [:get, :post],
  132. :settings => :get,
  133. :modules => :post,
  134. :archive => :post,
  135. :unarchive => :post
  136. } do |project|
  137. project.resource :enumerations, :controller => 'project_enumerations',
  138. :only => [:update, :destroy]
  139. # issue form update
  140. project.issue_form 'issues/new', :controller => 'issues',
  141. :action => 'new', :conditions => {:method => [:post, :put]}
  142. project.resources :issues, :only => [:index, :new, :create] do |issues|
  143. issues.resources :time_entries, :controller => 'timelog',
  144. :collection => {:report => :get}
  145. end
  146. project.resources :files, :only => [:index, :new, :create]
  147. project.resources :versions, :shallow => true,
  148. :collection => {:close_completed => :put},
  149. :member => {:status_by => :post}
  150. project.resources :news, :shallow => true
  151. project.resources :time_entries, :controller => 'timelog',
  152. :collection => {:report => :get}
  153. project.resources :queries, :only => [:new, :create]
  154. project.resources :issue_categories, :shallow => true
  155. project.resources :documents, :shallow => true, :member => {:add_attachment => :post}
  156. project.resources :boards
  157. project.resources :repositories, :shallow => true, :except => [:index, :show],
  158. :member => {:committers => [:get, :post]}
  159. project.resources :memberships, :shallow => true, :controller => 'members',
  160. :only => [:index, :show, :create, :update, :destroy],
  161. :collection => {:autocomplete => :get}
  162. project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get}
  163. project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get}
  164. project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil
  165. project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff'
  166. project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate'
  167. project.resources :wiki, :except => [:new, :create], :member => {
  168. :rename => [:get, :post],
  169. :history => :get,
  170. :preview => :any,
  171. :protect => :post,
  172. :add_attachment => :post
  173. }, :collection => {
  174. :export => :get,
  175. :date_index => :get
  176. }
  177. end
  178. map.connect 'news', :controller => 'news', :action => 'index'
  179. map.connect 'news.:format', :controller => 'news', :action => 'index'
  180. map.resources :queries, :except => [:show]
  181. map.resources :issues,
  182. :collection => {:bulk_edit => [:get, :post], :bulk_update => :post} do |issues|
  183. issues.resources :time_entries, :controller => 'timelog',
  184. :collection => {:report => :get}
  185. issues.resources :relations, :shallow => true,
  186. :controller => 'issue_relations',
  187. :only => [:index, :show, :create, :destroy]
  188. end
  189. # Bulk deletion
  190. map.connect '/issues', :controller => 'issues', :action => 'destroy',
  191. :conditions => {:method => :delete}
  192. map.connect '/time_entries/destroy',
  193. :controller => 'timelog', :action => 'destroy',
  194. :conditions => { :method => :delete }
  195. map.time_entries_context_menu '/time_entries/context_menu',
  196. :controller => 'context_menus', :action => 'time_entries'
  197. map.resources :time_entries, :controller => 'timelog',
  198. :collection => {:report => :get, :bulk_edit => :get, :bulk_update => :post}
  199. map.with_options :controller => 'activities', :action => 'index',
  200. :conditions => {:method => :get} do |activity|
  201. activity.connect 'projects/:id/activity'
  202. activity.connect 'projects/:id/activity.:format'
  203. activity.connect 'activity', :id => nil
  204. activity.connect 'activity.:format', :id => nil
  205. end
  206. map.with_options :controller => 'repositories' do |repositories|
  207. repositories.with_options :conditions => {:method => :get} do |repository_views|
  208. repository_views.connect 'projects/:id/repository',
  209. :action => 'show'
  210. repository_views.connect 'projects/:id/repository/:repository_id/statistics',
  211. :action => 'stats'
  212. repository_views.connect 'projects/:id/repository/:repository_id/graph',
  213. :action => 'graph'
  214. repository_views.connect 'projects/:id/repository/statistics',
  215. :action => 'stats'
  216. repository_views.connect 'projects/:id/repository/graph',
  217. :action => 'graph'
  218. repository_views.connect 'projects/:id/repository/:repository_id/revisions',
  219. :action => 'revisions'
  220. repository_views.connect 'projects/:id/repository/:repository_id/revisions.:format',
  221. :action => 'revisions'
  222. repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev',
  223. :action => 'revision'
  224. repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/issues',
  225. :action => 'add_related_issue', :conditions => {:method => :post}
  226. repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id',
  227. :action => 'remove_related_issue', :conditions => {:method => :delete}
  228. repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/diff',
  229. :action => 'diff'
  230. repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/diff.:format',
  231. :action => 'diff'
  232. repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/raw/*path',
  233. :action => 'entry', :format => 'raw',
  234. :requirements => { :rev => /[a-z0-9\.\-_]+/ }
  235. repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/:action/*path',
  236. :requirements => {
  237. :action => /(browse|show|entry|changes|annotate|diff)/,
  238. :rev => /[a-z0-9\.\-_]+/
  239. }
  240. repository_views.connect 'projects/:id/repository/:repository_id/raw/*path',
  241. :action => 'entry', :format => 'raw'
  242. repository_views.connect 'projects/:id/repository/:repository_id/:action/*path',
  243. :requirements => { :action => /(browse|entry|changes|annotate|diff)/ }
  244. repository_views.connect 'projects/:id/repository/:repository_id/show/*path',
  245. :requirements => { :path => /.+/ }
  246. repository_views.connect 'projects/:id/repository/:repository_id/revision',
  247. :action => 'revision'
  248. repository_views.connect 'projects/:id/repository/revisions',
  249. :action => 'revisions'
  250. repository_views.connect 'projects/:id/repository/revisions.:format',
  251. :action => 'revisions'
  252. repository_views.connect 'projects/:id/repository/revisions/:rev',
  253. :action => 'revision'
  254. repository_views.connect 'projects/:id/repository/revisions/:rev/issues',
  255. :action => 'add_related_issue', :conditions => {:method => :post}
  256. repository_views.connect 'projects/:id/repository/revisions/:rev/issues/:issue_id',
  257. :action => 'remove_related_issue', :conditions => {:method => :delete}
  258. repository_views.connect 'projects/:id/repository/revisions/:rev/diff',
  259. :action => 'diff'
  260. repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format',
  261. :action => 'diff'
  262. repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path',
  263. :action => 'entry', :format => 'raw',
  264. :requirements => { :rev => /[a-z0-9\.\-_]+/ }
  265. repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path',
  266. :requirements => {
  267. :action => /(browse|show|entry|changes|annotate|diff)/,
  268. :rev => /[a-z0-9\.\-_]+/
  269. }
  270. repository_views.connect 'projects/:id/repository/raw/*path',
  271. :action => 'entry', :format => 'raw'
  272. repository_views.connect 'projects/:id/repository/:action/*path',
  273. :requirements => { :action => /(browse|show|entry|changes|annotate|diff)/ }
  274. repository_views.connect 'projects/:id/repository/revision',
  275. :action => 'revision'
  276. repository_views.connect 'projects/:id/repository/:repository_id',
  277. :action => 'show'
  278. end
  279. end
  280. # additional routes for having the file name at the end of url
  281. map.connect 'attachments/:id/:filename', :controller => 'attachments',
  282. :action => 'show', :id => /\d+/, :filename => /.*/,
  283. :conditions => {:method => :get}
  284. map.connect 'attachments/download/:id/:filename', :controller => 'attachments',
  285. :action => 'download', :id => /\d+/, :filename => /.*/,
  286. :conditions => {:method => :get}
  287. map.connect 'attachments/download/:id', :controller => 'attachments',
  288. :action => 'download', :id => /\d+/,
  289. :conditions => {:method => :get}
  290. map.resources :attachments, :only => [:show, :destroy]
  291. map.resources :groups, :member => {:autocomplete_for_user => :get}
  292. map.group_users 'groups/:id/users', :controller => 'groups',
  293. :action => 'add_users', :id => /\d+/,
  294. :conditions => {:method => :post}
  295. map.group_user 'groups/:id/users/:user_id', :controller => 'groups',
  296. :action => 'remove_user', :id => /\d+/,
  297. :conditions => {:method => :delete}
  298. map.connect 'groups/destroy_membership/:id', :controller => 'groups',
  299. :action => 'destroy_membership', :id => /\d+/,
  300. :conditions => {:method => :post}
  301. map.connect 'groups/edit_membership/:id', :controller => 'groups',
  302. :action => 'edit_membership', :id => /\d+/,
  303. :conditions => {:method => :post}
  304. map.resources :trackers, :except => :show
  305. map.resources :issue_statuses, :except => :show, :collection => {:update_issue_done_ratio => :post}
  306. map.resources :custom_fields, :except => :show
  307. map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]}
  308. map.resources :enumerations, :except => :show
  309. map.connect 'projects/:id/search', :controller => 'search', :action => 'index', :conditions => {:method => :get}
  310. map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get}
  311. map.connect 'mail_handler', :controller => 'mail_handler',
  312. :action => 'index', :conditions => {:method => :post}
  313. map.connect 'admin', :controller => 'admin', :action => 'index',
  314. :conditions => {:method => :get}
  315. map.connect 'admin/projects', :controller => 'admin', :action => 'projects',
  316. :conditions => {:method => :get}
  317. map.connect 'admin/plugins', :controller => 'admin', :action => 'plugins',
  318. :conditions => {:method => :get}
  319. map.connect 'admin/info', :controller => 'admin', :action => 'info',
  320. :conditions => {:method => :get}
  321. map.connect 'admin/test_email', :controller => 'admin', :action => 'test_email',
  322. :conditions => {:method => :get}
  323. map.connect 'admin/default_configuration', :controller => 'admin',
  324. :action => 'default_configuration', :conditions => {:method => :post}
  325. map.resources :auth_sources, :member => {:test_connection => :get}
  326. map.connect 'workflows', :controller => 'workflows',
  327. :action => 'index', :conditions => {:method => :get}
  328. map.connect 'workflows/edit', :controller => 'workflows',
  329. :action => 'edit', :conditions => {:method => [:get, :post]}
  330. map.connect 'workflows/copy', :controller => 'workflows',
  331. :action => 'copy', :conditions => {:method => [:get, :post]}
  332. map.connect 'settings', :controller => 'settings',
  333. :action => 'index', :conditions => {:method => :get}
  334. map.connect 'settings/edit', :controller => 'settings',
  335. :action => 'edit', :conditions => {:method => [:get, :post]}
  336. map.connect 'settings/plugin/:id', :controller => 'settings',
  337. :action => 'plugin', :conditions => {:method => [:get, :post]}
  338. map.with_options :controller => 'sys' do |sys|
  339. sys.connect 'sys/projects.:format',
  340. :action => 'projects',
  341. :conditions => {:method => :get}
  342. sys.connect 'sys/projects/:id/repository.:format',
  343. :action => 'create_project_repository',
  344. :conditions => {:method => :post}
  345. sys.connect 'sys/fetch_changesets',
  346. :action => 'fetch_changesets',
  347. :conditions => {:method => :get}
  348. end
  349. map.connect 'uploads.:format', :controller => 'attachments', :action => 'upload', :conditions => {:method => :post}
  350. map.connect 'robots.txt', :controller => 'welcome',
  351. :action => 'robots', :conditions => {:method => :get}
  352. # Used for OpenID
  353. map.root :controller => 'account', :action => 'login'
  354. end