##// END OF EJS Templates
route: move time entries matchings and resources after /issues matchings...
Toshi MARUYAMA -
r8326:25ead5fd42db
parent child
Show More
@@ -1,376 +1,376
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 9 map.home '', :controller => 'welcome', :conditions => {:method => :get}
10 10
11 11 map.signin 'login', :controller => 'account', :action => 'login',
12 12 :conditions => {:method => [:get, :post]}
13 13 map.signout 'logout', :controller => 'account', :action => 'logout',
14 14 :conditions => {:method => :get}
15 15 map.connect 'account/register', :controller => 'account', :action => 'register',
16 16 :conditions => {:method => [:get, :post]}
17 17 map.connect 'account/lost_password', :controller => 'account', :action => 'lost_password',
18 18 :conditions => {:method => [:get, :post]}
19 19 map.connect 'account/activate', :controller => 'account', :action => 'activate',
20 20 :conditions => {:method => :get}
21 21
22 map.connect '/time_entries/destroy',
23 :controller => 'timelog', :action => 'destroy',
24 :conditions => { :method => :delete }
25 map.time_entries_context_menu '/time_entries/context_menu',
26 :controller => 'context_menus', :action => 'time_entries'
27
28 map.resources :time_entries, :controller => 'timelog',
29 :collection => {:report => :get, :bulk_edit => :get, :bulk_update => :post}
30
31 22 map.connect 'projects/:id/wiki', :controller => 'wikis',
32 23 :action => 'edit', :conditions => {:method => :post}
33 24 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis',
34 25 :action => 'destroy', :conditions => {:method => [:get, :post]}
35 26
36 27 map.with_options :controller => 'messages' do |messages_routes|
37 28 messages_routes.with_options :conditions => {:method => :get} do |messages_views|
38 29 messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
39 30 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
40 31 messages_views.connect 'boards/:board_id/topics/quote/:id', :action => 'quote'
41 32 messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
42 33 end
43 34 messages_routes.with_options :conditions => {:method => :post} do |messages_actions|
44 35 messages_actions.connect 'boards/:board_id/topics/new', :action => 'new'
45 36 messages_actions.connect 'boards/:board_id/topics/preview', :action => 'preview'
46 37 messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply'
47 38 messages_actions.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
48 39 messages_actions.connect 'boards/:board_id/topics/:id/destroy', :action => 'destroy'
49 40 end
50 41 end
51 42
52 43 map.resources :issue_moves, :only => [:new, :create],
53 44 :path_prefix => '/issues', :as => 'move'
54 45
55 46 # Misc issue routes. TODO: move into resources
56 47 map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes',
57 48 :action => 'issues', :conditions => { :method => :get }
58 49 # TODO: would look nicer as /issues/:id/preview
59 50 map.preview_issue '/issues/preview/:id', :controller => 'previews',
60 51 :action => 'issue'
61 52 map.issues_context_menu '/issues/context_menu',
62 53 :controller => 'context_menus', :action => 'issues'
63 54
64 55 map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index'
65 56 map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new',
66 57 :id => /\d+/, :conditions => { :method => :post }
67 58
68 59 map.connect '/journals/diff/:id', :controller => 'journals', :action => 'diff',
69 60 :id => /\d+/, :conditions => { :method => :get }
70 61 map.connect '/journals/edit/:id', :controller => 'journals', :action => 'edit',
71 62 :id => /\d+/, :conditions => { :method => [:get, :post] }
72 63
73 64 map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes|
74 65 gantts_routes.connect '/projects/:project_id/issues/gantt'
75 66 gantts_routes.connect '/projects/:project_id/issues/gantt.:format'
76 67 gantts_routes.connect '/issues/gantt.:format'
77 68 end
78 69
79 70 map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes|
80 71 calendars_routes.connect '/projects/:project_id/issues/calendar'
81 72 calendars_routes.connect '/issues/calendar'
82 73 end
83 74
84 75 map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports|
85 76 reports.connect 'projects/:id/issues/report', :action => 'issue_report'
86 77 reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details'
87 78 end
88 79
89 80 map.connect 'my/account', :controller => 'my', :action => 'account',
90 81 :conditions => {:method => [:get, :post]}
91 82 map.connect 'my/page', :controller => 'my', :action => 'page',
92 83 :conditions => {:method => :get}
93 84 # Redirects to my/page
94 85 map.connect 'my', :controller => 'my', :action => 'index',
95 86 :conditions => {:method => :get}
96 87 map.connect 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key',
97 88 :conditions => {:method => :post}
98 89 map.connect 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key',
99 90 :conditions => {:method => :post}
100 91 map.connect 'my/password', :controller => 'my', :action => 'password',
101 92 :conditions => {:method => [:get, :post]}
102 93 map.connect 'my/page_layout', :controller => 'my', :action => 'page_layout',
103 94 :conditions => {:method => :get}
104 95 map.connect 'my/add_block', :controller => 'my', :action => 'add_block',
105 96 :conditions => {:method => :post}
106 97 map.connect 'my/remove_block', :controller => 'my', :action => 'remove_block',
107 98 :conditions => {:method => :post}
108 99 map.connect 'my/order_blocks', :controller => 'my', :action => 'order_blocks',
109 100 :conditions => {:method => :post}
110 101
111 102 map.connect 'projects/:id/members/new', :controller => 'members',
112 103 :action => 'new', :conditions => { :method => :post }
113 104 map.connect 'members/edit/:id', :controller => 'members',
114 105 :action => 'edit', :id => /\d+/, :conditions => { :method => :post }
115 106 map.connect 'members/destroy/:id', :controller => 'members',
116 107 :action => 'destroy', :id => /\d+/, :conditions => { :method => :post }
117 108 map.connect 'members/autocomplete_for_member/:id', :controller => 'members',
118 109 :action => 'autocomplete_for_member', :conditions => { :method => :post }
119 110
120 111 map.with_options :controller => 'users' do |users|
121 112 users.user_membership 'users/:id/memberships/:membership_id',
122 113 :action => 'edit_membership',
123 114 :conditions => {:method => :put}
124 115 users.connect 'users/:id/memberships/:membership_id',
125 116 :action => 'destroy_membership',
126 117 :conditions => {:method => :delete}
127 118 users.user_memberships 'users/:id/memberships',
128 119 :action => 'edit_membership',
129 120 :conditions => {:method => :post}
130 121 end
131 122 map.resources :users
132 123
133 124 # For nice "roadmap" in the url for the index action
134 125 map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index'
135 126
136 127 map.connect 'news', :controller => 'news', :action => 'index'
137 128 map.connect 'news.:format', :controller => 'news', :action => 'index'
138 129 map.preview_news '/news/preview', :controller => 'previews', :action => 'news'
139 130 map.connect 'news/:id/comments', :controller => 'comments',
140 131 :action => 'create', :conditions => {:method => :post}
141 132 map.connect 'news/:id/comments/:comment_id', :controller => 'comments',
142 133 :action => 'destroy', :conditions => {:method => :delete}
143 134
144 135 map.connect 'watchers/new', :controller=> 'watchers', :action => 'new',
145 136 :conditions => {:method => [:get, :post]}
146 137 map.connect 'watchers/destroy', :controller=> 'watchers', :action => 'destroy',
147 138 :conditions => {:method => :post}
148 139 map.connect 'watchers/watch', :controller=> 'watchers', :action => 'watch',
149 140 :conditions => {:method => :post}
150 141 map.connect 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch',
151 142 :conditions => {:method => :post}
152 143
153 144 # TODO: port to be part of the resources route(s)
154 145 map.with_options :conditions => {:method => :get} do |project_views|
155 146 project_views.connect 'projects/:id/settings/:tab',
156 147 :controller => 'projects', :action => 'settings'
157 148 project_views.connect 'projects/:project_id/issues/:copy_from/copy',
158 149 :controller => 'issues', :action => 'new'
159 150 end
160 151
161 152 map.resources :projects, :member => {
162 153 :copy => [:get, :post],
163 154 :settings => :get,
164 155 :modules => :post,
165 156 :archive => :post,
166 157 :unarchive => :post
167 158 } do |project|
168 159 project.resource :project_enumerations, :as => 'enumerations',
169 160 :only => [:update, :destroy]
170 161 # issue form update
171 162 project.issue_form 'issues/new', :controller => 'issues',
172 163 :action => 'new', :conditions => {:method => :post}
173 164 project.resources :issues, :only => [:index, :new, :create] do |issues|
174 165 issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get}
175 166 end
176 167
177 168 project.resources :files, :only => [:index, :new, :create]
178 169 project.resources :versions, :shallow => true,
179 170 :collection => {:close_completed => :put},
180 171 :member => {:status_by => :post}
181 172 project.resources :news, :shallow => true
182 173 project.resources :time_entries, :controller => 'timelog', :path_prefix => 'projects/:project_id', :collection => {:report => :get}
183 174 project.resources :queries, :only => [:new, :create]
184 175 project.resources :issue_categories, :shallow => true
185 176 project.resources :documents, :shallow => true, :member => {:add_attachment => :post}
186 177 project.resources :boards
187 178
188 179 project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get}
189 180 project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get}
190 181 project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil
191 182 project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff'
192 183 project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate'
193 184 project.resources :wiki, :except => [:new, :create], :member => {
194 185 :rename => [:get, :post],
195 186 :history => :get,
196 187 :preview => :any,
197 188 :protect => :post,
198 189 :add_attachment => :post
199 190 }, :collection => {
200 191 :export => :get,
201 192 :date_index => :get
202 193 }
203 194 end
204 195
205 196 map.resources :queries, :except => [:show]
206 197 map.resources :issues,
207 198 :collection => {:bulk_edit => :get, :bulk_update => :post} do |issues|
208 199 issues.resources :time_entries, :controller => 'timelog',
209 200 :collection => {:report => :get}
210 201 issues.resources :relations, :shallow => true,
211 202 :controller => 'issue_relations',
212 203 :only => [:index, :show, :create, :destroy]
213 204 end
214 205 # Bulk deletion
215 206 map.connect '/issues', :controller => 'issues', :action => 'destroy',
216 207 :conditions => {:method => :delete}
217 208
209 map.connect '/time_entries/destroy',
210 :controller => 'timelog', :action => 'destroy',
211 :conditions => { :method => :delete }
212 map.time_entries_context_menu '/time_entries/context_menu',
213 :controller => 'context_menus', :action => 'time_entries'
214
215 map.resources :time_entries, :controller => 'timelog',
216 :collection => {:report => :get, :bulk_edit => :get, :bulk_update => :post}
217
218 218 map.with_options :controller => 'activities', :action => 'index',
219 219 :conditions => {:method => :get} do |activity|
220 220 activity.connect 'projects/:id/activity'
221 221 activity.connect 'projects/:id/activity.:format'
222 222 activity.connect 'activity', :id => nil
223 223 activity.connect 'activity.:format', :id => nil
224 224 end
225 225
226 226 map.with_options :controller => 'repositories' do |repositories|
227 227 repositories.with_options :conditions => {:method => :get} do |repository_views|
228 228 repository_views.connect 'projects/:id/repository', :action => 'show'
229 229 repository_views.connect 'projects/:id/repository/edit', :action => 'edit'
230 230 repository_views.connect 'projects/:id/repository/statistics', :action => 'stats'
231 231
232 232 repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions'
233 233 repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions'
234 234 repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision'
235 235 repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff'
236 236 repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff'
237 237 repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry',
238 238 :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
239 239 repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path',
240 240 :requirements => { :rev => /[a-z0-9\.\-_]+/ }
241 241
242 242 repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw'
243 243 repository_views.connect 'projects/:id/repository/browse/*path', :action => 'browse'
244 244 repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry'
245 245 repository_views.connect 'projects/:id/repository/changes/*path', :action => 'changes'
246 246 repository_views.connect 'projects/:id/repository/annotate/*path', :action => 'annotate'
247 247 repository_views.connect 'projects/:id/repository/diff/*path', :action => 'diff'
248 248 repository_views.connect 'projects/:id/repository/show/*path', :action => 'show'
249 249 repository_views.connect 'projects/:id/repository/graph', :action => 'graph'
250 250 end
251 251
252 252 repositories.connect 'projects/:id/repository/revision', :action => 'revision',
253 253 :conditions => {:method => [:get, :post]}
254 254
255 255 repositories.connect 'projects/:id/repository/committers', :action => 'committers',
256 256 :conditions => {:method => [:get, :post]}
257 257 repositories.connect 'projects/:id/repository/edit', :action => 'edit',
258 258 :conditions => {:method => :post}
259 259 repositories.connect 'projects/:id/repository/destroy', :action => 'destroy',
260 260 :conditions => {:method => :post}
261 261 end
262 262
263 263 # additional routes for having the file name at the end of url
264 264 map.connect 'attachments/:id/:filename', :controller => 'attachments',
265 265 :action => 'show', :id => /\d+/, :filename => /.*/,
266 266 :conditions => {:method => :get}
267 267 map.connect 'attachments/download/:id/:filename', :controller => 'attachments',
268 268 :action => 'download', :id => /\d+/, :filename => /.*/,
269 269 :conditions => {:method => :get}
270 270 map.connect 'attachments/download/:id', :controller => 'attachments',
271 271 :action => 'download', :id => /\d+/,
272 272 :conditions => {:method => :get}
273 273 map.resources :attachments, :only => [:show, :destroy]
274 274
275 275 map.resources :groups, :member => {:autocomplete_for_user => :get}
276 276 map.group_users 'groups/:id/users', :controller => 'groups',
277 277 :action => 'add_users', :id => /\d+/,
278 278 :conditions => {:method => :post}
279 279 map.group_user 'groups/:id/users/:user_id', :controller => 'groups',
280 280 :action => 'remove_user', :id => /\d+/,
281 281 :conditions => {:method => :delete}
282 282 map.connect 'groups/destroy_membership/:id', :controller => 'groups',
283 283 :action => 'destroy_membership', :id => /\d+/,
284 284 :conditions => {:method => :post}
285 285 map.connect 'groups/edit_membership/:id', :controller => 'groups',
286 286 :action => 'edit_membership', :id => /\d+/,
287 287 :conditions => {:method => :post}
288 288
289 289 map.resources :trackers, :except => :show
290 290 map.resources :issue_statuses, :except => :show, :collection => {:update_issue_done_ratio => :post}
291 291 map.resources :custom_fields, :except => :show
292 292 map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]}
293 293 map.resources :enumerations, :except => :show
294 294
295 295 map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get}
296 296
297 297 map.connect 'mail_handler', :controller => 'mail_handler',
298 298 :action => 'index', :conditions => {:method => :post}
299 299
300 300 map.connect 'admin', :controller => 'admin', :action => 'index',
301 301 :conditions => {:method => :get}
302 302 map.connect 'admin/projects', :controller => 'admin', :action => 'projects',
303 303 :conditions => {:method => :get}
304 304 map.connect 'admin/plugins', :controller => 'admin', :action => 'plugins',
305 305 :conditions => {:method => :get}
306 306 map.connect 'admin/info', :controller => 'admin', :action => 'info',
307 307 :conditions => {:method => :get}
308 308 map.connect 'admin/test_email', :controller => 'admin', :action => 'test_email',
309 309 :conditions => {:method => :get}
310 310 map.connect 'admin/default_configuration', :controller => 'admin',
311 311 :action => 'default_configuration', :conditions => {:method => :post}
312 312
313 313 # Used by AuthSourcesControllerTest
314 314 # TODO : refactor *AuthSourcesController to remove these routes
315 315 map.connect 'auth_sources', :controller => 'auth_sources',
316 316 :action => 'index', :conditions => {:method => :get}
317 317 map.connect 'auth_sources/new', :controller => 'auth_sources',
318 318 :action => 'new', :conditions => {:method => :get}
319 319 map.connect 'auth_sources/create', :controller => 'auth_sources',
320 320 :action => 'create', :conditions => {:method => :post}
321 321 map.connect 'auth_sources/destroy/:id', :controller => 'auth_sources',
322 322 :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
323 323 map.connect 'auth_sources/test_connection/:id', :controller => 'auth_sources',
324 324 :action => 'test_connection', :conditions => {:method => :get}
325 325 map.connect 'auth_sources/edit/:id', :controller => 'auth_sources',
326 326 :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
327 327 map.connect 'auth_sources/update/:id', :controller => 'auth_sources',
328 328 :action => 'update', :id => /\d+/, :conditions => {:method => :post}
329 329
330 330 map.connect 'ldap_auth_sources', :controller => 'ldap_auth_sources',
331 331 :action => 'index', :conditions => {:method => :get}
332 332 map.connect 'ldap_auth_sources/new', :controller => 'ldap_auth_sources',
333 333 :action => 'new', :conditions => {:method => :get}
334 334 map.connect 'ldap_auth_sources/create', :controller => 'ldap_auth_sources',
335 335 :action => 'create', :conditions => {:method => :post}
336 336 map.connect 'ldap_auth_sources/destroy/:id', :controller => 'ldap_auth_sources',
337 337 :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
338 338 map.connect 'ldap_auth_sources/test_connection/:id', :controller => 'ldap_auth_sources',
339 339 :action => 'test_connection', :conditions => {:method => :get}
340 340 map.connect 'ldap_auth_sources/edit/:id', :controller => 'ldap_auth_sources',
341 341 :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
342 342 map.connect 'ldap_auth_sources/update/:id', :controller => 'ldap_auth_sources',
343 343 :action => 'update', :id => /\d+/, :conditions => {:method => :post}
344 344
345 345 map.connect 'workflows', :controller => 'workflows',
346 346 :action => 'index', :conditions => {:method => :get}
347 347 map.connect 'workflows/edit', :controller => 'workflows',
348 348 :action => 'edit', :conditions => {:method => [:get, :post]}
349 349 map.connect 'workflows/copy', :controller => 'workflows',
350 350 :action => 'copy', :conditions => {:method => [:get, :post]}
351 351
352 352 map.connect 'settings', :controller => 'settings',
353 353 :action => 'index', :conditions => {:method => :get}
354 354 map.connect 'settings/edit', :controller => 'settings',
355 355 :action => 'edit', :conditions => {:method => [:get, :post]}
356 356 map.connect 'settings/plugin/:id', :controller => 'settings',
357 357 :action => 'plugin', :conditions => {:method => [:get, :post]}
358 358
359 359 map.with_options :controller => 'sys' do |sys|
360 360 sys.connect 'sys/projects.:format',
361 361 :action => 'projects',
362 362 :conditions => {:method => :get}
363 363 sys.connect 'sys/projects/:id/repository.:format',
364 364 :action => 'create_project_repository',
365 365 :conditions => {:method => :post}
366 366 sys.connect 'sys/fetch_changesets',
367 367 :action => 'fetch_changesets',
368 368 :conditions => {:method => :get}
369 369 end
370 370
371 371 map.connect 'robots.txt', :controller => 'welcome',
372 372 :action => 'robots', :conditions => {:method => :get}
373 373
374 374 # Used for OpenID
375 375 map.root :controller => 'account', :action => 'login'
376 376 end
General Comments 0
You need to be logged in to leave comments. Login now