##// END OF EJS Templates
routing: fixed depracated patterns for routes matching using /d
super-admin -
r5099:5122f321 default
parent child Browse files
Show More
@@ -1,1082 +1,1082 b''
1 1 # Copyright (C) 2016-2023 RhodeCode GmbH
2 2 #
3 3 # This program is free software: you can redistribute it and/or modify
4 4 # it under the terms of the GNU Affero General Public License, version 3
5 5 # (only), as published by the Free Software Foundation.
6 6 #
7 7 # This program is distributed in the hope that it will be useful,
8 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 10 # GNU General Public License for more details.
11 11 #
12 12 # You should have received a copy of the GNU Affero General Public License
13 13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 14 #
15 15 # This program is dual-licensed. If you wish to learn more about the
16 16 # RhodeCode Enterprise Edition, including its added features, Support services,
17 17 # and proprietary license terms, please see https://rhodecode.com/licenses/
18 18
19 19
20 20 from rhodecode.apps._base import ADMIN_PREFIX
21 21
22 22
23 23 def admin_routes(config):
24 24 """
25 25 Admin prefixed routes
26 26 """
27 27 from rhodecode.apps.admin.views.audit_logs import AdminAuditLogsView
28 28 from rhodecode.apps.admin.views.artifacts import AdminArtifactsView
29 29 from rhodecode.apps.admin.views.defaults import AdminDefaultSettingsView
30 30 from rhodecode.apps.admin.views.exception_tracker import ExceptionsTrackerView
31 31 from rhodecode.apps.admin.views.main_views import AdminMainView
32 32 from rhodecode.apps.admin.views.open_source_licenses import OpenSourceLicensesAdminSettingsView
33 33 from rhodecode.apps.admin.views.permissions import AdminPermissionsView
34 34 from rhodecode.apps.admin.views.process_management import AdminProcessManagementView
35 35 from rhodecode.apps.admin.views.repo_groups import AdminRepoGroupsView
36 36 from rhodecode.apps.admin.views.repositories import AdminReposView
37 37 from rhodecode.apps.admin.views.sessions import AdminSessionSettingsView
38 38 from rhodecode.apps.admin.views.settings import AdminSettingsView
39 39 from rhodecode.apps.admin.views.svn_config import AdminSvnConfigView
40 40 from rhodecode.apps.admin.views.system_info import AdminSystemInfoSettingsView
41 41 from rhodecode.apps.admin.views.user_groups import AdminUserGroupsView
42 42 from rhodecode.apps.admin.views.users import AdminUsersView, UsersView
43 43
44 44 config.add_route(
45 45 name='admin_audit_logs',
46 46 pattern='/audit_logs')
47 47 config.add_view(
48 48 AdminAuditLogsView,
49 49 attr='admin_audit_logs',
50 50 route_name='admin_audit_logs', request_method='GET',
51 51 renderer='rhodecode:templates/admin/admin_audit_logs.mako')
52 52
53 53 config.add_route(
54 54 name='admin_audit_log_entry',
55 55 pattern='/audit_logs/{audit_log_id}')
56 56 config.add_view(
57 57 AdminAuditLogsView,
58 58 attr='admin_audit_log_entry',
59 59 route_name='admin_audit_log_entry', request_method='GET',
60 60 renderer='rhodecode:templates/admin/admin_audit_log_entry.mako')
61 61
62 62 # Artifacts EE feature
63 63 config.add_route(
64 64 'admin_artifacts',
65 65 pattern=ADMIN_PREFIX + '/artifacts')
66 66 config.add_route(
67 67 'admin_artifacts_show_all',
68 68 pattern=ADMIN_PREFIX + '/artifacts')
69 69 config.add_view(
70 70 AdminArtifactsView,
71 71 attr='artifacts',
72 72 route_name='admin_artifacts', request_method='GET',
73 73 renderer='rhodecode:templates/admin/artifacts/artifacts.mako')
74 74 config.add_view(
75 75 AdminArtifactsView,
76 76 attr='artifacts',
77 77 route_name='admin_artifacts_show_all', request_method='GET',
78 78 renderer='rhodecode:templates/admin/artifacts/artifacts.mako')
79 79 # EE views
80 80 config.add_route(
81 81 name='admin_artifacts_show_info',
82 82 pattern=ADMIN_PREFIX + '/artifacts/{uid}')
83 83 config.add_route(
84 84 name='admin_artifacts_delete',
85 85 pattern=ADMIN_PREFIX + '/artifacts/{uid}/delete')
86 86 config.add_route(
87 87 name='admin_artifacts_update',
88 88 pattern=ADMIN_PREFIX + '/artifacts/{uid}/update')
89 89
90 90 config.add_route(
91 91 name='admin_settings_open_source',
92 92 pattern='/settings/open_source')
93 93 config.add_view(
94 94 OpenSourceLicensesAdminSettingsView,
95 95 attr='open_source_licenses',
96 96 route_name='admin_settings_open_source', request_method='GET',
97 97 renderer='rhodecode:templates/admin/settings/settings.mako')
98 98
99 99 config.add_route(
100 100 name='admin_settings_vcs_svn_generate_cfg',
101 101 pattern='/settings/vcs/svn_generate_cfg')
102 102 config.add_view(
103 103 AdminSvnConfigView,
104 104 attr='vcs_svn_generate_config',
105 105 route_name='admin_settings_vcs_svn_generate_cfg',
106 106 request_method='POST', renderer='json')
107 107
108 108 config.add_route(
109 109 name='admin_settings_system',
110 110 pattern='/settings/system')
111 111 config.add_view(
112 112 AdminSystemInfoSettingsView,
113 113 attr='settings_system_info',
114 114 route_name='admin_settings_system', request_method='GET',
115 115 renderer='rhodecode:templates/admin/settings/settings.mako')
116 116
117 117 config.add_route(
118 118 name='admin_settings_system_update',
119 119 pattern='/settings/system/updates')
120 120 config.add_view(
121 121 AdminSystemInfoSettingsView,
122 122 attr='settings_system_info_check_update',
123 123 route_name='admin_settings_system_update', request_method='GET',
124 124 renderer='rhodecode:templates/admin/settings/settings_system_update.mako')
125 125
126 126 config.add_route(
127 127 name='admin_settings_exception_tracker',
128 128 pattern='/settings/exceptions')
129 129 config.add_view(
130 130 ExceptionsTrackerView,
131 131 attr='browse_exceptions',
132 132 route_name='admin_settings_exception_tracker', request_method='GET',
133 133 renderer='rhodecode:templates/admin/settings/settings.mako')
134 134
135 135 config.add_route(
136 136 name='admin_settings_exception_tracker_delete_all',
137 137 pattern='/settings/exceptions_delete_all')
138 138 config.add_view(
139 139 ExceptionsTrackerView,
140 140 attr='exception_delete_all',
141 141 route_name='admin_settings_exception_tracker_delete_all', request_method='POST',
142 142 renderer='rhodecode:templates/admin/settings/settings.mako')
143 143
144 144 config.add_route(
145 145 name='admin_settings_exception_tracker_show',
146 146 pattern='/settings/exceptions/{exception_id}')
147 147 config.add_view(
148 148 ExceptionsTrackerView,
149 149 attr='exception_show',
150 150 route_name='admin_settings_exception_tracker_show', request_method='GET',
151 151 renderer='rhodecode:templates/admin/settings/settings.mako')
152 152
153 153 config.add_route(
154 154 name='admin_settings_exception_tracker_delete',
155 155 pattern='/settings/exceptions/{exception_id}/delete')
156 156 config.add_view(
157 157 ExceptionsTrackerView,
158 158 attr='exception_delete',
159 159 route_name='admin_settings_exception_tracker_delete', request_method='POST',
160 160 renderer='rhodecode:templates/admin/settings/settings.mako')
161 161
162 162 config.add_route(
163 163 name='admin_settings_sessions',
164 164 pattern='/settings/sessions')
165 165 config.add_view(
166 166 AdminSessionSettingsView,
167 167 attr='settings_sessions',
168 168 route_name='admin_settings_sessions', request_method='GET',
169 169 renderer='rhodecode:templates/admin/settings/settings.mako')
170 170
171 171 config.add_route(
172 172 name='admin_settings_sessions_cleanup',
173 173 pattern='/settings/sessions/cleanup')
174 174 config.add_view(
175 175 AdminSessionSettingsView,
176 176 attr='settings_sessions_cleanup',
177 177 route_name='admin_settings_sessions_cleanup', request_method='POST')
178 178
179 179 config.add_route(
180 180 name='admin_settings_process_management',
181 181 pattern='/settings/process_management')
182 182 config.add_view(
183 183 AdminProcessManagementView,
184 184 attr='process_management',
185 185 route_name='admin_settings_process_management', request_method='GET',
186 186 renderer='rhodecode:templates/admin/settings/settings.mako')
187 187
188 188 config.add_route(
189 189 name='admin_settings_process_management_data',
190 190 pattern='/settings/process_management/data')
191 191 config.add_view(
192 192 AdminProcessManagementView,
193 193 attr='process_management_data',
194 194 route_name='admin_settings_process_management_data', request_method='GET',
195 195 renderer='rhodecode:templates/admin/settings/settings_process_management_data.mako')
196 196
197 197 config.add_route(
198 198 name='admin_settings_process_management_signal',
199 199 pattern='/settings/process_management/signal')
200 200 config.add_view(
201 201 AdminProcessManagementView,
202 202 attr='process_management_signal',
203 203 route_name='admin_settings_process_management_signal',
204 204 request_method='POST', renderer='json_ext')
205 205
206 206 config.add_route(
207 207 name='admin_settings_process_management_master_signal',
208 208 pattern='/settings/process_management/master_signal')
209 209 config.add_view(
210 210 AdminProcessManagementView,
211 211 attr='process_management_master_signal',
212 212 route_name='admin_settings_process_management_master_signal',
213 213 request_method='POST', renderer='json_ext')
214 214
215 215 # default settings
216 216 config.add_route(
217 217 name='admin_defaults_repositories',
218 218 pattern='/defaults/repositories')
219 219 config.add_view(
220 220 AdminDefaultSettingsView,
221 221 attr='defaults_repository_show',
222 222 route_name='admin_defaults_repositories', request_method='GET',
223 223 renderer='rhodecode:templates/admin/defaults/defaults.mako')
224 224
225 225 config.add_route(
226 226 name='admin_defaults_repositories_update',
227 227 pattern='/defaults/repositories/update')
228 228 config.add_view(
229 229 AdminDefaultSettingsView,
230 230 attr='defaults_repository_update',
231 231 route_name='admin_defaults_repositories_update', request_method='POST',
232 232 renderer='rhodecode:templates/admin/defaults/defaults.mako')
233 233
234 234 # admin settings
235 235
236 236 config.add_route(
237 237 name='admin_settings',
238 238 pattern='/settings')
239 239 config.add_view(
240 240 AdminSettingsView,
241 241 attr='settings_global',
242 242 route_name='admin_settings', request_method='GET',
243 243 renderer='rhodecode:templates/admin/settings/settings.mako')
244 244
245 245 config.add_route(
246 246 name='admin_settings_update',
247 247 pattern='/settings/update')
248 248 config.add_view(
249 249 AdminSettingsView,
250 250 attr='settings_global_update',
251 251 route_name='admin_settings_update', request_method='POST',
252 252 renderer='rhodecode:templates/admin/settings/settings.mako')
253 253
254 254 config.add_route(
255 255 name='admin_settings_global',
256 256 pattern='/settings/global')
257 257 config.add_view(
258 258 AdminSettingsView,
259 259 attr='settings_global',
260 260 route_name='admin_settings_global', request_method='GET',
261 261 renderer='rhodecode:templates/admin/settings/settings.mako')
262 262
263 263 config.add_route(
264 264 name='admin_settings_global_update',
265 265 pattern='/settings/global/update')
266 266 config.add_view(
267 267 AdminSettingsView,
268 268 attr='settings_global_update',
269 269 route_name='admin_settings_global_update', request_method='POST',
270 270 renderer='rhodecode:templates/admin/settings/settings.mako')
271 271
272 272 config.add_route(
273 273 name='admin_settings_vcs',
274 274 pattern='/settings/vcs')
275 275 config.add_view(
276 276 AdminSettingsView,
277 277 attr='settings_vcs',
278 278 route_name='admin_settings_vcs', request_method='GET',
279 279 renderer='rhodecode:templates/admin/settings/settings.mako')
280 280
281 281 config.add_route(
282 282 name='admin_settings_vcs_update',
283 283 pattern='/settings/vcs/update')
284 284 config.add_view(
285 285 AdminSettingsView,
286 286 attr='settings_vcs_update',
287 287 route_name='admin_settings_vcs_update', request_method='POST',
288 288 renderer='rhodecode:templates/admin/settings/settings.mako')
289 289
290 290 config.add_route(
291 291 name='admin_settings_vcs_svn_pattern_delete',
292 292 pattern='/settings/vcs/svn_pattern_delete')
293 293 config.add_view(
294 294 AdminSettingsView,
295 295 attr='settings_vcs_delete_svn_pattern',
296 296 route_name='admin_settings_vcs_svn_pattern_delete', request_method='POST',
297 297 renderer='json_ext', xhr=True)
298 298
299 299 config.add_route(
300 300 name='admin_settings_mapping',
301 301 pattern='/settings/mapping')
302 302 config.add_view(
303 303 AdminSettingsView,
304 304 attr='settings_mapping',
305 305 route_name='admin_settings_mapping', request_method='GET',
306 306 renderer='rhodecode:templates/admin/settings/settings.mako')
307 307
308 308 config.add_route(
309 309 name='admin_settings_mapping_update',
310 310 pattern='/settings/mapping/update')
311 311 config.add_view(
312 312 AdminSettingsView,
313 313 attr='settings_mapping_update',
314 314 route_name='admin_settings_mapping_update', request_method='POST',
315 315 renderer='rhodecode:templates/admin/settings/settings.mako')
316 316
317 317 config.add_route(
318 318 name='admin_settings_visual',
319 319 pattern='/settings/visual')
320 320 config.add_view(
321 321 AdminSettingsView,
322 322 attr='settings_visual',
323 323 route_name='admin_settings_visual', request_method='GET',
324 324 renderer='rhodecode:templates/admin/settings/settings.mako')
325 325
326 326 config.add_route(
327 327 name='admin_settings_visual_update',
328 328 pattern='/settings/visual/update')
329 329 config.add_view(
330 330 AdminSettingsView,
331 331 attr='settings_visual_update',
332 332 route_name='admin_settings_visual_update', request_method='POST',
333 333 renderer='rhodecode:templates/admin/settings/settings.mako')
334 334
335 335 config.add_route(
336 336 name='admin_settings_issuetracker',
337 337 pattern='/settings/issue-tracker')
338 338 config.add_view(
339 339 AdminSettingsView,
340 340 attr='settings_issuetracker',
341 341 route_name='admin_settings_issuetracker', request_method='GET',
342 342 renderer='rhodecode:templates/admin/settings/settings.mako')
343 343
344 344 config.add_route(
345 345 name='admin_settings_issuetracker_update',
346 346 pattern='/settings/issue-tracker/update')
347 347 config.add_view(
348 348 AdminSettingsView,
349 349 attr='settings_issuetracker_update',
350 350 route_name='admin_settings_issuetracker_update', request_method='POST',
351 351 renderer='rhodecode:templates/admin/settings/settings.mako')
352 352
353 353 config.add_route(
354 354 name='admin_settings_issuetracker_test',
355 355 pattern='/settings/issue-tracker/test')
356 356 config.add_view(
357 357 AdminSettingsView,
358 358 attr='settings_issuetracker_test',
359 359 route_name='admin_settings_issuetracker_test', request_method='POST',
360 360 renderer='string', xhr=True)
361 361
362 362 config.add_route(
363 363 name='admin_settings_issuetracker_delete',
364 364 pattern='/settings/issue-tracker/delete')
365 365 config.add_view(
366 366 AdminSettingsView,
367 367 attr='settings_issuetracker_delete',
368 368 route_name='admin_settings_issuetracker_delete', request_method='POST',
369 369 renderer='json_ext', xhr=True)
370 370
371 371 config.add_route(
372 372 name='admin_settings_email',
373 373 pattern='/settings/email')
374 374 config.add_view(
375 375 AdminSettingsView,
376 376 attr='settings_email',
377 377 route_name='admin_settings_email', request_method='GET',
378 378 renderer='rhodecode:templates/admin/settings/settings.mako')
379 379
380 380 config.add_route(
381 381 name='admin_settings_email_update',
382 382 pattern='/settings/email/update')
383 383 config.add_view(
384 384 AdminSettingsView,
385 385 attr='settings_email_update',
386 386 route_name='admin_settings_email_update', request_method='POST',
387 387 renderer='rhodecode:templates/admin/settings/settings.mako')
388 388
389 389 config.add_route(
390 390 name='admin_settings_hooks',
391 391 pattern='/settings/hooks')
392 392 config.add_view(
393 393 AdminSettingsView,
394 394 attr='settings_hooks',
395 395 route_name='admin_settings_hooks', request_method='GET',
396 396 renderer='rhodecode:templates/admin/settings/settings.mako')
397 397
398 398 config.add_route(
399 399 name='admin_settings_hooks_update',
400 400 pattern='/settings/hooks/update')
401 401 config.add_view(
402 402 AdminSettingsView,
403 403 attr='settings_hooks_update',
404 404 route_name='admin_settings_hooks_update', request_method='POST',
405 405 renderer='rhodecode:templates/admin/settings/settings.mako')
406 406
407 407 config.add_route(
408 408 name='admin_settings_hooks_delete',
409 409 pattern='/settings/hooks/delete')
410 410 config.add_view(
411 411 AdminSettingsView,
412 412 attr='settings_hooks_update',
413 413 route_name='admin_settings_hooks_delete', request_method='POST',
414 414 renderer='rhodecode:templates/admin/settings/settings.mako')
415 415
416 416 config.add_route(
417 417 name='admin_settings_search',
418 418 pattern='/settings/search')
419 419 config.add_view(
420 420 AdminSettingsView,
421 421 attr='settings_search',
422 422 route_name='admin_settings_search', request_method='GET',
423 423 renderer='rhodecode:templates/admin/settings/settings.mako')
424 424
425 425 config.add_route(
426 426 name='admin_settings_labs',
427 427 pattern='/settings/labs')
428 428 config.add_view(
429 429 AdminSettingsView,
430 430 attr='settings_labs',
431 431 route_name='admin_settings_labs', request_method='GET',
432 432 renderer='rhodecode:templates/admin/settings/settings.mako')
433 433
434 434 config.add_route(
435 435 name='admin_settings_labs_update',
436 436 pattern='/settings/labs/update')
437 437 config.add_view(
438 438 AdminSettingsView,
439 439 attr='settings_labs_update',
440 440 route_name='admin_settings_labs_update', request_method='POST',
441 441 renderer='rhodecode:templates/admin/settings/settings.mako')
442 442
443 443 # Automation EE feature
444 444 config.add_route(
445 445 'admin_settings_automation',
446 446 pattern=ADMIN_PREFIX + '/settings/automation')
447 447 config.add_view(
448 448 AdminSettingsView,
449 449 attr='settings_automation',
450 450 route_name='admin_settings_automation', request_method='GET',
451 451 renderer='rhodecode:templates/admin/settings/settings.mako')
452 452
453 453 # global permissions
454 454
455 455 config.add_route(
456 456 name='admin_permissions_application',
457 457 pattern='/permissions/application')
458 458 config.add_view(
459 459 AdminPermissionsView,
460 460 attr='permissions_application',
461 461 route_name='admin_permissions_application', request_method='GET',
462 462 renderer='rhodecode:templates/admin/permissions/permissions.mako')
463 463
464 464 config.add_route(
465 465 name='admin_permissions_application_update',
466 466 pattern='/permissions/application/update')
467 467 config.add_view(
468 468 AdminPermissionsView,
469 469 attr='permissions_application_update',
470 470 route_name='admin_permissions_application_update', request_method='POST',
471 471 renderer='rhodecode:templates/admin/permissions/permissions.mako')
472 472
473 473 config.add_route(
474 474 name='admin_permissions_global',
475 475 pattern='/permissions/global')
476 476 config.add_view(
477 477 AdminPermissionsView,
478 478 attr='permissions_global',
479 479 route_name='admin_permissions_global', request_method='GET',
480 480 renderer='rhodecode:templates/admin/permissions/permissions.mako')
481 481
482 482 config.add_route(
483 483 name='admin_permissions_global_update',
484 484 pattern='/permissions/global/update')
485 485 config.add_view(
486 486 AdminPermissionsView,
487 487 attr='permissions_global_update',
488 488 route_name='admin_permissions_global_update', request_method='POST',
489 489 renderer='rhodecode:templates/admin/permissions/permissions.mako')
490 490
491 491 config.add_route(
492 492 name='admin_permissions_object',
493 493 pattern='/permissions/object')
494 494 config.add_view(
495 495 AdminPermissionsView,
496 496 attr='permissions_objects',
497 497 route_name='admin_permissions_object', request_method='GET',
498 498 renderer='rhodecode:templates/admin/permissions/permissions.mako')
499 499
500 500 config.add_route(
501 501 name='admin_permissions_object_update',
502 502 pattern='/permissions/object/update')
503 503 config.add_view(
504 504 AdminPermissionsView,
505 505 attr='permissions_objects_update',
506 506 route_name='admin_permissions_object_update', request_method='POST',
507 507 renderer='rhodecode:templates/admin/permissions/permissions.mako')
508 508
509 509 # Branch perms EE feature
510 510 config.add_route(
511 511 name='admin_permissions_branch',
512 512 pattern='/permissions/branch')
513 513 config.add_view(
514 514 AdminPermissionsView,
515 515 attr='permissions_branch',
516 516 route_name='admin_permissions_branch', request_method='GET',
517 517 renderer='rhodecode:templates/admin/permissions/permissions.mako')
518 518
519 519 config.add_route(
520 520 name='admin_permissions_ips',
521 521 pattern='/permissions/ips')
522 522 config.add_view(
523 523 AdminPermissionsView,
524 524 attr='permissions_ips',
525 525 route_name='admin_permissions_ips', request_method='GET',
526 526 renderer='rhodecode:templates/admin/permissions/permissions.mako')
527 527
528 528 config.add_route(
529 529 name='admin_permissions_overview',
530 530 pattern='/permissions/overview')
531 531 config.add_view(
532 532 AdminPermissionsView,
533 533 attr='permissions_overview',
534 534 route_name='admin_permissions_overview', request_method='GET',
535 535 renderer='rhodecode:templates/admin/permissions/permissions.mako')
536 536
537 537 config.add_route(
538 538 name='admin_permissions_auth_token_access',
539 539 pattern='/permissions/auth_token_access')
540 540 config.add_view(
541 541 AdminPermissionsView,
542 542 attr='auth_token_access',
543 543 route_name='admin_permissions_auth_token_access', request_method='GET',
544 544 renderer='rhodecode:templates/admin/permissions/permissions.mako')
545 545
546 546 config.add_route(
547 547 name='admin_permissions_ssh_keys',
548 548 pattern='/permissions/ssh_keys')
549 549 config.add_view(
550 550 AdminPermissionsView,
551 551 attr='ssh_keys',
552 552 route_name='admin_permissions_ssh_keys', request_method='GET',
553 553 renderer='rhodecode:templates/admin/permissions/permissions.mako')
554 554
555 555 config.add_route(
556 556 name='admin_permissions_ssh_keys_data',
557 557 pattern='/permissions/ssh_keys/data')
558 558 config.add_view(
559 559 AdminPermissionsView,
560 560 attr='ssh_keys_data',
561 561 route_name='admin_permissions_ssh_keys_data', request_method='GET',
562 562 renderer='json_ext', xhr=True)
563 563
564 564 config.add_route(
565 565 name='admin_permissions_ssh_keys_update',
566 566 pattern='/permissions/ssh_keys/update')
567 567 config.add_view(
568 568 AdminPermissionsView,
569 569 attr='ssh_keys_update',
570 570 route_name='admin_permissions_ssh_keys_update', request_method='POST',
571 571 renderer='rhodecode:templates/admin/permissions/permissions.mako')
572 572
573 573 # users admin
574 574 config.add_route(
575 575 name='users',
576 576 pattern='/users')
577 577 config.add_view(
578 578 AdminUsersView,
579 579 attr='users_list',
580 580 route_name='users', request_method='GET',
581 581 renderer='rhodecode:templates/admin/users/users.mako')
582 582
583 583 config.add_route(
584 584 name='users_data',
585 585 pattern='/users_data')
586 586 config.add_view(
587 587 AdminUsersView,
588 588 attr='users_list_data',
589 589 # renderer defined below
590 590 route_name='users_data', request_method='GET',
591 591 renderer='json_ext', xhr=True)
592 592
593 593 config.add_route(
594 594 name='users_create',
595 595 pattern='/users/create')
596 596 config.add_view(
597 597 AdminUsersView,
598 598 attr='users_create',
599 599 route_name='users_create', request_method='POST',
600 600 renderer='rhodecode:templates/admin/users/user_add.mako')
601 601
602 602 config.add_route(
603 603 name='users_new',
604 604 pattern='/users/new')
605 605 config.add_view(
606 606 AdminUsersView,
607 607 attr='users_new',
608 608 route_name='users_new', request_method='GET',
609 609 renderer='rhodecode:templates/admin/users/user_add.mako')
610 610
611 611 # user management
612 612 config.add_route(
613 613 name='user_edit',
614 pattern='/users/{user_id:\d+}/edit',
614 pattern=r'/users/{user_id:\d+}/edit',
615 615 user_route=True)
616 616 config.add_view(
617 617 UsersView,
618 618 attr='user_edit',
619 619 route_name='user_edit', request_method='GET',
620 620 renderer='rhodecode:templates/admin/users/user_edit.mako')
621 621
622 622 config.add_route(
623 623 name='user_edit_advanced',
624 pattern='/users/{user_id:\d+}/edit/advanced',
624 pattern=r'/users/{user_id:\d+}/edit/advanced',
625 625 user_route=True)
626 626 config.add_view(
627 627 UsersView,
628 628 attr='user_edit_advanced',
629 629 route_name='user_edit_advanced', request_method='GET',
630 630 renderer='rhodecode:templates/admin/users/user_edit.mako')
631 631
632 632 config.add_route(
633 633 name='user_edit_global_perms',
634 pattern='/users/{user_id:\d+}/edit/global_permissions',
634 pattern=r'/users/{user_id:\d+}/edit/global_permissions',
635 635 user_route=True)
636 636 config.add_view(
637 637 UsersView,
638 638 attr='user_edit_global_perms',
639 639 route_name='user_edit_global_perms', request_method='GET',
640 640 renderer='rhodecode:templates/admin/users/user_edit.mako')
641 641
642 642 config.add_route(
643 643 name='user_edit_global_perms_update',
644 pattern='/users/{user_id:\d+}/edit/global_permissions/update',
644 pattern=r'/users/{user_id:\d+}/edit/global_permissions/update',
645 645 user_route=True)
646 646 config.add_view(
647 647 UsersView,
648 648 attr='user_edit_global_perms_update',
649 649 route_name='user_edit_global_perms_update', request_method='POST',
650 650 renderer='rhodecode:templates/admin/users/user_edit.mako')
651 651
652 652 config.add_route(
653 653 name='user_update',
654 pattern='/users/{user_id:\d+}/update',
654 pattern=r'/users/{user_id:\d+}/update',
655 655 user_route=True)
656 656 config.add_view(
657 657 UsersView,
658 658 attr='user_update',
659 659 route_name='user_update', request_method='POST',
660 660 renderer='rhodecode:templates/admin/users/user_edit.mako')
661 661
662 662 config.add_route(
663 663 name='user_delete',
664 pattern='/users/{user_id:\d+}/delete',
664 pattern=r'/users/{user_id:\d+}/delete',
665 665 user_route=True)
666 666 config.add_view(
667 667 UsersView,
668 668 attr='user_delete',
669 669 route_name='user_delete', request_method='POST',
670 670 renderer='rhodecode:templates/admin/users/user_edit.mako')
671 671
672 672 config.add_route(
673 673 name='user_enable_force_password_reset',
674 pattern='/users/{user_id:\d+}/password_reset_enable',
674 pattern=r'/users/{user_id:\d+}/password_reset_enable',
675 675 user_route=True)
676 676 config.add_view(
677 677 UsersView,
678 678 attr='user_enable_force_password_reset',
679 679 route_name='user_enable_force_password_reset', request_method='POST',
680 680 renderer='rhodecode:templates/admin/users/user_edit.mako')
681 681
682 682 config.add_route(
683 683 name='user_disable_force_password_reset',
684 pattern='/users/{user_id:\d+}/password_reset_disable',
684 pattern=r'/users/{user_id:\d+}/password_reset_disable',
685 685 user_route=True)
686 686 config.add_view(
687 687 UsersView,
688 688 attr='user_disable_force_password_reset',
689 689 route_name='user_disable_force_password_reset', request_method='POST',
690 690 renderer='rhodecode:templates/admin/users/user_edit.mako')
691 691
692 692 config.add_route(
693 693 name='user_create_personal_repo_group',
694 pattern='/users/{user_id:\d+}/create_repo_group',
694 pattern=r'/users/{user_id:\d+}/create_repo_group',
695 695 user_route=True)
696 696 config.add_view(
697 697 UsersView,
698 698 attr='user_create_personal_repo_group',
699 699 route_name='user_create_personal_repo_group', request_method='POST',
700 700 renderer='rhodecode:templates/admin/users/user_edit.mako')
701 701
702 702 # user notice
703 703 config.add_route(
704 704 name='user_notice_dismiss',
705 pattern='/users/{user_id:\d+}/notice_dismiss',
705 pattern=r'/users/{user_id:\d+}/notice_dismiss',
706 706 user_route=True)
707 707 config.add_view(
708 708 UsersView,
709 709 attr='user_notice_dismiss',
710 710 route_name='user_notice_dismiss', request_method='POST',
711 711 renderer='json_ext', xhr=True)
712 712
713 713 # user auth tokens
714 714 config.add_route(
715 715 name='edit_user_auth_tokens',
716 pattern='/users/{user_id:\d+}/edit/auth_tokens',
716 pattern=r'/users/{user_id:\d+}/edit/auth_tokens',
717 717 user_route=True)
718 718 config.add_view(
719 719 UsersView,
720 720 attr='auth_tokens',
721 721 route_name='edit_user_auth_tokens', request_method='GET',
722 722 renderer='rhodecode:templates/admin/users/user_edit.mako')
723 723
724 724 config.add_route(
725 725 name='edit_user_auth_tokens_view',
726 pattern='/users/{user_id:\d+}/edit/auth_tokens/view',
726 pattern=r'/users/{user_id:\d+}/edit/auth_tokens/view',
727 727 user_route=True)
728 728 config.add_view(
729 729 UsersView,
730 730 attr='auth_tokens_view',
731 731 route_name='edit_user_auth_tokens_view', request_method='POST',
732 732 renderer='json_ext', xhr=True)
733 733
734 734 config.add_route(
735 735 name='edit_user_auth_tokens_add',
736 pattern='/users/{user_id:\d+}/edit/auth_tokens/new',
736 pattern=r'/users/{user_id:\d+}/edit/auth_tokens/new',
737 737 user_route=True)
738 738 config.add_view(
739 739 UsersView,
740 740 attr='auth_tokens_add',
741 741 route_name='edit_user_auth_tokens_add', request_method='POST')
742 742
743 743 config.add_route(
744 744 name='edit_user_auth_tokens_delete',
745 pattern='/users/{user_id:\d+}/edit/auth_tokens/delete',
745 pattern=r'/users/{user_id:\d+}/edit/auth_tokens/delete',
746 746 user_route=True)
747 747 config.add_view(
748 748 UsersView,
749 749 attr='auth_tokens_delete',
750 750 route_name='edit_user_auth_tokens_delete', request_method='POST')
751 751
752 752 # user ssh keys
753 753 config.add_route(
754 754 name='edit_user_ssh_keys',
755 pattern='/users/{user_id:\d+}/edit/ssh_keys',
755 pattern=r'/users/{user_id:\d+}/edit/ssh_keys',
756 756 user_route=True)
757 757 config.add_view(
758 758 UsersView,
759 759 attr='ssh_keys',
760 760 route_name='edit_user_ssh_keys', request_method='GET',
761 761 renderer='rhodecode:templates/admin/users/user_edit.mako')
762 762
763 763 config.add_route(
764 764 name='edit_user_ssh_keys_generate_keypair',
765 pattern='/users/{user_id:\d+}/edit/ssh_keys/generate',
765 pattern=r'/users/{user_id:\d+}/edit/ssh_keys/generate',
766 766 user_route=True)
767 767 config.add_view(
768 768 UsersView,
769 769 attr='ssh_keys_generate_keypair',
770 770 route_name='edit_user_ssh_keys_generate_keypair', request_method='GET',
771 771 renderer='rhodecode:templates/admin/users/user_edit.mako')
772 772
773 773 config.add_route(
774 774 name='edit_user_ssh_keys_add',
775 pattern='/users/{user_id:\d+}/edit/ssh_keys/new',
775 pattern=r'/users/{user_id:\d+}/edit/ssh_keys/new',
776 776 user_route=True)
777 777 config.add_view(
778 778 UsersView,
779 779 attr='ssh_keys_add',
780 780 route_name='edit_user_ssh_keys_add', request_method='POST')
781 781
782 782 config.add_route(
783 783 name='edit_user_ssh_keys_delete',
784 pattern='/users/{user_id:\d+}/edit/ssh_keys/delete',
784 pattern=r'/users/{user_id:\d+}/edit/ssh_keys/delete',
785 785 user_route=True)
786 786 config.add_view(
787 787 UsersView,
788 788 attr='ssh_keys_delete',
789 789 route_name='edit_user_ssh_keys_delete', request_method='POST')
790 790
791 791 # user emails
792 792 config.add_route(
793 793 name='edit_user_emails',
794 pattern='/users/{user_id:\d+}/edit/emails',
794 pattern=r'/users/{user_id:\d+}/edit/emails',
795 795 user_route=True)
796 796 config.add_view(
797 797 UsersView,
798 798 attr='emails',
799 799 route_name='edit_user_emails', request_method='GET',
800 800 renderer='rhodecode:templates/admin/users/user_edit.mako')
801 801
802 802 config.add_route(
803 803 name='edit_user_emails_add',
804 pattern='/users/{user_id:\d+}/edit/emails/new',
804 pattern=r'/users/{user_id:\d+}/edit/emails/new',
805 805 user_route=True)
806 806 config.add_view(
807 807 UsersView,
808 808 attr='emails_add',
809 809 route_name='edit_user_emails_add', request_method='POST')
810 810
811 811 config.add_route(
812 812 name='edit_user_emails_delete',
813 pattern='/users/{user_id:\d+}/edit/emails/delete',
813 pattern=r'/users/{user_id:\d+}/edit/emails/delete',
814 814 user_route=True)
815 815 config.add_view(
816 816 UsersView,
817 817 attr='emails_delete',
818 818 route_name='edit_user_emails_delete', request_method='POST')
819 819
820 820 # user IPs
821 821 config.add_route(
822 822 name='edit_user_ips',
823 pattern='/users/{user_id:\d+}/edit/ips',
823 pattern=r'/users/{user_id:\d+}/edit/ips',
824 824 user_route=True)
825 825 config.add_view(
826 826 UsersView,
827 827 attr='ips',
828 828 route_name='edit_user_ips', request_method='GET',
829 829 renderer='rhodecode:templates/admin/users/user_edit.mako')
830 830
831 831 config.add_route(
832 832 name='edit_user_ips_add',
833 pattern='/users/{user_id:\d+}/edit/ips/new',
833 pattern=r'/users/{user_id:\d+}/edit/ips/new',
834 834 user_route_with_default=True) # enabled for default user too
835 835 config.add_view(
836 836 UsersView,
837 837 attr='ips_add',
838 838 route_name='edit_user_ips_add', request_method='POST')
839 839
840 840 config.add_route(
841 841 name='edit_user_ips_delete',
842 pattern='/users/{user_id:\d+}/edit/ips/delete',
842 pattern=r'/users/{user_id:\d+}/edit/ips/delete',
843 843 user_route_with_default=True) # enabled for default user too
844 844 config.add_view(
845 845 UsersView,
846 846 attr='ips_delete',
847 847 route_name='edit_user_ips_delete', request_method='POST')
848 848
849 849 # user perms
850 850 config.add_route(
851 851 name='edit_user_perms_summary',
852 pattern='/users/{user_id:\d+}/edit/permissions_summary',
852 pattern=r'/users/{user_id:\d+}/edit/permissions_summary',
853 853 user_route=True)
854 854 config.add_view(
855 855 UsersView,
856 856 attr='user_perms_summary',
857 857 route_name='edit_user_perms_summary', request_method='GET',
858 858 renderer='rhodecode:templates/admin/users/user_edit.mako')
859 859
860 860 config.add_route(
861 861 name='edit_user_perms_summary_json',
862 pattern='/users/{user_id:\d+}/edit/permissions_summary/json',
862 pattern=r'/users/{user_id:\d+}/edit/permissions_summary/json',
863 863 user_route=True)
864 864 config.add_view(
865 865 UsersView,
866 866 attr='user_perms_summary_json',
867 867 route_name='edit_user_perms_summary_json', request_method='GET',
868 868 renderer='json_ext')
869 869
870 870 # user user groups management
871 871 config.add_route(
872 872 name='edit_user_groups_management',
873 pattern='/users/{user_id:\d+}/edit/groups_management',
873 pattern=r'/users/{user_id:\d+}/edit/groups_management',
874 874 user_route=True)
875 875 config.add_view(
876 876 UsersView,
877 877 attr='groups_management',
878 878 route_name='edit_user_groups_management', request_method='GET',
879 879 renderer='rhodecode:templates/admin/users/user_edit.mako')
880 880
881 881 config.add_route(
882 882 name='edit_user_groups_management_updates',
883 pattern='/users/{user_id:\d+}/edit/edit_user_groups_management/updates',
883 pattern=r'/users/{user_id:\d+}/edit/edit_user_groups_management/updates',
884 884 user_route=True)
885 885 config.add_view(
886 886 UsersView,
887 887 attr='groups_management_updates',
888 888 route_name='edit_user_groups_management_updates', request_method='POST')
889 889
890 890 # user audit logs
891 891 config.add_route(
892 892 name='edit_user_audit_logs',
893 pattern='/users/{user_id:\d+}/edit/audit', user_route=True)
893 pattern=r'/users/{user_id:\d+}/edit/audit', user_route=True)
894 894 config.add_view(
895 895 UsersView,
896 896 attr='user_audit_logs',
897 897 route_name='edit_user_audit_logs', request_method='GET',
898 898 renderer='rhodecode:templates/admin/users/user_edit.mako')
899 899
900 900 config.add_route(
901 901 name='edit_user_audit_logs_download',
902 pattern='/users/{user_id:\d+}/edit/audit/download', user_route=True)
902 pattern=r'/users/{user_id:\d+}/edit/audit/download', user_route=True)
903 903 config.add_view(
904 904 UsersView,
905 905 attr='user_audit_logs_download',
906 906 route_name='edit_user_audit_logs_download', request_method='GET',
907 907 renderer='string')
908 908
909 909 # user caches
910 910 config.add_route(
911 911 name='edit_user_caches',
912 pattern='/users/{user_id:\d+}/edit/caches',
912 pattern=r'/users/{user_id:\d+}/edit/caches',
913 913 user_route=True)
914 914 config.add_view(
915 915 UsersView,
916 916 attr='user_caches',
917 917 route_name='edit_user_caches', request_method='GET',
918 918 renderer='rhodecode:templates/admin/users/user_edit.mako')
919 919
920 920 config.add_route(
921 921 name='edit_user_caches_update',
922 pattern='/users/{user_id:\d+}/edit/caches/update',
922 pattern=r'/users/{user_id:\d+}/edit/caches/update',
923 923 user_route=True)
924 924 config.add_view(
925 925 UsersView,
926 926 attr='user_caches_update',
927 927 route_name='edit_user_caches_update', request_method='POST')
928 928
929 929 # user-groups admin
930 930 config.add_route(
931 931 name='user_groups',
932 932 pattern='/user_groups')
933 933 config.add_view(
934 934 AdminUserGroupsView,
935 935 attr='user_groups_list',
936 936 route_name='user_groups', request_method='GET',
937 937 renderer='rhodecode:templates/admin/user_groups/user_groups.mako')
938 938
939 939 config.add_route(
940 940 name='user_groups_data',
941 941 pattern='/user_groups_data')
942 942 config.add_view(
943 943 AdminUserGroupsView,
944 944 attr='user_groups_list_data',
945 945 route_name='user_groups_data', request_method='GET',
946 946 renderer='json_ext', xhr=True)
947 947
948 948 config.add_route(
949 949 name='user_groups_new',
950 950 pattern='/user_groups/new')
951 951 config.add_view(
952 952 AdminUserGroupsView,
953 953 attr='user_groups_new',
954 954 route_name='user_groups_new', request_method='GET',
955 955 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
956 956
957 957 config.add_route(
958 958 name='user_groups_create',
959 959 pattern='/user_groups/create')
960 960 config.add_view(
961 961 AdminUserGroupsView,
962 962 attr='user_groups_create',
963 963 route_name='user_groups_create', request_method='POST',
964 964 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
965 965
966 966 # repos admin
967 967 config.add_route(
968 968 name='repos',
969 969 pattern='/repos')
970 970 config.add_view(
971 971 AdminReposView,
972 972 attr='repository_list',
973 973 route_name='repos', request_method='GET',
974 974 renderer='rhodecode:templates/admin/repos/repos.mako')
975 975
976 976 config.add_route(
977 977 name='repos_data',
978 978 pattern='/repos_data')
979 979 config.add_view(
980 980 AdminReposView,
981 981 attr='repository_list_data',
982 982 route_name='repos_data', request_method='GET',
983 983 renderer='json_ext', xhr=True)
984 984
985 985 config.add_route(
986 986 name='repo_new',
987 987 pattern='/repos/new')
988 988 config.add_view(
989 989 AdminReposView,
990 990 attr='repository_new',
991 991 route_name='repo_new', request_method='GET',
992 992 renderer='rhodecode:templates/admin/repos/repo_add.mako')
993 993
994 994 config.add_route(
995 995 name='repo_create',
996 996 pattern='/repos/create')
997 997 config.add_view(
998 998 AdminReposView,
999 999 attr='repository_create',
1000 1000 route_name='repo_create', request_method='POST',
1001 1001 renderer='rhodecode:templates/admin/repos/repos.mako')
1002 1002
1003 1003 # repo groups admin
1004 1004 config.add_route(
1005 1005 name='repo_groups',
1006 1006 pattern='/repo_groups')
1007 1007 config.add_view(
1008 1008 AdminRepoGroupsView,
1009 1009 attr='repo_group_list',
1010 1010 route_name='repo_groups', request_method='GET',
1011 1011 renderer='rhodecode:templates/admin/repo_groups/repo_groups.mako')
1012 1012
1013 1013 config.add_route(
1014 1014 name='repo_groups_data',
1015 1015 pattern='/repo_groups_data')
1016 1016 config.add_view(
1017 1017 AdminRepoGroupsView,
1018 1018 attr='repo_group_list_data',
1019 1019 route_name='repo_groups_data', request_method='GET',
1020 1020 renderer='json_ext', xhr=True)
1021 1021
1022 1022 config.add_route(
1023 1023 name='repo_group_new',
1024 1024 pattern='/repo_group/new')
1025 1025 config.add_view(
1026 1026 AdminRepoGroupsView,
1027 1027 attr='repo_group_new',
1028 1028 route_name='repo_group_new', request_method='GET',
1029 1029 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
1030 1030
1031 1031 config.add_route(
1032 1032 name='repo_group_create',
1033 1033 pattern='/repo_group/create')
1034 1034 config.add_view(
1035 1035 AdminRepoGroupsView,
1036 1036 attr='repo_group_create',
1037 1037 route_name='repo_group_create', request_method='POST',
1038 1038 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
1039 1039
1040 1040
1041 1041 def includeme(config):
1042 1042 from rhodecode.apps._base.navigation import includeme as nav_includeme
1043 1043 from rhodecode.apps.admin.views.main_views import AdminMainView
1044 1044
1045 1045 # Create admin navigation registry and add it to the pyramid registry.
1046 1046 nav_includeme(config)
1047 1047
1048 1048 # main admin routes
1049 1049 config.add_route(
1050 1050 name='admin_home', pattern=ADMIN_PREFIX)
1051 1051 config.add_view(
1052 1052 AdminMainView,
1053 1053 attr='admin_main',
1054 1054 route_name='admin_home', request_method='GET',
1055 1055 renderer='rhodecode:templates/admin/main.mako')
1056 1056
1057 1057 # pr global redirect
1058 1058 config.add_route(
1059 1059 name='pull_requests_global_0', # backward compat
1060 pattern=ADMIN_PREFIX + '/pull_requests/{pull_request_id:\d+}')
1060 pattern=ADMIN_PREFIX + r'/pull_requests/{pull_request_id:\d+}')
1061 1061 config.add_view(
1062 1062 AdminMainView,
1063 1063 attr='pull_requests',
1064 1064 route_name='pull_requests_global_0', request_method='GET')
1065 1065
1066 1066 config.add_route(
1067 1067 name='pull_requests_global_1', # backward compat
1068 pattern=ADMIN_PREFIX + '/pull-requests/{pull_request_id:\d+}')
1068 pattern=ADMIN_PREFIX + r'/pull-requests/{pull_request_id:\d+}')
1069 1069 config.add_view(
1070 1070 AdminMainView,
1071 1071 attr='pull_requests',
1072 1072 route_name='pull_requests_global_1', request_method='GET')
1073 1073
1074 1074 config.add_route(
1075 1075 name='pull_requests_global',
1076 pattern=ADMIN_PREFIX + '/pull-request/{pull_request_id:\d+}')
1076 pattern=ADMIN_PREFIX + r'/pull-request/{pull_request_id:\d+}')
1077 1077 config.add_view(
1078 1078 AdminMainView,
1079 1079 attr='pull_requests',
1080 1080 route_name='pull_requests_global', request_method='GET')
1081 1081
1082 1082 config.include(admin_routes, route_prefix=ADMIN_PREFIX)
@@ -1,1225 +1,1225 b''
1 1 # Copyright (C) 2016-2023 RhodeCode GmbH
2 2 #
3 3 # This program is free software: you can redistribute it and/or modify
4 4 # it under the terms of the GNU Affero General Public License, version 3
5 5 # (only), as published by the Free Software Foundation.
6 6 #
7 7 # This program is distributed in the hope that it will be useful,
8 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 10 # GNU General Public License for more details.
11 11 #
12 12 # You should have received a copy of the GNU Affero General Public License
13 13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 14 #
15 15 # This program is dual-licensed. If you wish to learn more about the
16 16 # RhodeCode Enterprise Edition, including its added features, Support services,
17 17 # and proprietary license terms, please see https://rhodecode.com/licenses/
18 18 from rhodecode.apps._base import add_route_with_slash
19 19
20 20
21 21 def includeme(config):
22 22 from rhodecode.apps.repository.views.repo_artifacts import RepoArtifactsView
23 23 from rhodecode.apps.repository.views.repo_audit_logs import AuditLogsView
24 24 from rhodecode.apps.repository.views.repo_automation import RepoAutomationView
25 25 from rhodecode.apps.repository.views.repo_bookmarks import RepoBookmarksView
26 26 from rhodecode.apps.repository.views.repo_branch_permissions import RepoSettingsBranchPermissionsView
27 27 from rhodecode.apps.repository.views.repo_branches import RepoBranchesView
28 28 from rhodecode.apps.repository.views.repo_caches import RepoCachesView
29 29 from rhodecode.apps.repository.views.repo_changelog import RepoChangelogView
30 30 from rhodecode.apps.repository.views.repo_checks import RepoChecksView
31 31 from rhodecode.apps.repository.views.repo_commits import RepoCommitsView
32 32 from rhodecode.apps.repository.views.repo_compare import RepoCompareView
33 33 from rhodecode.apps.repository.views.repo_feed import RepoFeedView
34 34 from rhodecode.apps.repository.views.repo_files import RepoFilesView
35 35 from rhodecode.apps.repository.views.repo_forks import RepoForksView
36 36 from rhodecode.apps.repository.views.repo_maintainance import RepoMaintenanceView
37 37 from rhodecode.apps.repository.views.repo_permissions import RepoSettingsPermissionsView
38 38 from rhodecode.apps.repository.views.repo_pull_requests import RepoPullRequestsView
39 39 from rhodecode.apps.repository.views.repo_review_rules import RepoReviewRulesView
40 40 from rhodecode.apps.repository.views.repo_settings import RepoSettingsView
41 41 from rhodecode.apps.repository.views.repo_settings_advanced import RepoSettingsAdvancedView
42 42 from rhodecode.apps.repository.views.repo_settings_fields import RepoSettingsFieldsView
43 43 from rhodecode.apps.repository.views.repo_settings_issue_trackers import RepoSettingsIssueTrackersView
44 44 from rhodecode.apps.repository.views.repo_settings_remote import RepoSettingsRemoteView
45 45 from rhodecode.apps.repository.views.repo_settings_vcs import RepoSettingsVcsView
46 46 from rhodecode.apps.repository.views.repo_strip import RepoStripView
47 47 from rhodecode.apps.repository.views.repo_summary import RepoSummaryView
48 48 from rhodecode.apps.repository.views.repo_tags import RepoTagsView
49 49
50 50 # repo creating checks, special cases that aren't repo routes
51 51 config.add_route(
52 52 name='repo_creating',
53 53 pattern='/{repo_name:.*?[^/]}/repo_creating')
54 54 config.add_view(
55 55 RepoChecksView,
56 56 attr='repo_creating',
57 57 route_name='repo_creating', request_method='GET',
58 58 renderer='rhodecode:templates/admin/repos/repo_creating.mako')
59 59
60 60 config.add_route(
61 61 name='repo_creating_check',
62 62 pattern='/{repo_name:.*?[^/]}/repo_creating_check')
63 63 config.add_view(
64 64 RepoChecksView,
65 65 attr='repo_creating_check',
66 66 route_name='repo_creating_check', request_method='GET',
67 67 renderer='json_ext')
68 68
69 69 # Summary
70 70 # NOTE(marcink): one additional route is defined in very bottom, catch
71 71 # all pattern
72 72 config.add_route(
73 73 name='repo_summary_explicit',
74 74 pattern='/{repo_name:.*?[^/]}/summary', repo_route=True)
75 75 config.add_view(
76 76 RepoSummaryView,
77 77 attr='summary',
78 78 route_name='repo_summary_explicit', request_method='GET',
79 79 renderer='rhodecode:templates/summary/summary.mako')
80 80
81 81 config.add_route(
82 82 name='repo_summary_commits',
83 83 pattern='/{repo_name:.*?[^/]}/summary-commits', repo_route=True)
84 84 config.add_view(
85 85 RepoSummaryView,
86 86 attr='summary_commits',
87 87 route_name='repo_summary_commits', request_method='GET',
88 88 renderer='rhodecode:templates/summary/summary_commits.mako')
89 89
90 90 # Commits
91 91 config.add_route(
92 92 name='repo_commit',
93 93 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}', repo_route=True)
94 94 config.add_view(
95 95 RepoCommitsView,
96 96 attr='repo_commit_show',
97 97 route_name='repo_commit', request_method='GET',
98 98 renderer=None)
99 99
100 100 config.add_route(
101 101 name='repo_commit_children',
102 102 pattern='/{repo_name:.*?[^/]}/changeset_children/{commit_id}', repo_route=True)
103 103 config.add_view(
104 104 RepoCommitsView,
105 105 attr='repo_commit_children',
106 106 route_name='repo_commit_children', request_method='GET',
107 107 renderer='json_ext', xhr=True)
108 108
109 109 config.add_route(
110 110 name='repo_commit_parents',
111 111 pattern='/{repo_name:.*?[^/]}/changeset_parents/{commit_id}', repo_route=True)
112 112 config.add_view(
113 113 RepoCommitsView,
114 114 attr='repo_commit_parents',
115 115 route_name='repo_commit_parents', request_method='GET',
116 116 renderer='json_ext')
117 117
118 118 config.add_route(
119 119 name='repo_commit_raw',
120 120 pattern='/{repo_name:.*?[^/]}/changeset-diff/{commit_id}', repo_route=True)
121 121 config.add_view(
122 122 RepoCommitsView,
123 123 attr='repo_commit_raw',
124 124 route_name='repo_commit_raw', request_method='GET',
125 125 renderer=None)
126 126
127 127 config.add_route(
128 128 name='repo_commit_patch',
129 129 pattern='/{repo_name:.*?[^/]}/changeset-patch/{commit_id}', repo_route=True)
130 130 config.add_view(
131 131 RepoCommitsView,
132 132 attr='repo_commit_patch',
133 133 route_name='repo_commit_patch', request_method='GET',
134 134 renderer=None)
135 135
136 136 config.add_route(
137 137 name='repo_commit_download',
138 138 pattern='/{repo_name:.*?[^/]}/changeset-download/{commit_id}', repo_route=True)
139 139 config.add_view(
140 140 RepoCommitsView,
141 141 attr='repo_commit_download',
142 142 route_name='repo_commit_download', request_method='GET',
143 143 renderer=None)
144 144
145 145 config.add_route(
146 146 name='repo_commit_data',
147 147 pattern='/{repo_name:.*?[^/]}/changeset-data/{commit_id}', repo_route=True)
148 148 config.add_view(
149 149 RepoCommitsView,
150 150 attr='repo_commit_data',
151 151 route_name='repo_commit_data', request_method='GET',
152 152 renderer='json_ext', xhr=True)
153 153
154 154 config.add_route(
155 155 name='repo_commit_comment_create',
156 156 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/create', repo_route=True)
157 157 config.add_view(
158 158 RepoCommitsView,
159 159 attr='repo_commit_comment_create',
160 160 route_name='repo_commit_comment_create', request_method='POST',
161 161 renderer='json_ext')
162 162
163 163 config.add_route(
164 164 name='repo_commit_comment_preview',
165 165 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/preview', repo_route=True)
166 166 config.add_view(
167 167 RepoCommitsView,
168 168 attr='repo_commit_comment_preview',
169 169 route_name='repo_commit_comment_preview', request_method='POST',
170 170 renderer='string', xhr=True)
171 171
172 172 config.add_route(
173 173 name='repo_commit_comment_history_view',
174 174 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/history_view/{comment_history_id}', repo_route=True)
175 175 config.add_view(
176 176 RepoCommitsView,
177 177 attr='repo_commit_comment_history_view',
178 178 route_name='repo_commit_comment_history_view', request_method='POST',
179 179 renderer='string', xhr=True)
180 180
181 181 config.add_route(
182 182 name='repo_commit_comment_attachment_upload',
183 183 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/attachment_upload', repo_route=True)
184 184 config.add_view(
185 185 RepoCommitsView,
186 186 attr='repo_commit_comment_attachment_upload',
187 187 route_name='repo_commit_comment_attachment_upload', request_method='POST',
188 188 renderer='json_ext', xhr=True)
189 189
190 190 config.add_route(
191 191 name='repo_commit_comment_delete',
192 192 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/delete', repo_route=True)
193 193 config.add_view(
194 194 RepoCommitsView,
195 195 attr='repo_commit_comment_delete',
196 196 route_name='repo_commit_comment_delete', request_method='POST',
197 197 renderer='json_ext')
198 198
199 199 config.add_route(
200 200 name='repo_commit_comment_edit',
201 201 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/edit', repo_route=True)
202 202 config.add_view(
203 203 RepoCommitsView,
204 204 attr='repo_commit_comment_edit',
205 205 route_name='repo_commit_comment_edit', request_method='POST',
206 206 renderer='json_ext')
207 207
208 208 # still working url for backward compat.
209 209 config.add_route(
210 210 name='repo_commit_raw_deprecated',
211 211 pattern='/{repo_name:.*?[^/]}/raw-changeset/{commit_id}', repo_route=True)
212 212 config.add_view(
213 213 RepoCommitsView,
214 214 attr='repo_commit_raw',
215 215 route_name='repo_commit_raw_deprecated', request_method='GET',
216 216 renderer=None)
217 217
218 218 # Files
219 219 config.add_route(
220 220 name='repo_archivefile',
221 221 pattern='/{repo_name:.*?[^/]}/archive/{fname:.*}', repo_route=True)
222 222 config.add_view(
223 223 RepoFilesView,
224 224 attr='repo_archivefile',
225 225 route_name='repo_archivefile', request_method='GET',
226 226 renderer=None)
227 227
228 228 config.add_route(
229 229 name='repo_files_diff',
230 230 pattern='/{repo_name:.*?[^/]}/diff/{f_path:.*}', repo_route=True)
231 231 config.add_view(
232 232 RepoFilesView,
233 233 attr='repo_files_diff',
234 234 route_name='repo_files_diff', request_method='GET',
235 235 renderer=None)
236 236
237 237 config.add_route( # legacy route to make old links work
238 238 name='repo_files_diff_2way_redirect',
239 239 pattern='/{repo_name:.*?[^/]}/diff-2way/{f_path:.*}', repo_route=True)
240 240 config.add_view(
241 241 RepoFilesView,
242 242 attr='repo_files_diff_2way_redirect',
243 243 route_name='repo_files_diff_2way_redirect', request_method='GET',
244 244 renderer=None)
245 245
246 246 config.add_route(
247 247 name='repo_files',
248 248 pattern='/{repo_name:.*?[^/]}/files/{commit_id}/{f_path:.*}', repo_route=True)
249 249 config.add_view(
250 250 RepoFilesView,
251 251 attr='repo_files',
252 252 route_name='repo_files', request_method='GET',
253 253 renderer=None)
254 254
255 255 config.add_route(
256 256 name='repo_files:default_path',
257 257 pattern='/{repo_name:.*?[^/]}/files/{commit_id}/', repo_route=True)
258 258 config.add_view(
259 259 RepoFilesView,
260 260 attr='repo_files',
261 261 route_name='repo_files:default_path', request_method='GET',
262 262 renderer=None)
263 263
264 264 config.add_route(
265 265 name='repo_files:default_commit',
266 266 pattern='/{repo_name:.*?[^/]}/files', repo_route=True)
267 267 config.add_view(
268 268 RepoFilesView,
269 269 attr='repo_files',
270 270 route_name='repo_files:default_commit', request_method='GET',
271 271 renderer=None)
272 272
273 273 config.add_route(
274 274 name='repo_files:rendered',
275 275 pattern='/{repo_name:.*?[^/]}/render/{commit_id}/{f_path:.*}', repo_route=True)
276 276 config.add_view(
277 277 RepoFilesView,
278 278 attr='repo_files',
279 279 route_name='repo_files:rendered', request_method='GET',
280 280 renderer=None)
281 281
282 282 config.add_route(
283 283 name='repo_files:annotated',
284 284 pattern='/{repo_name:.*?[^/]}/annotate/{commit_id}/{f_path:.*}', repo_route=True)
285 285 config.add_view(
286 286 RepoFilesView,
287 287 attr='repo_files',
288 288 route_name='repo_files:annotated', request_method='GET',
289 289 renderer=None)
290 290
291 291 config.add_route(
292 292 name='repo_files:annotated_previous',
293 293 pattern='/{repo_name:.*?[^/]}/annotate-previous/{commit_id}/{f_path:.*}', repo_route=True)
294 294 config.add_view(
295 295 RepoFilesView,
296 296 attr='repo_files_annotated_previous',
297 297 route_name='repo_files:annotated_previous', request_method='GET',
298 298 renderer=None)
299 299
300 300 config.add_route(
301 301 name='repo_nodetree_full',
302 302 pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/{f_path:.*}', repo_route=True)
303 303 config.add_view(
304 304 RepoFilesView,
305 305 attr='repo_nodetree_full',
306 306 route_name='repo_nodetree_full', request_method='GET',
307 307 renderer=None, xhr=True)
308 308
309 309 config.add_route(
310 310 name='repo_nodetree_full:default_path',
311 311 pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/', repo_route=True)
312 312 config.add_view(
313 313 RepoFilesView,
314 314 attr='repo_nodetree_full',
315 315 route_name='repo_nodetree_full:default_path', request_method='GET',
316 316 renderer=None, xhr=True)
317 317
318 318 config.add_route(
319 319 name='repo_files_nodelist',
320 320 pattern='/{repo_name:.*?[^/]}/nodelist/{commit_id}/{f_path:.*}', repo_route=True)
321 321 config.add_view(
322 322 RepoFilesView,
323 323 attr='repo_nodelist',
324 324 route_name='repo_files_nodelist', request_method='GET',
325 325 renderer='json_ext', xhr=True)
326 326
327 327 config.add_route(
328 328 name='repo_file_raw',
329 329 pattern='/{repo_name:.*?[^/]}/raw/{commit_id}/{f_path:.*}', repo_route=True)
330 330 config.add_view(
331 331 RepoFilesView,
332 332 attr='repo_file_raw',
333 333 route_name='repo_file_raw', request_method='GET',
334 334 renderer=None)
335 335
336 336 config.add_route(
337 337 name='repo_file_download',
338 338 pattern='/{repo_name:.*?[^/]}/download/{commit_id}/{f_path:.*}', repo_route=True)
339 339 config.add_view(
340 340 RepoFilesView,
341 341 attr='repo_file_download',
342 342 route_name='repo_file_download', request_method='GET',
343 343 renderer=None)
344 344
345 345 config.add_route( # backward compat to keep old links working
346 346 name='repo_file_download:legacy',
347 347 pattern='/{repo_name:.*?[^/]}/rawfile/{commit_id}/{f_path:.*}',
348 348 repo_route=True)
349 349 config.add_view(
350 350 RepoFilesView,
351 351 attr='repo_file_download',
352 352 route_name='repo_file_download:legacy', request_method='GET',
353 353 renderer=None)
354 354
355 355 config.add_route(
356 356 name='repo_file_history',
357 357 pattern='/{repo_name:.*?[^/]}/history/{commit_id}/{f_path:.*}', repo_route=True)
358 358 config.add_view(
359 359 RepoFilesView,
360 360 attr='repo_file_history',
361 361 route_name='repo_file_history', request_method='GET',
362 362 renderer='json_ext')
363 363
364 364 config.add_route(
365 365 name='repo_file_authors',
366 366 pattern='/{repo_name:.*?[^/]}/authors/{commit_id}/{f_path:.*}', repo_route=True)
367 367 config.add_view(
368 368 RepoFilesView,
369 369 attr='repo_file_authors',
370 370 route_name='repo_file_authors', request_method='GET',
371 371 renderer='rhodecode:templates/files/file_authors_box.mako')
372 372
373 373 config.add_route(
374 374 name='repo_files_check_head',
375 375 pattern='/{repo_name:.*?[^/]}/check_head/{commit_id}/{f_path:.*}',
376 376 repo_route=True)
377 377 config.add_view(
378 378 RepoFilesView,
379 379 attr='repo_files_check_head',
380 380 route_name='repo_files_check_head', request_method='POST',
381 381 renderer='json_ext', xhr=True)
382 382
383 383 config.add_route(
384 384 name='repo_files_remove_file',
385 385 pattern='/{repo_name:.*?[^/]}/remove_file/{commit_id}/{f_path:.*}',
386 386 repo_route=True)
387 387 config.add_view(
388 388 RepoFilesView,
389 389 attr='repo_files_remove_file',
390 390 route_name='repo_files_remove_file', request_method='GET',
391 391 renderer='rhodecode:templates/files/files_delete.mako')
392 392
393 393 config.add_route(
394 394 name='repo_files_delete_file',
395 395 pattern='/{repo_name:.*?[^/]}/delete_file/{commit_id}/{f_path:.*}',
396 396 repo_route=True)
397 397 config.add_view(
398 398 RepoFilesView,
399 399 attr='repo_files_delete_file',
400 400 route_name='repo_files_delete_file', request_method='POST',
401 401 renderer=None)
402 402
403 403 config.add_route(
404 404 name='repo_files_edit_file',
405 405 pattern='/{repo_name:.*?[^/]}/edit_file/{commit_id}/{f_path:.*}',
406 406 repo_route=True)
407 407 config.add_view(
408 408 RepoFilesView,
409 409 attr='repo_files_edit_file',
410 410 route_name='repo_files_edit_file', request_method='GET',
411 411 renderer='rhodecode:templates/files/files_edit.mako')
412 412
413 413 config.add_route(
414 414 name='repo_files_update_file',
415 415 pattern='/{repo_name:.*?[^/]}/update_file/{commit_id}/{f_path:.*}',
416 416 repo_route=True)
417 417 config.add_view(
418 418 RepoFilesView,
419 419 attr='repo_files_update_file',
420 420 route_name='repo_files_update_file', request_method='POST',
421 421 renderer=None)
422 422
423 423 config.add_route(
424 424 name='repo_files_add_file',
425 425 pattern='/{repo_name:.*?[^/]}/add_file/{commit_id}/{f_path:.*}',
426 426 repo_route=True)
427 427 config.add_view(
428 428 RepoFilesView,
429 429 attr='repo_files_add_file',
430 430 route_name='repo_files_add_file', request_method='GET',
431 431 renderer='rhodecode:templates/files/files_add.mako')
432 432
433 433 config.add_route(
434 434 name='repo_files_upload_file',
435 435 pattern='/{repo_name:.*?[^/]}/upload_file/{commit_id}/{f_path:.*}',
436 436 repo_route=True)
437 437 config.add_view(
438 438 RepoFilesView,
439 439 attr='repo_files_add_file',
440 440 route_name='repo_files_upload_file', request_method='GET',
441 441 renderer='rhodecode:templates/files/files_upload.mako')
442 442 config.add_view( # POST creates
443 443 RepoFilesView,
444 444 attr='repo_files_upload_file',
445 445 route_name='repo_files_upload_file', request_method='POST',
446 446 renderer='json_ext')
447 447
448 448 config.add_route(
449 449 name='repo_files_create_file',
450 450 pattern='/{repo_name:.*?[^/]}/create_file/{commit_id}/{f_path:.*}',
451 451 repo_route=True)
452 452 config.add_view( # POST creates
453 453 RepoFilesView,
454 454 attr='repo_files_create_file',
455 455 route_name='repo_files_create_file', request_method='POST',
456 456 renderer=None)
457 457
458 458 # Refs data
459 459 config.add_route(
460 460 name='repo_refs_data',
461 461 pattern='/{repo_name:.*?[^/]}/refs-data', repo_route=True)
462 462 config.add_view(
463 463 RepoSummaryView,
464 464 attr='repo_refs_data',
465 465 route_name='repo_refs_data', request_method='GET',
466 466 renderer='json_ext')
467 467
468 468 config.add_route(
469 469 name='repo_refs_changelog_data',
470 470 pattern='/{repo_name:.*?[^/]}/refs-data-changelog', repo_route=True)
471 471 config.add_view(
472 472 RepoSummaryView,
473 473 attr='repo_refs_changelog_data',
474 474 route_name='repo_refs_changelog_data', request_method='GET',
475 475 renderer='json_ext')
476 476
477 477 config.add_route(
478 478 name='repo_stats',
479 479 pattern='/{repo_name:.*?[^/]}/repo_stats/{commit_id}', repo_route=True)
480 480 config.add_view(
481 481 RepoSummaryView,
482 482 attr='repo_stats',
483 483 route_name='repo_stats', request_method='GET',
484 484 renderer='json_ext')
485 485
486 486 # Commits
487 487 config.add_route(
488 488 name='repo_commits',
489 489 pattern='/{repo_name:.*?[^/]}/commits', repo_route=True)
490 490 config.add_view(
491 491 RepoChangelogView,
492 492 attr='repo_changelog',
493 493 route_name='repo_commits', request_method='GET',
494 494 renderer='rhodecode:templates/commits/changelog.mako')
495 495 # old routes for backward compat
496 496 config.add_view(
497 497 RepoChangelogView,
498 498 attr='repo_changelog',
499 499 route_name='repo_changelog', request_method='GET',
500 500 renderer='rhodecode:templates/commits/changelog.mako')
501 501
502 502 config.add_route(
503 503 name='repo_commits_elements',
504 504 pattern='/{repo_name:.*?[^/]}/commits_elements', repo_route=True)
505 505 config.add_view(
506 506 RepoChangelogView,
507 507 attr='repo_commits_elements',
508 508 route_name='repo_commits_elements', request_method=('GET', 'POST'),
509 509 renderer='rhodecode:templates/commits/changelog_elements.mako',
510 510 xhr=True)
511 511
512 512 config.add_route(
513 513 name='repo_commits_elements_file',
514 514 pattern='/{repo_name:.*?[^/]}/commits_elements/{commit_id}/{f_path:.*}', repo_route=True)
515 515 config.add_view(
516 516 RepoChangelogView,
517 517 attr='repo_commits_elements',
518 518 route_name='repo_commits_elements_file', request_method=('GET', 'POST'),
519 519 renderer='rhodecode:templates/commits/changelog_elements.mako',
520 520 xhr=True)
521 521
522 522 config.add_route(
523 523 name='repo_commits_file',
524 524 pattern='/{repo_name:.*?[^/]}/commits/{commit_id}/{f_path:.*}', repo_route=True)
525 525 config.add_view(
526 526 RepoChangelogView,
527 527 attr='repo_changelog',
528 528 route_name='repo_commits_file', request_method='GET',
529 529 renderer='rhodecode:templates/commits/changelog.mako')
530 530 # old routes for backward compat
531 531 config.add_view(
532 532 RepoChangelogView,
533 533 attr='repo_changelog',
534 534 route_name='repo_changelog_file', request_method='GET',
535 535 renderer='rhodecode:templates/commits/changelog.mako')
536 536
537 537 # Changelog (old deprecated name for commits page)
538 538 config.add_route(
539 539 name='repo_changelog',
540 540 pattern='/{repo_name:.*?[^/]}/changelog', repo_route=True)
541 541 config.add_route(
542 542 name='repo_changelog_file',
543 543 pattern='/{repo_name:.*?[^/]}/changelog/{commit_id}/{f_path:.*}', repo_route=True)
544 544
545 545 # Compare
546 546 config.add_route(
547 547 name='repo_compare_select',
548 548 pattern='/{repo_name:.*?[^/]}/compare', repo_route=True)
549 549 config.add_view(
550 550 RepoCompareView,
551 551 attr='compare_select',
552 552 route_name='repo_compare_select', request_method='GET',
553 553 renderer='rhodecode:templates/compare/compare_diff.mako')
554 554
555 555 config.add_route(
556 556 name='repo_compare',
557 557 pattern='/{repo_name:.*?[^/]}/compare/{source_ref_type}@{source_ref:.*?}...{target_ref_type}@{target_ref:.*?}', repo_route=True)
558 558 config.add_view(
559 559 RepoCompareView,
560 560 attr='compare',
561 561 route_name='repo_compare', request_method='GET',
562 562 renderer=None)
563 563
564 564 # Tags
565 565 config.add_route(
566 566 name='tags_home',
567 567 pattern='/{repo_name:.*?[^/]}/tags', repo_route=True)
568 568 config.add_view(
569 569 RepoTagsView,
570 570 attr='tags',
571 571 route_name='tags_home', request_method='GET',
572 572 renderer='rhodecode:templates/tags/tags.mako')
573 573
574 574 # Branches
575 575 config.add_route(
576 576 name='branches_home',
577 577 pattern='/{repo_name:.*?[^/]}/branches', repo_route=True)
578 578 config.add_view(
579 579 RepoBranchesView,
580 580 attr='branches',
581 581 route_name='branches_home', request_method='GET',
582 582 renderer='rhodecode:templates/branches/branches.mako')
583 583
584 584 # Bookmarks
585 585 config.add_route(
586 586 name='bookmarks_home',
587 587 pattern='/{repo_name:.*?[^/]}/bookmarks', repo_route=True)
588 588 config.add_view(
589 589 RepoBookmarksView,
590 590 attr='bookmarks',
591 591 route_name='bookmarks_home', request_method='GET',
592 592 renderer='rhodecode:templates/bookmarks/bookmarks.mako')
593 593
594 594 # Forks
595 595 config.add_route(
596 596 name='repo_fork_new',
597 597 pattern='/{repo_name:.*?[^/]}/fork', repo_route=True,
598 598 repo_forbid_when_archived=True,
599 599 repo_accepted_types=['hg', 'git'])
600 600 config.add_view(
601 601 RepoForksView,
602 602 attr='repo_fork_new',
603 603 route_name='repo_fork_new', request_method='GET',
604 604 renderer='rhodecode:templates/forks/forks.mako')
605 605
606 606 config.add_route(
607 607 name='repo_fork_create',
608 608 pattern='/{repo_name:.*?[^/]}/fork/create', repo_route=True,
609 609 repo_forbid_when_archived=True,
610 610 repo_accepted_types=['hg', 'git'])
611 611 config.add_view(
612 612 RepoForksView,
613 613 attr='repo_fork_create',
614 614 route_name='repo_fork_create', request_method='POST',
615 615 renderer='rhodecode:templates/forks/fork.mako')
616 616
617 617 config.add_route(
618 618 name='repo_forks_show_all',
619 619 pattern='/{repo_name:.*?[^/]}/forks', repo_route=True,
620 620 repo_accepted_types=['hg', 'git'])
621 621 config.add_view(
622 622 RepoForksView,
623 623 attr='repo_forks_show_all',
624 624 route_name='repo_forks_show_all', request_method='GET',
625 625 renderer='rhodecode:templates/forks/forks.mako')
626 626
627 627 config.add_route(
628 628 name='repo_forks_data',
629 629 pattern='/{repo_name:.*?[^/]}/forks/data', repo_route=True,
630 630 repo_accepted_types=['hg', 'git'])
631 631 config.add_view(
632 632 RepoForksView,
633 633 attr='repo_forks_data',
634 634 route_name='repo_forks_data', request_method='GET',
635 635 renderer='json_ext', xhr=True)
636 636
637 637 # Pull Requests
638 638 config.add_route(
639 639 name='pullrequest_show',
640 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}',
640 pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}',
641 641 repo_route=True)
642 642 config.add_view(
643 643 RepoPullRequestsView,
644 644 attr='pull_request_show',
645 645 route_name='pullrequest_show', request_method='GET',
646 646 renderer='rhodecode:templates/pullrequests/pullrequest_show.mako')
647 647
648 648 config.add_route(
649 649 name='pullrequest_show_all',
650 650 pattern='/{repo_name:.*?[^/]}/pull-request',
651 651 repo_route=True, repo_accepted_types=['hg', 'git'])
652 652 config.add_view(
653 653 RepoPullRequestsView,
654 654 attr='pull_request_list',
655 655 route_name='pullrequest_show_all', request_method='GET',
656 656 renderer='rhodecode:templates/pullrequests/pullrequests.mako')
657 657
658 658 config.add_route(
659 659 name='pullrequest_show_all_data',
660 660 pattern='/{repo_name:.*?[^/]}/pull-request-data',
661 661 repo_route=True, repo_accepted_types=['hg', 'git'])
662 662 config.add_view(
663 663 RepoPullRequestsView,
664 664 attr='pull_request_list_data',
665 665 route_name='pullrequest_show_all_data', request_method='GET',
666 666 renderer='json_ext', xhr=True)
667 667
668 668 config.add_route(
669 669 name='pullrequest_repo_refs',
670 670 pattern='/{repo_name:.*?[^/]}/pull-request/refs/{target_repo_name:.*?[^/]}',
671 671 repo_route=True)
672 672 config.add_view(
673 673 RepoPullRequestsView,
674 674 attr='pull_request_repo_refs',
675 675 route_name='pullrequest_repo_refs', request_method='GET',
676 676 renderer='json_ext', xhr=True)
677 677
678 678 config.add_route(
679 679 name='pullrequest_repo_targets',
680 680 pattern='/{repo_name:.*?[^/]}/pull-request/repo-targets',
681 681 repo_route=True)
682 682 config.add_view(
683 683 RepoPullRequestsView,
684 684 attr='pullrequest_repo_targets',
685 685 route_name='pullrequest_repo_targets', request_method='GET',
686 686 renderer='json_ext', xhr=True)
687 687
688 688 config.add_route(
689 689 name='pullrequest_new',
690 690 pattern='/{repo_name:.*?[^/]}/pull-request/new',
691 691 repo_route=True, repo_accepted_types=['hg', 'git'],
692 692 repo_forbid_when_archived=True)
693 693 config.add_view(
694 694 RepoPullRequestsView,
695 695 attr='pull_request_new',
696 696 route_name='pullrequest_new', request_method='GET',
697 697 renderer='rhodecode:templates/pullrequests/pullrequest.mako')
698 698
699 699 config.add_route(
700 700 name='pullrequest_create',
701 701 pattern='/{repo_name:.*?[^/]}/pull-request/create',
702 702 repo_route=True, repo_accepted_types=['hg', 'git'],
703 703 repo_forbid_when_archived=True)
704 704 config.add_view(
705 705 RepoPullRequestsView,
706 706 attr='pull_request_create',
707 707 route_name='pullrequest_create', request_method='POST',
708 708 renderer=None)
709 709
710 710 config.add_route(
711 711 name='pullrequest_update',
712 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update',
712 pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update',
713 713 repo_route=True, repo_forbid_when_archived=True)
714 714 config.add_view(
715 715 RepoPullRequestsView,
716 716 attr='pull_request_update',
717 717 route_name='pullrequest_update', request_method='POST',
718 718 renderer='json_ext')
719 719
720 720 config.add_route(
721 721 name='pullrequest_merge',
722 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge',
722 pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge',
723 723 repo_route=True, repo_forbid_when_archived=True)
724 724 config.add_view(
725 725 RepoPullRequestsView,
726 726 attr='pull_request_merge',
727 727 route_name='pullrequest_merge', request_method='POST',
728 728 renderer='json_ext')
729 729
730 730 config.add_route(
731 731 name='pullrequest_delete',
732 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete',
732 pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete',
733 733 repo_route=True, repo_forbid_when_archived=True)
734 734 config.add_view(
735 735 RepoPullRequestsView,
736 736 attr='pull_request_delete',
737 737 route_name='pullrequest_delete', request_method='POST',
738 738 renderer='json_ext')
739 739
740 740 config.add_route(
741 741 name='pullrequest_comment_create',
742 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment',
742 pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment',
743 743 repo_route=True)
744 744 config.add_view(
745 745 RepoPullRequestsView,
746 746 attr='pull_request_comment_create',
747 747 route_name='pullrequest_comment_create', request_method='POST',
748 748 renderer='json_ext')
749 749
750 750 config.add_route(
751 751 name='pullrequest_comment_edit',
752 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/edit',
752 pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/edit',
753 753 repo_route=True, repo_accepted_types=['hg', 'git'])
754 754 config.add_view(
755 755 RepoPullRequestsView,
756 756 attr='pull_request_comment_edit',
757 757 route_name='pullrequest_comment_edit', request_method='POST',
758 758 renderer='json_ext')
759 759
760 760 config.add_route(
761 761 name='pullrequest_comment_delete',
762 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete',
762 pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete',
763 763 repo_route=True, repo_accepted_types=['hg', 'git'])
764 764 config.add_view(
765 765 RepoPullRequestsView,
766 766 attr='pull_request_comment_delete',
767 767 route_name='pullrequest_comment_delete', request_method='POST',
768 768 renderer='json_ext')
769 769
770 770 config.add_route(
771 771 name='pullrequest_comments',
772 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comments',
772 pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comments',
773 773 repo_route=True)
774 774 config.add_view(
775 775 RepoPullRequestsView,
776 776 attr='pullrequest_comments',
777 777 route_name='pullrequest_comments', request_method='POST',
778 778 renderer='string_html', xhr=True)
779 779
780 780 config.add_route(
781 781 name='pullrequest_todos',
782 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/todos',
782 pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/todos',
783 783 repo_route=True)
784 784 config.add_view(
785 785 RepoPullRequestsView,
786 786 attr='pullrequest_todos',
787 787 route_name='pullrequest_todos', request_method='POST',
788 788 renderer='string_html', xhr=True)
789 789
790 790 config.add_route(
791 791 name='pullrequest_drafts',
792 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/drafts',
792 pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/drafts',
793 793 repo_route=True)
794 794 config.add_view(
795 795 RepoPullRequestsView,
796 796 attr='pullrequest_drafts',
797 797 route_name='pullrequest_drafts', request_method='POST',
798 798 renderer='string_html', xhr=True)
799 799
800 800 # Artifacts, (EE feature)
801 801 config.add_route(
802 802 name='repo_artifacts_list',
803 803 pattern='/{repo_name:.*?[^/]}/artifacts', repo_route=True)
804 804 config.add_view(
805 805 RepoArtifactsView,
806 806 attr='repo_artifacts',
807 807 route_name='repo_artifacts_list', request_method='GET',
808 808 renderer='rhodecode:templates/artifacts/artifact_list.mako')
809 809
810 810 # Settings
811 811 config.add_route(
812 812 name='edit_repo',
813 813 pattern='/{repo_name:.*?[^/]}/settings', repo_route=True)
814 814 config.add_view(
815 815 RepoSettingsView,
816 816 attr='edit_settings',
817 817 route_name='edit_repo', request_method='GET',
818 818 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
819 819 # update is POST on edit_repo
820 820 config.add_view(
821 821 RepoSettingsView,
822 822 attr='edit_settings_update',
823 823 route_name='edit_repo', request_method='POST',
824 824 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
825 825
826 826 # Settings advanced
827 827 config.add_route(
828 828 name='edit_repo_advanced',
829 829 pattern='/{repo_name:.*?[^/]}/settings/advanced', repo_route=True)
830 830 config.add_view(
831 831 RepoSettingsAdvancedView,
832 832 attr='edit_advanced',
833 833 route_name='edit_repo_advanced', request_method='GET',
834 834 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
835 835
836 836 config.add_route(
837 837 name='edit_repo_advanced_archive',
838 838 pattern='/{repo_name:.*?[^/]}/settings/advanced/archive', repo_route=True)
839 839 config.add_view(
840 840 RepoSettingsAdvancedView,
841 841 attr='edit_advanced_archive',
842 842 route_name='edit_repo_advanced_archive', request_method='POST',
843 843 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
844 844
845 845 config.add_route(
846 846 name='edit_repo_advanced_delete',
847 847 pattern='/{repo_name:.*?[^/]}/settings/advanced/delete', repo_route=True)
848 848 config.add_view(
849 849 RepoSettingsAdvancedView,
850 850 attr='edit_advanced_delete',
851 851 route_name='edit_repo_advanced_delete', request_method='POST',
852 852 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
853 853
854 854 config.add_route(
855 855 name='edit_repo_advanced_locking',
856 856 pattern='/{repo_name:.*?[^/]}/settings/advanced/locking', repo_route=True)
857 857 config.add_view(
858 858 RepoSettingsAdvancedView,
859 859 attr='edit_advanced_toggle_locking',
860 860 route_name='edit_repo_advanced_locking', request_method='POST',
861 861 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
862 862
863 863 config.add_route(
864 864 name='edit_repo_advanced_journal',
865 865 pattern='/{repo_name:.*?[^/]}/settings/advanced/journal', repo_route=True)
866 866 config.add_view(
867 867 RepoSettingsAdvancedView,
868 868 attr='edit_advanced_journal',
869 869 route_name='edit_repo_advanced_journal', request_method='POST',
870 870 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
871 871
872 872 config.add_route(
873 873 name='edit_repo_advanced_fork',
874 874 pattern='/{repo_name:.*?[^/]}/settings/advanced/fork', repo_route=True)
875 875 config.add_view(
876 876 RepoSettingsAdvancedView,
877 877 attr='edit_advanced_fork',
878 878 route_name='edit_repo_advanced_fork', request_method='POST',
879 879 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
880 880
881 881 config.add_route(
882 882 name='edit_repo_advanced_hooks',
883 883 pattern='/{repo_name:.*?[^/]}/settings/advanced/hooks', repo_route=True)
884 884 config.add_view(
885 885 RepoSettingsAdvancedView,
886 886 attr='edit_advanced_install_hooks',
887 887 route_name='edit_repo_advanced_hooks', request_method='GET',
888 888 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
889 889
890 890 # Caches
891 891 config.add_route(
892 892 name='edit_repo_caches',
893 893 pattern='/{repo_name:.*?[^/]}/settings/caches', repo_route=True)
894 894 config.add_view(
895 895 RepoCachesView,
896 896 attr='repo_caches',
897 897 route_name='edit_repo_caches', request_method='GET',
898 898 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
899 899 config.add_view(
900 900 RepoCachesView,
901 901 attr='repo_caches_purge',
902 902 route_name='edit_repo_caches', request_method='POST')
903 903
904 904 # Permissions
905 905 config.add_route(
906 906 name='edit_repo_perms',
907 907 pattern='/{repo_name:.*?[^/]}/settings/permissions', repo_route=True)
908 908 config.add_view(
909 909 RepoSettingsPermissionsView,
910 910 attr='edit_permissions',
911 911 route_name='edit_repo_perms', request_method='GET',
912 912 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
913 913 config.add_view(
914 914 RepoSettingsPermissionsView,
915 915 attr='edit_permissions_update',
916 916 route_name='edit_repo_perms', request_method='POST',
917 917 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
918 918
919 919 config.add_route(
920 920 name='edit_repo_perms_set_private',
921 921 pattern='/{repo_name:.*?[^/]}/settings/permissions/set_private', repo_route=True)
922 922 config.add_view(
923 923 RepoSettingsPermissionsView,
924 924 attr='edit_permissions_set_private_repo',
925 925 route_name='edit_repo_perms_set_private', request_method='POST',
926 926 renderer='json_ext')
927 927
928 928 # Permissions Branch (EE feature)
929 929 config.add_route(
930 930 name='edit_repo_perms_branch',
931 931 pattern='/{repo_name:.*?[^/]}/settings/branch_permissions', repo_route=True)
932 932 config.add_view(
933 933 RepoSettingsBranchPermissionsView,
934 934 attr='branch_permissions',
935 935 route_name='edit_repo_perms_branch', request_method='GET',
936 936 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
937 937
938 938 config.add_route(
939 939 name='edit_repo_perms_branch_delete',
940 940 pattern='/{repo_name:.*?[^/]}/settings/branch_permissions/{rule_id}/delete',
941 941 repo_route=True)
942 942 ## Only implemented in EE
943 943
944 944 # Maintenance
945 945 config.add_route(
946 946 name='edit_repo_maintenance',
947 947 pattern='/{repo_name:.*?[^/]}/settings/maintenance', repo_route=True)
948 948 config.add_view(
949 949 RepoMaintenanceView,
950 950 attr='repo_maintenance',
951 951 route_name='edit_repo_maintenance', request_method='GET',
952 952 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
953 953
954 954 config.add_route(
955 955 name='edit_repo_maintenance_execute',
956 956 pattern='/{repo_name:.*?[^/]}/settings/maintenance/execute', repo_route=True)
957 957 config.add_view(
958 958 RepoMaintenanceView,
959 959 attr='repo_maintenance_execute',
960 960 route_name='edit_repo_maintenance_execute', request_method='GET',
961 961 renderer='json', xhr=True)
962 962
963 963 # Fields
964 964 config.add_route(
965 965 name='edit_repo_fields',
966 966 pattern='/{repo_name:.*?[^/]}/settings/fields', repo_route=True)
967 967 config.add_view(
968 968 RepoSettingsFieldsView,
969 969 attr='repo_field_edit',
970 970 route_name='edit_repo_fields', request_method='GET',
971 971 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
972 972
973 973 config.add_route(
974 974 name='edit_repo_fields_create',
975 975 pattern='/{repo_name:.*?[^/]}/settings/fields/create', repo_route=True)
976 976 config.add_view(
977 977 RepoSettingsFieldsView,
978 978 attr='repo_field_create',
979 979 route_name='edit_repo_fields_create', request_method='POST',
980 980 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
981 981
982 982 config.add_route(
983 983 name='edit_repo_fields_delete',
984 984 pattern='/{repo_name:.*?[^/]}/settings/fields/{field_id}/delete', repo_route=True)
985 985 config.add_view(
986 986 RepoSettingsFieldsView,
987 987 attr='repo_field_delete',
988 988 route_name='edit_repo_fields_delete', request_method='POST',
989 989 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
990 990
991 991 # quick actions: locking
992 992 config.add_route(
993 993 name='repo_settings_quick_actions',
994 994 pattern='/{repo_name:.*?[^/]}/settings/quick-action', repo_route=True)
995 995 config.add_view(
996 996 RepoSettingsView,
997 997 attr='repo_settings_quick_actions',
998 998 route_name='repo_settings_quick_actions', request_method='GET',
999 999 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1000 1000
1001 1001 # Remote
1002 1002 config.add_route(
1003 1003 name='edit_repo_remote',
1004 1004 pattern='/{repo_name:.*?[^/]}/settings/remote', repo_route=True)
1005 1005 config.add_view(
1006 1006 RepoSettingsRemoteView,
1007 1007 attr='repo_remote_edit_form',
1008 1008 route_name='edit_repo_remote', request_method='GET',
1009 1009 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1010 1010
1011 1011 config.add_route(
1012 1012 name='edit_repo_remote_pull',
1013 1013 pattern='/{repo_name:.*?[^/]}/settings/remote/pull', repo_route=True)
1014 1014 config.add_view(
1015 1015 RepoSettingsRemoteView,
1016 1016 attr='repo_remote_pull_changes',
1017 1017 route_name='edit_repo_remote_pull', request_method='POST',
1018 1018 renderer=None)
1019 1019
1020 1020 config.add_route(
1021 1021 name='edit_repo_remote_push',
1022 1022 pattern='/{repo_name:.*?[^/]}/settings/remote/push', repo_route=True)
1023 1023
1024 1024 # Statistics
1025 1025 config.add_route(
1026 1026 name='edit_repo_statistics',
1027 1027 pattern='/{repo_name:.*?[^/]}/settings/statistics', repo_route=True)
1028 1028 config.add_view(
1029 1029 RepoSettingsView,
1030 1030 attr='edit_statistics_form',
1031 1031 route_name='edit_repo_statistics', request_method='GET',
1032 1032 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1033 1033
1034 1034 config.add_route(
1035 1035 name='edit_repo_statistics_reset',
1036 1036 pattern='/{repo_name:.*?[^/]}/settings/statistics/update', repo_route=True)
1037 1037 config.add_view(
1038 1038 RepoSettingsView,
1039 1039 attr='repo_statistics_reset',
1040 1040 route_name='edit_repo_statistics_reset', request_method='POST',
1041 1041 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1042 1042
1043 1043 # Issue trackers
1044 1044 config.add_route(
1045 1045 name='edit_repo_issuetracker',
1046 1046 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers', repo_route=True)
1047 1047 config.add_view(
1048 1048 RepoSettingsIssueTrackersView,
1049 1049 attr='repo_issuetracker',
1050 1050 route_name='edit_repo_issuetracker', request_method='GET',
1051 1051 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1052 1052
1053 1053 config.add_route(
1054 1054 name='edit_repo_issuetracker_test',
1055 1055 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/test', repo_route=True)
1056 1056 config.add_view(
1057 1057 RepoSettingsIssueTrackersView,
1058 1058 attr='repo_issuetracker_test',
1059 1059 route_name='edit_repo_issuetracker_test', request_method='POST',
1060 1060 renderer='string', xhr=True)
1061 1061
1062 1062 config.add_route(
1063 1063 name='edit_repo_issuetracker_delete',
1064 1064 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/delete', repo_route=True)
1065 1065 config.add_view(
1066 1066 RepoSettingsIssueTrackersView,
1067 1067 attr='repo_issuetracker_delete',
1068 1068 route_name='edit_repo_issuetracker_delete', request_method='POST',
1069 1069 renderer='json_ext', xhr=True)
1070 1070
1071 1071 config.add_route(
1072 1072 name='edit_repo_issuetracker_update',
1073 1073 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/update', repo_route=True)
1074 1074 config.add_view(
1075 1075 RepoSettingsIssueTrackersView,
1076 1076 attr='repo_issuetracker_update',
1077 1077 route_name='edit_repo_issuetracker_update', request_method='POST',
1078 1078 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1079 1079
1080 1080 # VCS Settings
1081 1081 config.add_route(
1082 1082 name='edit_repo_vcs',
1083 1083 pattern='/{repo_name:.*?[^/]}/settings/vcs', repo_route=True)
1084 1084 config.add_view(
1085 1085 RepoSettingsVcsView,
1086 1086 attr='repo_vcs_settings',
1087 1087 route_name='edit_repo_vcs', request_method='GET',
1088 1088 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1089 1089
1090 1090 config.add_route(
1091 1091 name='edit_repo_vcs_update',
1092 1092 pattern='/{repo_name:.*?[^/]}/settings/vcs/update', repo_route=True)
1093 1093 config.add_view(
1094 1094 RepoSettingsVcsView,
1095 1095 attr='repo_settings_vcs_update',
1096 1096 route_name='edit_repo_vcs_update', request_method='POST',
1097 1097 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1098 1098
1099 1099 # svn pattern
1100 1100 config.add_route(
1101 1101 name='edit_repo_vcs_svn_pattern_delete',
1102 1102 pattern='/{repo_name:.*?[^/]}/settings/vcs/svn_pattern/delete', repo_route=True)
1103 1103 config.add_view(
1104 1104 RepoSettingsVcsView,
1105 1105 attr='repo_settings_delete_svn_pattern',
1106 1106 route_name='edit_repo_vcs_svn_pattern_delete', request_method='POST',
1107 1107 renderer='json_ext', xhr=True)
1108 1108
1109 1109 # Repo Review Rules (EE feature)
1110 1110 config.add_route(
1111 1111 name='repo_reviewers',
1112 1112 pattern='/{repo_name:.*?[^/]}/settings/review/rules', repo_route=True)
1113 1113 config.add_view(
1114 1114 RepoReviewRulesView,
1115 1115 attr='repo_review_rules',
1116 1116 route_name='repo_reviewers', request_method='GET',
1117 1117 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1118 1118
1119 1119 config.add_route(
1120 1120 name='repo_default_reviewers_data',
1121 1121 pattern='/{repo_name:.*?[^/]}/settings/review/default-reviewers', repo_route=True)
1122 1122 config.add_view(
1123 1123 RepoReviewRulesView,
1124 1124 attr='repo_default_reviewers_data',
1125 1125 route_name='repo_default_reviewers_data', request_method='GET',
1126 1126 renderer='json_ext')
1127 1127
1128 1128 # Repo Automation (EE feature)
1129 1129 config.add_route(
1130 1130 name='repo_automation',
1131 1131 pattern='/{repo_name:.*?[^/]}/settings/automation', repo_route=True)
1132 1132 config.add_view(
1133 1133 RepoAutomationView,
1134 1134 attr='repo_automation',
1135 1135 route_name='repo_automation', request_method='GET',
1136 1136 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1137 1137
1138 1138 # Strip
1139 1139 config.add_route(
1140 1140 name='edit_repo_strip',
1141 1141 pattern='/{repo_name:.*?[^/]}/settings/strip', repo_route=True)
1142 1142 config.add_view(
1143 1143 RepoStripView,
1144 1144 attr='strip',
1145 1145 route_name='edit_repo_strip', request_method='GET',
1146 1146 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1147 1147
1148 1148 config.add_route(
1149 1149 name='strip_check',
1150 1150 pattern='/{repo_name:.*?[^/]}/settings/strip_check', repo_route=True)
1151 1151 config.add_view(
1152 1152 RepoStripView,
1153 1153 attr='strip_check',
1154 1154 route_name='strip_check', request_method='POST',
1155 1155 renderer='json', xhr=True)
1156 1156
1157 1157 config.add_route(
1158 1158 name='strip_execute',
1159 1159 pattern='/{repo_name:.*?[^/]}/settings/strip_execute', repo_route=True)
1160 1160 config.add_view(
1161 1161 RepoStripView,
1162 1162 attr='strip_execute',
1163 1163 route_name='strip_execute', request_method='POST',
1164 1164 renderer='json', xhr=True)
1165 1165
1166 1166 # Audit logs
1167 1167 config.add_route(
1168 1168 name='edit_repo_audit_logs',
1169 1169 pattern='/{repo_name:.*?[^/]}/settings/audit_logs', repo_route=True)
1170 1170 config.add_view(
1171 1171 AuditLogsView,
1172 1172 attr='repo_audit_logs',
1173 1173 route_name='edit_repo_audit_logs', request_method='GET',
1174 1174 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1175 1175
1176 1176 # ATOM/RSS Feed, shouldn't contain slashes for outlook compatibility
1177 1177 config.add_route(
1178 1178 name='rss_feed_home',
1179 1179 pattern='/{repo_name:.*?[^/]}/feed-rss', repo_route=True)
1180 1180 config.add_view(
1181 1181 RepoFeedView,
1182 1182 attr='rss',
1183 1183 route_name='rss_feed_home', request_method='GET', renderer=None)
1184 1184
1185 1185 config.add_route(
1186 1186 name='rss_feed_home_old',
1187 1187 pattern='/{repo_name:.*?[^/]}/feed/rss', repo_route=True)
1188 1188 config.add_view(
1189 1189 RepoFeedView,
1190 1190 attr='rss',
1191 1191 route_name='rss_feed_home_old', request_method='GET', renderer=None)
1192 1192
1193 1193 config.add_route(
1194 1194 name='atom_feed_home',
1195 1195 pattern='/{repo_name:.*?[^/]}/feed-atom', repo_route=True)
1196 1196 config.add_view(
1197 1197 RepoFeedView,
1198 1198 attr='atom',
1199 1199 route_name='atom_feed_home', request_method='GET', renderer=None)
1200 1200
1201 1201 config.add_route(
1202 1202 name='atom_feed_home_old',
1203 1203 pattern='/{repo_name:.*?[^/]}/feed/atom', repo_route=True)
1204 1204 config.add_view(
1205 1205 RepoFeedView,
1206 1206 attr='atom',
1207 1207 route_name='atom_feed_home_old', request_method='GET', renderer=None)
1208 1208
1209 1209 # NOTE(marcink): needs to be at the end for catch-all
1210 1210 add_route_with_slash(
1211 1211 config,
1212 1212 name='repo_summary',
1213 1213 pattern='/{repo_name:.*?[^/]}', repo_route=True)
1214 1214 config.add_view(
1215 1215 RepoSummaryView,
1216 1216 attr='summary',
1217 1217 route_name='repo_summary', request_method='GET',
1218 1218 renderer='rhodecode:templates/summary/summary.mako')
1219 1219
1220 1220 # TODO(marcink): there's no such route??
1221 1221 config.add_view(
1222 1222 RepoSummaryView,
1223 1223 attr='summary',
1224 1224 route_name='repo_summary_slash', request_method='GET',
1225 1225 renderer='rhodecode:templates/summary/summary.mako') No newline at end of file
@@ -1,159 +1,155 b''
1 1 # Copyright (C) 2016-2023 RhodeCode GmbH
2 2 #
3 3 # This program is free software: you can redistribute it and/or modify
4 4 # it under the terms of the GNU Affero General Public License, version 3
5 5 # (only), as published by the Free Software Foundation.
6 6 #
7 7 # This program is distributed in the hope that it will be useful,
8 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 10 # GNU General Public License for more details.
11 11 #
12 12 # You should have received a copy of the GNU Affero General Public License
13 13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 14 #
15 15 # This program is dual-licensed. If you wish to learn more about the
16 16 # RhodeCode Enterprise Edition, including its added features, Support services,
17 17 # and proprietary license terms, please see https://rhodecode.com/licenses/
18 18
19
20 from rhodecode.apps._base.navigation import NavigationRegistry
21 19 from rhodecode.apps._base import ADMIN_PREFIX
22 from rhodecode.lib.utils2 import str2bool
23 20
24 21
25 22 def admin_routes(config):
26 23 """
27 24 User groups /_admin prefixed routes
28 25 """
29 26 from rhodecode.apps.user_group.views import UserGroupsView
30 27
31 28 config.add_route(
32 29 name='user_group_members_data',
33 pattern='/user_groups/{user_group_id:\d+}/members',
30 pattern=r'/user_groups/{user_group_id:\d+}/members',
34 31 user_group_route=True)
35 32 config.add_view(
36 33 UserGroupsView,
37 34 attr='user_group_members',
38 35 route_name='user_group_members_data', request_method='GET',
39 36 renderer='json_ext', xhr=True)
40 37
41 38 # user groups perms
42 39 config.add_route(
43 40 name='edit_user_group_perms_summary',
44 pattern='/user_groups/{user_group_id:\d+}/edit/permissions_summary',
41 pattern=r'/user_groups/{user_group_id:\d+}/edit/permissions_summary',
45 42 user_group_route=True)
46 43 config.add_view(
47 44 UserGroupsView,
48 45 attr='user_group_perms_summary',
49 46 route_name='edit_user_group_perms_summary', request_method='GET',
50 47 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
51 48
52 49 config.add_route(
53 50 name='edit_user_group_perms_summary_json',
54 pattern='/user_groups/{user_group_id:\d+}/edit/permissions_summary/json',
51 pattern=r'/user_groups/{user_group_id:\d+}/edit/permissions_summary/json',
55 52 user_group_route=True)
56 53 config.add_view(
57 54 UserGroupsView,
58 55 attr='user_group_perms_summary_json',
59 56 route_name='edit_user_group_perms_summary_json', request_method='GET',
60 57 renderer='json_ext')
61 58
62 59 # user groups edit
63 60 config.add_route(
64 61 name='edit_user_group',
65 pattern='/user_groups/{user_group_id:\d+}/edit',
62 pattern=r'/user_groups/{user_group_id:\d+}/edit',
66 63 user_group_route=True)
67 64 config.add_view(
68 65 UserGroupsView,
69 66 attr='user_group_edit',
70 67 route_name='edit_user_group', request_method='GET',
71 68 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
72 69
73 70 # user groups update
74 71 config.add_route(
75 72 name='user_groups_update',
76 pattern='/user_groups/{user_group_id:\d+}/update',
73 pattern=r'/user_groups/{user_group_id:\d+}/update',
77 74 user_group_route=True)
78 75 config.add_view(
79 76 UserGroupsView,
80 77 attr='user_group_update',
81 78 route_name='user_groups_update', request_method='POST',
82 79 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
83 80
84 81 config.add_route(
85 82 name='edit_user_group_global_perms',
86 pattern='/user_groups/{user_group_id:\d+}/edit/global_permissions',
83 pattern=r'/user_groups/{user_group_id:\d+}/edit/global_permissions',
87 84 user_group_route=True)
88 85 config.add_view(
89 86 UserGroupsView,
90 87 attr='user_group_global_perms_edit',
91 88 route_name='edit_user_group_global_perms', request_method='GET',
92 89 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
93 90
94 91 config.add_route(
95 92 name='edit_user_group_global_perms_update',
96 pattern='/user_groups/{user_group_id:\d+}/edit/global_permissions/update',
93 pattern=r'/user_groups/{user_group_id:\d+}/edit/global_permissions/update',
97 94 user_group_route=True)
98 95 config.add_view(
99 96 UserGroupsView,
100 97 attr='user_group_global_perms_update',
101 98 route_name='edit_user_group_global_perms_update', request_method='POST',
102 99 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
103 100
104 101 config.add_route(
105 102 name='edit_user_group_perms',
106 pattern='/user_groups/{user_group_id:\d+}/edit/permissions',
103 pattern=r'/user_groups/{user_group_id:\d+}/edit/permissions',
107 104 user_group_route=True)
108 105 config.add_view(
109 106 UserGroupsView,
110 107 attr='user_group_edit_perms',
111 108 route_name='edit_user_group_perms', request_method='GET',
112 109 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
113 110
114 111 config.add_route(
115 112 name='edit_user_group_perms_update',
116 pattern='/user_groups/{user_group_id:\d+}/edit/permissions/update',
113 pattern=r'/user_groups/{user_group_id:\d+}/edit/permissions/update',
117 114 user_group_route=True)
118 115 config.add_view(
119 116 UserGroupsView,
120 117 attr='user_group_update_perms',
121 118 route_name='edit_user_group_perms_update', request_method='POST',
122 119 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
123 120
124 121 config.add_route(
125 122 name='edit_user_group_advanced',
126 pattern='/user_groups/{user_group_id:\d+}/edit/advanced',
123 pattern=r'/user_groups/{user_group_id:\d+}/edit/advanced',
127 124 user_group_route=True)
128 125 config.add_view(
129 126 UserGroupsView,
130 127 attr='user_group_edit_advanced',
131 128 route_name='edit_user_group_advanced', request_method='GET',
132 129 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
133 130
134 131 config.add_route(
135 132 name='edit_user_group_advanced_sync',
136 pattern='/user_groups/{user_group_id:\d+}/edit/advanced/sync',
133 pattern=r'/user_groups/{user_group_id:\d+}/edit/advanced/sync',
137 134 user_group_route=True)
138 135 config.add_view(
139 136 UserGroupsView,
140 137 attr='user_group_edit_advanced_set_synchronization',
141 138 route_name='edit_user_group_advanced_sync', request_method='POST',
142 139 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
143 140
144 141 # user groups delete
145 142 config.add_route(
146 143 name='user_groups_delete',
147 pattern='/user_groups/{user_group_id:\d+}/delete',
144 pattern=r'/user_groups/{user_group_id:\d+}/delete',
148 145 user_group_route=True)
149 146 config.add_view(
150 147 UserGroupsView,
151 148 attr='user_group_delete',
152 149 route_name='user_groups_delete', request_method='POST',
153 150 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
154 151
155 152
156 153 def includeme(config):
157 154 # main admin routes
158 155 config.include(admin_routes, route_prefix=ADMIN_PREFIX)
159
General Comments 0
You need to be logged in to leave comments. Login now