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