##// END OF EJS Templates
artifacts: added missing code for CE views and admin artifacts.
milka -
r4675:fd01c700 stable
parent child Browse files
Show More
@@ -0,0 +1,40 b''
1 # -*- coding: utf-8 -*-
2
3 # Copyright (C) 2016-2020 RhodeCode GmbH
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License, version 3
7 # (only), as published by the Free Software Foundation.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 # This program is dual-licensed. If you wish to learn more about the
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
21 import logging
22
23 from rhodecode.apps._base import BaseAppView, DataGridAppView
24 from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator
25
26 log = logging.getLogger(__name__)
27
28
29 class AdminArtifactsView(BaseAppView, DataGridAppView):
30
31 def load_default_context(self):
32 c = self._get_local_tmpl_context()
33 return c
34
35 @LoginRequired()
36 @HasPermissionAllDecorator('hg.admin')
37 def artifacts(self):
38 c = self.load_default_context()
39 c.active = 'artifacts'
40 return self._get_template_context(c)
@@ -0,0 +1,39 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
3
4 <%def name="title()">
5 ${_('Artifacts Admin')}
6 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
9 </%def>
10
11 <%def name="breadcrumbs_links()"></%def>
12
13 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='admin')}
15 </%def>
16
17 <%def name="menu_bar_subnav()">
18 ${self.admin_menu(active='artifacts')}
19 </%def>
20
21 <%def name="main()">
22
23 <div class="box">
24
25 <div class="panel panel-default">
26 <div class="panel-heading">
27 <h3 class="panel-title">${_('Artifacts Administration.')}</h3>
28 </div>
29 <div class="panel-body">
30 <h4>${_('This feature is available in RhodeCode EE edition only. Contact {sales_email} to obtain a trial license.').format(sales_email='<a href="mailto:sales@rhodecode.com">sales@rhodecode.com</a>')|n}</h4>
31
32 </div>
33 </div>
34
35 </div>
36
37
38 </%def>
39
@@ -1,1055 +1,1084 b''
1 1 # -*- coding: utf-8 -*-
2 2
3 3 # Copyright (C) 2016-2020 RhodeCode GmbH
4 4 #
5 5 # This program is free software: you can redistribute it and/or modify
6 6 # it under the terms of the GNU Affero General Public License, version 3
7 7 # (only), as published by the Free Software Foundation.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU Affero General Public License
15 15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 16 #
17 17 # This program is dual-licensed. If you wish to learn more about the
18 18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20 20
21 21
22 22 from rhodecode.apps._base import ADMIN_PREFIX
23 23
24 24
25 25 def admin_routes(config):
26 26 """
27 27 Admin prefixed routes
28 28 """
29 29 from rhodecode.apps.admin.views.audit_logs import AdminAuditLogsView
30 from rhodecode.apps.admin.views.artifacts import AdminArtifactsView
30 31 from rhodecode.apps.admin.views.defaults import AdminDefaultSettingsView
31 32 from rhodecode.apps.admin.views.exception_tracker import ExceptionsTrackerView
32 33 from rhodecode.apps.admin.views.main_views import AdminMainView
33 34 from rhodecode.apps.admin.views.open_source_licenses import OpenSourceLicensesAdminSettingsView
34 35 from rhodecode.apps.admin.views.permissions import AdminPermissionsView
35 36 from rhodecode.apps.admin.views.process_management import AdminProcessManagementView
36 37 from rhodecode.apps.admin.views.repo_groups import AdminRepoGroupsView
37 38 from rhodecode.apps.admin.views.repositories import AdminReposView
38 39 from rhodecode.apps.admin.views.sessions import AdminSessionSettingsView
39 40 from rhodecode.apps.admin.views.settings import AdminSettingsView
40 41 from rhodecode.apps.admin.views.svn_config import AdminSvnConfigView
41 42 from rhodecode.apps.admin.views.system_info import AdminSystemInfoSettingsView
42 43 from rhodecode.apps.admin.views.user_groups import AdminUserGroupsView
43 44 from rhodecode.apps.admin.views.users import AdminUsersView, UsersView
44 45
45 46 config.add_route(
46 47 name='admin_audit_logs',
47 48 pattern='/audit_logs')
48 49 config.add_view(
49 50 AdminAuditLogsView,
50 51 attr='admin_audit_logs',
51 52 route_name='admin_audit_logs', request_method='GET',
52 53 renderer='rhodecode:templates/admin/admin_audit_logs.mako')
53 54
54 55 config.add_route(
55 56 name='admin_audit_log_entry',
56 57 pattern='/audit_logs/{audit_log_id}')
57 58 config.add_view(
58 59 AdminAuditLogsView,
59 60 attr='admin_audit_log_entry',
60 61 route_name='admin_audit_log_entry', request_method='GET',
61 62 renderer='rhodecode:templates/admin/admin_audit_log_entry.mako')
62 63
64 # Artifacts EE feature
65 config.add_route(
66 'admin_artifacts',
67 pattern=ADMIN_PREFIX + '/artifacts')
68 config.add_route(
69 'admin_artifacts_show_all',
70 pattern=ADMIN_PREFIX + '/artifacts')
71 config.add_view(
72 AdminArtifactsView,
73 attr='artifacts',
74 route_name='admin_artifacts', request_method='GET',
75 renderer='rhodecode:templates/admin/artifacts/artifacts.mako')
76 config.add_view(
77 AdminArtifactsView,
78 attr='artifacts',
79 route_name='admin_artifacts_show_all', request_method='GET',
80 renderer='rhodecode:templates/admin/artifacts/artifacts.mako')
81 # EE views
82 config.add_route(
83 name='admin_artifacts_show_info',
84 pattern=ADMIN_PREFIX + '/artifacts/{uid}')
85 config.add_route(
86 name='admin_artifacts_delete',
87 pattern=ADMIN_PREFIX + '/artifacts/{uid}/delete')
88 config.add_route(
89 name='admin_artifacts_update',
90 pattern=ADMIN_PREFIX + '/artifacts/{uid}/update')
91
63 92 config.add_route(
64 93 name='admin_settings_open_source',
65 94 pattern='/settings/open_source')
66 95 config.add_view(
67 96 OpenSourceLicensesAdminSettingsView,
68 97 attr='open_source_licenses',
69 98 route_name='admin_settings_open_source', request_method='GET',
70 99 renderer='rhodecode:templates/admin/settings/settings.mako')
71 100
72 101 config.add_route(
73 102 name='admin_settings_vcs_svn_generate_cfg',
74 103 pattern='/settings/vcs/svn_generate_cfg')
75 104 config.add_view(
76 105 AdminSvnConfigView,
77 106 attr='vcs_svn_generate_config',
78 107 route_name='admin_settings_vcs_svn_generate_cfg',
79 108 request_method='POST', renderer='json')
80 109
81 110 config.add_route(
82 111 name='admin_settings_system',
83 112 pattern='/settings/system')
84 113 config.add_view(
85 114 AdminSystemInfoSettingsView,
86 115 attr='settings_system_info',
87 116 route_name='admin_settings_system', request_method='GET',
88 117 renderer='rhodecode:templates/admin/settings/settings.mako')
89 118
90 119 config.add_route(
91 120 name='admin_settings_system_update',
92 121 pattern='/settings/system/updates')
93 122 config.add_view(
94 123 AdminSystemInfoSettingsView,
95 124 attr='settings_system_info_check_update',
96 125 route_name='admin_settings_system_update', request_method='GET',
97 126 renderer='rhodecode:templates/admin/settings/settings_system_update.mako')
98 127
99 128 config.add_route(
100 129 name='admin_settings_exception_tracker',
101 130 pattern='/settings/exceptions')
102 131 config.add_view(
103 132 ExceptionsTrackerView,
104 133 attr='browse_exceptions',
105 134 route_name='admin_settings_exception_tracker', request_method='GET',
106 135 renderer='rhodecode:templates/admin/settings/settings.mako')
107 136
108 137 config.add_route(
109 138 name='admin_settings_exception_tracker_delete_all',
110 139 pattern='/settings/exceptions_delete_all')
111 140 config.add_view(
112 141 ExceptionsTrackerView,
113 142 attr='exception_delete_all',
114 143 route_name='admin_settings_exception_tracker_delete_all', request_method='POST',
115 144 renderer='rhodecode:templates/admin/settings/settings.mako')
116 145
117 146 config.add_route(
118 147 name='admin_settings_exception_tracker_show',
119 148 pattern='/settings/exceptions/{exception_id}')
120 149 config.add_view(
121 150 ExceptionsTrackerView,
122 151 attr='exception_show',
123 152 route_name='admin_settings_exception_tracker_show', request_method='GET',
124 153 renderer='rhodecode:templates/admin/settings/settings.mako')
125 154
126 155 config.add_route(
127 156 name='admin_settings_exception_tracker_delete',
128 157 pattern='/settings/exceptions/{exception_id}/delete')
129 158 config.add_view(
130 159 ExceptionsTrackerView,
131 160 attr='exception_delete',
132 161 route_name='admin_settings_exception_tracker_delete', request_method='POST',
133 162 renderer='rhodecode:templates/admin/settings/settings.mako')
134 163
135 164 config.add_route(
136 165 name='admin_settings_sessions',
137 166 pattern='/settings/sessions')
138 167 config.add_view(
139 168 AdminSessionSettingsView,
140 169 attr='settings_sessions',
141 170 route_name='admin_settings_sessions', request_method='GET',
142 171 renderer='rhodecode:templates/admin/settings/settings.mako')
143 172
144 173 config.add_route(
145 174 name='admin_settings_sessions_cleanup',
146 175 pattern='/settings/sessions/cleanup')
147 176 config.add_view(
148 177 AdminSessionSettingsView,
149 178 attr='settings_sessions_cleanup',
150 179 route_name='admin_settings_sessions_cleanup', request_method='POST')
151 180
152 181 config.add_route(
153 182 name='admin_settings_process_management',
154 183 pattern='/settings/process_management')
155 184 config.add_view(
156 185 AdminProcessManagementView,
157 186 attr='process_management',
158 187 route_name='admin_settings_process_management', request_method='GET',
159 188 renderer='rhodecode:templates/admin/settings/settings.mako')
160 189
161 190 config.add_route(
162 191 name='admin_settings_process_management_data',
163 192 pattern='/settings/process_management/data')
164 193 config.add_view(
165 194 AdminProcessManagementView,
166 195 attr='process_management_data',
167 196 route_name='admin_settings_process_management_data', request_method='GET',
168 197 renderer='rhodecode:templates/admin/settings/settings_process_management_data.mako')
169 198
170 199 config.add_route(
171 200 name='admin_settings_process_management_signal',
172 201 pattern='/settings/process_management/signal')
173 202 config.add_view(
174 203 AdminProcessManagementView,
175 204 attr='process_management_signal',
176 205 route_name='admin_settings_process_management_signal',
177 206 request_method='POST', renderer='json_ext')
178 207
179 208 config.add_route(
180 209 name='admin_settings_process_management_master_signal',
181 210 pattern='/settings/process_management/master_signal')
182 211 config.add_view(
183 212 AdminProcessManagementView,
184 213 attr='process_management_master_signal',
185 214 route_name='admin_settings_process_management_master_signal',
186 215 request_method='POST', renderer='json_ext')
187 216
188 217 # default settings
189 218 config.add_route(
190 219 name='admin_defaults_repositories',
191 220 pattern='/defaults/repositories')
192 221 config.add_view(
193 222 AdminDefaultSettingsView,
194 223 attr='defaults_repository_show',
195 224 route_name='admin_defaults_repositories', request_method='GET',
196 225 renderer='rhodecode:templates/admin/defaults/defaults.mako')
197 226
198 227 config.add_route(
199 228 name='admin_defaults_repositories_update',
200 229 pattern='/defaults/repositories/update')
201 230 config.add_view(
202 231 AdminDefaultSettingsView,
203 232 attr='defaults_repository_update',
204 233 route_name='admin_defaults_repositories_update', request_method='POST',
205 234 renderer='rhodecode:templates/admin/defaults/defaults.mako')
206 235
207 236 # admin settings
208 237
209 238 config.add_route(
210 239 name='admin_settings',
211 240 pattern='/settings')
212 241 config.add_view(
213 242 AdminSettingsView,
214 243 attr='settings_global',
215 244 route_name='admin_settings', request_method='GET',
216 245 renderer='rhodecode:templates/admin/settings/settings.mako')
217 246
218 247 config.add_route(
219 248 name='admin_settings_update',
220 249 pattern='/settings/update')
221 250 config.add_view(
222 251 AdminSettingsView,
223 252 attr='settings_global_update',
224 253 route_name='admin_settings_update', request_method='POST',
225 254 renderer='rhodecode:templates/admin/settings/settings.mako')
226 255
227 256 config.add_route(
228 257 name='admin_settings_global',
229 258 pattern='/settings/global')
230 259 config.add_view(
231 260 AdminSettingsView,
232 261 attr='settings_global',
233 262 route_name='admin_settings_global', request_method='GET',
234 263 renderer='rhodecode:templates/admin/settings/settings.mako')
235 264
236 265 config.add_route(
237 266 name='admin_settings_global_update',
238 267 pattern='/settings/global/update')
239 268 config.add_view(
240 269 AdminSettingsView,
241 270 attr='settings_global_update',
242 271 route_name='admin_settings_global_update', request_method='POST',
243 272 renderer='rhodecode:templates/admin/settings/settings.mako')
244 273
245 274 config.add_route(
246 275 name='admin_settings_vcs',
247 276 pattern='/settings/vcs')
248 277 config.add_view(
249 278 AdminSettingsView,
250 279 attr='settings_vcs',
251 280 route_name='admin_settings_vcs', request_method='GET',
252 281 renderer='rhodecode:templates/admin/settings/settings.mako')
253 282
254 283 config.add_route(
255 284 name='admin_settings_vcs_update',
256 285 pattern='/settings/vcs/update')
257 286 config.add_view(
258 287 AdminSettingsView,
259 288 attr='settings_vcs_update',
260 289 route_name='admin_settings_vcs_update', request_method='POST',
261 290 renderer='rhodecode:templates/admin/settings/settings.mako')
262 291
263 292 config.add_route(
264 293 name='admin_settings_vcs_svn_pattern_delete',
265 294 pattern='/settings/vcs/svn_pattern_delete')
266 295 config.add_view(
267 296 AdminSettingsView,
268 297 attr='settings_vcs_delete_svn_pattern',
269 298 route_name='admin_settings_vcs_svn_pattern_delete', request_method='POST',
270 299 renderer='json_ext', xhr=True)
271 300
272 301 config.add_route(
273 302 name='admin_settings_mapping',
274 303 pattern='/settings/mapping')
275 304 config.add_view(
276 305 AdminSettingsView,
277 306 attr='settings_mapping',
278 307 route_name='admin_settings_mapping', request_method='GET',
279 308 renderer='rhodecode:templates/admin/settings/settings.mako')
280 309
281 310 config.add_route(
282 311 name='admin_settings_mapping_update',
283 312 pattern='/settings/mapping/update')
284 313 config.add_view(
285 314 AdminSettingsView,
286 315 attr='settings_mapping_update',
287 316 route_name='admin_settings_mapping_update', request_method='POST',
288 317 renderer='rhodecode:templates/admin/settings/settings.mako')
289 318
290 319 config.add_route(
291 320 name='admin_settings_visual',
292 321 pattern='/settings/visual')
293 322 config.add_view(
294 323 AdminSettingsView,
295 324 attr='settings_visual',
296 325 route_name='admin_settings_visual', request_method='GET',
297 326 renderer='rhodecode:templates/admin/settings/settings.mako')
298 327
299 328 config.add_route(
300 329 name='admin_settings_visual_update',
301 330 pattern='/settings/visual/update')
302 331 config.add_view(
303 332 AdminSettingsView,
304 333 attr='settings_visual_update',
305 334 route_name='admin_settings_visual_update', request_method='POST',
306 335 renderer='rhodecode:templates/admin/settings/settings.mako')
307 336
308 337 config.add_route(
309 338 name='admin_settings_issuetracker',
310 339 pattern='/settings/issue-tracker')
311 340 config.add_view(
312 341 AdminSettingsView,
313 342 attr='settings_issuetracker',
314 343 route_name='admin_settings_issuetracker', request_method='GET',
315 344 renderer='rhodecode:templates/admin/settings/settings.mako')
316 345
317 346 config.add_route(
318 347 name='admin_settings_issuetracker_update',
319 348 pattern='/settings/issue-tracker/update')
320 349 config.add_view(
321 350 AdminSettingsView,
322 351 attr='settings_issuetracker_update',
323 352 route_name='admin_settings_issuetracker_update', request_method='POST',
324 353 renderer='rhodecode:templates/admin/settings/settings.mako')
325 354
326 355 config.add_route(
327 356 name='admin_settings_issuetracker_test',
328 357 pattern='/settings/issue-tracker/test')
329 358 config.add_view(
330 359 AdminSettingsView,
331 360 attr='settings_issuetracker_test',
332 361 route_name='admin_settings_issuetracker_test', request_method='POST',
333 362 renderer='string', xhr=True)
334 363
335 364 config.add_route(
336 365 name='admin_settings_issuetracker_delete',
337 366 pattern='/settings/issue-tracker/delete')
338 367 config.add_view(
339 368 AdminSettingsView,
340 369 attr='settings_issuetracker_delete',
341 370 route_name='admin_settings_issuetracker_delete', request_method='POST',
342 371 renderer='json_ext', xhr=True)
343 372
344 373 config.add_route(
345 374 name='admin_settings_email',
346 375 pattern='/settings/email')
347 376 config.add_view(
348 377 AdminSettingsView,
349 378 attr='settings_email',
350 379 route_name='admin_settings_email', request_method='GET',
351 380 renderer='rhodecode:templates/admin/settings/settings.mako')
352 381
353 382 config.add_route(
354 383 name='admin_settings_email_update',
355 384 pattern='/settings/email/update')
356 385 config.add_view(
357 386 AdminSettingsView,
358 387 attr='settings_email_update',
359 388 route_name='admin_settings_email_update', request_method='POST',
360 389 renderer='rhodecode:templates/admin/settings/settings.mako')
361 390
362 391 config.add_route(
363 392 name='admin_settings_hooks',
364 393 pattern='/settings/hooks')
365 394 config.add_view(
366 395 AdminSettingsView,
367 396 attr='settings_hooks',
368 397 route_name='admin_settings_hooks', request_method='GET',
369 398 renderer='rhodecode:templates/admin/settings/settings.mako')
370 399
371 400 config.add_route(
372 401 name='admin_settings_hooks_update',
373 402 pattern='/settings/hooks/update')
374 403 config.add_view(
375 404 AdminSettingsView,
376 405 attr='settings_hooks_update',
377 406 route_name='admin_settings_hooks_update', request_method='POST',
378 407 renderer='rhodecode:templates/admin/settings/settings.mako')
379 408
380 409 config.add_route(
381 410 name='admin_settings_hooks_delete',
382 411 pattern='/settings/hooks/delete')
383 412 config.add_view(
384 413 AdminSettingsView,
385 414 attr='settings_hooks_update',
386 415 route_name='admin_settings_hooks_delete', request_method='POST',
387 416 renderer='rhodecode:templates/admin/settings/settings.mako')
388 417
389 418 config.add_route(
390 419 name='admin_settings_search',
391 420 pattern='/settings/search')
392 421 config.add_view(
393 422 AdminSettingsView,
394 423 attr='settings_search',
395 424 route_name='admin_settings_search', request_method='GET',
396 425 renderer='rhodecode:templates/admin/settings/settings.mako')
397 426
398 427 config.add_route(
399 428 name='admin_settings_labs',
400 429 pattern='/settings/labs')
401 430 config.add_view(
402 431 AdminSettingsView,
403 432 attr='settings_labs',
404 433 route_name='admin_settings_labs', request_method='GET',
405 434 renderer='rhodecode:templates/admin/settings/settings.mako')
406 435
407 436 config.add_route(
408 437 name='admin_settings_labs_update',
409 438 pattern='/settings/labs/update')
410 439 config.add_view(
411 440 AdminSettingsView,
412 441 attr='settings_labs_update',
413 442 route_name='admin_settings_labs_update', request_method='POST',
414 443 renderer='rhodecode:templates/admin/settings/settings.mako')
415 444
416 445 # Automation EE feature
417 446 config.add_route(
418 447 'admin_settings_automation',
419 448 pattern=ADMIN_PREFIX + '/settings/automation')
420 449 config.add_view(
421 450 AdminSettingsView,
422 451 attr='settings_automation',
423 452 route_name='admin_settings_automation', request_method='GET',
424 453 renderer='rhodecode:templates/admin/settings/settings.mako')
425 454
426 455 # global permissions
427 456
428 457 config.add_route(
429 458 name='admin_permissions_application',
430 459 pattern='/permissions/application')
431 460 config.add_view(
432 461 AdminPermissionsView,
433 462 attr='permissions_application',
434 463 route_name='admin_permissions_application', request_method='GET',
435 464 renderer='rhodecode:templates/admin/permissions/permissions.mako')
436 465
437 466 config.add_route(
438 467 name='admin_permissions_application_update',
439 468 pattern='/permissions/application/update')
440 469 config.add_view(
441 470 AdminPermissionsView,
442 471 attr='permissions_application_update',
443 472 route_name='admin_permissions_application_update', request_method='POST',
444 473 renderer='rhodecode:templates/admin/permissions/permissions.mako')
445 474
446 475 config.add_route(
447 476 name='admin_permissions_global',
448 477 pattern='/permissions/global')
449 478 config.add_view(
450 479 AdminPermissionsView,
451 480 attr='permissions_global',
452 481 route_name='admin_permissions_global', request_method='GET',
453 482 renderer='rhodecode:templates/admin/permissions/permissions.mako')
454 483
455 484 config.add_route(
456 485 name='admin_permissions_global_update',
457 486 pattern='/permissions/global/update')
458 487 config.add_view(
459 488 AdminPermissionsView,
460 489 attr='permissions_global_update',
461 490 route_name='admin_permissions_global_update', request_method='POST',
462 491 renderer='rhodecode:templates/admin/permissions/permissions.mako')
463 492
464 493 config.add_route(
465 494 name='admin_permissions_object',
466 495 pattern='/permissions/object')
467 496 config.add_view(
468 497 AdminPermissionsView,
469 498 attr='permissions_objects',
470 499 route_name='admin_permissions_object', request_method='GET',
471 500 renderer='rhodecode:templates/admin/permissions/permissions.mako')
472 501
473 502 config.add_route(
474 503 name='admin_permissions_object_update',
475 504 pattern='/permissions/object/update')
476 505 config.add_view(
477 506 AdminPermissionsView,
478 507 attr='permissions_objects_update',
479 508 route_name='admin_permissions_object_update', request_method='POST',
480 509 renderer='rhodecode:templates/admin/permissions/permissions.mako')
481 510
482 511 # Branch perms EE feature
483 512 config.add_route(
484 513 name='admin_permissions_branch',
485 514 pattern='/permissions/branch')
486 515 config.add_view(
487 516 AdminPermissionsView,
488 517 attr='permissions_branch',
489 518 route_name='admin_permissions_branch', request_method='GET',
490 519 renderer='rhodecode:templates/admin/permissions/permissions.mako')
491 520
492 521 config.add_route(
493 522 name='admin_permissions_ips',
494 523 pattern='/permissions/ips')
495 524 config.add_view(
496 525 AdminPermissionsView,
497 526 attr='permissions_ips',
498 527 route_name='admin_permissions_ips', request_method='GET',
499 528 renderer='rhodecode:templates/admin/permissions/permissions.mako')
500 529
501 530 config.add_route(
502 531 name='admin_permissions_overview',
503 532 pattern='/permissions/overview')
504 533 config.add_view(
505 534 AdminPermissionsView,
506 535 attr='permissions_overview',
507 536 route_name='admin_permissions_overview', request_method='GET',
508 537 renderer='rhodecode:templates/admin/permissions/permissions.mako')
509 538
510 539 config.add_route(
511 540 name='admin_permissions_auth_token_access',
512 541 pattern='/permissions/auth_token_access')
513 542 config.add_view(
514 543 AdminPermissionsView,
515 544 attr='auth_token_access',
516 545 route_name='admin_permissions_auth_token_access', request_method='GET',
517 546 renderer='rhodecode:templates/admin/permissions/permissions.mako')
518 547
519 548 config.add_route(
520 549 name='admin_permissions_ssh_keys',
521 550 pattern='/permissions/ssh_keys')
522 551 config.add_view(
523 552 AdminPermissionsView,
524 553 attr='ssh_keys',
525 554 route_name='admin_permissions_ssh_keys', request_method='GET',
526 555 renderer='rhodecode:templates/admin/permissions/permissions.mako')
527 556
528 557 config.add_route(
529 558 name='admin_permissions_ssh_keys_data',
530 559 pattern='/permissions/ssh_keys/data')
531 560 config.add_view(
532 561 AdminPermissionsView,
533 562 attr='ssh_keys_data',
534 563 route_name='admin_permissions_ssh_keys_data', request_method='GET',
535 564 renderer='json_ext', xhr=True)
536 565
537 566 config.add_route(
538 567 name='admin_permissions_ssh_keys_update',
539 568 pattern='/permissions/ssh_keys/update')
540 569 config.add_view(
541 570 AdminPermissionsView,
542 571 attr='ssh_keys_update',
543 572 route_name='admin_permissions_ssh_keys_update', request_method='POST',
544 573 renderer='rhodecode:templates/admin/permissions/permissions.mako')
545 574
546 575 # users admin
547 576 config.add_route(
548 577 name='users',
549 578 pattern='/users')
550 579 config.add_view(
551 580 AdminUsersView,
552 581 attr='users_list',
553 582 route_name='users', request_method='GET',
554 583 renderer='rhodecode:templates/admin/users/users.mako')
555 584
556 585 config.add_route(
557 586 name='users_data',
558 587 pattern='/users_data')
559 588 config.add_view(
560 589 AdminUsersView,
561 590 attr='users_list_data',
562 591 # renderer defined below
563 592 route_name='users_data', request_method='GET',
564 593 renderer='json_ext', xhr=True)
565 594
566 595 config.add_route(
567 596 name='users_create',
568 597 pattern='/users/create')
569 598 config.add_view(
570 599 AdminUsersView,
571 600 attr='users_create',
572 601 route_name='users_create', request_method='POST',
573 602 renderer='rhodecode:templates/admin/users/user_add.mako')
574 603
575 604 config.add_route(
576 605 name='users_new',
577 606 pattern='/users/new')
578 607 config.add_view(
579 608 AdminUsersView,
580 609 attr='users_new',
581 610 route_name='users_new', request_method='GET',
582 611 renderer='rhodecode:templates/admin/users/user_add.mako')
583 612
584 613 # user management
585 614 config.add_route(
586 615 name='user_edit',
587 616 pattern='/users/{user_id:\d+}/edit',
588 617 user_route=True)
589 618 config.add_view(
590 619 UsersView,
591 620 attr='user_edit',
592 621 route_name='user_edit', request_method='GET',
593 622 renderer='rhodecode:templates/admin/users/user_edit.mako')
594 623
595 624 config.add_route(
596 625 name='user_edit_advanced',
597 626 pattern='/users/{user_id:\d+}/edit/advanced',
598 627 user_route=True)
599 628 config.add_view(
600 629 UsersView,
601 630 attr='user_edit_advanced',
602 631 route_name='user_edit_advanced', request_method='GET',
603 632 renderer='rhodecode:templates/admin/users/user_edit.mako')
604 633
605 634 config.add_route(
606 635 name='user_edit_global_perms',
607 636 pattern='/users/{user_id:\d+}/edit/global_permissions',
608 637 user_route=True)
609 638 config.add_view(
610 639 UsersView,
611 640 attr='user_edit_global_perms',
612 641 route_name='user_edit_global_perms', request_method='GET',
613 642 renderer='rhodecode:templates/admin/users/user_edit.mako')
614 643
615 644 config.add_route(
616 645 name='user_edit_global_perms_update',
617 646 pattern='/users/{user_id:\d+}/edit/global_permissions/update',
618 647 user_route=True)
619 648 config.add_view(
620 649 UsersView,
621 650 attr='user_edit_global_perms_update',
622 651 route_name='user_edit_global_perms_update', request_method='POST',
623 652 renderer='rhodecode:templates/admin/users/user_edit.mako')
624 653
625 654 config.add_route(
626 655 name='user_update',
627 656 pattern='/users/{user_id:\d+}/update',
628 657 user_route=True)
629 658 config.add_view(
630 659 UsersView,
631 660 attr='user_update',
632 661 route_name='user_update', request_method='POST',
633 662 renderer='rhodecode:templates/admin/users/user_edit.mako')
634 663
635 664 config.add_route(
636 665 name='user_delete',
637 666 pattern='/users/{user_id:\d+}/delete',
638 667 user_route=True)
639 668 config.add_view(
640 669 UsersView,
641 670 attr='user_delete',
642 671 route_name='user_delete', request_method='POST',
643 672 renderer='rhodecode:templates/admin/users/user_edit.mako')
644 673
645 674 config.add_route(
646 675 name='user_enable_force_password_reset',
647 676 pattern='/users/{user_id:\d+}/password_reset_enable',
648 677 user_route=True)
649 678 config.add_view(
650 679 UsersView,
651 680 attr='user_enable_force_password_reset',
652 681 route_name='user_enable_force_password_reset', request_method='POST',
653 682 renderer='rhodecode:templates/admin/users/user_edit.mako')
654 683
655 684 config.add_route(
656 685 name='user_disable_force_password_reset',
657 686 pattern='/users/{user_id:\d+}/password_reset_disable',
658 687 user_route=True)
659 688 config.add_view(
660 689 UsersView,
661 690 attr='user_disable_force_password_reset',
662 691 route_name='user_disable_force_password_reset', request_method='POST',
663 692 renderer='rhodecode:templates/admin/users/user_edit.mako')
664 693
665 694 config.add_route(
666 695 name='user_create_personal_repo_group',
667 696 pattern='/users/{user_id:\d+}/create_repo_group',
668 697 user_route=True)
669 698 config.add_view(
670 699 UsersView,
671 700 attr='user_create_personal_repo_group',
672 701 route_name='user_create_personal_repo_group', request_method='POST',
673 702 renderer='rhodecode:templates/admin/users/user_edit.mako')
674 703
675 704 # user notice
676 705 config.add_route(
677 706 name='user_notice_dismiss',
678 707 pattern='/users/{user_id:\d+}/notice_dismiss',
679 708 user_route=True)
680 709 config.add_view(
681 710 UsersView,
682 711 attr='user_notice_dismiss',
683 712 route_name='user_notice_dismiss', request_method='POST',
684 713 renderer='json_ext', xhr=True)
685 714
686 715 # user auth tokens
687 716 config.add_route(
688 717 name='edit_user_auth_tokens',
689 718 pattern='/users/{user_id:\d+}/edit/auth_tokens',
690 719 user_route=True)
691 720 config.add_view(
692 721 UsersView,
693 722 attr='auth_tokens',
694 723 route_name='edit_user_auth_tokens', request_method='GET',
695 724 renderer='rhodecode:templates/admin/users/user_edit.mako')
696 725
697 726 config.add_route(
698 727 name='edit_user_auth_tokens_view',
699 728 pattern='/users/{user_id:\d+}/edit/auth_tokens/view',
700 729 user_route=True)
701 730 config.add_view(
702 731 UsersView,
703 732 attr='auth_tokens_view',
704 733 route_name='edit_user_auth_tokens_view', request_method='POST',
705 734 renderer='json_ext', xhr=True)
706 735
707 736 config.add_route(
708 737 name='edit_user_auth_tokens_add',
709 738 pattern='/users/{user_id:\d+}/edit/auth_tokens/new',
710 739 user_route=True)
711 740 config.add_view(
712 741 UsersView,
713 742 attr='auth_tokens_add',
714 743 route_name='edit_user_auth_tokens_add', request_method='POST')
715 744
716 745 config.add_route(
717 746 name='edit_user_auth_tokens_delete',
718 747 pattern='/users/{user_id:\d+}/edit/auth_tokens/delete',
719 748 user_route=True)
720 749 config.add_view(
721 750 UsersView,
722 751 attr='auth_tokens_delete',
723 752 route_name='edit_user_auth_tokens_delete', request_method='POST')
724 753
725 754 # user ssh keys
726 755 config.add_route(
727 756 name='edit_user_ssh_keys',
728 757 pattern='/users/{user_id:\d+}/edit/ssh_keys',
729 758 user_route=True)
730 759 config.add_view(
731 760 UsersView,
732 761 attr='ssh_keys',
733 762 route_name='edit_user_ssh_keys', request_method='GET',
734 763 renderer='rhodecode:templates/admin/users/user_edit.mako')
735 764
736 765 config.add_route(
737 766 name='edit_user_ssh_keys_generate_keypair',
738 767 pattern='/users/{user_id:\d+}/edit/ssh_keys/generate',
739 768 user_route=True)
740 769 config.add_view(
741 770 UsersView,
742 771 attr='ssh_keys_generate_keypair',
743 772 route_name='edit_user_ssh_keys_generate_keypair', request_method='GET',
744 773 renderer='rhodecode:templates/admin/users/user_edit.mako')
745 774
746 775 config.add_route(
747 776 name='edit_user_ssh_keys_add',
748 777 pattern='/users/{user_id:\d+}/edit/ssh_keys/new',
749 778 user_route=True)
750 779 config.add_view(
751 780 UsersView,
752 781 attr='ssh_keys_add',
753 782 route_name='edit_user_ssh_keys_add', request_method='POST')
754 783
755 784 config.add_route(
756 785 name='edit_user_ssh_keys_delete',
757 786 pattern='/users/{user_id:\d+}/edit/ssh_keys/delete',
758 787 user_route=True)
759 788 config.add_view(
760 789 UsersView,
761 790 attr='ssh_keys_delete',
762 791 route_name='edit_user_ssh_keys_delete', request_method='POST')
763 792
764 793 # user emails
765 794 config.add_route(
766 795 name='edit_user_emails',
767 796 pattern='/users/{user_id:\d+}/edit/emails',
768 797 user_route=True)
769 798 config.add_view(
770 799 UsersView,
771 800 attr='emails',
772 801 route_name='edit_user_emails', request_method='GET',
773 802 renderer='rhodecode:templates/admin/users/user_edit.mako')
774 803
775 804 config.add_route(
776 805 name='edit_user_emails_add',
777 806 pattern='/users/{user_id:\d+}/edit/emails/new',
778 807 user_route=True)
779 808 config.add_view(
780 809 UsersView,
781 810 attr='emails_add',
782 811 route_name='edit_user_emails_add', request_method='POST')
783 812
784 813 config.add_route(
785 814 name='edit_user_emails_delete',
786 815 pattern='/users/{user_id:\d+}/edit/emails/delete',
787 816 user_route=True)
788 817 config.add_view(
789 818 UsersView,
790 819 attr='emails_delete',
791 820 route_name='edit_user_emails_delete', request_method='POST')
792 821
793 822 # user IPs
794 823 config.add_route(
795 824 name='edit_user_ips',
796 825 pattern='/users/{user_id:\d+}/edit/ips',
797 826 user_route=True)
798 827 config.add_view(
799 828 UsersView,
800 829 attr='ips',
801 830 route_name='edit_user_ips', request_method='GET',
802 831 renderer='rhodecode:templates/admin/users/user_edit.mako')
803 832
804 833 config.add_route(
805 834 name='edit_user_ips_add',
806 835 pattern='/users/{user_id:\d+}/edit/ips/new',
807 836 user_route_with_default=True) # enabled for default user too
808 837 config.add_view(
809 838 UsersView,
810 839 attr='ips_add',
811 840 route_name='edit_user_ips_add', request_method='POST')
812 841
813 842 config.add_route(
814 843 name='edit_user_ips_delete',
815 844 pattern='/users/{user_id:\d+}/edit/ips/delete',
816 845 user_route_with_default=True) # enabled for default user too
817 846 config.add_view(
818 847 UsersView,
819 848 attr='ips_delete',
820 849 route_name='edit_user_ips_delete', request_method='POST')
821 850
822 851 # user perms
823 852 config.add_route(
824 853 name='edit_user_perms_summary',
825 854 pattern='/users/{user_id:\d+}/edit/permissions_summary',
826 855 user_route=True)
827 856 config.add_view(
828 857 UsersView,
829 858 attr='user_perms_summary',
830 859 route_name='edit_user_perms_summary', request_method='GET',
831 860 renderer='rhodecode:templates/admin/users/user_edit.mako')
832 861
833 862 config.add_route(
834 863 name='edit_user_perms_summary_json',
835 864 pattern='/users/{user_id:\d+}/edit/permissions_summary/json',
836 865 user_route=True)
837 866 config.add_view(
838 867 UsersView,
839 868 attr='user_perms_summary_json',
840 869 route_name='edit_user_perms_summary_json', request_method='GET',
841 870 renderer='json_ext')
842 871
843 872 # user user groups management
844 873 config.add_route(
845 874 name='edit_user_groups_management',
846 875 pattern='/users/{user_id:\d+}/edit/groups_management',
847 876 user_route=True)
848 877 config.add_view(
849 878 UsersView,
850 879 attr='groups_management',
851 880 route_name='edit_user_groups_management', request_method='GET',
852 881 renderer='rhodecode:templates/admin/users/user_edit.mako')
853 882
854 883 config.add_route(
855 884 name='edit_user_groups_management_updates',
856 885 pattern='/users/{user_id:\d+}/edit/edit_user_groups_management/updates',
857 886 user_route=True)
858 887 config.add_view(
859 888 UsersView,
860 889 attr='groups_management_updates',
861 890 route_name='edit_user_groups_management_updates', request_method='POST')
862 891
863 892 # user audit logs
864 893 config.add_route(
865 894 name='edit_user_audit_logs',
866 895 pattern='/users/{user_id:\d+}/edit/audit', user_route=True)
867 896 config.add_view(
868 897 UsersView,
869 898 attr='user_audit_logs',
870 899 route_name='edit_user_audit_logs', request_method='GET',
871 900 renderer='rhodecode:templates/admin/users/user_edit.mako')
872 901
873 902 config.add_route(
874 903 name='edit_user_audit_logs_download',
875 904 pattern='/users/{user_id:\d+}/edit/audit/download', user_route=True)
876 905 config.add_view(
877 906 UsersView,
878 907 attr='user_audit_logs_download',
879 908 route_name='edit_user_audit_logs_download', request_method='GET',
880 909 renderer='string')
881 910
882 911 # user caches
883 912 config.add_route(
884 913 name='edit_user_caches',
885 914 pattern='/users/{user_id:\d+}/edit/caches',
886 915 user_route=True)
887 916 config.add_view(
888 917 UsersView,
889 918 attr='user_caches',
890 919 route_name='edit_user_caches', request_method='GET',
891 920 renderer='rhodecode:templates/admin/users/user_edit.mako')
892 921
893 922 config.add_route(
894 923 name='edit_user_caches_update',
895 924 pattern='/users/{user_id:\d+}/edit/caches/update',
896 925 user_route=True)
897 926 config.add_view(
898 927 UsersView,
899 928 attr='user_caches_update',
900 929 route_name='edit_user_caches_update', request_method='POST')
901 930
902 931 # user-groups admin
903 932 config.add_route(
904 933 name='user_groups',
905 934 pattern='/user_groups')
906 935 config.add_view(
907 936 AdminUserGroupsView,
908 937 attr='user_groups_list',
909 938 route_name='user_groups', request_method='GET',
910 939 renderer='rhodecode:templates/admin/user_groups/user_groups.mako')
911 940
912 941 config.add_route(
913 942 name='user_groups_data',
914 943 pattern='/user_groups_data')
915 944 config.add_view(
916 945 AdminUserGroupsView,
917 946 attr='user_groups_list_data',
918 947 route_name='user_groups_data', request_method='GET',
919 948 renderer='json_ext', xhr=True)
920 949
921 950 config.add_route(
922 951 name='user_groups_new',
923 952 pattern='/user_groups/new')
924 953 config.add_view(
925 954 AdminUserGroupsView,
926 955 attr='user_groups_new',
927 956 route_name='user_groups_new', request_method='GET',
928 957 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
929 958
930 959 config.add_route(
931 960 name='user_groups_create',
932 961 pattern='/user_groups/create')
933 962 config.add_view(
934 963 AdminUserGroupsView,
935 964 attr='user_groups_create',
936 965 route_name='user_groups_create', request_method='POST',
937 966 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
938 967
939 968 # repos admin
940 969 config.add_route(
941 970 name='repos',
942 971 pattern='/repos')
943 972 config.add_view(
944 973 AdminReposView,
945 974 attr='repository_list',
946 975 route_name='repos', request_method='GET',
947 976 renderer='rhodecode:templates/admin/repos/repos.mako')
948 977
949 978 config.add_route(
950 979 name='repos_data',
951 980 pattern='/repos_data')
952 981 config.add_view(
953 982 AdminReposView,
954 983 attr='repository_list_data',
955 984 route_name='repos_data', request_method='GET',
956 985 renderer='json_ext', xhr=True)
957 986
958 987 config.add_route(
959 988 name='repo_new',
960 989 pattern='/repos/new')
961 990 config.add_view(
962 991 AdminReposView,
963 992 attr='repository_new',
964 993 route_name='repo_new', request_method='GET',
965 994 renderer='rhodecode:templates/admin/repos/repo_add.mako')
966 995
967 996 config.add_route(
968 997 name='repo_create',
969 998 pattern='/repos/create')
970 999 config.add_view(
971 1000 AdminReposView,
972 1001 attr='repository_create',
973 1002 route_name='repo_create', request_method='POST',
974 1003 renderer='rhodecode:templates/admin/repos/repos.mako')
975 1004
976 1005 # repo groups admin
977 1006 config.add_route(
978 1007 name='repo_groups',
979 1008 pattern='/repo_groups')
980 1009 config.add_view(
981 1010 AdminRepoGroupsView,
982 1011 attr='repo_group_list',
983 1012 route_name='repo_groups', request_method='GET',
984 1013 renderer='rhodecode:templates/admin/repo_groups/repo_groups.mako')
985 1014
986 1015 config.add_route(
987 1016 name='repo_groups_data',
988 1017 pattern='/repo_groups_data')
989 1018 config.add_view(
990 1019 AdminRepoGroupsView,
991 1020 attr='repo_group_list_data',
992 1021 route_name='repo_groups_data', request_method='GET',
993 1022 renderer='json_ext', xhr=True)
994 1023
995 1024 config.add_route(
996 1025 name='repo_group_new',
997 1026 pattern='/repo_group/new')
998 1027 config.add_view(
999 1028 AdminRepoGroupsView,
1000 1029 attr='repo_group_new',
1001 1030 route_name='repo_group_new', request_method='GET',
1002 1031 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
1003 1032
1004 1033 config.add_route(
1005 1034 name='repo_group_create',
1006 1035 pattern='/repo_group/create')
1007 1036 config.add_view(
1008 1037 AdminRepoGroupsView,
1009 1038 attr='repo_group_create',
1010 1039 route_name='repo_group_create', request_method='POST',
1011 1040 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
1012 1041
1013 1042
1014 1043 def includeme(config):
1015 1044 from rhodecode.apps._base.navigation import includeme as nav_includeme
1016 1045 from rhodecode.apps.admin.views.main_views import AdminMainView
1017 1046
1018 1047 # Create admin navigation registry and add it to the pyramid registry.
1019 1048 nav_includeme(config)
1020 1049
1021 1050 # main admin routes
1022 1051 config.add_route(
1023 1052 name='admin_home', pattern=ADMIN_PREFIX)
1024 1053 config.add_view(
1025 1054 AdminMainView,
1026 1055 attr='admin_main',
1027 1056 route_name='admin_home', request_method='GET',
1028 1057 renderer='rhodecode:templates/admin/main.mako')
1029 1058
1030 1059 # pr global redirect
1031 1060 config.add_route(
1032 1061 name='pull_requests_global_0', # backward compat
1033 1062 pattern=ADMIN_PREFIX + '/pull_requests/{pull_request_id:\d+}')
1034 1063 config.add_view(
1035 1064 AdminMainView,
1036 1065 attr='pull_requests',
1037 1066 route_name='pull_requests_global_0', request_method='GET')
1038 1067
1039 1068 config.add_route(
1040 1069 name='pull_requests_global_1', # backward compat
1041 1070 pattern=ADMIN_PREFIX + '/pull-requests/{pull_request_id:\d+}')
1042 1071 config.add_view(
1043 1072 AdminMainView,
1044 1073 attr='pull_requests',
1045 1074 route_name='pull_requests_global_1', request_method='GET')
1046 1075
1047 1076 config.add_route(
1048 1077 name='pull_requests_global',
1049 1078 pattern=ADMIN_PREFIX + '/pull-request/{pull_request_id:\d+}')
1050 1079 config.add_view(
1051 1080 AdminMainView,
1052 1081 attr='pull_requests',
1053 1082 route_name='pull_requests_global', request_method='GET')
1054 1083
1055 1084 config.include(admin_routes, route_prefix=ADMIN_PREFIX)
General Comments 1
Under Review
author

Auto status change to "Under Review"

You need to be logged in to leave comments. Login now