comparison config/routes.rb @ 1298:4f746d8966dd redmine_2.3_integration

Merge from redmine-2.3 branch to create new branch redmine-2.3-integration
author Chris Cannam
date Fri, 14 Jun 2013 09:28:30 +0100
parents d8e15cc24494 622f24f53b42
children
comparison
equal deleted inserted replaced
1297:0a574315af3e 1298:4f746d8966dd
1 # Redmine - project management software 1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang 2 # Copyright (C) 2006-2013 Jean-Philippe Lang
3 # 3 #
4 # This program is free software; you can redistribute it and/or 4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License 5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2 6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version. 7 # of the License, or (at your option) any later version.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 RedmineApp::Application.routes.draw do 18 RedmineApp::Application.routes.draw do
19 root :to => 'welcome#index', :as => 'home' 19 root :to => 'welcome#index', :as => 'home'
20 20
21 match 'login', :to => 'account#login', :as => 'signin' 21 match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post]
22 match 'logout', :to => 'account#logout', :as => 'signout' 22 match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]
23 match 'account/register', :to => 'account#register', :via => [:get, :post], :as => 'register' 23 match 'account/register', :to => 'account#register', :via => [:get, :post], :as => 'register'
24 match 'account/lost_password', :to => 'account#lost_password', :via => [:get, :post], :as => 'lost_password' 24 match 'account/lost_password', :to => 'account#lost_password', :via => [:get, :post], :as => 'lost_password'
25 match 'account/activate', :to => 'account#activate', :via => :get 25 match 'account/activate', :to => 'account#activate', :via => :get
26 26
27 match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news' 27 match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news', :via => [:get, :post, :put]
28 match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue' 28 match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post, :put]
29 match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue' 29 match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue', :via => [:get, :post, :put]
30 match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue' 30 match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue', :via => [:get, :post, :put]
31 31
32 match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post 32 match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post
33 match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post] 33 match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]
34 34
35 match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post] 35 match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message'
36 get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message' 36 get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message'
37 match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post] 37 match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post]
38 get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit' 38 get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
39 39
40 post 'boards/:board_id/topics/preview', :to => 'messages#preview' 40 post 'boards/:board_id/topics/preview', :to => 'messages#preview', :as => 'preview_board_message'
41 post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply' 41 post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply'
42 post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit' 42 post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
43 post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy' 43 post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy'
44 44
45 # Misc issue routes. TODO: move into resources 45 # Misc issue routes. TODO: move into resources
46 match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues' 46 match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues'
47 match '/issues/context_menu', :to => 'context_menus#issues', :as => 'issues_context_menu' 47 match '/issues/context_menu', :to => 'context_menus#issues', :as => 'issues_context_menu', :via => [:get, :post]
48 match '/issues/changes', :to => 'journals#index', :as => 'issue_changes' 48 match '/issues/changes', :to => 'journals#index', :as => 'issue_changes', :via => :get
49 match '/issues/:id/quoted', :to => 'journals#new', :id => /\d+/, :via => :post, :as => 'quoted_issue' 49 match '/issues/:id/quoted', :to => 'journals#new', :id => /\d+/, :via => :post, :as => 'quoted_issue'
50 50
51 match '/journals/diff/:id', :to => 'journals#diff', :id => /\d+/, :via => :get 51 match '/journals/diff/:id', :to => 'journals#diff', :id => /\d+/, :via => :get
52 match '/journals/edit/:id', :to => 'journals#edit', :id => /\d+/, :via => [:get, :post] 52 match '/journals/edit/:id', :to => 'journals#edit', :id => /\d+/, :via => [:get, :post]
53 53
54 match '/projects/:project_id/issues/gantt', :to => 'gantts#show' 54 get '/projects/:project_id/issues/gantt', :to => 'gantts#show', :as => 'project_gantt'
55 match '/issues/gantt', :to => 'gantts#show' 55 get '/issues/gantt', :to => 'gantts#show'
56 56
57 match '/projects/:project_id/issues/calendar', :to => 'calendars#show' 57 get '/projects/:project_id/issues/calendar', :to => 'calendars#show', :as => 'project_calendar'
58 match '/issues/calendar', :to => 'calendars#show' 58 get '/issues/calendar', :to => 'calendars#show'
59 59
60 match 'projects/:id/issues/report', :to => 'reports#issue_report', :via => :get 60 get 'projects/:id/issues/report', :to => 'reports#issue_report', :as => 'project_issues_report'
61 match 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :via => :get 61 get 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :as => 'project_issues_report_details'
62 62
63 match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :post] 63 match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :post]
64 match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post] 64 match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post]
65 match 'my/page', :controller => 'my', :action => 'page', :via => :get 65 match 'my/page', :controller => 'my', :action => 'page', :via => :get
66 match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page 66 match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page
75 resources :users 75 resources :users
76 match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership' 76 match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership'
77 match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete 77 match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete
78 match 'users/:id/memberships', :to => 'users#edit_membership', :via => :post, :as => 'user_memberships' 78 match 'users/:id/memberships', :to => 'users#edit_membership', :via => :post, :as => 'user_memberships'
79 79
80 match 'watchers/new', :controller=> 'watchers', :action => 'new', :via => :get 80 post 'watchers/watch', :to => 'watchers#watch', :as => 'watch'
81 match 'watchers', :controller=> 'watchers', :action => 'create', :via => :post 81 delete 'watchers/watch', :to => 'watchers#unwatch'
82 match 'watchers/append', :controller=> 'watchers', :action => 'append', :via => :post 82 get 'watchers/new', :to => 'watchers#new'
83 match 'watchers/destroy', :controller=> 'watchers', :action => 'destroy', :via => :post 83 post 'watchers', :to => 'watchers#create'
84 match 'watchers/watch', :controller=> 'watchers', :action => 'watch', :via => :post 84 post 'watchers/append', :to => 'watchers#append'
85 match 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch', :via => :post 85 delete 'watchers', :to => 'watchers#destroy'
86 match 'watchers/autocomplete_for_user', :controller=> 'watchers', :action => 'autocomplete_for_user', :via => :get 86 get 'watchers/autocomplete_for_user', :to => 'watchers#autocomplete_for_user'
87 87 # Specific routes for issue watchers API
88 match 'projects/:id/settings/:tab', :to => "projects#settings" 88 post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue'
89 delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue'
89 match 'projects/:id/overview', :to => "projects#overview" 90 match 'projects/:id/overview', :to => "projects#overview"
90 91
91 resources :projects do 92 resources :projects do
92 member do 93 member do
93 get 'settings' 94 get 'settings(/:tab)', :action => 'settings', :as => 'settings'
94 post 'modules' 95 post 'modules'
95 post 'archive' 96 post 'archive'
96 post 'unarchive' 97 post 'unarchive'
97 post 'close' 98 post 'close'
98 post 'reopen' 99 post 'reopen'
99 match 'copy', :via => [:get, :post] 100 match 'copy', :via => [:get, :post]
100 end 101 end
101 102
102 resources :members, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do 103 shallow do
103 collection do 104 resources :memberships, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
104 get 'autocomplete' 105 get 'autocomplete'
105 end 106 end
106 end 107 end
107 resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do 108 shallow do
108 collection do 109 resources :members, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
109 get 'autocomplete' 110 collection do
111 get 'autocomplete'
112 end
110 end 113 end
111 end 114 end
112 115
113 resource :enumerations, :controller => 'project_enumerations', :only => [:update, :destroy] 116 resource :enumerations, :controller => 'project_enumerations', :only => [:update, :destroy]
114 117
115 match 'issues/:copy_from/copy', :to => 'issues#new' 118 get 'issues/:copy_from/copy', :to => 'issues#new', :as => 'copy_issue'
116 resources :issues, :only => [:index, :new, :create] do 119 resources :issues, :only => [:index, :new, :create] do
117 resources :time_entries, :controller => 'timelog' do 120 resources :time_entries, :controller => 'timelog' do
118 collection do 121 collection do
119 get 'report' 122 get 'report'
120 end 123 end
121 end 124 end
122 end 125 end
123 # issue form update 126 # issue form update
124 match 'issues/new', :controller => 'issues', :action => 'new', :via => [:put, :post], :as => 'issue_form' 127 match 'issues/update_form', :controller => 'issues', :action => 'update_form', :via => [:put, :post], :as => 'issue_form'
125 128
126 resources :files, :only => [:index, :new, :create] 129 resources :files, :only => [:index, :new, :create]
127 130
128 resources :versions, :except => [:index, :show, :edit, :update, :destroy] do 131 resources :versions, :except => [:index, :show, :edit, :update, :destroy] do
129 collection do 132 collection do
130 put 'close_completed' 133 put 'close_completed'
131 end 134 end
132 end 135 end
133 match 'versions.:format', :to => 'versions#index' 136 get 'versions.:format', :to => 'versions#index'
134 match 'roadmap', :to => 'versions#index', :format => false 137 get 'roadmap', :to => 'versions#index', :format => false
135 match 'versions', :to => 'versions#index' 138 get 'versions', :to => 'versions#index'
136 139
137 resources :news, :except => [:show, :edit, :update, :destroy] 140 resources :news, :except => [:show, :edit, :update, :destroy]
138 resources :time_entries, :controller => 'timelog' do 141 resources :time_entries, :controller => 'timelog' do
139 get 'report', :on => :collection 142 get 'report', :on => :collection
140 end 143 end
141 resources :queries, :only => [:new, :create] 144 resources :queries, :only => [:new, :create]
142 resources :issue_categories, :shallow => true 145 shallow do
146 resources :issue_categories
147 end
143 resources :documents, :except => [:show, :edit, :update, :destroy] 148 resources :documents, :except => [:show, :edit, :update, :destroy]
144 resources :boards 149 resources :boards
145 resources :repositories, :shallow => true, :except => [:index, :show] do 150 shallow do
146 member do 151 resources :repositories, :except => [:index, :show] do
147 match 'committers', :via => [:get, :post] 152 member do
148 end 153 match 'committers', :via => [:get, :post]
149 end 154 end
150 155 end
156 end
157
151 match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get 158 match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get
152 resources :wiki, :except => [:index, :new, :create] do 159 resources :wiki, :except => [:index, :new, :create], :as => 'wiki_page' do
153 member do 160 member do
154 get 'rename' 161 get 'rename'
155 post 'rename' 162 post 'rename'
156 get 'history' 163 get 'history'
157 get 'diff' 164 get 'diff'
163 get 'export' 170 get 'export'
164 get 'date_index' 171 get 'date_index'
165 end 172 end
166 end 173 end
167 match 'wiki', :controller => 'wiki', :action => 'show', :via => :get 174 match 'wiki', :controller => 'wiki', :action => 'show', :via => :get
168 get 'wiki/:id/:version', :to => 'wiki#show' 175 get 'wiki/:id/:version', :to => 'wiki#show', :constraints => {:version => /\d+/}
169 delete 'wiki/:id/:version', :to => 'wiki#destroy_version' 176 delete 'wiki/:id/:version', :to => 'wiki#destroy_version'
170 get 'wiki/:id/:version/annotate', :to => 'wiki#annotate' 177 get 'wiki/:id/:version/annotate', :to => 'wiki#annotate'
171 get 'wiki/:id/:version/diff', :to => 'wiki#diff' 178 get 'wiki/:id/:version/diff', :to => 'wiki#diff'
172 end 179 end
173 180
179 resources :time_entries, :controller => 'timelog' do 186 resources :time_entries, :controller => 'timelog' do
180 collection do 187 collection do
181 get 'report' 188 get 'report'
182 end 189 end
183 end 190 end
184 resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy] 191 shallow do
192 resources :relations, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy]
193 end
185 end 194 end
186 match '/issues', :controller => 'issues', :action => 'destroy', :via => :delete 195 match '/issues', :controller => 'issues', :action => 'destroy', :via => :delete
187 196
188 # changed this route to ensure compatibility with Rails 3 --lf.20130109 197 # changed this route to ensure compatibility with Rails 3 --lf.20130109
189 match 'explore' => 'projects#explore' 198 match 'explore' => 'projects#explore'
200 209
201 resources :documents, :only => [:show, :edit, :update, :destroy] do 210 resources :documents, :only => [:show, :edit, :update, :destroy] do
202 post 'add_attachment', :on => :member 211 post 'add_attachment', :on => :member
203 end 212 end
204 213
205 match '/time_entries/context_menu', :to => 'context_menus#time_entries', :as => :time_entries_context_menu 214 match '/time_entries/context_menu', :to => 'context_menus#time_entries', :as => :time_entries_context_menu, :via => [:get, :post]
206 215
207 resources :time_entries, :controller => 'timelog', :except => :destroy do 216 resources :time_entries, :controller => 'timelog', :except => :destroy do
208 collection do 217 collection do
209 get 'report' 218 get 'report'
210 get 'bulk_edit' 219 get 'bulk_edit'
212 end 221 end
213 end 222 end
214 match '/time_entries/:id', :to => 'timelog#destroy', :via => :delete, :id => /\d+/ 223 match '/time_entries/:id', :to => 'timelog#destroy', :via => :delete, :id => /\d+/
215 # TODO: delete /time_entries for bulk deletion 224 # TODO: delete /time_entries for bulk deletion
216 match '/time_entries/destroy', :to => 'timelog#destroy', :via => :delete 225 match '/time_entries/destroy', :to => 'timelog#destroy', :via => :delete
217
218 # TODO: port to be part of the resources route(s)
219 match 'projects/:id/settings/:tab', :to => 'projects#settings', :via => :get
220 226
221 get 'projects/:id/activity', :to => 'activities#index' 227 get 'projects/:id/activity', :to => 'activities#index'
222 get 'projects/:id/activity.:format', :to => 'activities#index' 228 get 'projects/:id/activity.:format', :to => 'activities#index'
223 get 'activity', :to => 'activities#index' 229 get 'activity', :to => 'activities#index'
224 230
269 275
270 get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil 276 get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
271 get 'projects/:id/repository', :to => 'repositories#show', :path => nil 277 get 'projects/:id/repository', :to => 'repositories#show', :path => nil
272 278
273 # additional routes for having the file name at the end of url 279 # additional routes for having the file name at the end of url
274 match 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/, :via => :get 280 get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment'
275 match 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/, :via => :get 281 get 'attachments/download/:id/:filename', :to => 'attachments#download', :id => /\d+/, :filename => /.*/, :as => 'download_named_attachment'
276 match 'attachments/download/:id', :controller => 'attachments', :action => 'download', :id => /\d+/, :via => :get 282 get 'attachments/download/:id', :to => 'attachments#download', :id => /\d+/
283 get 'attachments/thumbnail/:id(/:size)', :to => 'attachments#thumbnail', :id => /\d+/, :size => /\d+/, :as => 'thumbnail'
277 match 'attachments/toggle_active/:id', :controller => 'attachments', :action => 'toggle_active', :id => /\d+/, :via => :get 284 match 'attachments/toggle_active/:id', :controller => 'attachments', :action => 'toggle_active', :id => /\d+/, :via => :get
278 match 'attachments/thumbnail/:id(/:size)', :controller => 'attachments', :action => 'thumbnail', :id => /\d+/, :via => :get, :size => /\d+/
279 resources :attachments, :only => [:show, :destroy] 285 resources :attachments, :only => [:show, :destroy]
280 286
281 resources :groups do 287 resources :groups do
282 member do 288 member do
283 get 'autocomplete_for_user' 289 get 'autocomplete_for_user'
320 match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :get 326 match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :get
321 match 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :via => :post 327 match 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :via => :post
322 328
323 resources :auth_sources do 329 resources :auth_sources do
324 member do 330 member do
325 get 'test_connection' 331 get 'test_connection', :as => 'try_connection'
332 end
333 collection do
334 get 'autocomplete_for_new_user'
326 end 335 end
327 end 336 end
328 337
329 match 'workflows', :controller => 'workflows', :action => 'index', :via => :get 338 match 'workflows', :controller => 'workflows', :action => 'index', :via => :get
330 match 'workflows/edit', :controller => 'workflows', :action => 'edit', :via => [:get, :post] 339 match 'workflows/edit', :controller => 'workflows', :action => 'edit', :via => [:get, :post]
331 match 'workflows/permissions', :controller => 'workflows', :action => 'permissions', :via => [:get, :post] 340 match 'workflows/permissions', :controller => 'workflows', :action => 'permissions', :via => [:get, :post]
332 match 'workflows/copy', :controller => 'workflows', :action => 'copy', :via => [:get, :post] 341 match 'workflows/copy', :controller => 'workflows', :action => 'copy', :via => [:get, :post]
333 match 'settings', :controller => 'settings', :action => 'index', :via => :get 342 match 'settings', :controller => 'settings', :action => 'index', :via => :get
334 match 'settings/edit', :controller => 'settings', :action => 'edit', :via => [:get, :post] 343 match 'settings/edit', :controller => 'settings', :action => 'edit', :via => [:get, :post]
335 match 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :via => [:get, :post] 344 match 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :via => [:get, :post], :as => 'plugin_settings'
336 345
337 match 'sys/projects', :to => 'sys#projects', :via => :get 346 match 'sys/projects', :to => 'sys#projects', :via => :get
338 match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post 347 match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post
339 match 'sys/fetch_changesets', :to => 'sys#fetch_changesets', :via => :get 348 match 'sys/fetch_changesets', :to => 'sys#fetch_changesets', :via => :get
340 349