##// END OF EJS Templates
application: not use config.scan(), and replace all @add_view decorator into a explicit add_view call for faster app start.
milka -
r4610:1c249462 stable
parent child
Show More
@@ -527,6 +527,14 class jsonrpc_deprecated_method(object):
527 return result
527 return result
528
528
529
529
530 def add_api_methods(config):
531 from rhodecode.api.views import (
532 deprecated_api, gist_api, pull_request_api, repo_api, repo_group_api,
533 server_api, search_api, testing_api, user_api, user_group_api)
534
535 config.scan('rhodecode.api.views')
536
537
530 def includeme(config):
538 def includeme(config):
531 plugin_module = 'rhodecode.api'
539 plugin_module = 'rhodecode.api'
532 plugin_settings = get_plugin_settings(
540 plugin_settings = get_plugin_settings(
@@ -549,7 +557,8 def includeme(config):
549 config.add_route(
557 config.add_route(
550 'apiv2', plugin_settings.get('url', DEFAULT_URL), jsonrpc_call=True)
558 'apiv2', plugin_settings.get('url', DEFAULT_URL), jsonrpc_call=True)
551
559
552 config.scan(plugin_module, ignore='rhodecode.api.tests')
553 # register some exception handling view
560 # register some exception handling view
554 config.add_view(exception_view, context=JSONRPCBaseError)
561 config.add_view(exception_view, context=JSONRPCBaseError)
555 config.add_notfound_view(exception_view, jsonrpc_method_not_found=True)
562 config.add_notfound_view(exception_view, jsonrpc_method_not_found=True)
563
564 add_api_methods(config)
@@ -144,3 +144,5 def includeme(config):
144 labs_active = str2bool(settings.get('labs_settings_active', False))
144 labs_active = str2bool(settings.get('labs_settings_active', False))
145 navigation_registry_instance = NavigationRegistry(labs_active=labs_active)
145 navigation_registry_instance = NavigationRegistry(labs_active=labs_active)
146 config.registry.registerUtility(navigation_registry_instance)
146 config.registry.registerUtility(navigation_registry_instance)
147 log.debug('Created new nabigation instance, %s', navigation_registry_instance)
148
This diff has been collapsed as it changes many lines, (619 lines changed) Show them Hide them
@@ -26,441 +26,1030 def admin_routes(config):
26 """
26 """
27 Admin prefixed routes
27 Admin prefixed routes
28 """
28 """
29 from rhodecode.apps.admin.views.audit_logs import AdminAuditLogsView
30 from rhodecode.apps.admin.views.defaults import AdminDefaultSettingsView
31 from rhodecode.apps.admin.views.exception_tracker import ExceptionsTrackerView
32 from rhodecode.apps.admin.views.main_views import AdminMainView
33 from rhodecode.apps.admin.views.open_source_licenses import OpenSourceLicensesAdminSettingsView
34 from rhodecode.apps.admin.views.permissions import AdminPermissionsView
35 from rhodecode.apps.admin.views.process_management import AdminProcessManagementView
36 from rhodecode.apps.admin.views.repo_groups import AdminRepoGroupsView
37 from rhodecode.apps.admin.views.repositories import AdminReposView
38 from rhodecode.apps.admin.views.sessions import AdminSessionSettingsView
39 from rhodecode.apps.admin.views.settings import AdminSettingsView
40 from rhodecode.apps.admin.views.svn_config import AdminSvnConfigView
41 from rhodecode.apps.admin.views.system_info import AdminSystemInfoSettingsView
42 from rhodecode.apps.admin.views.user_groups import AdminUserGroupsView
43 from rhodecode.apps.admin.views.users import AdminUsersView, UsersView
44
29 config.add_route(
45 config.add_route(
30 name='admin_audit_logs',
46 name='admin_audit_logs',
31 pattern='/audit_logs')
47 pattern='/audit_logs')
48 config.add_view(
49 AdminAuditLogsView,
50 attr='admin_audit_logs',
51 route_name='admin_audit_logs', request_method='GET',
52 renderer='rhodecode:templates/admin/admin_audit_logs.mako')
32
53
33 config.add_route(
54 config.add_route(
34 name='admin_audit_log_entry',
55 name='admin_audit_log_entry',
35 pattern='/audit_logs/{audit_log_id}')
56 pattern='/audit_logs/{audit_log_id}')
36
57 config.add_view(
37 config.add_route(
58 AdminAuditLogsView,
38 name='pull_requests_global_0', # backward compat
59 attr='admin_audit_log_entry',
39 pattern='/pull_requests/{pull_request_id:\d+}')
60 route_name='admin_audit_log_entry', request_method='GET',
40 config.add_route(
61 renderer='rhodecode:templates/admin/admin_audit_log_entry.mako')
41 name='pull_requests_global_1', # backward compat
42 pattern='/pull-requests/{pull_request_id:\d+}')
43 config.add_route(
44 name='pull_requests_global',
45 pattern='/pull-request/{pull_request_id:\d+}')
46
62
47 config.add_route(
63 config.add_route(
48 name='admin_settings_open_source',
64 name='admin_settings_open_source',
49 pattern='/settings/open_source')
65 pattern='/settings/open_source')
66 config.add_view(
67 OpenSourceLicensesAdminSettingsView,
68 attr='open_source_licenses',
69 route_name='admin_settings_open_source', request_method='GET',
70 renderer='rhodecode:templates/admin/settings/settings.mako')
71
50 config.add_route(
72 config.add_route(
51 name='admin_settings_vcs_svn_generate_cfg',
73 name='admin_settings_vcs_svn_generate_cfg',
52 pattern='/settings/vcs/svn_generate_cfg')
74 pattern='/settings/vcs/svn_generate_cfg')
75 config.add_view(
76 AdminSvnConfigView,
77 attr='vcs_svn_generate_config',
78 route_name='admin_settings_vcs_svn_generate_cfg',
79 request_method='POST', renderer='json')
53
80
54 config.add_route(
81 config.add_route(
55 name='admin_settings_system',
82 name='admin_settings_system',
56 pattern='/settings/system')
83 pattern='/settings/system')
84 config.add_view(
85 AdminSystemInfoSettingsView,
86 attr='settings_system_info',
87 route_name='admin_settings_system', request_method='GET',
88 renderer='rhodecode:templates/admin/settings/settings.mako')
89
57 config.add_route(
90 config.add_route(
58 name='admin_settings_system_update',
91 name='admin_settings_system_update',
59 pattern='/settings/system/updates')
92 pattern='/settings/system/updates')
93 config.add_view(
94 AdminSystemInfoSettingsView,
95 attr='settings_system_info_check_update',
96 route_name='admin_settings_system_update', request_method='GET',
97 renderer='rhodecode:templates/admin/settings/settings_system_update.mako')
60
98
61 config.add_route(
99 config.add_route(
62 name='admin_settings_exception_tracker',
100 name='admin_settings_exception_tracker',
63 pattern='/settings/exceptions')
101 pattern='/settings/exceptions')
102 config.add_view(
103 ExceptionsTrackerView,
104 attr='browse_exceptions',
105 route_name='admin_settings_exception_tracker', request_method='GET',
106 renderer='rhodecode:templates/admin/settings/settings.mako')
107
64 config.add_route(
108 config.add_route(
65 name='admin_settings_exception_tracker_delete_all',
109 name='admin_settings_exception_tracker_delete_all',
66 pattern='/settings/exceptions/delete')
110 pattern='/settings/exceptions_delete_all')
111 config.add_view(
112 ExceptionsTrackerView,
113 attr='exception_delete_all',
114 route_name='admin_settings_exception_tracker_delete_all', request_method='POST',
115 renderer='rhodecode:templates/admin/settings/settings.mako')
116
67 config.add_route(
117 config.add_route(
68 name='admin_settings_exception_tracker_show',
118 name='admin_settings_exception_tracker_show',
69 pattern='/settings/exceptions/{exception_id}')
119 pattern='/settings/exceptions/{exception_id}')
120 config.add_view(
121 ExceptionsTrackerView,
122 attr='exception_show',
123 route_name='admin_settings_exception_tracker_show', request_method='GET',
124 renderer='rhodecode:templates/admin/settings/settings.mako')
125
70 config.add_route(
126 config.add_route(
71 name='admin_settings_exception_tracker_delete',
127 name='admin_settings_exception_tracker_delete',
72 pattern='/settings/exceptions/{exception_id}/delete')
128 pattern='/settings/exceptions/{exception_id}/delete')
129 config.add_view(
130 ExceptionsTrackerView,
131 attr='exception_delete',
132 route_name='admin_settings_exception_tracker_delete', request_method='POST',
133 renderer='rhodecode:templates/admin/settings/settings.mako')
73
134
74 config.add_route(
135 config.add_route(
75 name='admin_settings_sessions',
136 name='admin_settings_sessions',
76 pattern='/settings/sessions')
137 pattern='/settings/sessions')
138 config.add_view(
139 AdminSessionSettingsView,
140 attr='settings_sessions',
141 route_name='admin_settings_sessions', request_method='GET',
142 renderer='rhodecode:templates/admin/settings/settings.mako')
143
77 config.add_route(
144 config.add_route(
78 name='admin_settings_sessions_cleanup',
145 name='admin_settings_sessions_cleanup',
79 pattern='/settings/sessions/cleanup')
146 pattern='/settings/sessions/cleanup')
147 config.add_view(
148 AdminSessionSettingsView,
149 attr='settings_sessions_cleanup',
150 route_name='admin_settings_sessions_cleanup', request_method='POST')
80
151
81 config.add_route(
152 config.add_route(
82 name='admin_settings_process_management',
153 name='admin_settings_process_management',
83 pattern='/settings/process_management')
154 pattern='/settings/process_management')
155 config.add_view(
156 AdminProcessManagementView,
157 attr='process_management',
158 route_name='admin_settings_process_management', request_method='GET',
159 renderer='rhodecode:templates/admin/settings/settings.mako')
160
84 config.add_route(
161 config.add_route(
85 name='admin_settings_process_management_data',
162 name='admin_settings_process_management_data',
86 pattern='/settings/process_management/data')
163 pattern='/settings/process_management/data')
164 config.add_view(
165 AdminProcessManagementView,
166 attr='process_management_data',
167 route_name='admin_settings_process_management_data', request_method='GET',
168 renderer='rhodecode:templates/admin/settings/settings_process_management_data.mako')
169
87 config.add_route(
170 config.add_route(
88 name='admin_settings_process_management_signal',
171 name='admin_settings_process_management_signal',
89 pattern='/settings/process_management/signal')
172 pattern='/settings/process_management/signal')
173 config.add_view(
174 AdminProcessManagementView,
175 attr='process_management_signal',
176 route_name='admin_settings_process_management_signal',
177 request_method='POST', renderer='json_ext')
178
90 config.add_route(
179 config.add_route(
91 name='admin_settings_process_management_master_signal',
180 name='admin_settings_process_management_master_signal',
92 pattern='/settings/process_management/master_signal')
181 pattern='/settings/process_management/master_signal')
182 config.add_view(
183 AdminProcessManagementView,
184 attr='process_management_master_signal',
185 route_name='admin_settings_process_management_master_signal',
186 request_method='POST', renderer='json_ext')
93
187
94 # default settings
188 # default settings
95 config.add_route(
189 config.add_route(
96 name='admin_defaults_repositories',
190 name='admin_defaults_repositories',
97 pattern='/defaults/repositories')
191 pattern='/defaults/repositories')
192 config.add_view(
193 AdminDefaultSettingsView,
194 attr='defaults_repository_show',
195 route_name='admin_defaults_repositories', request_method='GET',
196 renderer='rhodecode:templates/admin/defaults/defaults.mako')
197
98 config.add_route(
198 config.add_route(
99 name='admin_defaults_repositories_update',
199 name='admin_defaults_repositories_update',
100 pattern='/defaults/repositories/update')
200 pattern='/defaults/repositories/update')
201 config.add_view(
202 AdminDefaultSettingsView,
203 attr='defaults_repository_update',
204 route_name='admin_defaults_repositories_update', request_method='POST',
205 renderer='rhodecode:templates/admin/defaults/defaults.mako')
101
206
102 # admin settings
207 # admin settings
103
208
104 config.add_route(
209 config.add_route(
105 name='admin_settings',
210 name='admin_settings',
106 pattern='/settings')
211 pattern='/settings')
212 config.add_view(
213 AdminSettingsView,
214 attr='settings_global',
215 route_name='admin_settings', request_method='GET',
216 renderer='rhodecode:templates/admin/settings/settings.mako')
217
107 config.add_route(
218 config.add_route(
108 name='admin_settings_update',
219 name='admin_settings_update',
109 pattern='/settings/update')
220 pattern='/settings/update')
221 config.add_view(
222 AdminSettingsView,
223 attr='settings_global_update',
224 route_name='admin_settings_update', request_method='POST',
225 renderer='rhodecode:templates/admin/settings/settings.mako')
110
226
111 config.add_route(
227 config.add_route(
112 name='admin_settings_global',
228 name='admin_settings_global',
113 pattern='/settings/global')
229 pattern='/settings/global')
230 config.add_view(
231 AdminSettingsView,
232 attr='settings_global',
233 route_name='admin_settings_global', request_method='GET',
234 renderer='rhodecode:templates/admin/settings/settings.mako')
235
114 config.add_route(
236 config.add_route(
115 name='admin_settings_global_update',
237 name='admin_settings_global_update',
116 pattern='/settings/global/update')
238 pattern='/settings/global/update')
239 config.add_view(
240 AdminSettingsView,
241 attr='settings_global_update',
242 route_name='admin_settings_global_update', request_method='POST',
243 renderer='rhodecode:templates/admin/settings/settings.mako')
117
244
118 config.add_route(
245 config.add_route(
119 name='admin_settings_vcs',
246 name='admin_settings_vcs',
120 pattern='/settings/vcs')
247 pattern='/settings/vcs')
248 config.add_view(
249 AdminSettingsView,
250 attr='settings_vcs',
251 route_name='admin_settings_vcs', request_method='GET',
252 renderer='rhodecode:templates/admin/settings/settings.mako')
253
121 config.add_route(
254 config.add_route(
122 name='admin_settings_vcs_update',
255 name='admin_settings_vcs_update',
123 pattern='/settings/vcs/update')
256 pattern='/settings/vcs/update')
257 config.add_view(
258 AdminSettingsView,
259 attr='settings_vcs_update',
260 route_name='admin_settings_vcs_update', request_method='POST',
261 renderer='rhodecode:templates/admin/settings/settings.mako')
262
124 config.add_route(
263 config.add_route(
125 name='admin_settings_vcs_svn_pattern_delete',
264 name='admin_settings_vcs_svn_pattern_delete',
126 pattern='/settings/vcs/svn_pattern_delete')
265 pattern='/settings/vcs/svn_pattern_delete')
266 config.add_view(
267 AdminSettingsView,
268 attr='settings_vcs_delete_svn_pattern',
269 route_name='admin_settings_vcs_svn_pattern_delete', request_method='POST',
270 renderer='json_ext', xhr=True)
127
271
128 config.add_route(
272 config.add_route(
129 name='admin_settings_mapping',
273 name='admin_settings_mapping',
130 pattern='/settings/mapping')
274 pattern='/settings/mapping')
275 config.add_view(
276 AdminSettingsView,
277 attr='settings_mapping',
278 route_name='admin_settings_mapping', request_method='GET',
279 renderer='rhodecode:templates/admin/settings/settings.mako')
280
131 config.add_route(
281 config.add_route(
132 name='admin_settings_mapping_update',
282 name='admin_settings_mapping_update',
133 pattern='/settings/mapping/update')
283 pattern='/settings/mapping/update')
284 config.add_view(
285 AdminSettingsView,
286 attr='settings_mapping_update',
287 route_name='admin_settings_mapping_update', request_method='POST',
288 renderer='rhodecode:templates/admin/settings/settings.mako')
134
289
135 config.add_route(
290 config.add_route(
136 name='admin_settings_visual',
291 name='admin_settings_visual',
137 pattern='/settings/visual')
292 pattern='/settings/visual')
293 config.add_view(
294 AdminSettingsView,
295 attr='settings_visual',
296 route_name='admin_settings_visual', request_method='GET',
297 renderer='rhodecode:templates/admin/settings/settings.mako')
298
138 config.add_route(
299 config.add_route(
139 name='admin_settings_visual_update',
300 name='admin_settings_visual_update',
140 pattern='/settings/visual/update')
301 pattern='/settings/visual/update')
302 config.add_view(
303 AdminSettingsView,
304 attr='settings_visual_update',
305 route_name='admin_settings_visual_update', request_method='POST',
306 renderer='rhodecode:templates/admin/settings/settings.mako')
141
307
142 config.add_route(
308 config.add_route(
143 name='admin_settings_issuetracker',
309 name='admin_settings_issuetracker',
144 pattern='/settings/issue-tracker')
310 pattern='/settings/issue-tracker')
311 config.add_view(
312 AdminSettingsView,
313 attr='settings_issuetracker',
314 route_name='admin_settings_issuetracker', request_method='GET',
315 renderer='rhodecode:templates/admin/settings/settings.mako')
316
145 config.add_route(
317 config.add_route(
146 name='admin_settings_issuetracker_update',
318 name='admin_settings_issuetracker_update',
147 pattern='/settings/issue-tracker/update')
319 pattern='/settings/issue-tracker/update')
320 config.add_view(
321 AdminSettingsView,
322 attr='settings_issuetracker_update',
323 route_name='admin_settings_issuetracker_update', request_method='POST',
324 renderer='rhodecode:templates/admin/settings/settings.mako')
325
148 config.add_route(
326 config.add_route(
149 name='admin_settings_issuetracker_test',
327 name='admin_settings_issuetracker_test',
150 pattern='/settings/issue-tracker/test')
328 pattern='/settings/issue-tracker/test')
329 config.add_view(
330 AdminSettingsView,
331 attr='settings_issuetracker_test',
332 route_name='admin_settings_issuetracker_test', request_method='POST',
333 renderer='string', xhr=True)
334
151 config.add_route(
335 config.add_route(
152 name='admin_settings_issuetracker_delete',
336 name='admin_settings_issuetracker_delete',
153 pattern='/settings/issue-tracker/delete')
337 pattern='/settings/issue-tracker/delete')
338 config.add_view(
339 AdminSettingsView,
340 attr='settings_issuetracker_delete',
341 route_name='admin_settings_issuetracker_delete', request_method='POST',
342 renderer='json_ext', xhr=True)
154
343
155 config.add_route(
344 config.add_route(
156 name='admin_settings_email',
345 name='admin_settings_email',
157 pattern='/settings/email')
346 pattern='/settings/email')
347 config.add_view(
348 AdminSettingsView,
349 attr='settings_email',
350 route_name='admin_settings_email', request_method='GET',
351 renderer='rhodecode:templates/admin/settings/settings.mako')
352
158 config.add_route(
353 config.add_route(
159 name='admin_settings_email_update',
354 name='admin_settings_email_update',
160 pattern='/settings/email/update')
355 pattern='/settings/email/update')
356 config.add_view(
357 AdminSettingsView,
358 attr='settings_email_update',
359 route_name='admin_settings_email_update', request_method='POST',
360 renderer='rhodecode:templates/admin/settings/settings.mako')
161
361
162 config.add_route(
362 config.add_route(
163 name='admin_settings_hooks',
363 name='admin_settings_hooks',
164 pattern='/settings/hooks')
364 pattern='/settings/hooks')
365 config.add_view(
366 AdminSettingsView,
367 attr='settings_hooks',
368 route_name='admin_settings_hooks', request_method='GET',
369 renderer='rhodecode:templates/admin/settings/settings.mako')
370
165 config.add_route(
371 config.add_route(
166 name='admin_settings_hooks_update',
372 name='admin_settings_hooks_update',
167 pattern='/settings/hooks/update')
373 pattern='/settings/hooks/update')
374 config.add_view(
375 AdminSettingsView,
376 attr='settings_hooks_update',
377 route_name='admin_settings_hooks_update', request_method='POST',
378 renderer='rhodecode:templates/admin/settings/settings.mako')
379
168 config.add_route(
380 config.add_route(
169 name='admin_settings_hooks_delete',
381 name='admin_settings_hooks_delete',
170 pattern='/settings/hooks/delete')
382 pattern='/settings/hooks/delete')
383 config.add_view(
384 AdminSettingsView,
385 attr='settings_hooks_update',
386 route_name='admin_settings_hooks_delete', request_method='POST',
387 renderer='rhodecode:templates/admin/settings/settings.mako')
171
388
172 config.add_route(
389 config.add_route(
173 name='admin_settings_search',
390 name='admin_settings_search',
174 pattern='/settings/search')
391 pattern='/settings/search')
392 config.add_view(
393 AdminSettingsView,
394 attr='settings_search',
395 route_name='admin_settings_search', request_method='GET',
396 renderer='rhodecode:templates/admin/settings/settings.mako')
175
397
176 config.add_route(
398 config.add_route(
177 name='admin_settings_labs',
399 name='admin_settings_labs',
178 pattern='/settings/labs')
400 pattern='/settings/labs')
401 config.add_view(
402 AdminSettingsView,
403 attr='settings_labs',
404 route_name='admin_settings_labs', request_method='GET',
405 renderer='rhodecode:templates/admin/settings/settings.mako')
406
179 config.add_route(
407 config.add_route(
180 name='admin_settings_labs_update',
408 name='admin_settings_labs_update',
181 pattern='/settings/labs/update')
409 pattern='/settings/labs/update')
410 config.add_view(
411 AdminSettingsView,
412 attr='settings_labs_update',
413 route_name='admin_settings_labs_update', request_method='POST',
414 renderer='rhodecode:templates/admin/settings/settings.mako')
182
415
183 # Automation EE feature
416 # Automation EE feature
184 config.add_route(
417 config.add_route(
185 'admin_settings_automation',
418 'admin_settings_automation',
186 pattern=ADMIN_PREFIX + '/settings/automation')
419 pattern=ADMIN_PREFIX + '/settings/automation')
420 config.add_view(
421 AdminSettingsView,
422 attr='settings_automation',
423 route_name='admin_settings_automation', request_method='GET',
424 renderer='rhodecode:templates/admin/settings/settings.mako')
187
425
188 # global permissions
426 # global permissions
189
427
190 config.add_route(
428 config.add_route(
191 name='admin_permissions_application',
429 name='admin_permissions_application',
192 pattern='/permissions/application')
430 pattern='/permissions/application')
431 config.add_view(
432 AdminPermissionsView,
433 attr='permissions_application',
434 route_name='admin_permissions_application', request_method='GET',
435 renderer='rhodecode:templates/admin/permissions/permissions.mako')
436
193 config.add_route(
437 config.add_route(
194 name='admin_permissions_application_update',
438 name='admin_permissions_application_update',
195 pattern='/permissions/application/update')
439 pattern='/permissions/application/update')
440 config.add_view(
441 AdminPermissionsView,
442 attr='permissions_application_update',
443 route_name='admin_permissions_application_update', request_method='POST',
444 renderer='rhodecode:templates/admin/permissions/permissions.mako')
196
445
197 config.add_route(
446 config.add_route(
198 name='admin_permissions_global',
447 name='admin_permissions_global',
199 pattern='/permissions/global')
448 pattern='/permissions/global')
449 config.add_view(
450 AdminPermissionsView,
451 attr='permissions_global',
452 route_name='admin_permissions_global', request_method='GET',
453 renderer='rhodecode:templates/admin/permissions/permissions.mako')
454
200 config.add_route(
455 config.add_route(
201 name='admin_permissions_global_update',
456 name='admin_permissions_global_update',
202 pattern='/permissions/global/update')
457 pattern='/permissions/global/update')
458 config.add_view(
459 AdminPermissionsView,
460 attr='permissions_global_update',
461 route_name='admin_permissions_global_update', request_method='POST',
462 renderer='rhodecode:templates/admin/permissions/permissions.mako')
203
463
204 config.add_route(
464 config.add_route(
205 name='admin_permissions_object',
465 name='admin_permissions_object',
206 pattern='/permissions/object')
466 pattern='/permissions/object')
467 config.add_view(
468 AdminPermissionsView,
469 attr='permissions_objects',
470 route_name='admin_permissions_object', request_method='GET',
471 renderer='rhodecode:templates/admin/permissions/permissions.mako')
472
207 config.add_route(
473 config.add_route(
208 name='admin_permissions_object_update',
474 name='admin_permissions_object_update',
209 pattern='/permissions/object/update')
475 pattern='/permissions/object/update')
476 config.add_view(
477 AdminPermissionsView,
478 attr='permissions_objects_update',
479 route_name='admin_permissions_object_update', request_method='POST',
480 renderer='rhodecode:templates/admin/permissions/permissions.mako')
210
481
211 # Branch perms EE feature
482 # Branch perms EE feature
212 config.add_route(
483 config.add_route(
213 name='admin_permissions_branch',
484 name='admin_permissions_branch',
214 pattern='/permissions/branch')
485 pattern='/permissions/branch')
486 config.add_view(
487 AdminPermissionsView,
488 attr='permissions_branch',
489 route_name='admin_permissions_branch', request_method='GET',
490 renderer='rhodecode:templates/admin/permissions/permissions.mako')
215
491
216 config.add_route(
492 config.add_route(
217 name='admin_permissions_ips',
493 name='admin_permissions_ips',
218 pattern='/permissions/ips')
494 pattern='/permissions/ips')
495 config.add_view(
496 AdminPermissionsView,
497 attr='permissions_ips',
498 route_name='admin_permissions_ips', request_method='GET',
499 renderer='rhodecode:templates/admin/permissions/permissions.mako')
219
500
220 config.add_route(
501 config.add_route(
221 name='admin_permissions_overview',
502 name='admin_permissions_overview',
222 pattern='/permissions/overview')
503 pattern='/permissions/overview')
504 config.add_view(
505 AdminPermissionsView,
506 attr='permissions_overview',
507 route_name='admin_permissions_overview', request_method='GET',
508 renderer='rhodecode:templates/admin/permissions/permissions.mako')
223
509
224 config.add_route(
510 config.add_route(
225 name='admin_permissions_auth_token_access',
511 name='admin_permissions_auth_token_access',
226 pattern='/permissions/auth_token_access')
512 pattern='/permissions/auth_token_access')
513 config.add_view(
514 AdminPermissionsView,
515 attr='auth_token_access',
516 route_name='admin_permissions_auth_token_access', request_method='GET',
517 renderer='rhodecode:templates/admin/permissions/permissions.mako')
227
518
228 config.add_route(
519 config.add_route(
229 name='admin_permissions_ssh_keys',
520 name='admin_permissions_ssh_keys',
230 pattern='/permissions/ssh_keys')
521 pattern='/permissions/ssh_keys')
522 config.add_view(
523 AdminPermissionsView,
524 attr='ssh_keys',
525 route_name='admin_permissions_ssh_keys', request_method='GET',
526 renderer='rhodecode:templates/admin/permissions/permissions.mako')
527
231 config.add_route(
528 config.add_route(
232 name='admin_permissions_ssh_keys_data',
529 name='admin_permissions_ssh_keys_data',
233 pattern='/permissions/ssh_keys/data')
530 pattern='/permissions/ssh_keys/data')
531 config.add_view(
532 AdminPermissionsView,
533 attr='ssh_keys_data',
534 route_name='admin_permissions_ssh_keys_data', request_method='GET',
535 renderer='json_ext', xhr=True)
536
234 config.add_route(
537 config.add_route(
235 name='admin_permissions_ssh_keys_update',
538 name='admin_permissions_ssh_keys_update',
236 pattern='/permissions/ssh_keys/update')
539 pattern='/permissions/ssh_keys/update')
540 config.add_view(
541 AdminPermissionsView,
542 attr='ssh_keys_update',
543 route_name='admin_permissions_ssh_keys_update', request_method='POST',
544 renderer='rhodecode:templates/admin/permissions/permissions.mako')
237
545
238 # users admin
546 # users admin
239 config.add_route(
547 config.add_route(
240 name='users',
548 name='users',
241 pattern='/users')
549 pattern='/users')
550 config.add_view(
551 AdminUsersView,
552 attr='users_list',
553 route_name='users', request_method='GET',
554 renderer='rhodecode:templates/admin/users/users.mako')
242
555
243 config.add_route(
556 config.add_route(
244 name='users_data',
557 name='users_data',
245 pattern='/users_data')
558 pattern='/users_data')
559 config.add_view(
560 AdminUsersView,
561 attr='users_list_data',
562 # renderer defined below
563 route_name='users_data', request_method='GET',
564 renderer='json_ext', xhr=True)
246
565
247 config.add_route(
566 config.add_route(
248 name='users_create',
567 name='users_create',
249 pattern='/users/create')
568 pattern='/users/create')
569 config.add_view(
570 AdminUsersView,
571 attr='users_create',
572 route_name='users_create', request_method='POST',
573 renderer='rhodecode:templates/admin/users/user_add.mako')
250
574
251 config.add_route(
575 config.add_route(
252 name='users_new',
576 name='users_new',
253 pattern='/users/new')
577 pattern='/users/new')
578 config.add_view(
579 AdminUsersView,
580 attr='users_new',
581 route_name='users_new', request_method='GET',
582 renderer='rhodecode:templates/admin/users/user_add.mako')
254
583
255 # user management
584 # user management
256 config.add_route(
585 config.add_route(
257 name='user_edit',
586 name='user_edit',
258 pattern='/users/{user_id:\d+}/edit',
587 pattern='/users/{user_id:\d+}/edit',
259 user_route=True)
588 user_route=True)
589 config.add_view(
590 UsersView,
591 attr='user_edit',
592 route_name='user_edit', request_method='GET',
593 renderer='rhodecode:templates/admin/users/user_edit.mako')
594
260 config.add_route(
595 config.add_route(
261 name='user_edit_advanced',
596 name='user_edit_advanced',
262 pattern='/users/{user_id:\d+}/edit/advanced',
597 pattern='/users/{user_id:\d+}/edit/advanced',
263 user_route=True)
598 user_route=True)
599 config.add_view(
600 UsersView,
601 attr='user_edit_advanced',
602 route_name='user_edit_advanced', request_method='GET',
603 renderer='rhodecode:templates/admin/users/user_edit.mako')
604
264 config.add_route(
605 config.add_route(
265 name='user_edit_global_perms',
606 name='user_edit_global_perms',
266 pattern='/users/{user_id:\d+}/edit/global_permissions',
607 pattern='/users/{user_id:\d+}/edit/global_permissions',
267 user_route=True)
608 user_route=True)
609 config.add_view(
610 UsersView,
611 attr='user_edit_global_perms',
612 route_name='user_edit_global_perms', request_method='GET',
613 renderer='rhodecode:templates/admin/users/user_edit.mako')
614
268 config.add_route(
615 config.add_route(
269 name='user_edit_global_perms_update',
616 name='user_edit_global_perms_update',
270 pattern='/users/{user_id:\d+}/edit/global_permissions/update',
617 pattern='/users/{user_id:\d+}/edit/global_permissions/update',
271 user_route=True)
618 user_route=True)
619 config.add_view(
620 UsersView,
621 attr='user_edit_global_perms_update',
622 route_name='user_edit_global_perms_update', request_method='POST',
623 renderer='rhodecode:templates/admin/users/user_edit.mako')
624
272 config.add_route(
625 config.add_route(
273 name='user_update',
626 name='user_update',
274 pattern='/users/{user_id:\d+}/update',
627 pattern='/users/{user_id:\d+}/update',
275 user_route=True)
628 user_route=True)
629 config.add_view(
630 UsersView,
631 attr='user_update',
632 route_name='user_update', request_method='POST',
633 renderer='rhodecode:templates/admin/users/user_edit.mako')
634
276 config.add_route(
635 config.add_route(
277 name='user_delete',
636 name='user_delete',
278 pattern='/users/{user_id:\d+}/delete',
637 pattern='/users/{user_id:\d+}/delete',
279 user_route=True)
638 user_route=True)
639 config.add_view(
640 UsersView,
641 attr='user_delete',
642 route_name='user_delete', request_method='POST',
643 renderer='rhodecode:templates/admin/users/user_edit.mako')
644
280 config.add_route(
645 config.add_route(
281 name='user_enable_force_password_reset',
646 name='user_enable_force_password_reset',
282 pattern='/users/{user_id:\d+}/password_reset_enable',
647 pattern='/users/{user_id:\d+}/password_reset_enable',
283 user_route=True)
648 user_route=True)
649 config.add_view(
650 UsersView,
651 attr='user_enable_force_password_reset',
652 route_name='user_enable_force_password_reset', request_method='POST',
653 renderer='rhodecode:templates/admin/users/user_edit.mako')
654
284 config.add_route(
655 config.add_route(
285 name='user_disable_force_password_reset',
656 name='user_disable_force_password_reset',
286 pattern='/users/{user_id:\d+}/password_reset_disable',
657 pattern='/users/{user_id:\d+}/password_reset_disable',
287 user_route=True)
658 user_route=True)
659 config.add_view(
660 UsersView,
661 attr='user_disable_force_password_reset',
662 route_name='user_disable_force_password_reset', request_method='POST',
663 renderer='rhodecode:templates/admin/users/user_edit.mako')
664
288 config.add_route(
665 config.add_route(
289 name='user_create_personal_repo_group',
666 name='user_create_personal_repo_group',
290 pattern='/users/{user_id:\d+}/create_repo_group',
667