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