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