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