##// END OF EJS Templates
summary: don't link explicitly to /summary...
Mads Kiilerich -
r3283:a34b9842 beta
parent child Browse files
Show More
@@ -1,629 +1,629
1 1 """
2 2 Routes configuration
3 3
4 4 The more specific and detailed routes should be defined first so they
5 5 may take precedent over the more generic routes. For more information
6 6 refer to the routes manual at http://routes.groovie.org/docs/
7 7 """
8 8 from __future__ import with_statement
9 9 from routes import Mapper
10 10
11 11 # prefix for non repository related links needs to be prefixed with `/`
12 12 ADMIN_PREFIX = '/_admin'
13 13
14 14
15 15 def make_map(config):
16 16 """Create, configure and return the routes Mapper"""
17 17 rmap = Mapper(directory=config['pylons.paths']['controllers'],
18 18 always_scan=config['debug'])
19 19 rmap.minimization = False
20 20 rmap.explicit = False
21 21
22 22 from rhodecode.lib.utils import is_valid_repo
23 23 from rhodecode.lib.utils import is_valid_repos_group
24 24
25 25 def check_repo(environ, match_dict):
26 26 """
27 27 check for valid repository for proper 404 handling
28 28
29 29 :param environ:
30 30 :param match_dict:
31 31 """
32 32 from rhodecode.model.db import Repository
33 33 repo_name = match_dict.get('repo_name')
34 34
35 35 if match_dict.get('f_path'):
36 36 #fix for multiple initial slashes that causes errors
37 37 match_dict['f_path'] = match_dict['f_path'].lstrip('/')
38 38
39 39 try:
40 40 by_id = repo_name.split('_')
41 41 if len(by_id) == 2 and by_id[1].isdigit() and by_id[0] == '':
42 42 repo_name = Repository.get(by_id[1]).repo_name
43 43 match_dict['repo_name'] = repo_name
44 44 except:
45 45 pass
46 46
47 47 return is_valid_repo(repo_name, config['base_path'])
48 48
49 49 def check_group(environ, match_dict):
50 50 """
51 51 check for valid repositories group for proper 404 handling
52 52
53 53 :param environ:
54 54 :param match_dict:
55 55 """
56 56 repos_group_name = match_dict.get('group_name')
57 57 return is_valid_repos_group(repos_group_name, config['base_path'])
58 58
59 59 def check_int(environ, match_dict):
60 60 return match_dict.get('id').isdigit()
61 61
62 62 # The ErrorController route (handles 404/500 error pages); it should
63 63 # likely stay at the top, ensuring it can always be resolved
64 64 rmap.connect('/error/{action}', controller='error')
65 65 rmap.connect('/error/{action}/{id}', controller='error')
66 66
67 67 #==========================================================================
68 68 # CUSTOM ROUTES HERE
69 69 #==========================================================================
70 70
71 71 #MAIN PAGE
72 72 rmap.connect('home', '/', controller='home', action='index')
73 73 rmap.connect('repo_switcher', '/repos', controller='home',
74 74 action='repo_switcher')
75 75 rmap.connect('branch_tag_switcher', '/branches-tags/{repo_name:.*?}',
76 76 controller='home', action='branch_tag_switcher')
77 77 rmap.connect('bugtracker',
78 78 "http://bitbucket.org/marcinkuzminski/rhodecode/issues",
79 79 _static=True)
80 80 rmap.connect('rst_help',
81 81 "http://docutils.sourceforge.net/docs/user/rst/quickref.html",
82 82 _static=True)
83 83 rmap.connect('rhodecode_official', "http://rhodecode.org", _static=True)
84 84
85 85 #ADMIN REPOSITORY REST ROUTES
86 86 with rmap.submapper(path_prefix=ADMIN_PREFIX,
87 87 controller='admin/repos') as m:
88 88 m.connect("repos", "/repos",
89 89 action="create", conditions=dict(method=["POST"]))
90 90 m.connect("repos", "/repos",
91 91 action="index", conditions=dict(method=["GET"]))
92 92 m.connect("formatted_repos", "/repos.{format}",
93 93 action="index",
94 94 conditions=dict(method=["GET"]))
95 95 m.connect("new_repo", "/repos/new",
96 96 action="new", conditions=dict(method=["GET"]))
97 97 m.connect("formatted_new_repo", "/repos/new.{format}",
98 98 action="new", conditions=dict(method=["GET"]))
99 99 m.connect("/repos/{repo_name:.*?}",
100 100 action="update", conditions=dict(method=["PUT"],
101 101 function=check_repo))
102 102 m.connect("/repos/{repo_name:.*?}",
103 103 action="delete", conditions=dict(method=["DELETE"],
104 104 function=check_repo))
105 105 m.connect("edit_repo", "/repos/{repo_name:.*?}/edit",
106 106 action="edit", conditions=dict(method=["GET"],
107 107 function=check_repo))
108 108 m.connect("formatted_edit_repo", "/repos/{repo_name:.*?}.{format}/edit",
109 109 action="edit", conditions=dict(method=["GET"],
110 110 function=check_repo))
111 111 m.connect("repo", "/repos/{repo_name:.*?}",
112 112 action="show", conditions=dict(method=["GET"],
113 113 function=check_repo))
114 114 m.connect("formatted_repo", "/repos/{repo_name:.*?}.{format}",
115 115 action="show", conditions=dict(method=["GET"],
116 116 function=check_repo))
117 117 #ajax delete repo perm user
118 118 m.connect('delete_repo_user', "/repos_delete_user/{repo_name:.*?}",
119 119 action="delete_perm_user",
120 120 conditions=dict(method=["DELETE"], function=check_repo))
121 121
122 122 #ajax delete repo perm users_group
123 123 m.connect('delete_repo_users_group',
124 124 "/repos_delete_users_group/{repo_name:.*?}",
125 125 action="delete_perm_users_group",
126 126 conditions=dict(method=["DELETE"], function=check_repo))
127 127
128 128 #settings actions
129 129 m.connect('repo_stats', "/repos_stats/{repo_name:.*?}",
130 130 action="repo_stats", conditions=dict(method=["DELETE"],
131 131 function=check_repo))
132 132 m.connect('repo_cache', "/repos_cache/{repo_name:.*?}",
133 133 action="repo_cache", conditions=dict(method=["DELETE"],
134 134 function=check_repo))
135 135 m.connect('repo_public_journal', "/repos_public_journal/{repo_name:.*?}",
136 136 action="repo_public_journal", conditions=dict(method=["PUT"],
137 137 function=check_repo))
138 138 m.connect('repo_pull', "/repo_pull/{repo_name:.*?}",
139 139 action="repo_pull", conditions=dict(method=["PUT"],
140 140 function=check_repo))
141 141 m.connect('repo_as_fork', "/repo_as_fork/{repo_name:.*?}",
142 142 action="repo_as_fork", conditions=dict(method=["PUT"],
143 143 function=check_repo))
144 144 m.connect('repo_locking', "/repo_locking/{repo_name:.*?}",
145 145 action="repo_locking", conditions=dict(method=["PUT"],
146 146 function=check_repo))
147 147
148 148 with rmap.submapper(path_prefix=ADMIN_PREFIX,
149 149 controller='admin/repos_groups') as m:
150 150 m.connect("repos_groups", "/repos_groups",
151 151 action="create", conditions=dict(method=["POST"]))
152 152 m.connect("repos_groups", "/repos_groups",
153 153 action="index", conditions=dict(method=["GET"]))
154 154 m.connect("formatted_repos_groups", "/repos_groups.{format}",
155 155 action="index", conditions=dict(method=["GET"]))
156 156 m.connect("new_repos_group", "/repos_groups/new",
157 157 action="new", conditions=dict(method=["GET"]))
158 158 m.connect("formatted_new_repos_group", "/repos_groups/new.{format}",
159 159 action="new", conditions=dict(method=["GET"]))
160 160 m.connect("update_repos_group", "/repos_groups/{group_name:.*?}",
161 161 action="update", conditions=dict(method=["PUT"],
162 162 function=check_group))
163 163 m.connect("delete_repos_group", "/repos_groups/{group_name:.*?}",
164 164 action="delete", conditions=dict(method=["DELETE"],
165 165 function=check_group))
166 166 m.connect("edit_repos_group", "/repos_groups/{group_name:.*?}/edit",
167 167 action="edit", conditions=dict(method=["GET"],))
168 168 m.connect("formatted_edit_repos_group",
169 169 "/repos_groups/{group_name:.*?}.{format}/edit",
170 170 action="edit", conditions=dict(method=["GET"],
171 171 function=check_group))
172 172 m.connect("repos_group", "/repos_groups/{group_name:.*?}",
173 173 action="show", conditions=dict(method=["GET"],
174 174 function=check_group))
175 175 m.connect("formatted_repos_group", "/repos_groups/{group_name:.*?}.{format}",
176 176 action="show", conditions=dict(method=["GET"],
177 177 function=check_group))
178 178 # ajax delete repos group perm user
179 179 m.connect('delete_repos_group_user_perm',
180 180 "/delete_repos_group_user_perm/{group_name:.*?}",
181 181 action="delete_repos_group_user_perm",
182 182 conditions=dict(method=["DELETE"], function=check_group))
183 183
184 184 # ajax delete repos group perm users_group
185 185 m.connect('delete_repos_group_users_group_perm',
186 186 "/delete_repos_group_users_group_perm/{group_name:.*?}",
187 187 action="delete_repos_group_users_group_perm",
188 188 conditions=dict(method=["DELETE"], function=check_group))
189 189
190 190 #ADMIN USER REST ROUTES
191 191 with rmap.submapper(path_prefix=ADMIN_PREFIX,
192 192 controller='admin/users') as m:
193 193 m.connect("users", "/users",
194 194 action="create", conditions=dict(method=["POST"]))
195 195 m.connect("users", "/users",
196 196 action="index", conditions=dict(method=["GET"]))
197 197 m.connect("formatted_users", "/users.{format}",
198 198 action="index", conditions=dict(method=["GET"]))
199 199 m.connect("new_user", "/users/new",
200 200 action="new", conditions=dict(method=["GET"]))
201 201 m.connect("formatted_new_user", "/users/new.{format}",
202 202 action="new", conditions=dict(method=["GET"]))
203 203 m.connect("update_user", "/users/{id}",
204 204 action="update", conditions=dict(method=["PUT"]))
205 205 m.connect("delete_user", "/users/{id}",
206 206 action="delete", conditions=dict(method=["DELETE"]))
207 207 m.connect("edit_user", "/users/{id}/edit",
208 208 action="edit", conditions=dict(method=["GET"]))
209 209 m.connect("formatted_edit_user",
210 210 "/users/{id}.{format}/edit",
211 211 action="edit", conditions=dict(method=["GET"]))
212 212 m.connect("user", "/users/{id}",
213 213 action="show", conditions=dict(method=["GET"]))
214 214 m.connect("formatted_user", "/users/{id}.{format}",
215 215 action="show", conditions=dict(method=["GET"]))
216 216
217 217 #EXTRAS USER ROUTES
218 218 m.connect("user_perm", "/users_perm/{id}",
219 219 action="update_perm", conditions=dict(method=["PUT"]))
220 220 m.connect("user_emails", "/users_emails/{id}",
221 221 action="add_email", conditions=dict(method=["PUT"]))
222 222 m.connect("user_emails_delete", "/users_emails/{id}",
223 223 action="delete_email", conditions=dict(method=["DELETE"]))
224 224 m.connect("user_ips", "/users_ips/{id}",
225 225 action="add_ip", conditions=dict(method=["PUT"]))
226 226 m.connect("user_ips_delete", "/users_ips/{id}",
227 227 action="delete_ip", conditions=dict(method=["DELETE"]))
228 228
229 229 #ADMIN USERS GROUPS REST ROUTES
230 230 with rmap.submapper(path_prefix=ADMIN_PREFIX,
231 231 controller='admin/users_groups') as m:
232 232 m.connect("users_groups", "/users_groups",
233 233 action="create", conditions=dict(method=["POST"]))
234 234 m.connect("users_groups", "/users_groups",
235 235 action="index", conditions=dict(method=["GET"]))
236 236 m.connect("formatted_users_groups", "/users_groups.{format}",
237 237 action="index", conditions=dict(method=["GET"]))
238 238 m.connect("new_users_group", "/users_groups/new",
239 239 action="new", conditions=dict(method=["GET"]))
240 240 m.connect("formatted_new_users_group", "/users_groups/new.{format}",
241 241 action="new", conditions=dict(method=["GET"]))
242 242 m.connect("update_users_group", "/users_groups/{id}",
243 243 action="update", conditions=dict(method=["PUT"]))
244 244 m.connect("delete_users_group", "/users_groups/{id}",
245 245 action="delete", conditions=dict(method=["DELETE"]))
246 246 m.connect("edit_users_group", "/users_groups/{id}/edit",
247 247 action="edit", conditions=dict(method=["GET"]))
248 248 m.connect("formatted_edit_users_group",
249 249 "/users_groups/{id}.{format}/edit",
250 250 action="edit", conditions=dict(method=["GET"]))
251 251 m.connect("users_group", "/users_groups/{id}",
252 252 action="show", conditions=dict(method=["GET"]))
253 253 m.connect("formatted_users_group", "/users_groups/{id}.{format}",
254 254 action="show", conditions=dict(method=["GET"]))
255 255
256 256 #EXTRAS USER ROUTES
257 257 m.connect("users_group_perm", "/users_groups_perm/{id}",
258 258 action="update_perm", conditions=dict(method=["PUT"]))
259 259
260 260 #ADMIN GROUP REST ROUTES
261 261 rmap.resource('group', 'groups',
262 262 controller='admin/groups', path_prefix=ADMIN_PREFIX)
263 263
264 264 #ADMIN PERMISSIONS REST ROUTES
265 265 rmap.resource('permission', 'permissions',
266 266 controller='admin/permissions', path_prefix=ADMIN_PREFIX)
267 267
268 268 #ADMIN DEFAULTS REST ROUTES
269 269 rmap.resource('default', 'defaults',
270 270 controller='admin/defaults', path_prefix=ADMIN_PREFIX)
271 271
272 272 ##ADMIN LDAP SETTINGS
273 273 rmap.connect('ldap_settings', '%s/ldap' % ADMIN_PREFIX,
274 274 controller='admin/ldap_settings', action='ldap_settings',
275 275 conditions=dict(method=["POST"]))
276 276
277 277 rmap.connect('ldap_home', '%s/ldap' % ADMIN_PREFIX,
278 278 controller='admin/ldap_settings')
279 279
280 280 #ADMIN SETTINGS REST ROUTES
281 281 with rmap.submapper(path_prefix=ADMIN_PREFIX,
282 282 controller='admin/settings') as m:
283 283 m.connect("admin_settings", "/settings",
284 284 action="create", conditions=dict(method=["POST"]))
285 285 m.connect("admin_settings", "/settings",
286 286 action="index", conditions=dict(method=["GET"]))
287 287 m.connect("formatted_admin_settings", "/settings.{format}",
288 288 action="index", conditions=dict(method=["GET"]))
289 289 m.connect("admin_new_setting", "/settings/new",
290 290 action="new", conditions=dict(method=["GET"]))
291 291 m.connect("formatted_admin_new_setting", "/settings/new.{format}",
292 292 action="new", conditions=dict(method=["GET"]))
293 293 m.connect("/settings/{setting_id}",
294 294 action="update", conditions=dict(method=["PUT"]))
295 295 m.connect("/settings/{setting_id}",
296 296 action="delete", conditions=dict(method=["DELETE"]))
297 297 m.connect("admin_edit_setting", "/settings/{setting_id}/edit",
298 298 action="edit", conditions=dict(method=["GET"]))
299 299 m.connect("formatted_admin_edit_setting",
300 300 "/settings/{setting_id}.{format}/edit",
301 301 action="edit", conditions=dict(method=["GET"]))
302 302 m.connect("admin_setting", "/settings/{setting_id}",
303 303 action="show", conditions=dict(method=["GET"]))
304 304 m.connect("formatted_admin_setting", "/settings/{setting_id}.{format}",
305 305 action="show", conditions=dict(method=["GET"]))
306 306 m.connect("admin_settings_my_account", "/my_account",
307 307 action="my_account", conditions=dict(method=["GET"]))
308 308 m.connect("admin_settings_my_account_update", "/my_account_update",
309 309 action="my_account_update", conditions=dict(method=["PUT"]))
310 310 m.connect("admin_settings_create_repository", "/create_repository",
311 311 action="create_repository", conditions=dict(method=["GET"]))
312 312 m.connect("admin_settings_my_repos", "/my_account/repos",
313 313 action="my_account_my_repos", conditions=dict(method=["GET"]))
314 314 m.connect("admin_settings_my_pullrequests", "/my_account/pull_requests",
315 315 action="my_account_my_pullrequests", conditions=dict(method=["GET"]))
316 316
317 317 #NOTIFICATION REST ROUTES
318 318 with rmap.submapper(path_prefix=ADMIN_PREFIX,
319 319 controller='admin/notifications') as m:
320 320 m.connect("notifications", "/notifications",
321 321 action="create", conditions=dict(method=["POST"]))
322 322 m.connect("notifications", "/notifications",
323 323 action="index", conditions=dict(method=["GET"]))
324 324 m.connect("notifications_mark_all_read", "/notifications/mark_all_read",
325 325 action="mark_all_read", conditions=dict(method=["GET"]))
326 326 m.connect("formatted_notifications", "/notifications.{format}",
327 327 action="index", conditions=dict(method=["GET"]))
328 328 m.connect("new_notification", "/notifications/new",
329 329 action="new", conditions=dict(method=["GET"]))
330 330 m.connect("formatted_new_notification", "/notifications/new.{format}",
331 331 action="new", conditions=dict(method=["GET"]))
332 332 m.connect("/notification/{notification_id}",
333 333 action="update", conditions=dict(method=["PUT"]))
334 334 m.connect("/notification/{notification_id}",
335 335 action="delete", conditions=dict(method=["DELETE"]))
336 336 m.connect("edit_notification", "/notification/{notification_id}/edit",
337 337 action="edit", conditions=dict(method=["GET"]))
338 338 m.connect("formatted_edit_notification",
339 339 "/notification/{notification_id}.{format}/edit",
340 340 action="edit", conditions=dict(method=["GET"]))
341 341 m.connect("notification", "/notification/{notification_id}",
342 342 action="show", conditions=dict(method=["GET"]))
343 343 m.connect("formatted_notification", "/notifications/{notification_id}.{format}",
344 344 action="show", conditions=dict(method=["GET"]))
345 345
346 346 #ADMIN MAIN PAGES
347 347 with rmap.submapper(path_prefix=ADMIN_PREFIX,
348 348 controller='admin/admin') as m:
349 349 m.connect('admin_home', '', action='index')
350 350 m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}',
351 351 action='add_repo')
352 352
353 353 #==========================================================================
354 354 # API V2
355 355 #==========================================================================
356 356 with rmap.submapper(path_prefix=ADMIN_PREFIX,
357 357 controller='api/api') as m:
358 358 m.connect('api', '/api')
359 359
360 360 #USER JOURNAL
361 361 rmap.connect('journal', '%s/journal' % ADMIN_PREFIX,
362 362 controller='journal', action='index')
363 363 rmap.connect('journal_rss', '%s/journal/rss' % ADMIN_PREFIX,
364 364 controller='journal', action='journal_rss')
365 365 rmap.connect('journal_atom', '%s/journal/atom' % ADMIN_PREFIX,
366 366 controller='journal', action='journal_atom')
367 367
368 368 rmap.connect('public_journal', '%s/public_journal' % ADMIN_PREFIX,
369 369 controller='journal', action="public_journal")
370 370
371 371 rmap.connect('public_journal_rss', '%s/public_journal/rss' % ADMIN_PREFIX,
372 372 controller='journal', action="public_journal_rss")
373 373
374 374 rmap.connect('public_journal_rss_old', '%s/public_journal_rss' % ADMIN_PREFIX,
375 375 controller='journal', action="public_journal_rss")
376 376
377 377 rmap.connect('public_journal_atom',
378 378 '%s/public_journal/atom' % ADMIN_PREFIX, controller='journal',
379 379 action="public_journal_atom")
380 380
381 381 rmap.connect('public_journal_atom_old',
382 382 '%s/public_journal_atom' % ADMIN_PREFIX, controller='journal',
383 383 action="public_journal_atom")
384 384
385 385 rmap.connect('toggle_following', '%s/toggle_following' % ADMIN_PREFIX,
386 386 controller='journal', action='toggle_following',
387 387 conditions=dict(method=["POST"]))
388 388
389 389 #SEARCH
390 390 rmap.connect('search', '%s/search' % ADMIN_PREFIX, controller='search',)
391 391 rmap.connect('search_repo', '%s/search/{search_repo:.*}' % ADMIN_PREFIX,
392 392 controller='search')
393 393
394 394 #LOGIN/LOGOUT/REGISTER/SIGN IN
395 395 rmap.connect('login_home', '%s/login' % ADMIN_PREFIX, controller='login')
396 396 rmap.connect('logout_home', '%s/logout' % ADMIN_PREFIX, controller='login',
397 397 action='logout')
398 398
399 399 rmap.connect('register', '%s/register' % ADMIN_PREFIX, controller='login',
400 400 action='register')
401 401
402 402 rmap.connect('reset_password', '%s/password_reset' % ADMIN_PREFIX,
403 403 controller='login', action='password_reset')
404 404
405 405 rmap.connect('reset_password_confirmation',
406 406 '%s/password_reset_confirmation' % ADMIN_PREFIX,
407 407 controller='login', action='password_reset_confirmation')
408 408
409 409 #FEEDS
410 410 rmap.connect('rss_feed_home', '/{repo_name:.*?}/feed/rss',
411 411 controller='feed', action='rss',
412 412 conditions=dict(function=check_repo))
413 413
414 414 rmap.connect('atom_feed_home', '/{repo_name:.*?}/feed/atom',
415 415 controller='feed', action='atom',
416 416 conditions=dict(function=check_repo))
417 417
418 418 #==========================================================================
419 419 # REPOSITORY ROUTES
420 420 #==========================================================================
421 421 rmap.connect('summary_home', '/{repo_name:.*?}',
422 422 controller='summary',
423 423 conditions=dict(function=check_repo))
424 424
425 425 rmap.connect('repo_size', '/{repo_name:.*?}/repo_size',
426 426 controller='summary', action='repo_size',
427 427 conditions=dict(function=check_repo))
428 428
429 429 rmap.connect('repos_group_home', '/{group_name:.*}',
430 430 controller='admin/repos_groups', action="show_by_name",
431 431 conditions=dict(function=check_group))
432 432
433 433 rmap.connect('changeset_home', '/{repo_name:.*?}/changeset/{revision}',
434 434 controller='changeset', revision='tip',
435 435 conditions=dict(function=check_repo))
436 436
437 437 #still working url for backward compat.
438 438 rmap.connect('raw_changeset_home_depraced',
439 439 '/{repo_name:.*?}/raw-changeset/{revision}',
440 440 controller='changeset', action='changeset_raw',
441 441 revision='tip', conditions=dict(function=check_repo))
442 442
443 443 ## new URLs
444 444 rmap.connect('changeset_raw_home',
445 445 '/{repo_name:.*?}/changeset-diff/{revision}',
446 446 controller='changeset', action='changeset_raw',
447 447 revision='tip', conditions=dict(function=check_repo))
448 448
449 449 rmap.connect('changeset_patch_home',
450 450 '/{repo_name:.*?}/changeset-patch/{revision}',
451 451 controller='changeset', action='changeset_patch',
452 452 revision='tip', conditions=dict(function=check_repo))
453 453
454 454 rmap.connect('changeset_download_home',
455 455 '/{repo_name:.*?}/changeset-download/{revision}',
456 456 controller='changeset', action='changeset_download',
457 457 revision='tip', conditions=dict(function=check_repo))
458 458
459 459 rmap.connect('changeset_comment',
460 460 '/{repo_name:.*?}/changeset/{revision}/comment',
461 461 controller='changeset', revision='tip', action='comment',
462 462 conditions=dict(function=check_repo))
463 463
464 464 rmap.connect('changeset_comment_delete',
465 465 '/{repo_name:.*?}/changeset/comment/{comment_id}/delete',
466 466 controller='changeset', action='delete_comment',
467 467 conditions=dict(function=check_repo, method=["DELETE"]))
468 468
469 469 rmap.connect('changeset_info', '/changeset_info/{repo_name:.*?}/{revision}',
470 470 controller='changeset', action='changeset_info')
471 471
472 472 rmap.connect('compare_url',
473 473 '/{repo_name:.*?}/compare/{org_ref_type}@{org_ref:.*?}...{other_ref_type}@{other_ref:.*?}',
474 474 controller='compare', action='index',
475 475 conditions=dict(function=check_repo),
476 476 requirements=dict(
477 477 org_ref_type='(branch|book|tag|rev|org_ref_type)',
478 478 other_ref_type='(branch|book|tag|rev|other_ref_type)')
479 479 )
480 480
481 481 rmap.connect('pullrequest_home',
482 482 '/{repo_name:.*?}/pull-request/new', controller='pullrequests',
483 483 action='index', conditions=dict(function=check_repo,
484 484 method=["GET"]))
485 485
486 486 rmap.connect('pullrequest',
487 487 '/{repo_name:.*?}/pull-request/new', controller='pullrequests',
488 488 action='create', conditions=dict(function=check_repo,
489 489 method=["POST"]))
490 490
491 491 rmap.connect('pullrequest_show',
492 492 '/{repo_name:.*?}/pull-request/{pull_request_id}',
493 493 controller='pullrequests',
494 494 action='show', conditions=dict(function=check_repo,
495 495 method=["GET"]))
496 496 rmap.connect('pullrequest_update',
497 497 '/{repo_name:.*?}/pull-request/{pull_request_id}',
498 498 controller='pullrequests',
499 499 action='update', conditions=dict(function=check_repo,
500 500 method=["PUT"]))
501 501 rmap.connect('pullrequest_delete',
502 502 '/{repo_name:.*?}/pull-request/{pull_request_id}',
503 503 controller='pullrequests',
504 504 action='delete', conditions=dict(function=check_repo,
505 505 method=["DELETE"]))
506 506
507 507 rmap.connect('pullrequest_show_all',
508 508 '/{repo_name:.*?}/pull-request',
509 509 controller='pullrequests',
510 510 action='show_all', conditions=dict(function=check_repo,
511 511 method=["GET"]))
512 512
513 513 rmap.connect('pullrequest_comment',
514 514 '/{repo_name:.*?}/pull-request-comment/{pull_request_id}',
515 515 controller='pullrequests',
516 516 action='comment', conditions=dict(function=check_repo,
517 517 method=["POST"]))
518 518
519 519 rmap.connect('pullrequest_comment_delete',
520 520 '/{repo_name:.*?}/pull-request-comment/{comment_id}/delete',
521 521 controller='pullrequests', action='delete_comment',
522 522 conditions=dict(function=check_repo, method=["DELETE"]))
523 523
524 rmap.connect('summary_home', '/{repo_name:.*?}/summary',
524 rmap.connect('summary_home_summary', '/{repo_name:.*?}/summary',
525 525 controller='summary', conditions=dict(function=check_repo))
526 526
527 527 rmap.connect('shortlog_home', '/{repo_name:.*?}/shortlog',
528 528 controller='shortlog', conditions=dict(function=check_repo))
529 529
530 530 rmap.connect('shortlog_file_home', '/{repo_name:.*?}/shortlog/{revision}/{f_path:.*}',
531 531 controller='shortlog', f_path=None,
532 532 conditions=dict(function=check_repo))
533 533
534 534 rmap.connect('branches_home', '/{repo_name:.*?}/branches',
535 535 controller='branches', conditions=dict(function=check_repo))
536 536
537 537 rmap.connect('tags_home', '/{repo_name:.*?}/tags',
538 538 controller='tags', conditions=dict(function=check_repo))
539 539
540 540 rmap.connect('bookmarks_home', '/{repo_name:.*?}/bookmarks',
541 541 controller='bookmarks', conditions=dict(function=check_repo))
542 542
543 543 rmap.connect('changelog_home', '/{repo_name:.*?}/changelog',
544 544 controller='changelog', conditions=dict(function=check_repo))
545 545
546 546 rmap.connect('changelog_details', '/{repo_name:.*?}/changelog_details/{cs}',
547 547 controller='changelog', action='changelog_details',
548 548 conditions=dict(function=check_repo))
549 549
550 550 rmap.connect('files_home', '/{repo_name:.*?}/files/{revision}/{f_path:.*}',
551 551 controller='files', revision='tip', f_path='',
552 552 conditions=dict(function=check_repo))
553 553
554 554 rmap.connect('files_history_home',
555 555 '/{repo_name:.*?}/history/{revision}/{f_path:.*}',
556 556 controller='files', action='history', revision='tip', f_path='',
557 557 conditions=dict(function=check_repo))
558 558
559 559 rmap.connect('files_diff_home', '/{repo_name:.*?}/diff/{f_path:.*}',
560 560 controller='files', action='diff', revision='tip', f_path='',
561 561 conditions=dict(function=check_repo))
562 562
563 563 rmap.connect('files_rawfile_home',
564 564 '/{repo_name:.*?}/rawfile/{revision}/{f_path:.*}',
565 565 controller='files', action='rawfile', revision='tip',
566 566 f_path='', conditions=dict(function=check_repo))
567 567
568 568 rmap.connect('files_raw_home',
569 569 '/{repo_name:.*?}/raw/{revision}/{f_path:.*}',
570 570 controller='files', action='raw', revision='tip', f_path='',
571 571 conditions=dict(function=check_repo))
572 572
573 573 rmap.connect('files_annotate_home',
574 574 '/{repo_name:.*?}/annotate/{revision}/{f_path:.*}',
575 575 controller='files', action='index', revision='tip',
576 576 f_path='', annotate=True, conditions=dict(function=check_repo))
577 577
578 578 rmap.connect('files_edit_home',
579 579 '/{repo_name:.*?}/edit/{revision}/{f_path:.*}',
580 580 controller='files', action='edit', revision='tip',
581 581 f_path='', conditions=dict(function=check_repo))
582 582
583 583 rmap.connect('files_add_home',
584 584 '/{repo_name:.*?}/add/{revision}/{f_path:.*}',
585 585 controller='files', action='add', revision='tip',
586 586 f_path='', conditions=dict(function=check_repo))
587 587
588 588 rmap.connect('files_archive_home', '/{repo_name:.*?}/archive/{fname}',
589 589 controller='files', action='archivefile',
590 590 conditions=dict(function=check_repo))
591 591
592 592 rmap.connect('files_nodelist_home',
593 593 '/{repo_name:.*?}/nodelist/{revision}/{f_path:.*}',
594 594 controller='files', action='nodelist',
595 595 conditions=dict(function=check_repo))
596 596
597 597 rmap.connect('repo_settings_delete', '/{repo_name:.*?}/settings',
598 598 controller='settings', action="delete",
599 599 conditions=dict(method=["DELETE"], function=check_repo))
600 600
601 601 rmap.connect('repo_settings_update', '/{repo_name:.*?}/settings',
602 602 controller='settings', action="update",
603 603 conditions=dict(method=["PUT"], function=check_repo))
604 604
605 605 rmap.connect('repo_settings_home', '/{repo_name:.*?}/settings',
606 606 controller='settings', action='index',
607 607 conditions=dict(function=check_repo))
608 608
609 609 rmap.connect('toggle_locking', "/{repo_name:.*?}/locking_toggle",
610 610 controller='settings', action="toggle_locking",
611 611 conditions=dict(method=["GET"], function=check_repo))
612 612
613 613 rmap.connect('repo_fork_create_home', '/{repo_name:.*?}/fork',
614 614 controller='forks', action='fork_create',
615 615 conditions=dict(function=check_repo, method=["POST"]))
616 616
617 617 rmap.connect('repo_fork_home', '/{repo_name:.*?}/fork',
618 618 controller='forks', action='fork',
619 619 conditions=dict(function=check_repo))
620 620
621 621 rmap.connect('repo_forks_home', '/{repo_name:.*?}/forks',
622 622 controller='forks', action='forks',
623 623 conditions=dict(function=check_repo))
624 624
625 625 rmap.connect('repo_followers_home', '/{repo_name:.*?}/followers',
626 626 controller='followers', action='followers',
627 627 conditions=dict(function=check_repo))
628 628
629 629 return rmap
General Comments 0
You need to be logged in to leave comments. Login now