##// 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 Browse files
Show More
@@ -527,6 +527,14 b' 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 b' 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 b' 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 b' 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 pattern='/users/{user_id:\d+}/create_repo_group',
291 user_route=True)
668 user_route=True)
669 config.add_view(
670 UsersView,
671 attr='user_create_personal_repo_group',
672 route_name='user_create_personal_repo_group', request_method='POST',
673 renderer='rhodecode:templates/admin/users/user_edit.mako')
292
674
293 # user notice
675 # user notice
294 config.add_route(
676 config.add_route(
295 name='user_notice_dismiss',
677 name='user_notice_dismiss',
296 pattern='/users/{user_id:\d+}/notice_dismiss',
678 pattern='/users/{user_id:\d+}/notice_dismiss',
297 user_route=True)
679 user_route=True)
680 config.add_view(
681 UsersView,
682 attr='user_notice_dismiss',
683 route_name='user_notice_dismiss', request_method='POST',
684 renderer='json_ext', xhr=True)
298
685
299 # user auth tokens
686 # user auth tokens
300 config.add_route(
687 config.add_route(
301 name='edit_user_auth_tokens',
688 name='edit_user_auth_tokens',
302 pattern='/users/{user_id:\d+}/edit/auth_tokens',
689 pattern='/users/{user_id:\d+}/edit/auth_tokens',
303 user_route=True)
690 user_route=True)
691 config.add_view(
692 UsersView,
693 attr='auth_tokens',
694 route_name='edit_user_auth_tokens', request_method='GET',
695 renderer='rhodecode:templates/admin/users/user_edit.mako')
696
304 config.add_route(
697 config.add_route(
305 name='edit_user_auth_tokens_view',
698 name='edit_user_auth_tokens_view',
306 pattern='/users/{user_id:\d+}/edit/auth_tokens/view',
699 pattern='/users/{user_id:\d+}/edit/auth_tokens/view',
307 user_route=True)
700 user_route=True)
701 config.add_view(
702 UsersView,
703 attr='auth_tokens_view',
704 route_name='edit_user_auth_tokens_view', request_method='POST',
705 renderer='json_ext', xhr=True)
706
308 config.add_route(
707 config.add_route(
309 name='edit_user_auth_tokens_add',
708 name='edit_user_auth_tokens_add',
310 pattern='/users/{user_id:\d+}/edit/auth_tokens/new',
709 pattern='/users/{user_id:\d+}/edit/auth_tokens/new',
311 user_route=True)
710 user_route=True)
711 config.add_view(
712 UsersView,
713 attr='auth_tokens_add',
714 route_name='edit_user_auth_tokens_add', request_method='POST')
715
312 config.add_route(
716 config.add_route(
313 name='edit_user_auth_tokens_delete',
717 name='edit_user_auth_tokens_delete',
314 pattern='/users/{user_id:\d+}/edit/auth_tokens/delete',
718 pattern='/users/{user_id:\d+}/edit/auth_tokens/delete',
315 user_route=True)
719 user_route=True)
720 config.add_view(
721 UsersView,
722 attr='auth_tokens_delete',
723 route_name='edit_user_auth_tokens_delete', request_method='POST')
316
724
317 # user ssh keys
725 # user ssh keys
318 config.add_route(
726 config.add_route(
319 name='edit_user_ssh_keys',
727 name='edit_user_ssh_keys',
320 pattern='/users/{user_id:\d+}/edit/ssh_keys',
728 pattern='/users/{user_id:\d+}/edit/ssh_keys',
321 user_route=True)
729 user_route=True)
730 config.add_view(
731 UsersView,
732 attr='ssh_keys',
733 route_name='edit_user_ssh_keys', request_method='GET',
734 renderer='rhodecode:templates/admin/users/user_edit.mako')
735
322 config.add_route(
736 config.add_route(
323 name='edit_user_ssh_keys_generate_keypair',
737 name='edit_user_ssh_keys_generate_keypair',
324 pattern='/users/{user_id:\d+}/edit/ssh_keys/generate',
738 pattern='/users/{user_id:\d+}/edit/ssh_keys/generate',
325 user_route=True)
739 user_route=True)
740 config.add_view(
741 UsersView,
742 attr='ssh_keys_generate_keypair',
743 route_name='edit_user_ssh_keys_generate_keypair', request_method='GET',
744 renderer='rhodecode:templates/admin/users/user_edit.mako')
745
326 config.add_route(
746 config.add_route(
327 name='edit_user_ssh_keys_add',
747 name='edit_user_ssh_keys_add',
328 pattern='/users/{user_id:\d+}/edit/ssh_keys/new',
748 pattern='/users/{user_id:\d+}/edit/ssh_keys/new',
329 user_route=True)
749 user_route=True)
750 config.add_view(
751 UsersView,
752 attr='ssh_keys_add',
753 route_name='edit_user_ssh_keys_add', request_method='POST')
754
330 config.add_route(
755 config.add_route(
331 name='edit_user_ssh_keys_delete',
756 name='edit_user_ssh_keys_delete',
332 pattern='/users/{user_id:\d+}/edit/ssh_keys/delete',
757 pattern='/users/{user_id:\d+}/edit/ssh_keys/delete',
333 user_route=True)
758 user_route=True)
759 config.add_view(
760 UsersView,
761 attr='ssh_keys_delete',
762 route_name='edit_user_ssh_keys_delete', request_method='POST')
334
763
335 # user emails
764 # user emails
336 config.add_route(
765 config.add_route(
337 name='edit_user_emails',
766 name='edit_user_emails',
338 pattern='/users/{user_id:\d+}/edit/emails',
767 pattern='/users/{user_id:\d+}/edit/emails',
339 user_route=True)
768 user_route=True)
769 config.add_view(
770 UsersView,
771 attr='emails',
772 route_name='edit_user_emails', request_method='GET',
773 renderer='rhodecode:templates/admin/users/user_edit.mako')
774
340 config.add_route(
775 config.add_route(
341 name='edit_user_emails_add',
776 name='edit_user_emails_add',
342 pattern='/users/{user_id:\d+}/edit/emails/new',
777 pattern='/users/{user_id:\d+}/edit/emails/new',
343 user_route=True)
778 user_route=True)
779 config.add_view(
780 UsersView,
781 attr='emails_add',
782 route_name='edit_user_emails_add', request_method='POST')
783
344 config.add_route(
784 config.add_route(
345 name='edit_user_emails_delete',
785 name='edit_user_emails_delete',
346 pattern='/users/{user_id:\d+}/edit/emails/delete',
786 pattern='/users/{user_id:\d+}/edit/emails/delete',
347 user_route=True)
787 user_route=True)
788 config.add_view(
789 UsersView,
790 attr='emails_delete',
791 route_name='edit_user_emails_delete', request_method='POST')
348
792
349 # user IPs
793 # user IPs
350 config.add_route(
794 config.add_route(
351 name='edit_user_ips',
795 name='edit_user_ips',
352 pattern='/users/{user_id:\d+}/edit/ips',
796 pattern='/users/{user_id:\d+}/edit/ips',
353 user_route=True)
797 user_route=True)
798 config.add_view(
799 UsersView,
800 attr='ips',
801 route_name='edit_user_ips', request_method='GET',
802 renderer='rhodecode:templates/admin/users/user_edit.mako')
803
354 config.add_route(
804 config.add_route(
355 name='edit_user_ips_add',
805 name='edit_user_ips_add',
356 pattern='/users/{user_id:\d+}/edit/ips/new',
806 pattern='/users/{user_id:\d+}/edit/ips/new',
357 user_route_with_default=True) # enabled for default user too
807 user_route_with_default=True) # enabled for default user too
808 config.add_view(
809 UsersView,
810 attr='ips_add',
811 route_name='edit_user_ips_add', request_method='POST')
812
358 config.add_route(
813 config.add_route(
359 name='edit_user_ips_delete',
814 name='edit_user_ips_delete',
360 pattern='/users/{user_id:\d+}/edit/ips/delete',
815 pattern='/users/{user_id:\d+}/edit/ips/delete',
361 user_route_with_default=True) # enabled for default user too
816 user_route_with_default=True) # enabled for default user too
817 config.add_view(
818 UsersView,
819 attr='ips_delete',
820 route_name='edit_user_ips_delete', request_method='POST')
362
821
363 # user perms
822 # user perms
364 config.add_route(
823 config.add_route(
365 name='edit_user_perms_summary',
824 name='edit_user_perms_summary',
366 pattern='/users/{user_id:\d+}/edit/permissions_summary',
825 pattern='/users/{user_id:\d+}/edit/permissions_summary',
367 user_route=True)
826 user_route=True)
827 config.add_view(
828 UsersView,
829 attr='user_perms_summary',
830 route_name='edit_user_perms_summary', request_method='GET',
831 renderer='rhodecode:templates/admin/users/user_edit.mako')
832
368 config.add_route(
833 config.add_route(
369 name='edit_user_perms_summary_json',
834 name='edit_user_perms_summary_json',
370 pattern='/users/{user_id:\d+}/edit/permissions_summary/json',
835 pattern='/users/{user_id:\d+}/edit/permissions_summary/json',
371 user_route=True)
836 user_route=True)
837 config.add_view(
838 UsersView,
839 attr='user_perms_summary_json',
840 route_name='edit_user_perms_summary_json', request_method='GET',
841 renderer='json_ext')
372
842
373 # user user groups management
843 # user user groups management
374 config.add_route(
844 config.add_route(
375 name='edit_user_groups_management',
845 name='edit_user_groups_management',
376 pattern='/users/{user_id:\d+}/edit/groups_management',
846 pattern='/users/{user_id:\d+}/edit/groups_management',
377 user_route=True)
847 user_route=True)
848 config.add_view(
849 UsersView,
850 attr='groups_management',
851 route_name='edit_user_groups_management', request_method='GET',
852 renderer='rhodecode:templates/admin/users/user_edit.mako')
378
853
379 config.add_route(
854 config.add_route(
380 name='edit_user_groups_management_updates',
855 name='edit_user_groups_management_updates',
381 pattern='/users/{user_id:\d+}/edit/edit_user_groups_management/updates',
856 pattern='/users/{user_id:\d+}/edit/edit_user_groups_management/updates',
382 user_route=True)
857 user_route=True)
858 config.add_view(
859 UsersView,
860 attr='groups_management_updates',
861 route_name='edit_user_groups_management_updates', request_method='POST')
383
862
384 # user audit logs
863 # user audit logs
385 config.add_route(
864 config.add_route(
386 name='edit_user_audit_logs',
865 name='edit_user_audit_logs',
387 pattern='/users/{user_id:\d+}/edit/audit', user_route=True)
866 pattern='/users/{user_id:\d+}/edit/audit', user_route=True)
867 config.add_view(
868 UsersView,
869 attr='user_audit_logs',
870 route_name='edit_user_audit_logs', request_method='GET',
871 renderer='rhodecode:templates/admin/users/user_edit.mako')
388
872
389 config.add_route(
873 config.add_route(
390 name='edit_user_audit_logs_download',
874 name='edit_user_audit_logs_download',
391 pattern='/users/{user_id:\d+}/edit/audit/download', user_route=True)
875 pattern='/users/{user_id:\d+}/edit/audit/download', user_route=True)
876 config.add_view(
877 UsersView,
878 attr='user_audit_logs_download',
879 route_name='edit_user_audit_logs_download', request_method='GET',
880 renderer='string')
392
881
393 # user caches
882 # user caches
394 config.add_route(
883 config.add_route(
395 name='edit_user_caches',
884 name='edit_user_caches',
396 pattern='/users/{user_id:\d+}/edit/caches',
885 pattern='/users/{user_id:\d+}/edit/caches',
397 user_route=True)
886 user_route=True)
887 config.add_view(
888 UsersView,
889 attr='user_caches',
890 route_name='edit_user_caches', request_method='GET',
891 renderer='rhodecode:templates/admin/users/user_edit.mako')
892
398 config.add_route(
893 config.add_route(
399 name='edit_user_caches_update',
894 name='edit_user_caches_update',
400 pattern='/users/{user_id:\d+}/edit/caches/update',
895 pattern='/users/{user_id:\d+}/edit/caches/update',
401 user_route=True)
896 user_route=True)
897 config.add_view(
898 UsersView,
899 attr='user_caches_update',
900 route_name='edit_user_caches_update', request_method='POST')
402
901
403 # user-groups admin
902 # user-groups admin
404 config.add_route(
903 config.add_route(
405 name='user_groups',
904 name='user_groups',
406 pattern='/user_groups')
905 pattern='/user_groups')
906 config.add_view(
907 AdminUserGroupsView,
908 attr='user_groups_list',
909 route_name='user_groups', request_method='GET',
910 renderer='rhodecode:templates/admin/user_groups/user_groups.mako')
407
911
408 config.add_route(
912 config.add_route(
409 name='user_groups_data',
913 name='user_groups_data',
410 pattern='/user_groups_data')
914 pattern='/user_groups_data')
915 config.add_view(
916 AdminUserGroupsView,
917 attr='user_groups_list_data',
918 route_name='user_groups_data', request_method='GET',
919 renderer='json_ext', xhr=True)
411
920
412 config.add_route(
921 config.add_route(
413 name='user_groups_new',
922 name='user_groups_new',
414 pattern='/user_groups/new')
923 pattern='/user_groups/new')
924 config.add_view(
925 AdminUserGroupsView,
926 attr='user_groups_new',
927 route_name='user_groups_new', request_method='GET',
928 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
415
929
416 config.add_route(
930 config.add_route(
417 name='user_groups_create',
931 name='user_groups_create',
418 pattern='/user_groups/create')
932 pattern='/user_groups/create')
933 config.add_view(
934 AdminUserGroupsView,
935 attr='user_groups_create',
936 route_name='user_groups_create', request_method='POST',
937 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
419
938
420 # repos admin
939 # repos admin
421 config.add_route(
940 config.add_route(
422 name='repos',
941 name='repos',
423 pattern='/repos')
942 pattern='/repos')
943 config.add_view(
944 AdminReposView,
945 attr='repository_list',
946 route_name='repos', request_method='GET',
947 renderer='rhodecode:templates/admin/repos/repos.mako')
424
948
425 config.add_route(
949 config.add_route(
426 name='repos_data',
950 name='repos_data',
427 pattern='/repos_data')
951 pattern='/repos_data')
952 config.add_view(
953 AdminReposView,
954 attr='repository_list_data',
955 route_name='repos_data', request_method='GET',
956 renderer='json_ext', xhr=True)
428
957
429 config.add_route(
958 config.add_route(
430 name='repo_new',
959 name='repo_new',
431 pattern='/repos/new')
960 pattern='/repos/new')
961 config.add_view(
962 AdminReposView,
963 attr='repository_new',
964 route_name='repo_new', request_method='GET',
965 renderer='rhodecode:templates/admin/repos/repo_add.mako')
432
966
433 config.add_route(
967 config.add_route(
434 name='repo_create',
968 name='repo_create',
435 pattern='/repos/create')
969 pattern='/repos/create')
970 config.add_view(
971 AdminReposView,
972 attr='repository_create',
973 route_name='repo_create', request_method='POST',
974 renderer='rhodecode:templates/admin/repos/repos.mako')
436
975
437 # repo groups admin
976 # repo groups admin
438 config.add_route(
977 config.add_route(
439 name='repo_groups',
978 name='repo_groups',
440 pattern='/repo_groups')
979 pattern='/repo_groups')
980 config.add_view(
981 AdminRepoGroupsView,
982 attr='repo_group_list',
983 route_name='repo_groups', request_method='GET',
984 renderer='rhodecode:templates/admin/repo_groups/repo_groups.mako')
441
985
442 config.add_route(
986 config.add_route(
443 name='repo_groups_data',
987 name='repo_groups_data',
444 pattern='/repo_groups_data')
988 pattern='/repo_groups_data')
989 config.add_view(
990 AdminRepoGroupsView,
991 attr='repo_group_list_data',
992 route_name='repo_groups_data', request_method='GET',
993 renderer='json_ext', xhr=True)
445
994
446 config.add_route(
995 config.add_route(
447 name='repo_group_new',
996 name='repo_group_new',
448 pattern='/repo_group/new')
997 pattern='/repo_group/new')
998 config.add_view(
999 AdminRepoGroupsView,
1000 attr='repo_group_new',
1001 route_name='repo_group_new', request_method='GET',
1002 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
449
1003
450 config.add_route(
1004 config.add_route(
451 name='repo_group_create',
1005 name='repo_group_create',
452 pattern='/repo_group/create')
1006 pattern='/repo_group/create')
1007 config.add_view(
1008 AdminRepoGroupsView,
1009 attr='repo_group_create',
1010 route_name='repo_group_create', request_method='POST',
1011 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
453
1012
454
1013
455 def includeme(config):
1014 def includeme(config):
456 from rhodecode.apps._base.navigation import includeme as nav_includeme
1015 from rhodecode.apps._base.navigation import includeme as nav_includeme
1016 from rhodecode.apps.admin.views.main_views import AdminMainView
457
1017
458 # Create admin navigation registry and add it to the pyramid registry.
1018 # Create admin navigation registry and add it to the pyramid registry.
459 nav_includeme(config)
1019 nav_includeme(config)
460
1020
461 # main admin routes
1021 # main admin routes
462 config.add_route(name='admin_home', pattern=ADMIN_PREFIX)
1022 config.add_route(
463 config.include(admin_routes, route_prefix=ADMIN_PREFIX)
1023 name='admin_home', pattern=ADMIN_PREFIX)
1024 config.add_view(
1025 AdminMainView,
1026 attr='admin_main',
1027 route_name='admin_home', request_method='GET',
1028 renderer='rhodecode:templates/admin/main.mako')
1029
1030 # pr global redirect
1031 config.add_route(
1032 name='pull_requests_global_0', # backward compat
1033 pattern=ADMIN_PREFIX + '/pull_requests/{pull_request_id:\d+}')
1034 config.add_view(
1035 AdminMainView,
1036 attr='pull_requests',
1037 route_name='pull_requests_global_0', request_method='GET')
464
1038
465 # Scan module for configuration decorators.
1039 config.add_route(
466 config.scan('.views', ignore='.tests')
1040 name='pull_requests_global_1', # backward compat
1041 pattern=ADMIN_PREFIX + '/pull-requests/{pull_request_id:\d+}')
1042 config.add_view(
1043 AdminMainView,
1044 attr='pull_requests',
1045 route_name='pull_requests_global_1', request_method='GET')
1046
1047 config.add_route(
1048 name='pull_requests_global',
1049 pattern=ADMIN_PREFIX + '/pull-request/{pull_request_id:\d+}')
1050 config.add_view(
1051 AdminMainView,
1052 attr='pull_requests',
1053 route_name='pull_requests_global', request_method='GET')
1054
1055 config.include(admin_routes, route_prefix=ADMIN_PREFIX)
@@ -21,7 +21,6 b''
21 import logging
21 import logging
22
22
23 from pyramid.httpexceptions import HTTPNotFound
23 from pyramid.httpexceptions import HTTPNotFound
24 from pyramid.view import view_config
25
24
26 from rhodecode.apps._base import BaseAppView
25 from rhodecode.apps._base import BaseAppView
27 from rhodecode.model.db import joinedload, UserLog
26 from rhodecode.model.db import joinedload, UserLog
@@ -34,15 +33,13 b' log = logging.getLogger(__name__)'
34
33
35
34
36 class AdminAuditLogsView(BaseAppView):
35 class AdminAuditLogsView(BaseAppView):
36
37 def load_default_context(self):
37 def load_default_context(self):
38 c = self._get_local_tmpl_context()
38 c = self._get_local_tmpl_context()
39 return c
39 return c
40
40
41 @LoginRequired()
41 @LoginRequired()
42 @HasPermissionAllDecorator('hg.admin')
42 @HasPermissionAllDecorator('hg.admin')
43 @view_config(
44 route_name='admin_audit_logs', request_method='GET',
45 renderer='rhodecode:templates/admin/admin_audit_logs.mako')
46 def admin_audit_logs(self):
43 def admin_audit_logs(self):
47 c = self.load_default_context()
44 c = self.load_default_context()
48
45
@@ -76,9 +73,6 b' class AdminAuditLogsView(BaseAppView):'
76
73
77 @LoginRequired()
74 @LoginRequired()
78 @HasPermissionAllDecorator('hg.admin')
75 @HasPermissionAllDecorator('hg.admin')
79 @view_config(
80 route_name='admin_audit_log_entry', request_method='GET',
81 renderer='rhodecode:templates/admin/admin_audit_log_entry.mako')
82 def admin_audit_log_entry(self):
76 def admin_audit_log_entry(self):
83 c = self.load_default_context()
77 c = self.load_default_context()
84 audit_log_id = self.request.matchdict['audit_log_id']
78 audit_log_id = self.request.matchdict['audit_log_id']
@@ -23,7 +23,6 b' import logging'
23 import formencode
23 import formencode
24 import formencode.htmlfill
24 import formencode.htmlfill
25
25
26 from pyramid.view import view_config
27 from pyramid.httpexceptions import HTTPFound
26 from pyramid.httpexceptions import HTTPFound
28 from pyramid.renderers import render
27 from pyramid.renderers import render
29 from pyramid.response import Response
28 from pyramid.response import Response
@@ -41,17 +40,13 b' log = logging.getLogger(__name__)'
41
40
42
41
43 class AdminDefaultSettingsView(BaseAppView):
42 class AdminDefaultSettingsView(BaseAppView):
43
44 def load_default_context(self):
44 def load_default_context(self):
45 c = self._get_local_tmpl_context()
45 c = self._get_local_tmpl_context()
46
47
48 return c
46 return c
49
47
50 @LoginRequired()
48 @LoginRequired()
51 @HasPermissionAllDecorator('hg.admin')
49 @HasPermissionAllDecorator('hg.admin')
52 @view_config(
53 route_name='admin_defaults_repositories', request_method='GET',
54 renderer='rhodecode:templates/admin/defaults/defaults.mako')
55 def defaults_repository_show(self):
50 def defaults_repository_show(self):
56 c = self.load_default_context()
51 c = self.load_default_context()
57 c.backends = BACKENDS.keys()
52 c.backends = BACKENDS.keys()
@@ -72,9 +67,6 b' class AdminDefaultSettingsView(BaseAppVi'
72 @LoginRequired()
67 @LoginRequired()
73 @HasPermissionAllDecorator('hg.admin')
68 @HasPermissionAllDecorator('hg.admin')
74 @CSRFRequired()
69 @CSRFRequired()
75 @view_config(
76 route_name='admin_defaults_repositories_update', request_method='POST',
77 renderer='rhodecode:templates/admin/defaults/defaults.mako')
78 def defaults_repository_update(self):
70 def defaults_repository_update(self):
79 _ = self.request.translate
71 _ = self.request.translate
80 c = self.load_default_context()
72 c = self.load_default_context()
@@ -21,7 +21,6 b' import os'
21 import logging
21 import logging
22
22
23 from pyramid.httpexceptions import HTTPFound
23 from pyramid.httpexceptions import HTTPFound
24 from pyramid.view import view_config
25
24
26 from rhodecode.apps._base import BaseAppView
25 from rhodecode.apps._base import BaseAppView
27 from rhodecode.apps._base.navigation import navigation_list
26 from rhodecode.apps._base.navigation import navigation_list
@@ -99,9 +98,6 b' class ExceptionsTrackerView(BaseAppView)'
99
98
100 @LoginRequired()
99 @LoginRequired()
101 @HasPermissionAllDecorator('hg.admin')
100 @HasPermissionAllDecorator('hg.admin')
102 @view_config(
103 route_name='admin_settings_exception_tracker', request_method='GET',
104 renderer='rhodecode:templates/admin/settings/settings.mako')
105 def browse_exceptions(self):
101 def browse_exceptions(self):
106 _ = self.request.translate
102 _ = self.request.translate
107 c = self.load_default_context()
103 c = self.load_default_context()
@@ -117,9 +113,6 b' class ExceptionsTrackerView(BaseAppView)'
117
113
118 @LoginRequired()
114 @LoginRequired()
119 @HasPermissionAllDecorator('hg.admin')
115 @HasPermissionAllDecorator('hg.admin')
120 @view_config(
121 route_name='admin_settings_exception_tracker_show', request_method='GET',
122 renderer='rhodecode:templates/admin/settings/settings.mako')
123 def exception_show(self):
116 def exception_show(self):
124 _ = self.request.translate
117 _ = self.request.translate
125 c = self.load_default_context()
118 c = self.load_default_context()
@@ -132,9 +125,6 b' class ExceptionsTrackerView(BaseAppView)'
132 @LoginRequired()
125 @LoginRequired()
133 @HasPermissionAllDecorator('hg.admin')
126 @HasPermissionAllDecorator('hg.admin')
134 @CSRFRequired()
127 @CSRFRequired()
135 @view_config(
136 route_name='admin_settings_exception_tracker_delete_all', request_method='POST',
137 renderer='rhodecode:templates/admin/settings/settings.mako')
138 def exception_delete_all(self):
128 def exception_delete_all(self):
139 _ = self.request.translate
129 _ = self.request.translate
140 c = self.load_default_context()
130 c = self.load_default_context()
@@ -159,9 +149,6 b' class ExceptionsTrackerView(BaseAppView)'
159 @LoginRequired()
149 @LoginRequired()
160 @HasPermissionAllDecorator('hg.admin')
150 @HasPermissionAllDecorator('hg.admin')
161 @CSRFRequired()
151 @CSRFRequired()
162 @view_config(
163 route_name='admin_settings_exception_tracker_delete', request_method='POST',
164 renderer='rhodecode:templates/admin/settings/settings.mako')
165 def exception_delete(self):
152 def exception_delete(self):
166 _ = self.request.translate
153 _ = self.request.translate
167 c = self.load_default_context()
154 c = self.load_default_context()
@@ -21,7 +21,6 b''
21 import logging
21 import logging
22
22
23 from pyramid.httpexceptions import HTTPFound, HTTPNotFound
23 from pyramid.httpexceptions import HTTPFound, HTTPNotFound
24 from pyramid.view import view_config
25
24
26 from rhodecode.apps._base import BaseAppView
25 from rhodecode.apps._base import BaseAppView
27 from rhodecode.lib import helpers as h
26 from rhodecode.lib import helpers as h
@@ -39,9 +38,6 b' class AdminMainView(BaseAppView):'
39
38
40 @LoginRequired()
39 @LoginRequired()
41 @NotAnonymous()
40 @NotAnonymous()
42 @view_config(
43 route_name='admin_home', request_method='GET',
44 renderer='rhodecode:templates/admin/main.mako')
45 def admin_main(self):
41 def admin_main(self):
46 c = self.load_default_context()
42 c = self.load_default_context()
47 c.active = 'admin'
43 c.active = 'admin'
@@ -52,9 +48,6 b' class AdminMainView(BaseAppView):'
52 return self._get_template_context(c)
48 return self._get_template_context(c)
53
49
54 @LoginRequired()
50 @LoginRequired()
55 @view_config(route_name='pull_requests_global_0', request_method='GET')
56 @view_config(route_name='pull_requests_global_1', request_method='GET')
57 @view_config(route_name='pull_requests_global', request_method='GET')
58 def pull_requests(self):
51 def pull_requests(self):
59 """
52 """
60 Global redirect for Pull Requests
53 Global redirect for Pull Requests
@@ -21,8 +21,6 b''
21 import collections
21 import collections
22 import logging
22 import logging
23
23
24 from pyramid.view import view_config
25
26 from rhodecode.apps._base import BaseAppView
24 from rhodecode.apps._base import BaseAppView
27 from rhodecode.apps._base.navigation import navigation_list
25 from rhodecode.apps._base.navigation import navigation_list
28 from rhodecode.lib.auth import (LoginRequired, HasPermissionAllDecorator)
26 from rhodecode.lib.auth import (LoginRequired, HasPermissionAllDecorator)
@@ -39,9 +37,6 b' class OpenSourceLicensesAdminSettingsVie'
39
37
40 @LoginRequired()
38 @LoginRequired()
41 @HasPermissionAllDecorator('hg.admin')
39 @HasPermissionAllDecorator('hg.admin')
42 @view_config(
43 route_name='admin_settings_open_source', request_method='GET',
44 renderer='rhodecode:templates/admin/settings/settings.mako')
45 def open_source_licenses(self):
40 def open_source_licenses(self):
46 c = self.load_default_context()
41 c = self.load_default_context()
47 c.active = 'open_source'
42 c.active = 'open_source'
@@ -25,7 +25,6 b' import formencode.htmlfill'
25 import datetime
25 import datetime
26 from pyramid.interfaces import IRoutesMapper
26 from pyramid.interfaces import IRoutesMapper
27
27
28 from pyramid.view import view_config
29 from pyramid.httpexceptions import HTTPFound
28 from pyramid.httpexceptions import HTTPFound
30 from pyramid.renderers import render
29 from pyramid.renderers import render
31 from pyramid.response import Response
30 from pyramid.response import Response
@@ -59,9 +58,6 b' class AdminPermissionsView(BaseAppView, '
59
58
60 @LoginRequired()
59 @LoginRequired()
61 @HasPermissionAllDecorator('hg.admin')
60 @HasPermissionAllDecorator('hg.admin')
62 @view_config(
63 route_name='admin_permissions_application', request_method='GET',
64 renderer='rhodecode:templates/admin/permissions/permissions.mako')
65 def permissions_application(self):
61 def permissions_application(self):
66 c = self.load_default_context()
62 c = self.load_default_context()
67 c.active = 'application'
63 c.active = 'application'
@@ -90,9 +86,6 b' class AdminPermissionsView(BaseAppView, '
90 @LoginRequired()
86 @LoginRequired()
91 @HasPermissionAllDecorator('hg.admin')
87 @HasPermissionAllDecorator('hg.admin')
92 @CSRFRequired()
88 @CSRFRequired()
93 @view_config(
94 route_name='admin_permissions_application_update', request_method='POST',
95 renderer='rhodecode:templates/admin/permissions/permissions.mako')
96 def permissions_application_update(self):
89 def permissions_application_update(self):
97 _ = self.request.translate
90 _ = self.request.translate
98 c = self.load_default_context()
91 c = self.load_default_context()
@@ -149,9 +142,6 b' class AdminPermissionsView(BaseAppView, '
149
142
150 @LoginRequired()
143 @LoginRequired()
151 @HasPermissionAllDecorator('hg.admin')
144 @HasPermissionAllDecorator('hg.admin')
152 @view_config(
153 route_name='admin_permissions_object', request_method='GET',
154 renderer='rhodecode:templates/admin/permissions/permissions.mako')
155 def permissions_objects(self):
145 def permissions_objects(self):
156 c = self.load_default_context()
146 c = self.load_default_context()
157 c.active = 'objects'
147 c.active = 'objects'
@@ -174,9 +164,6 b' class AdminPermissionsView(BaseAppView, '
174 @LoginRequired()
164 @LoginRequired()
175 @HasPermissionAllDecorator('hg.admin')
165 @HasPermissionAllDecorator('hg.admin')
176 @CSRFRequired()
166 @CSRFRequired()
177 @view_config(
178 route_name='admin_permissions_object_update', request_method='POST',
179 renderer='rhodecode:templates/admin/permissions/permissions.mako')
180 def permissions_objects_update(self):
167 def permissions_objects_update(self):
181 _ = self.request.translate
168 _ = self.request.translate
182 c = self.load_default_context()
169 c = self.load_default_context()
@@ -225,9 +212,6 b' class AdminPermissionsView(BaseAppView, '
225
212
226 @LoginRequired()
213 @LoginRequired()
227 @HasPermissionAllDecorator('hg.admin')
214 @HasPermissionAllDecorator('hg.admin')
228 @view_config(
229 route_name='admin_permissions_branch', request_method='GET',
230 renderer='rhodecode:templates/admin/permissions/permissions.mako')
231 def permissions_branch(self):
215 def permissions_branch(self):
232 c = self.load_default_context()
216 c = self.load_default_context()
233 c.active = 'branch'
217 c.active = 'branch'
@@ -249,9 +233,6 b' class AdminPermissionsView(BaseAppView, '
249
233
250 @LoginRequired()
234 @LoginRequired()
251 @HasPermissionAllDecorator('hg.admin')
235 @HasPermissionAllDecorator('hg.admin')
252 @view_config(
253 route_name='admin_permissions_global', request_method='GET',
254 renderer='rhodecode:templates/admin/permissions/permissions.mako')
255 def permissions_global(self):
236 def permissions_global(self):
256 c = self.load_default_context()
237 c = self.load_default_context()
257 c.active = 'global'
238 c.active = 'global'
@@ -274,9 +255,6 b' class AdminPermissionsView(BaseAppView, '
274 @LoginRequired()
255 @LoginRequired()
275 @HasPermissionAllDecorator('hg.admin')
256 @HasPermissionAllDecorator('hg.admin')
276 @CSRFRequired()
257 @CSRFRequired()
277 @view_config(
278 route_name='admin_permissions_global_update', request_method='POST',
279 renderer='rhodecode:templates/admin/permissions/permissions.mako')
280 def permissions_global_update(self):
258 def permissions_global_update(self):
281 _ = self.request.translate
259 _ = self.request.translate
282 c = self.load_default_context()
260 c = self.load_default_context()
@@ -327,9 +305,6 b' class AdminPermissionsView(BaseAppView, '
327
305
328 @LoginRequired()
306 @LoginRequired()
329 @HasPermissionAllDecorator('hg.admin')
307 @HasPermissionAllDecorator('hg.admin')
330 @view_config(
331 route_name='admin_permissions_ips', request_method='GET',
332 renderer='rhodecode:templates/admin/permissions/permissions.mako')
333 def permissions_ips(self):
308 def permissions_ips(self):
334 c = self.load_default_context()
309 c = self.load_default_context()
335 c.active = 'ips'
310 c.active = 'ips'
@@ -342,9 +317,6 b' class AdminPermissionsView(BaseAppView, '
342
317
343 @LoginRequired()
318 @LoginRequired()
344 @HasPermissionAllDecorator('hg.admin')
319 @HasPermissionAllDecorator('hg.admin')
345 @view_config(
346 route_name='admin_permissions_overview', request_method='GET',
347 renderer='rhodecode:templates/admin/permissions/permissions.mako')
348 def permissions_overview(self):
320 def permissions_overview(self):
349 c = self.load_default_context()
321 c = self.load_default_context()
350 c.active = 'perms'
322 c.active = 'perms'
@@ -355,9 +327,6 b' class AdminPermissionsView(BaseAppView, '
355
327
356 @LoginRequired()
328 @LoginRequired()
357 @HasPermissionAllDecorator('hg.admin')
329 @HasPermissionAllDecorator('hg.admin')
358 @view_config(
359 route_name='admin_permissions_auth_token_access', request_method='GET',
360 renderer='rhodecode:templates/admin/permissions/permissions.mako')
361 def auth_token_access(self):
330 def auth_token_access(self):
362 from rhodecode import CONFIG
331 from rhodecode import CONFIG
363
332
@@ -415,9 +384,6 b' class AdminPermissionsView(BaseAppView, '
415
384
416 @LoginRequired()
385 @LoginRequired()
417 @HasPermissionAllDecorator('hg.admin')
386 @HasPermissionAllDecorator('hg.admin')
418 @view_config(
419 route_name='admin_permissions_ssh_keys', request_method='GET',
420 renderer='rhodecode:templates/admin/permissions/permissions.mako')
421 def ssh_keys(self):
387 def ssh_keys(self):
422 c = self.load_default_context()
388 c = self.load_default_context()
423 c.active = 'ssh_keys'
389 c.active = 'ssh_keys'
@@ -426,9 +392,6 b' class AdminPermissionsView(BaseAppView, '
426
392
427 @LoginRequired()
393 @LoginRequired()
428 @HasPermissionAllDecorator('hg.admin')
394 @HasPermissionAllDecorator('hg.admin')
429 @view_config(
430 route_name='admin_permissions_ssh_keys_data', request_method='GET',
431 renderer='json_ext', xhr=True)
432 def ssh_keys_data(self):
395 def ssh_keys_data(self):
433 _ = self.request.translate
396 _ = self.request.translate
434 self.load_default_context()
397 self.load_default_context()
@@ -498,9 +461,6 b' class AdminPermissionsView(BaseAppView, '
498 @LoginRequired()
461 @LoginRequired()
499 @HasPermissionAllDecorator('hg.admin')
462 @HasPermissionAllDecorator('hg.admin')
500 @CSRFRequired()
463 @CSRFRequired()
501 @view_config(
502 route_name='admin_permissions_ssh_keys_update', request_method='POST',
503 renderer='rhodecode:templates/admin/permissions/permissions.mako')
504 def ssh_keys_update(self):
464 def ssh_keys_update(self):
505 _ = self.request.translate
465 _ = self.request.translate
506 self.load_default_context()
466 self.load_default_context()
@@ -22,7 +22,7 b' import logging'
22
22
23 import psutil
23 import psutil
24 import signal
24 import signal
25 from pyramid.view import view_config
25
26
26
27 from rhodecode.apps._base import BaseAppView
27 from rhodecode.apps._base import BaseAppView
28 from rhodecode.apps._base.navigation import navigation_list
28 from rhodecode.apps._base.navigation import navigation_list
@@ -84,9 +84,6 b' class AdminProcessManagementView(BaseApp'
84
84
85 @LoginRequired()
85 @LoginRequired()
86 @HasPermissionAllDecorator('hg.admin')
86 @HasPermissionAllDecorator('hg.admin')
87 @view_config(
88 route_name='admin_settings_process_management', request_method='GET',
89 renderer='rhodecode:templates/admin/settings/settings.mako')
90 def process_management(self):
87 def process_management(self):
91 _ = self.request.translate
88 _ = self.request.translate
92 c = self.load_default_context()
89 c = self.load_default_context()
@@ -99,9 +96,6 b' class AdminProcessManagementView(BaseApp'
99
96
100 @LoginRequired()
97 @LoginRequired()
101 @HasPermissionAllDecorator('hg.admin')
98 @HasPermissionAllDecorator('hg.admin')
102 @view_config(
103 route_name='admin_settings_process_management_data', request_method='GET',
104 renderer='rhodecode:templates/admin/settings/settings_process_management_data.mako')
105 def process_management_data(self):
99 def process_management_data(self):
106 _ = self.request.translate
100 _ = self.request.translate
107 c = self.load_default_context()
101 c = self.load_default_context()
@@ -111,9 +105,6 b' class AdminProcessManagementView(BaseApp'
111 @LoginRequired()
105 @LoginRequired()
112 @HasPermissionAllDecorator('hg.admin')
106 @HasPermissionAllDecorator('hg.admin')
113 @CSRFRequired()
107 @CSRFRequired()
114 @view_config(
115 route_name='admin_settings_process_management_signal',
116 request_method='POST', renderer='json_ext')
117 def process_management_signal(self):
108 def process_management_signal(self):
118 pids = self.request.json.get('pids', [])
109 pids = self.request.json.get('pids', [])
119 result = []
110 result = []
@@ -155,9 +146,6 b' class AdminProcessManagementView(BaseApp'
155 @LoginRequired()
146 @LoginRequired()
156 @HasPermissionAllDecorator('hg.admin')
147 @HasPermissionAllDecorator('hg.admin')
157 @CSRFRequired()
148 @CSRFRequired()
158 @view_config(
159 route_name='admin_settings_process_management_master_signal',
160 request_method='POST', renderer='json_ext')
161 def process_management_master_signal(self):
149 def process_management_master_signal(self):
162 pid_data = self.request.json.get('pid_data', {})
150 pid_data = self.request.json.get('pid_data', {})
163 pid = safe_int(pid_data['pid'])
151 pid = safe_int(pid_data['pid'])
@@ -25,7 +25,7 b' import formencode'
25 import formencode.htmlfill
25 import formencode.htmlfill
26
26
27 from pyramid.httpexceptions import HTTPFound, HTTPForbidden
27 from pyramid.httpexceptions import HTTPFound, HTTPForbidden
28 from pyramid.view import view_config
28
29 from pyramid.renderers import render
29 from pyramid.renderers import render
30 from pyramid.response import Response
30 from pyramid.response import Response
31
31
@@ -96,9 +96,6 b' class AdminRepoGroupsView(BaseAppView, D'
96 # `repo_group_list_data` via RepoGroupList
96 # `repo_group_list_data` via RepoGroupList
97 @LoginRequired()
97 @LoginRequired()
98 @NotAnonymous()
98 @NotAnonymous()
99 @view_config(
100 route_name='repo_groups', request_method='GET',
101 renderer='rhodecode:templates/admin/repo_groups/repo_groups.mako')
102 def repo_group_list(self):
99 def repo_group_list(self):
103 c = self.load_default_context()
100 c = self.load_default_context()
104 return self._get_template_context(c)
101 return self._get_template_context(c)
@@ -106,9 +103,6 b' class AdminRepoGroupsView(BaseAppView, D'
106 # permission check inside
103 # permission check inside
107 @LoginRequired()
104 @LoginRequired()
108 @NotAnonymous()
105 @NotAnonymous()
109 @view_config(
110 route_name='repo_groups_data', request_method='GET',
111 renderer='json_ext', xhr=True)
112 def repo_group_list_data(self):
106 def repo_group_list_data(self):
113 self.load_default_context()
107 self.load_default_context()
114 column_map = {
108 column_map = {
@@ -254,9 +248,6 b' class AdminRepoGroupsView(BaseAppView, D'
254 @LoginRequired()
248 @LoginRequired()
255 @NotAnonymous()
249 @NotAnonymous()
256 # perm checks inside
250 # perm checks inside
257 @view_config(
258 route_name='repo_group_new', request_method='GET',
259 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
260 def repo_group_new(self):
251 def repo_group_new(self):
261 c = self.load_default_context()
252 c = self.load_default_context()
262
253
@@ -296,9 +287,6 b' class AdminRepoGroupsView(BaseAppView, D'
296 @NotAnonymous()
287 @NotAnonymous()
297 @CSRFRequired()
288 @CSRFRequired()
298 # perm checks inside
289 # perm checks inside
299 @view_config(
300 route_name='repo_group_create', request_method='POST',
301 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
302 def repo_group_create(self):
290 def repo_group_create(self):
303 c = self.load_default_context()
291 c = self.load_default_context()
304 _ = self.request.translate
292 _ = self.request.translate
@@ -23,7 +23,7 b' import formencode'
23 import formencode.htmlfill
23 import formencode.htmlfill
24
24
25 from pyramid.httpexceptions import HTTPFound, HTTPForbidden
25 from pyramid.httpexceptions import HTTPFound, HTTPForbidden
26 from pyramid.view import view_config
26
27 from pyramid.renderers import render
27 from pyramid.renderers import render
28 from pyramid.response import Response
28 from pyramid.response import Response
29
29
@@ -52,7 +52,6 b' class AdminReposView(BaseAppView, DataGr'
52
52
53 def load_default_context(self):
53 def load_default_context(self):
54 c = self._get_local_tmpl_context()
54 c = self._get_local_tmpl_context()
55
56 return c
55 return c
57
56
58 def _load_form_data(self, c):
57 def _load_form_data(self, c):
@@ -65,9 +64,6 b' class AdminReposView(BaseAppView, DataGr'
65 @LoginRequired()
64 @LoginRequired()
66 @NotAnonymous()
65 @NotAnonymous()
67 # perms check inside
66 # perms check inside
68 @view_config(
69 route_name='repos', request_method='GET',
70 renderer='rhodecode:templates/admin/repos/repos.mako')
71 def repository_list(self):
67 def repository_list(self):
72 c = self.load_default_context()
68 c = self.load_default_context()
73 return self._get_template_context(c)
69 return self._get_template_context(c)
@@ -75,9 +71,6 b' class AdminReposView(BaseAppView, DataGr'
75 @LoginRequired()
71 @LoginRequired()
76 @NotAnonymous()
72 @NotAnonymous()
77 # perms check inside
73 # perms check inside
78 @view_config(
79 route_name='repos_data', request_method='GET',
80 renderer='json_ext', xhr=True)
81 def repository_list_data(self):
74 def repository_list_data(self):
82 self.load_default_context()
75 self.load_default_context()
83 column_map = {
76 column_map = {
@@ -162,9 +155,6 b' class AdminReposView(BaseAppView, DataGr'
162 @LoginRequired()
155 @LoginRequired()
163 @NotAnonymous()
156 @NotAnonymous()
164 # perms check inside
157 # perms check inside
165 @view_config(
166 route_name='repo_new', request_method='GET',
167 renderer='rhodecode:templates/admin/repos/repo_add.mako')
168 def repository_new(self):
158 def repository_new(self):
169 c = self.load_default_context()
159 c = self.load_default_context()
170
160
@@ -216,9 +206,6 b' class AdminReposView(BaseAppView, DataGr'
216 @NotAnonymous()
206 @NotAnonymous()
217 @CSRFRequired()
207 @CSRFRequired()
218 # perms check inside
208 # perms check inside
219 @view_config(
220 route_name='repo_create', request_method='POST',
221 renderer='rhodecode:templates/admin/repos/repos.mako')
222 def repository_create(self):
209 def repository_create(self):
223 c = self.load_default_context()
210 c = self.load_default_context()
224
211
@@ -20,7 +20,7 b''
20
20
21 import logging
21 import logging
22
22
23 from pyramid.view import view_config
23
24 from pyramid.httpexceptions import HTTPFound
24 from pyramid.httpexceptions import HTTPFound
25
25
26 from rhodecode.apps._base import BaseAppView
26 from rhodecode.apps._base import BaseAppView
@@ -37,17 +37,13 b' log = logging.getLogger(__name__)'
37
37
38
38
39 class AdminSessionSettingsView(BaseAppView):
39 class AdminSessionSettingsView(BaseAppView):
40
40 def load_default_context(self):
41 def load_default_context(self):
41 c = self._get_local_tmpl_context()
42 c = self._get_local_tmpl_context()
42
43
44 return c
43 return c
45
44
46 @LoginRequired()
45 @LoginRequired()
47 @HasPermissionAllDecorator('hg.admin')
46 @HasPermissionAllDecorator('hg.admin')
48 @view_config(
49 route_name='admin_settings_sessions', request_method='GET',
50 renderer='rhodecode:templates/admin/settings/settings.mako')
51 def settings_sessions(self):
47 def settings_sessions(self):
52 c = self.load_default_context()
48 c = self.load_default_context()
53
49
@@ -71,8 +67,6 b' class AdminSessionSettingsView(BaseAppVi'
71 @LoginRequired()
67 @LoginRequired()
72 @HasPermissionAllDecorator('hg.admin')
68 @HasPermissionAllDecorator('hg.admin')
73 @CSRFRequired()
69 @CSRFRequired()
74 @view_config(
75 route_name='admin_settings_sessions_cleanup', request_method='POST')
76 def settings_sessions_cleanup(self):
70 def settings_sessions_cleanup(self):
77 _ = self.request.translate
71 _ = self.request.translate
78 expire_days = safe_int(self.request.params.get('expire_days'))
72 expire_days = safe_int(self.request.params.get('expire_days'))
@@ -27,7 +27,7 b' import formencode'
27 import formencode.htmlfill
27 import formencode.htmlfill
28
28
29 import rhodecode
29 import rhodecode
30 from pyramid.view import view_config
30
31 from pyramid.httpexceptions import HTTPFound, HTTPNotFound
31 from pyramid.httpexceptions import HTTPFound, HTTPNotFound
32 from pyramid.renderers import render
32 from pyramid.renderers import render
33 from pyramid.response import Response
33 from pyramid.response import Response
@@ -68,7 +68,6 b' class AdminSettingsView(BaseAppView):'
68 c.labs_active = str2bool(
68 c.labs_active = str2bool(
69 rhodecode.CONFIG.get('labs_settings_active', 'true'))
69 rhodecode.CONFIG.get('labs_settings_active', 'true'))
70 c.navlist = navigation_list(self.request)
70 c.navlist = navigation_list(self.request)
71
72 return c
71 return c
73
72
74 @classmethod
73 @classmethod
@@ -109,9 +108,6 b' class AdminSettingsView(BaseAppView):'
109
108
110 @LoginRequired()
109 @LoginRequired()
111 @HasPermissionAllDecorator('hg.admin')
110 @HasPermissionAllDecorator('hg.admin')
112 @view_config(
113 route_name='admin_settings_vcs', request_method='GET',
114 renderer='rhodecode:templates/admin/settings/settings.mako')
115 def settings_vcs(self):
111 def settings_vcs(self):
116 c = self.load_default_context()
112 c = self.load_default_context()
117 c.active = 'vcs'
113 c.active = 'vcs'
@@ -139,9 +135,6 b' class AdminSettingsView(BaseAppView):'
139 @LoginRequired()
135 @LoginRequired()
140 @HasPermissionAllDecorator('hg.admin')
136 @HasPermissionAllDecorator('hg.admin')
141 @CSRFRequired()
137 @CSRFRequired()
142 @view_config(
143 route_name='admin_settings_vcs_update', request_method='POST',
144 renderer='rhodecode:templates/admin/settings/settings.mako')
145 def settings_vcs_update(self):
138 def settings_vcs_update(self):
146 _ = self.request.translate
139 _ = self.request.translate
147 c = self.load_default_context()
140 c = self.load_default_context()
@@ -207,9 +200,6 b' class AdminSettingsView(BaseAppView):'
207 @LoginRequired()
200 @LoginRequired()
208 @HasPermissionAllDecorator('hg.admin')
201 @HasPermissionAllDecorator('hg.admin')
209 @CSRFRequired()
202 @CSRFRequired()
210 @view_config(
211 route_name='admin_settings_vcs_svn_pattern_delete', request_method='POST',
212 renderer='json_ext', xhr=True)
213 def settings_vcs_delete_svn_pattern(self):
203 def settings_vcs_delete_svn_pattern(self):
214 delete_pattern_id = self.request.POST.get('delete_svn_pattern')
204 delete_pattern_id = self.request.POST.get('delete_svn_pattern')
215 model = VcsSettingsModel()
205 model = VcsSettingsModel()
@@ -225,9 +215,6 b' class AdminSettingsView(BaseAppView):'
225
215
226 @LoginRequired()
216 @LoginRequired()
227 @HasPermissionAllDecorator('hg.admin')
217 @HasPermissionAllDecorator('hg.admin')
228 @view_config(
229 route_name='admin_settings_mapping', request_method='GET',
230 renderer='rhodecode:templates/admin/settings/settings.mako')
231 def settings_mapping(self):
218 def settings_mapping(self):
232 c = self.load_default_context()
219 c = self.load_default_context()
233 c.active = 'mapping'
220 c.active = 'mapping'
@@ -245,9 +232,6 b' class AdminSettingsView(BaseAppView):'
245 @LoginRequired()
232 @LoginRequired()
246 @HasPermissionAllDecorator('hg.admin')
233 @HasPermissionAllDecorator('hg.admin')
247 @CSRFRequired()
234 @CSRFRequired()
248 @view_config(
249 route_name='admin_settings_mapping_update', request_method='POST',
250 renderer='rhodecode:templates/admin/settings/settings.mako')
251 def settings_mapping_update(self):
235 def settings_mapping_update(self):
252 _ = self.request.translate
236 _ = self.request.translate
253 c = self.load_default_context()
237 c = self.load_default_context()
@@ -274,12 +258,6 b' class AdminSettingsView(BaseAppView):'
274
258
275 @LoginRequired()
259 @LoginRequired()
276 @HasPermissionAllDecorator('hg.admin')
260 @HasPermissionAllDecorator('hg.admin')
277 @view_config(
278 route_name='admin_settings', request_method='GET',
279 renderer='rhodecode:templates/admin/settings/settings.mako')
280 @view_config(
281 route_name='admin_settings_global', request_method='GET',
282 renderer='rhodecode:templates/admin/settings/settings.mako')
283 def settings_global(self):
261 def settings_global(self):
284 c = self.load_default_context()
262 c = self.load_default_context()
285 c.active = 'global'
263 c.active = 'global'
@@ -299,12 +277,6 b' class AdminSettingsView(BaseAppView):'
299 @LoginRequired()
277 @LoginRequired()
300 @HasPermissionAllDecorator('hg.admin')
278 @HasPermissionAllDecorator('hg.admin')
301 @CSRFRequired()
279 @CSRFRequired()
302 @view_config(
303 route_name='admin_settings_update', request_method='POST',
304 renderer='rhodecode:templates/admin/settings/settings.mako')
305 @view_config(
306 route_name='admin_settings_global_update', request_method='POST',
307 renderer='rhodecode:templates/admin/settings/settings.mako')
308 def settings_global_update(self):
280 def settings_global_update(self):
309 _ = self.request.translate
281 _ = self.request.translate
310 c = self.load_default_context()
282 c = self.load_default_context()
@@ -359,9 +331,6 b' class AdminSettingsView(BaseAppView):'
359
331
360 @LoginRequired()
332 @LoginRequired()
361 @HasPermissionAllDecorator('hg.admin')
333 @HasPermissionAllDecorator('hg.admin')
362 @view_config(
363 route_name='admin_settings_visual', request_method='GET',
364 renderer='rhodecode:templates/admin/settings/settings.mako')
365 def settings_visual(self):
334 def settings_visual(self):
366 c = self.load_default_context()
335 c = self.load_default_context()
367 c.active = 'visual'
336 c.active = 'visual'
@@ -379,9 +348,6 b' class AdminSettingsView(BaseAppView):'
379 @LoginRequired()
348 @LoginRequired()
380 @HasPermissionAllDecorator('hg.admin')
349 @HasPermissionAllDecorator('hg.admin')
381 @CSRFRequired()
350 @CSRFRequired()
382 @view_config(
383 route_name='admin_settings_visual_update', request_method='POST',
384 renderer='rhodecode:templates/admin/settings/settings.mako')
385 def settings_visual_update(self):
351 def settings_visual_update(self):
386 _ = self.request.translate
352 _ = self.request.translate
387 c = self.load_default_context()
353 c = self.load_default_context()
@@ -441,9 +407,6 b' class AdminSettingsView(BaseAppView):'
441
407
442 @LoginRequired()
408 @LoginRequired()
443 @HasPermissionAllDecorator('hg.admin')
409 @HasPermissionAllDecorator('hg.admin')
444 @view_config(
445 route_name='admin_settings_issuetracker', request_method='GET',
446 renderer='rhodecode:templates/admin/settings/settings.mako')
447 def settings_issuetracker(self):
410 def settings_issuetracker(self):
448 c = self.load_default_context()
411 c = self.load_default_context()
449 c.active = 'issuetracker'
412 c.active = 'issuetracker'
@@ -470,9 +433,6 b' class AdminSettingsView(BaseAppView):'
470 @LoginRequired()
433 @LoginRequired()
471 @HasPermissionAllDecorator('hg.admin')
434 @HasPermissionAllDecorator('hg.admin')
472 @CSRFRequired()
435 @CSRFRequired()
473 @view_config(
474 route_name='admin_settings_issuetracker_test', request_method='POST',
475 renderer='string', xhr=True)
476 def settings_issuetracker_test(self):
436 def settings_issuetracker_test(self):
477 error_container = []
437 error_container = []
478
438
@@ -490,9 +450,6 b' class AdminSettingsView(BaseAppView):'
490 @LoginRequired()
450 @LoginRequired()
491 @HasPermissionAllDecorator('hg.admin')
451 @HasPermissionAllDecorator('hg.admin')
492 @CSRFRequired()
452 @CSRFRequired()
493 @view_config(
494 route_name='admin_settings_issuetracker_update', request_method='POST',
495 renderer='rhodecode:templates/admin/settings/settings.mako')
496 def settings_issuetracker_update(self):
453 def settings_issuetracker_update(self):
497 _ = self.request.translate
454 _ = self.request.translate
498 self.load_default_context()
455 self.load_default_context()
@@ -527,9 +484,6 b' class AdminSettingsView(BaseAppView):'
527 @LoginRequired()
484 @LoginRequired()
528 @HasPermissionAllDecorator('hg.admin')
485 @HasPermissionAllDecorator('hg.admin')
529 @CSRFRequired()
486 @CSRFRequired()
530 @view_config(
531 route_name='admin_settings_issuetracker_delete', request_method='POST',
532 renderer='json_ext', xhr=True)
533 def settings_issuetracker_delete(self):
487 def settings_issuetracker_delete(self):
534 _ = self.request.translate
488 _ = self.request.translate
535 self.load_default_context()
489 self.load_default_context()
@@ -547,9 +501,6 b' class AdminSettingsView(BaseAppView):'
547
501
548 @LoginRequired()
502 @LoginRequired()
549 @HasPermissionAllDecorator('hg.admin')
503 @HasPermissionAllDecorator('hg.admin')
550 @view_config(
551 route_name='admin_settings_email', request_method='GET',
552 renderer='rhodecode:templates/admin/settings/settings.mako')
553 def settings_email(self):
504 def settings_email(self):
554 c = self.load_default_context()
505 c = self.load_default_context()
555 c.active = 'email'
506 c.active = 'email'
@@ -568,9 +519,6 b' class AdminSettingsView(BaseAppView):'
568 @LoginRequired()
519 @LoginRequired()
569 @HasPermissionAllDecorator('hg.admin')
520 @HasPermissionAllDecorator('hg.admin')
570 @CSRFRequired()
521 @CSRFRequired()
571 @view_config(
572 route_name='admin_settings_email_update', request_method='POST',
573 renderer='rhodecode:templates/admin/settings/settings.mako')
574 def settings_email_update(self):
522 def settings_email_update(self):
575 _ = self.request.translate
523 _ = self.request.translate
576 c = self.load_default_context()
524 c = self.load_default_context()
@@ -600,9 +548,6 b' class AdminSettingsView(BaseAppView):'
600
548
601 @LoginRequired()
549 @LoginRequired()
602 @HasPermissionAllDecorator('hg.admin')
550 @HasPermissionAllDecorator('hg.admin')
603 @view_config(
604 route_name='admin_settings_hooks', request_method='GET',
605 renderer='rhodecode:templates/admin/settings/settings.mako')
606 def settings_hooks(self):
551 def settings_hooks(self):
607 c = self.load_default_context()
552 c = self.load_default_context()
608 c.active = 'hooks'
553 c.active = 'hooks'
@@ -624,12 +569,6 b' class AdminSettingsView(BaseAppView):'
624 @LoginRequired()
569 @LoginRequired()
625 @HasPermissionAllDecorator('hg.admin')
570 @HasPermissionAllDecorator('hg.admin')
626 @CSRFRequired()
571 @CSRFRequired()
627 @view_config(
628 route_name='admin_settings_hooks_update', request_method='POST',
629 renderer='rhodecode:templates/admin/settings/settings.mako')
630 @view_config(
631 route_name='admin_settings_hooks_delete', request_method='POST',
632 renderer='rhodecode:templates/admin/settings/settings.mako')
633 def settings_hooks_update(self):
572 def settings_hooks_update(self):
634 _ = self.request.translate
573 _ = self.request.translate
635 c = self.load_default_context()
574 c = self.load_default_context()
@@ -671,9 +610,6 b' class AdminSettingsView(BaseAppView):'
671
610
672 @LoginRequired()
611 @LoginRequired()
673 @HasPermissionAllDecorator('hg.admin')
612 @HasPermissionAllDecorator('hg.admin')
674 @view_config(
675 route_name='admin_settings_search', request_method='GET',
676 renderer='rhodecode:templates/admin/settings/settings.mako')
677 def settings_search(self):
613 def settings_search(self):
678 c = self.load_default_context()
614 c = self.load_default_context()
679 c.active = 'search'
615 c.active = 'search'
@@ -685,9 +621,6 b' class AdminSettingsView(BaseAppView):'
685
621
686 @LoginRequired()
622 @LoginRequired()
687 @HasPermissionAllDecorator('hg.admin')
623 @HasPermissionAllDecorator('hg.admin')
688 @view_config(
689 route_name='admin_settings_automation', request_method='GET',
690 renderer='rhodecode:templates/admin/settings/settings.mako')
691 def settings_automation(self):
624 def settings_automation(self):
692 c = self.load_default_context()
625 c = self.load_default_context()
693 c.active = 'automation'
626 c.active = 'automation'
@@ -696,9 +629,6 b' class AdminSettingsView(BaseAppView):'
696
629
697 @LoginRequired()
630 @LoginRequired()
698 @HasPermissionAllDecorator('hg.admin')
631 @HasPermissionAllDecorator('hg.admin')
699 @view_config(
700 route_name='admin_settings_labs', request_method='GET',
701 renderer='rhodecode:templates/admin/settings/settings.mako')
702 def settings_labs(self):
632 def settings_labs(self):
703 c = self.load_default_context()
633 c = self.load_default_context()
704 if not c.labs_active:
634 if not c.labs_active:
@@ -720,9 +650,6 b' class AdminSettingsView(BaseAppView):'
720 @LoginRequired()
650 @LoginRequired()
721 @HasPermissionAllDecorator('hg.admin')
651 @HasPermissionAllDecorator('hg.admin')
722 @CSRFRequired()
652 @CSRFRequired()
723 @view_config(
724 route_name='admin_settings_labs_update', request_method='POST',
725 renderer='rhodecode:templates/admin/settings/settings.mako')
726 def settings_labs_update(self):
653 def settings_labs_update(self):
727 _ = self.request.translate
654 _ = self.request.translate
728 c = self.load_default_context()
655 c = self.load_default_context()
@@ -20,7 +20,7 b''
20
20
21 import logging
21 import logging
22
22
23 from pyramid.view import view_config
23
24
24
25 from rhodecode.apps._base import BaseAppView
25 from rhodecode.apps._base import BaseAppView
26 from rhodecode.apps.svn_support.utils import generate_mod_dav_svn_config
26 from rhodecode.apps.svn_support.utils import generate_mod_dav_svn_config
@@ -30,14 +30,11 b' from rhodecode.lib.auth import ('
30 log = logging.getLogger(__name__)
30 log = logging.getLogger(__name__)
31
31
32
32
33 class SvnConfigAdminSettingsView(BaseAppView):
33 class AdminSvnConfigView(BaseAppView):
34
34
35 @LoginRequired()
35 @LoginRequired()
36 @HasPermissionAllDecorator('hg.admin')
36 @HasPermissionAllDecorator('hg.admin')
37 @CSRFRequired()
37 @CSRFRequired()
38 @view_config(
39 route_name='admin_settings_vcs_svn_generate_cfg',
40 request_method='POST', renderer='json')
41 def vcs_svn_generate_config(self):
38 def vcs_svn_generate_config(self):
42 _ = self.request.translate
39 _ = self.request.translate
43 try:
40 try:
@@ -21,7 +21,7 b''
21 import logging
21 import logging
22 import urllib2
22 import urllib2
23
23
24 from pyramid.view import view_config
24
25
25
26 import rhodecode
26 import rhodecode
27 from rhodecode.apps._base import BaseAppView
27 from rhodecode.apps._base import BaseAppView
@@ -42,9 +42,6 b' class AdminSystemInfoSettingsView(BaseAp'
42
42
43 @LoginRequired()
43 @LoginRequired()
44 @HasPermissionAllDecorator('hg.admin')
44 @HasPermissionAllDecorator('hg.admin')
45 @view_config(
46 route_name='admin_settings_system', request_method='GET',
47 renderer='rhodecode:templates/admin/settings/settings.mako')
48 def settings_system_info(self):
45 def settings_system_info(self):
49 _ = self.request.translate
46 _ = self.request.translate
50 c = self.load_default_context()
47 c = self.load_default_context()
@@ -169,9 +166,6 b' class AdminSystemInfoSettingsView(BaseAp'
169
166
170 @LoginRequired()
167 @LoginRequired()
171 @HasPermissionAllDecorator('hg.admin')
168 @HasPermissionAllDecorator('hg.admin')
172 @view_config(
173 route_name='admin_settings_system_update', request_method='GET',
174 renderer='rhodecode:templates/admin/settings/settings_system_update.mako')
175 def settings_system_info_check_update(self):
169 def settings_system_info_check_update(self):
176 _ = self.request.translate
170 _ = self.request.translate
177 c = self.load_default_context()
171 c = self.load_default_context()
@@ -24,7 +24,7 b' import formencode'
24 import formencode.htmlfill
24 import formencode.htmlfill
25
25
26 from pyramid.httpexceptions import HTTPFound
26 from pyramid.httpexceptions import HTTPFound
27 from pyramid.view import view_config
27
28 from pyramid.response import Response
28 from pyramid.response import Response
29 from pyramid.renderers import render
29 from pyramid.renderers import render
30
30
@@ -51,19 +51,14 b' class AdminUserGroupsView(BaseAppView, D'
51
51
52 def load_default_context(self):
52 def load_default_context(self):
53 c = self._get_local_tmpl_context()
53 c = self._get_local_tmpl_context()
54
55 PermissionModel().set_global_permission_choices(
54 PermissionModel().set_global_permission_choices(
56 c, gettext_translator=self.request.translate)
55 c, gettext_translator=self.request.translate)
57
58 return c
56 return c
59
57
60 # permission check in data loading of
58 # permission check in data loading of
61 # `user_groups_list_data` via UserGroupList
59 # `user_groups_list_data` via UserGroupList
62 @LoginRequired()
60 @LoginRequired()
63 @NotAnonymous()
61 @NotAnonymous()
64 @view_config(
65 route_name='user_groups', request_method='GET',
66 renderer='rhodecode:templates/admin/user_groups/user_groups.mako')
67 def user_groups_list(self):
62 def user_groups_list(self):
68 c = self.load_default_context()
63 c = self.load_default_context()
69 return self._get_template_context(c)
64 return self._get_template_context(c)
@@ -71,9 +66,6 b' class AdminUserGroupsView(BaseAppView, D'
71 # permission check inside
66 # permission check inside
72 @LoginRequired()
67 @LoginRequired()
73 @NotAnonymous()
68 @NotAnonymous()
74 @view_config(
75 route_name='user_groups_data', request_method='GET',
76 renderer='json_ext', xhr=True)
77 def user_groups_list_data(self):
69 def user_groups_list_data(self):
78 self.load_default_context()
70 self.load_default_context()
79 column_map = {
71 column_map = {
@@ -197,9 +189,6 b' class AdminUserGroupsView(BaseAppView, D'
197
189
198 @LoginRequired()
190 @LoginRequired()
199 @HasPermissionAnyDecorator('hg.admin', 'hg.usergroup.create.true')
191 @HasPermissionAnyDecorator('hg.admin', 'hg.usergroup.create.true')
200 @view_config(
201 route_name='user_groups_new', request_method='GET',
202 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
203 def user_groups_new(self):
192 def user_groups_new(self):
204 c = self.load_default_context()
193 c = self.load_default_context()
205 return self._get_template_context(c)
194 return self._get_template_context(c)
@@ -207,9 +196,6 b' class AdminUserGroupsView(BaseAppView, D'
207 @LoginRequired()
196 @LoginRequired()
208 @HasPermissionAnyDecorator('hg.admin', 'hg.usergroup.create.true')
197 @HasPermissionAnyDecorator('hg.admin', 'hg.usergroup.create.true')
209 @CSRFRequired()
198 @CSRFRequired()
210 @view_config(
211 route_name='user_groups_create', request_method='POST',
212 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
213 def user_groups_create(self):
199 def user_groups_create(self):
214 _ = self.request.translate
200 _ = self.request.translate
215 c = self.load_default_context()
201 c = self.load_default_context()
@@ -24,7 +24,6 b' import formencode'
24 import formencode.htmlfill
24 import formencode.htmlfill
25
25
26 from pyramid.httpexceptions import HTTPFound
26 from pyramid.httpexceptions import HTTPFound
27 from pyramid.view import view_config
28 from pyramid.renderers import render
27 from pyramid.renderers import render
29 from pyramid.response import Response
28 from pyramid.response import Response
30
29
@@ -72,19 +71,12 b' class AdminUsersView(BaseAppView, DataGr'
72
71
73 @LoginRequired()
72 @LoginRequired()
74 @HasPermissionAllDecorator('hg.admin')
73 @HasPermissionAllDecorator('hg.admin')
75 @view_config(
76 route_name='users', request_method='GET',
77 renderer='rhodecode:templates/admin/users/users.mako')
78 def users_list(self):
74 def users_list(self):
79 c = self.load_default_context()
75 c = self.load_default_context()
80 return self._get_template_context(c)
76 return self._get_template_context(c)
81
77
82 @LoginRequired()
78 @LoginRequired()
83 @HasPermissionAllDecorator('hg.admin')
79 @HasPermissionAllDecorator('hg.admin')
84 @view_config(
85 # renderer defined below
86 route_name='users_data', request_method='GET',
87 renderer='json_ext', xhr=True)
88 def users_list_data(self):
80 def users_list_data(self):
89 self.load_default_context()
81 self.load_default_context()
90 column_map = {
82 column_map = {
@@ -183,9 +175,6 b' class AdminUsersView(BaseAppView, DataGr'
183
175
184 @LoginRequired()
176 @LoginRequired()
185 @HasPermissionAllDecorator('hg.admin')
177 @HasPermissionAllDecorator('hg.admin')
186 @view_config(
187 route_name='users_new', request_method='GET',
188 renderer='rhodecode:templates/admin/users/user_add.mako')
189 def users_new(self):
178 def users_new(self):
190 _ = self.request.translate
179 _ = self.request.translate
191 c = self.load_default_context()
180 c = self.load_default_context()
@@ -196,9 +185,6 b' class AdminUsersView(BaseAppView, DataGr'
196 @LoginRequired()
185 @LoginRequired()
197 @HasPermissionAllDecorator('hg.admin')
186 @HasPermissionAllDecorator('hg.admin')
198 @CSRFRequired()
187 @CSRFRequired()
199 @view_config(
200 route_name='users_create', request_method='POST',
201 renderer='rhodecode:templates/admin/users/user_add.mako')
202 def users_create(self):
188 def users_create(self):
203 _ = self.request.translate
189 _ = self.request.translate
204 c = self.load_default_context()
190 c = self.load_default_context()
@@ -309,9 +295,6 b' class UsersView(UserAppView):'
309 @LoginRequired()
295 @LoginRequired()
310 @HasPermissionAllDecorator('hg.admin')
296 @HasPermissionAllDecorator('hg.admin')
311 @CSRFRequired()
297 @CSRFRequired()
312 @view_config(
313 route_name='user_update', request_method='POST',
314 renderer='rhodecode:templates/admin/users/user_edit.mako')
315 def user_update(self):
298 def user_update(self):
316 _ = self.request.translate
299 _ = self.request.translate
317 c = self.load_default_context()
300 c = self.load_default_context()
@@ -371,9 +354,6 b' class UsersView(UserAppView):'
371 @LoginRequired()
354 @LoginRequired()
372 @HasPermissionAllDecorator('hg.admin')
355 @HasPermissionAllDecorator('hg.admin')
373 @CSRFRequired()
356 @CSRFRequired()
374 @view_config(
375 route_name='user_delete', request_method='POST',
376 renderer='rhodecode:templates/admin/users/user_edit.mako')
377 def user_delete(self):
357 def user_delete(self):
378 _ = self.request.translate
358 _ = self.request.translate
379 c = self.load_default_context()
359 c = self.load_default_context()
@@ -496,9 +476,6 b' class UsersView(UserAppView):'
496
476
497 @LoginRequired()
477 @LoginRequired()
498 @HasPermissionAllDecorator('hg.admin')
478 @HasPermissionAllDecorator('hg.admin')
499 @view_config(
500 route_name='user_edit', request_method='GET',
501 renderer='rhodecode:templates/admin/users/user_edit.mako')
502 def user_edit(self):
479 def user_edit(self):
503 _ = self.request.translate
480 _ = self.request.translate
504 c = self.load_default_context()
481 c = self.load_default_context()
@@ -525,9 +502,6 b' class UsersView(UserAppView):'
525
502
526 @LoginRequired()
503 @LoginRequired()
527 @HasPermissionAllDecorator('hg.admin')
504 @HasPermissionAllDecorator('hg.admin')
528 @view_config(
529 route_name='user_edit_advanced', request_method='GET',
530 renderer='rhodecode:templates/admin/users/user_edit.mako')
531 def user_edit_advanced(self):
505 def user_edit_advanced(self):
532 _ = self.request.translate
506 _ = self.request.translate
533 c = self.load_default_context()
507 c = self.load_default_context()
@@ -584,9 +558,6 b' class UsersView(UserAppView):'
584
558
585 @LoginRequired()
559 @LoginRequired()
586 @HasPermissionAllDecorator('hg.admin')
560 @HasPermissionAllDecorator('hg.admin')
587 @view_config(
588 route_name='user_edit_global_perms', request_method='GET',
589 renderer='rhodecode:templates/admin/users/user_edit.mako')
590 def user_edit_global_perms(self):
561 def user_edit_global_perms(self):
591 _ = self.request.translate
562 _ = self.request.translate
592 c = self.load_default_context()
563 c = self.load_default_context()
@@ -614,9 +585,6 b' class UsersView(UserAppView):'
614 @LoginRequired()
585 @LoginRequired()
615 @HasPermissionAllDecorator('hg.admin')
586 @HasPermissionAllDecorator('hg.admin')
616 @CSRFRequired()
587 @CSRFRequired()
617 @view_config(
618 route_name='user_edit_global_perms_update', request_method='POST',
619 renderer='rhodecode:templates/admin/users/user_edit.mako')
620 def user_edit_global_perms_update(self):
588 def user_edit_global_perms_update(self):
621 _ = self.request.translate
589 _ = self.request.translate
622 c = self.load_default_context()
590 c = self.load_default_context()
@@ -682,9 +650,6 b' class UsersView(UserAppView):'
682 @LoginRequired()
650 @LoginRequired()
683 @HasPermissionAllDecorator('hg.admin')
651 @HasPermissionAllDecorator('hg.admin')
684 @CSRFRequired()
652 @CSRFRequired()
685 @view_config(
686 route_name='user_enable_force_password_reset', request_method='POST',
687 renderer='rhodecode:templates/admin/users/user_edit.mako')
688 def user_enable_force_password_reset(self):
653 def user_enable_force_password_reset(self):
689 _ = self.request.translate
654 _ = self.request.translate
690 c = self.load_default_context()
655 c = self.load_default_context()
@@ -711,9 +676,6 b' class UsersView(UserAppView):'
711 @LoginRequired()
676 @LoginRequired()
712 @HasPermissionAllDecorator('hg.admin')
677 @HasPermissionAllDecorator('hg.admin')
713 @CSRFRequired()
678 @CSRFRequired()
714 @view_config(
715 route_name='user_disable_force_password_reset', request_method='POST',
716 renderer='rhodecode:templates/admin/users/user_edit.mako')
717 def user_disable_force_password_reset(self):
679 def user_disable_force_password_reset(self):
718 _ = self.request.translate
680 _ = self.request.translate
719 c = self.load_default_context()
681 c = self.load_default_context()
@@ -741,9 +703,6 b' class UsersView(UserAppView):'
741 @LoginRequired()
703 @LoginRequired()
742 @HasPermissionAllDecorator('hg.admin')
704 @HasPermissionAllDecorator('hg.admin')
743 @CSRFRequired()
705 @CSRFRequired()
744 @view_config(
745 route_name='user_notice_dismiss', request_method='POST',
746 renderer='json_ext', xhr=True)
747 def user_notice_dismiss(self):
706 def user_notice_dismiss(self):
748 _ = self.request.translate
707 _ = self.request.translate
749 c = self.load_default_context()
708 c = self.load_default_context()
@@ -767,9 +726,6 b' class UsersView(UserAppView):'
767 @LoginRequired()
726 @LoginRequired()
768 @HasPermissionAllDecorator('hg.admin')
727 @HasPermissionAllDecorator('hg.admin')
769 @CSRFRequired()
728 @CSRFRequired()
770 @view_config(
771 route_name='user_create_personal_repo_group', request_method='POST',
772 renderer='rhodecode:templates/admin/users/user_edit.mako')
773 def user_create_personal_repo_group(self):
729 def user_create_personal_repo_group(self):
774 """
730 """
775 Create personal repository group for this user
731 Create personal repository group for this user
@@ -821,9 +777,6 b' class UsersView(UserAppView):'
821
777
822 @LoginRequired()
778 @LoginRequired()
823 @HasPermissionAllDecorator('hg.admin')
779 @HasPermissionAllDecorator('hg.admin')
824 @view_config(
825 route_name='edit_user_auth_tokens', request_method='GET',
826 renderer='rhodecode:templates/admin/users/user_edit.mako')
827 def auth_tokens(self):
780 def auth_tokens(self):
828 _ = self.request.translate
781 _ = self.request.translate
829 c = self.load_default_context()
782 c = self.load_default_context()
@@ -843,9 +796,6 b' class UsersView(UserAppView):'
843
796
844 @LoginRequired()
797 @LoginRequired()
845 @HasPermissionAllDecorator('hg.admin')
798 @HasPermissionAllDecorator('hg.admin')
846 @view_config(
847 route_name='edit_user_auth_tokens_view', request_method='POST',
848 renderer='json_ext', xhr=True)
849 def auth_tokens_view(self):
799 def auth_tokens_view(self):
850 _ = self.request.translate
800 _ = self.request.translate
851 c = self.load_default_context()
801 c = self.load_default_context()
@@ -867,8 +817,6 b' class UsersView(UserAppView):'
867 @LoginRequired()
817 @LoginRequired()
868 @HasPermissionAllDecorator('hg.admin')
818 @HasPermissionAllDecorator('hg.admin')
869 @CSRFRequired()
819 @CSRFRequired()
870 @view_config(
871 route_name='edit_user_auth_tokens_add', request_method='POST')
872 def auth_tokens_add(self):
820 def auth_tokens_add(self):
873 _ = self.request.translate
821 _ = self.request.translate
874 c = self.load_default_context()
822 c = self.load_default_context()
@@ -899,8 +847,6 b' class UsersView(UserAppView):'
899 @LoginRequired()
847 @LoginRequired()
900 @HasPermissionAllDecorator('hg.admin')
848 @HasPermissionAllDecorator('hg.admin')
901 @CSRFRequired()
849 @CSRFRequired()
902 @view_config(
903 route_name='edit_user_auth_tokens_delete', request_method='POST')
904 def auth_tokens_delete(self):
850 def auth_tokens_delete(self):
905 _ = self.request.translate
851 _ = self.request.translate
906 c = self.load_default_context()
852 c = self.load_default_context()
@@ -928,9 +874,6 b' class UsersView(UserAppView):'
928
874
929 @LoginRequired()
875 @LoginRequired()
930 @HasPermissionAllDecorator('hg.admin')
876 @HasPermissionAllDecorator('hg.admin')
931 @view_config(
932 route_name='edit_user_ssh_keys', request_method='GET',
933 renderer='rhodecode:templates/admin/users/user_edit.mako')
934 def ssh_keys(self):
877 def ssh_keys(self):
935 _ = self.request.translate
878 _ = self.request.translate
936 c = self.load_default_context()
879 c = self.load_default_context()
@@ -943,9 +886,6 b' class UsersView(UserAppView):'
943
886
944 @LoginRequired()
887 @LoginRequired()
945 @HasPermissionAllDecorator('hg.admin')
888 @HasPermissionAllDecorator('hg.admin')
946 @view_config(
947 route_name='edit_user_ssh_keys_generate_keypair', request_method='GET',
948 renderer='rhodecode:templates/admin/users/user_edit.mako')
949 def ssh_keys_generate_keypair(self):
889 def ssh_keys_generate_keypair(self):
950 _ = self.request.translate
890 _ = self.request.translate
951 c = self.load_default_context()
891 c = self.load_default_context()
@@ -964,8 +904,6 b' class UsersView(UserAppView):'
964 @LoginRequired()
904 @LoginRequired()
965 @HasPermissionAllDecorator('hg.admin')
905 @HasPermissionAllDecorator('hg.admin')
966 @CSRFRequired()
906 @CSRFRequired()
967 @view_config(
968 route_name='edit_user_ssh_keys_add', request_method='POST')
969 def ssh_keys_add(self):
907 def ssh_keys_add(self):
970 _ = self.request.translate
908 _ = self.request.translate
971 c = self.load_default_context()
909 c = self.load_default_context()
@@ -1017,8 +955,6 b' class UsersView(UserAppView):'
1017 @LoginRequired()
955 @LoginRequired()
1018 @HasPermissionAllDecorator('hg.admin')
956 @HasPermissionAllDecorator('hg.admin')
1019 @CSRFRequired()
957 @CSRFRequired()
1020 @view_config(
1021 route_name='edit_user_ssh_keys_delete', request_method='POST')
1022 def ssh_keys_delete(self):
958 def ssh_keys_delete(self):
1023 _ = self.request.translate
959 _ = self.request.translate
1024 c = self.load_default_context()
960 c = self.load_default_context()
@@ -1048,9 +984,6 b' class UsersView(UserAppView):'
1048
984
1049 @LoginRequired()
985 @LoginRequired()
1050 @HasPermissionAllDecorator('hg.admin')
986 @HasPermissionAllDecorator('hg.admin')
1051 @view_config(
1052 route_name='edit_user_emails', request_method='GET',
1053 renderer='rhodecode:templates/admin/users/user_edit.mako')
1054 def emails(self):
987 def emails(self):
1055 _ = self.request.translate
988 _ = self.request.translate
1056 c = self.load_default_context()
989 c = self.load_default_context()
@@ -1065,8 +998,6 b' class UsersView(UserAppView):'
1065 @LoginRequired()
998 @LoginRequired()
1066 @HasPermissionAllDecorator('hg.admin')
999 @HasPermissionAllDecorator('hg.admin')
1067 @CSRFRequired()
1000 @CSRFRequired()
1068 @view_config(
1069 route_name='edit_user_emails_add', request_method='POST')
1070 def emails_add(self):
1001 def emails_add(self):
1071 _ = self.request.translate
1002 _ = self.request.translate
1072 c = self.load_default_context()
1003 c = self.load_default_context()
@@ -1105,8 +1036,6 b' class UsersView(UserAppView):'
1105 @LoginRequired()
1036 @LoginRequired()
1106 @HasPermissionAllDecorator('hg.admin')
1037 @HasPermissionAllDecorator('hg.admin')
1107 @CSRFRequired()
1038 @CSRFRequired()
1108 @view_config(
1109 route_name='edit_user_emails_delete', request_method='POST')
1110 def emails_delete(self):
1039 def emails_delete(self):
1111 _ = self.request.translate
1040 _ = self.request.translate
1112 c = self.load_default_context()
1041 c = self.load_default_context()
@@ -1131,9 +1060,6 b' class UsersView(UserAppView):'
1131
1060
1132 @LoginRequired()
1061 @LoginRequired()
1133 @HasPermissionAllDecorator('hg.admin')
1062 @HasPermissionAllDecorator('hg.admin')
1134 @view_config(
1135 route_name='edit_user_ips', request_method='GET',
1136 renderer='rhodecode:templates/admin/users/user_edit.mako')
1137 def ips(self):
1063 def ips(self):
1138 _ = self.request.translate
1064 _ = self.request.translate
1139 c = self.load_default_context()
1065 c = self.load_default_context()
@@ -1152,8 +1078,6 b' class UsersView(UserAppView):'
1152 @LoginRequired()
1078 @LoginRequired()
1153 @HasPermissionAllDecorator('hg.admin')
1079 @HasPermissionAllDecorator('hg.admin')
1154 @CSRFRequired()
1080 @CSRFRequired()
1155 @view_config(
1156 route_name='edit_user_ips_add', request_method='POST')
1157 # NOTE(marcink): this view is allowed for default users, as we can
1081 # NOTE(marcink): this view is allowed for default users, as we can
1158 # edit their IP white list
1082 # edit their IP white list
1159 def ips_add(self):
1083 def ips_add(self):
@@ -1207,8 +1131,6 b' class UsersView(UserAppView):'
1207 @LoginRequired()
1131 @LoginRequired()
1208 @HasPermissionAllDecorator('hg.admin')
1132 @HasPermissionAllDecorator('hg.admin')
1209 @CSRFRequired()
1133 @CSRFRequired()
1210 @view_config(
1211 route_name='edit_user_ips_delete', request_method='POST')
1212 # NOTE(marcink): this view is allowed for default users, as we can
1134 # NOTE(marcink): this view is allowed for default users, as we can
1213 # edit their IP white list
1135 # edit their IP white list
1214 def ips_delete(self):
1136 def ips_delete(self):
@@ -1236,9 +1158,6 b' class UsersView(UserAppView):'
1236
1158
1237 @LoginRequired()
1159 @LoginRequired()
1238 @HasPermissionAllDecorator('hg.admin')
1160 @HasPermissionAllDecorator('hg.admin')
1239 @view_config(
1240 route_name='edit_user_groups_management', request_method='GET',
1241 renderer='rhodecode:templates/admin/users/user_edit.mako')
1242 def groups_management(self):
1161 def groups_management(self):
1243 c = self.load_default_context()
1162 c = self.load_default_context()
1244 c.user = self.db_user
1163 c.user = self.db_user
@@ -1254,8 +1173,6 b' class UsersView(UserAppView):'
1254 @LoginRequired()
1173 @LoginRequired()
1255 @HasPermissionAllDecorator('hg.admin')
1174 @HasPermissionAllDecorator('hg.admin')
1256 @CSRFRequired()
1175 @CSRFRequired()
1257 @view_config(
1258 route_name='edit_user_groups_management_updates', request_method='POST')
1259 def groups_management_updates(self):
1176 def groups_management_updates(self):
1260 _ = self.request.translate
1177 _ = self.request.translate
1261 c = self.load_default_context()
1178 c = self.load_default_context()
@@ -1299,9 +1216,6 b' class UsersView(UserAppView):'
1299
1216
1300 @LoginRequired()
1217 @LoginRequired()
1301 @HasPermissionAllDecorator('hg.admin')
1218 @HasPermissionAllDecorator('hg.admin')
1302 @view_config(
1303 route_name='edit_user_audit_logs', request_method='GET',
1304 renderer='rhodecode:templates/admin/users/user_edit.mako')
1305 def user_audit_logs(self):
1219 def user_audit_logs(self):
1306 _ = self.request.translate
1220 _ = self.request.translate
1307 c = self.load_default_context()
1221 c = self.load_default_context()
@@ -1329,9 +1243,6 b' class UsersView(UserAppView):'
1329
1243
1330 @LoginRequired()
1244 @LoginRequired()
1331 @HasPermissionAllDecorator('hg.admin')
1245 @HasPermissionAllDecorator('hg.admin')
1332 @view_config(
1333 route_name='edit_user_audit_logs_download', request_method='GET',
1334 renderer='string')
1335 def user_audit_logs_download(self):
1246 def user_audit_logs_download(self):
1336 _ = self.request.translate
1247 _ = self.request.translate
1337 c = self.load_default_context()
1248 c = self.load_default_context()
@@ -1352,9 +1263,6 b' class UsersView(UserAppView):'
1352
1263
1353 @LoginRequired()
1264 @LoginRequired()
1354 @HasPermissionAllDecorator('hg.admin')
1265 @HasPermissionAllDecorator('hg.admin')
1355 @view_config(
1356 route_name='edit_user_perms_summary', request_method='GET',
1357 renderer='rhodecode:templates/admin/users/user_edit.mako')
1358 def user_perms_summary(self):
1266 def user_perms_summary(self):
1359 _ = self.request.translate
1267 _ = self.request.translate
1360 c = self.load_default_context()
1268 c = self.load_default_context()
@@ -1367,9 +1275,6 b' class UsersView(UserAppView):'
1367
1275
1368 @LoginRequired()
1276 @LoginRequired()
1369 @HasPermissionAllDecorator('hg.admin')
1277 @HasPermissionAllDecorator('hg.admin')
1370 @view_config(
1371 route_name='edit_user_perms_summary_json', request_method='GET',
1372 renderer='json_ext')
1373 def user_perms_summary_json(self):
1278 def user_perms_summary_json(self):
1374 self.load_default_context()
1279 self.load_default_context()
1375 perm_user = self.db_user.AuthUser(ip_addr=self.request.remote_addr)
1280 perm_user = self.db_user.AuthUser(ip_addr=self.request.remote_addr)
@@ -1378,9 +1283,6 b' class UsersView(UserAppView):'
1378
1283
1379 @LoginRequired()
1284 @LoginRequired()
1380 @HasPermissionAllDecorator('hg.admin')
1285 @HasPermissionAllDecorator('hg.admin')
1381 @view_config(
1382 route_name='edit_user_caches', request_method='GET',
1383 renderer='rhodecode:templates/admin/users/user_edit.mako')
1384 def user_caches(self):
1286 def user_caches(self):
1385 _ = self.request.translate
1287 _ = self.request.translate
1386 c = self.load_default_context()
1288 c = self.load_default_context()
@@ -1399,8 +1301,6 b' class UsersView(UserAppView):'
1399 @LoginRequired()
1301 @LoginRequired()
1400 @HasPermissionAllDecorator('hg.admin')
1302 @HasPermissionAllDecorator('hg.admin')
1401 @CSRFRequired()
1303 @CSRFRequired()
1402 @view_config(
1403 route_name='edit_user_caches_update', request_method='POST')
1404 def user_caches_update(self):
1304 def user_caches_update(self):
1405 _ = self.request.translate
1305 _ = self.request.translate
1406 c = self.load_default_context()
1306 c = self.load_default_context()
@@ -67,6 +67,8 b' def maybe_create_history_store(event):'
67
67
68
68
69 def includeme(config):
69 def includeme(config):
70 from rhodecode.apps.channelstream.views import ChannelstreamView
71
70 settings = config.registry.settings
72 settings = config.registry.settings
71 PLUGIN_DEFINITION['config']['enabled'] = asbool(
73 PLUGIN_DEFINITION['config']['enabled'] = asbool(
72 settings.get('channelstream.enabled'))
74 settings.get('channelstream.enabled'))
@@ -85,12 +87,20 b' def includeme(config):'
85 config.add_route(
87 config.add_route(
86 name='channelstream_connect',
88 name='channelstream_connect',
87 pattern=ADMIN_PREFIX + '/channelstream/connect')
89 pattern=ADMIN_PREFIX + '/channelstream/connect')
90 config.add_view(
91 ChannelstreamView,
92 attr='channelstream_connect',
93 route_name='channelstream_connect', renderer='json_ext')
94
88 config.add_route(
95 config.add_route(
89 name='channelstream_subscribe',
96 name='channelstream_subscribe',
90 pattern=ADMIN_PREFIX + '/channelstream/subscribe')
97 pattern=ADMIN_PREFIX + '/channelstream/subscribe')
98 config.add_view(
99 ChannelstreamView,
100 attr='channelstream_subscribe',
101 route_name='channelstream_subscribe', renderer='json_ext')
102
91 config.add_route(
103 config.add_route(
92 name='channelstream_proxy',
104 name='channelstream_proxy',
93 pattern=settings.get('channelstream.proxy_path') or '/_channelstream')
105 pattern=settings.get('channelstream.proxy_path') or '/_channelstream')
94
106
95 # Scan module for configuration decorators.
96 config.scan('.views', ignore='.tests')
@@ -21,7 +21,7 b''
21 import logging
21 import logging
22 import uuid
22 import uuid
23
23
24 from pyramid.view import view_config
24
25 from pyramid.httpexceptions import HTTPBadRequest, HTTPForbidden, HTTPBadGateway
25 from pyramid.httpexceptions import HTTPBadRequest, HTTPForbidden, HTTPBadGateway
26
26
27 from rhodecode.apps._base import BaseAppView
27 from rhodecode.apps._base import BaseAppView
@@ -54,8 +54,7 b' class ChannelstreamView(BaseAppView):'
54 return c
54 return c
55
55
56 @NotAnonymous()
56 @NotAnonymous()
57 @view_config(route_name='channelstream_connect', renderer='json_ext')
57 def channelstream_connect(self):
58 def connect(self):
59 """ handle authorization of users trying to connect """
58 """ handle authorization of users trying to connect """
60
59
61 self.load_default_context()
60 self.load_default_context()
@@ -132,8 +131,7 b' class ChannelstreamView(BaseAppView):'
132 return connect_result
131 return connect_result
133
132
134 @NotAnonymous()
133 @NotAnonymous()
135 @view_config(route_name='channelstream_subscribe', renderer='json_ext')
134 def channelstream_subscribe(self):
136 def subscribe(self):
137 """ can be used to subscribe specific connection to other channels """
135 """ can be used to subscribe specific connection to other channels """
138 self.load_default_context()
136 self.load_default_context()
139 try:
137 try:
@@ -35,6 +35,8 b' class DebugStylePredicate(object):'
35
35
36
36
37 def includeme(config):
37 def includeme(config):
38 from rhodecode.apps.debug_style.views import DebugStyleView
39
38 config.add_route_predicate(
40 config.add_route_predicate(
39 'debug_style', DebugStylePredicate)
41 'debug_style', DebugStylePredicate)
40
42
@@ -42,18 +44,38 b' def includeme(config):'
42 name='debug_style_home',
44 name='debug_style_home',
43 pattern=ADMIN_PREFIX + '/debug_style',
45 pattern=ADMIN_PREFIX + '/debug_style',
44 debug_style=True)
46 debug_style=True)
47 config.add_view(
48 DebugStyleView,
49 attr='index',
50 route_name='debug_style_home', request_method='GET',
51 renderer=None)
52
45 config.add_route(
53 config.add_route(
46 name='debug_style_email',
54 name='debug_style_email',
47 pattern=ADMIN_PREFIX + '/debug_style/email/{email_id}',
55 pattern=ADMIN_PREFIX + '/debug_style/email/{email_id}',
48 debug_style=True)
56 debug_style=True)
57 config.add_view(
58 DebugStyleView,
59 attr='render_email',
60 route_name='debug_style_email', request_method='GET',
61 renderer=None)
62
49 config.add_route(
63 config.add_route(
50 name='debug_style_email_plain_rendered',
64 name='debug_style_email_plain_rendered',
51 pattern=ADMIN_PREFIX + '/debug_style/email-rendered/{email_id}',
65 pattern=ADMIN_PREFIX + '/debug_style/email-rendered/{email_id}',
52 debug_style=True)
66 debug_style=True)
67 config.add_view(
68 DebugStyleView,
69 attr='render_email',
70 route_name='debug_style_email_plain_rendered', request_method='GET',
71 renderer=None)
72
53 config.add_route(
73 config.add_route(
54 name='debug_style_template',
74 name='debug_style_template',
55 pattern=ADMIN_PREFIX + '/debug_style/t/{t_path}',
75 pattern=ADMIN_PREFIX + '/debug_style/t/{t_path}',
56 debug_style=True)
76 debug_style=True)
57
77 config.add_view(
58 # Scan module for configuration decorators.
78 DebugStyleView,
59 config.scan('.views', ignore='.tests')
79 attr='template',
80 route_name='debug_style_template', request_method='GET',
81 renderer=None)
@@ -22,7 +22,6 b' import os'
22 import logging
22 import logging
23 import datetime
23 import datetime
24
24
25 from pyramid.view import view_config
26 from pyramid.renderers import render_to_response
25 from pyramid.renderers import render_to_response
27 from rhodecode.apps._base import BaseAppView
26 from rhodecode.apps._base import BaseAppView
28 from rhodecode.lib.celerylib import run_task, tasks
27 from rhodecode.lib.celerylib import run_task, tasks
@@ -37,12 +36,8 b' class DebugStyleView(BaseAppView):'
37
36
38 def load_default_context(self):
37 def load_default_context(self):
39 c = self._get_local_tmpl_context()
38 c = self._get_local_tmpl_context()
40
41 return c
39 return c
42
40
43 @view_config(
44 route_name='debug_style_home', request_method='GET',
45 renderer=None)
46 def index(self):
41 def index(self):
47 c = self.load_default_context()
42 c = self.load_default_context()
48 c.active = 'index'
43 c.active = 'index'
@@ -51,12 +46,6 b' class DebugStyleView(BaseAppView):'
51 'debug_style/index.html', self._get_template_context(c),
46 'debug_style/index.html', self._get_template_context(c),
52 request=self.request)
47 request=self.request)
53
48
54 @view_config(
55 route_name='debug_style_email', request_method='GET',
56 renderer=None)
57 @view_config(
58 route_name='debug_style_email_plain_rendered', request_method='GET',
59 renderer=None)
60 def render_email(self):
49 def render_email(self):
61 c = self.load_default_context()
50 c = self.load_default_context()
62 email_id = self.request.matchdict['email_id']
51 email_id = self.request.matchdict['email_id']
@@ -457,9 +446,6 b' users: description edit fixes'
457 template, self._get_template_context(c),
446 template, self._get_template_context(c),
458 request=self.request)
447 request=self.request)
459
448
460 @view_config(
461 route_name='debug_style_template', request_method='GET',
462 renderer=None)
463 def template(self):
449 def template(self):
464 t_path = self.request.matchdict['t_path']
450 t_path = self.request.matchdict['t_path']
465 c = self.load_default_context()
451 c = self.load_default_context()
@@ -483,4 +469,3 b' users: description edit fixes'
483 return render_to_response(
469 return render_to_response(
484 'debug_style/' + t_path, self._get_template_context(c),
470 'debug_style/' + t_path, self._get_template_context(c),
485 request=self.request)
471 request=self.request)
486
@@ -35,18 +35,31 b' def _sanitize_settings_and_apply_default'
35
35
36
36
37 def includeme(config):
37 def includeme(config):
38 from rhodecode.apps.file_store.views import FileStoreView
39
38 settings = config.registry.settings
40 settings = config.registry.settings
39 _sanitize_settings_and_apply_defaults(settings)
41 _sanitize_settings_and_apply_defaults(settings)
40
42
41 config.add_route(
43 config.add_route(
42 name='upload_file',
44 name='upload_file',
43 pattern='/_file_store/upload')
45 pattern='/_file_store/upload')
46 config.add_view(
47 FileStoreView,
48 attr='upload_file',
49 route_name='upload_file', request_method='POST', renderer='json_ext')
50
44 config.add_route(
51 config.add_route(
45 name='download_file',
52 name='download_file',
46 pattern='/_file_store/download/{fid:.*}')
53 pattern='/_file_store/download/{fid:.*}')
54 config.add_view(
55 FileStoreView,
56 attr='download_file',
57 route_name='download_file')
58
47 config.add_route(
59 config.add_route(
48 name='download_file_by_token',
60 name='download_file_by_token',
49 pattern='/_file_store/token-download/{_auth_token}/{fid:.*}')
61 pattern='/_file_store/token-download/{_auth_token}/{fid:.*}')
50
62 config.add_view(
51 # Scan module for configuration decorators.
63 FileStoreView,
52 config.scan('.views', ignore='.tests')
64 attr='download_file_by_token',
65 route_name='download_file_by_token')
@@ -19,7 +19,7 b''
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20 import logging
20 import logging
21
21
22 from pyramid.view import view_config
22
23 from pyramid.response import FileResponse
23 from pyramid.response import FileResponse
24 from pyramid.httpexceptions import HTTPFound, HTTPNotFound
24 from pyramid.httpexceptions import HTTPFound, HTTPNotFound
25
25
@@ -128,7 +128,6 b' class FileStoreView(BaseAppView):'
128 @LoginRequired()
128 @LoginRequired()
129 @NotAnonymous()
129 @NotAnonymous()
130 @CSRFRequired()
130 @CSRFRequired()
131 @view_config(route_name='upload_file', request_method='POST', renderer='json_ext')
132 def upload_file(self):
131 def upload_file(self):
133 self.load_default_context()
132 self.load_default_context()
134 file_obj = self.request.POST.get(self.upload_key)
133 file_obj = self.request.POST.get(self.upload_key)
@@ -182,7 +181,6 b' class FileStoreView(BaseAppView):'
182 'access_path': h.route_path('download_file', fid=store_uid)}
181 'access_path': h.route_path('download_file', fid=store_uid)}
183
182
184 # ACL is checked by scopes, if no scope the file is accessible to all
183 # ACL is checked by scopes, if no scope the file is accessible to all
185 @view_config(route_name='download_file')
186 def download_file(self):
184 def download_file(self):
187 self.load_default_context()
185 self.load_default_context()
188 file_uid = self.request.matchdict['fid']
186 file_uid = self.request.matchdict['fid']
@@ -192,7 +190,6 b' class FileStoreView(BaseAppView):'
192 # in addition to @LoginRequired ACL is checked by scopes
190 # in addition to @LoginRequired ACL is checked by scopes
193 @LoginRequired(auth_token_access=[UserApiKeys.ROLE_ARTIFACT_DOWNLOAD])
191 @LoginRequired(auth_token_access=[UserApiKeys.ROLE_ARTIFACT_DOWNLOAD])
194 @NotAnonymous()
192 @NotAnonymous()
195 @view_config(route_name='download_file_by_token')
196 def download_file_by_token(self):
193 def download_file_by_token(self):
197 """
194 """
198 Special view that allows to access the download file by special URL that
195 Special view that allows to access the download file by special URL that
@@ -21,42 +21,100 b' from rhodecode.apps._base import ADMIN_P'
21
21
22
22
23 def admin_routes(config):
23 def admin_routes(config):
24 from rhodecode.apps.gist.views import GistView
25
24 config.add_route(
26 config.add_route(
25 name='gists_show', pattern='/gists')
27 name='gists_show', pattern='/gists')
28 config.add_view(
29 GistView,
30 attr='gist_show_all',
31 route_name='gists_show', request_method='GET',
32 renderer='rhodecode:templates/admin/gists/gist_index.mako')
33
26 config.add_route(
34 config.add_route(
27 name='gists_new', pattern='/gists/new')
35 name='gists_new', pattern='/gists/new')
36 config.add_view(
37 GistView,
38 attr='gist_new',
39 route_name='gists_new', request_method='GET',
40 renderer='rhodecode:templates/admin/gists/gist_new.mako')
41
28 config.add_route(
42 config.add_route(
29 name='gists_create', pattern='/gists/create')
43 name='gists_create', pattern='/gists/create')
44 config.add_view(
45 GistView,
46 attr='gist_create',
47 route_name='gists_create', request_method='POST',
48 renderer='rhodecode:templates/admin/gists/gist_new.mako')
30
49
31 config.add_route(
50 config.add_route(
32 name='gist_show', pattern='/gists/{gist_id}')
51 name='gist_show', pattern='/gists/{gist_id}')
52 config.add_view(
53 GistView,
54 attr='gist_show',
55 route_name='gist_show', request_method='GET',
56 renderer='rhodecode:templates/admin/gists/gist_show.mako')
57
58 config.add_route(
59 name='gist_show_rev',
60 pattern='/gists/{gist_id}/rev/{revision}')
61
62 config.add_view(
63 GistView,
64 attr='gist_show',
65 route_name='gist_show_rev', request_method='GET',
66 renderer='rhodecode:templates/admin/gists/gist_show.mako')
67
68 config.add_route(
69 name='gist_show_formatted',
70 pattern='/gists/{gist_id}/rev/{revision}/{format}')
71 config.add_view(
72 GistView,
73 attr='gist_show',
74 route_name='gist_show_formatted', request_method='GET',
75 renderer=None)
76
77 config.add_route(
78 name='gist_show_formatted_path',
79 pattern='/gists/{gist_id}/rev/{revision}/{format}/{f_path:.*}')
80 config.add_view(
81 GistView,
82 attr='gist_show',
83 route_name='gist_show_formatted_path', request_method='GET',
84 renderer=None)
33
85
34 config.add_route(
86 config.add_route(
35 name='gist_delete', pattern='/gists/{gist_id}/delete')
87 name='gist_delete', pattern='/gists/{gist_id}/delete')
88 config.add_view(
89 GistView,
90 attr='gist_delete',
91 route_name='gist_delete', request_method='POST')
36
92
37 config.add_route(
93 config.add_route(
38 name='gist_edit', pattern='/gists/{gist_id}/edit')
94 name='gist_edit', pattern='/gists/{gist_id}/edit')
95 config.add_view(
96 GistView,
97 attr='gist_edit',
98 route_name='gist_edit', request_method='GET',
99 renderer='rhodecode:templates/admin/gists/gist_edit.mako')
100
101 config.add_route(
102 name='gist_update', pattern='/gists/{gist_id}/update')
103 config.add_view(
104 GistView,
105 attr='gist_update',
106 route_name='gist_update', request_method='POST',
107 renderer='rhodecode:templates/admin/gists/gist_edit.mako')
39
108
40 config.add_route(
109 config.add_route(
41 name='gist_edit_check_revision',
110 name='gist_edit_check_revision',
42 pattern='/gists/{gist_id}/edit/check_revision')
111 pattern='/gists/{gist_id}/edit/check_revision')
43
112 config.add_view(
44 config.add_route(
113 GistView,
45 name='gist_update', pattern='/gists/{gist_id}/update')
114 attr='gist_edit_check_revision',
46
115 route_name='gist_edit_check_revision', request_method='GET',
47 config.add_route(
116 renderer='json_ext')
48 name='gist_show_rev',
49 pattern='/gists/{gist_id}/{revision}')
50 config.add_route(
51 name='gist_show_formatted',
52 pattern='/gists/{gist_id}/{revision}/{format}')
53
54 config.add_route(
55 name='gist_show_formatted_path',
56 pattern='/gists/{gist_id}/{revision}/{format}/{f_path:.*}')
57
117
58
118
59 def includeme(config):
119 def includeme(config):
60 config.include(admin_routes, route_prefix=ADMIN_PREFIX)
120 config.include(admin_routes, route_prefix=ADMIN_PREFIX)
61 # Scan module for configuration decorators.
62 config.scan('.views', ignore='.tests')
@@ -43,9 +43,9 b' def route_path(name, params=None, **kwar'
43 'gist_edit': ADMIN_PREFIX + '/gists/{gist_id}/edit',
43 'gist_edit': ADMIN_PREFIX + '/gists/{gist_id}/edit',
44 'gist_edit_check_revision': ADMIN_PREFIX + '/gists/{gist_id}/edit/check_revision',
44 'gist_edit_check_revision': ADMIN_PREFIX + '/gists/{gist_id}/edit/check_revision',
45 'gist_update': ADMIN_PREFIX + '/gists/{gist_id}/update',
45 'gist_update': ADMIN_PREFIX + '/gists/{gist_id}/update',
46 'gist_show_rev': ADMIN_PREFIX + '/gists/{gist_id}/{revision}',
46 'gist_show_rev': ADMIN_PREFIX + '/gists/{gist_id}/rev/{revision}',
47 'gist_show_formatted': ADMIN_PREFIX + '/gists/{gist_id}/{revision}/{format}',
47 'gist_show_formatted': ADMIN_PREFIX + '/gists/{gist_id}/rev/{revision}/{format}',
48 'gist_show_formatted_path': ADMIN_PREFIX + '/gists/{gist_id}/{revision}/{format}/{f_path}',
48 'gist_show_formatted_path': ADMIN_PREFIX + '/gists/{gist_id}/rev/{revision}/{format}/{f_path}',
49
49
50 }[name].format(**kwargs)
50 }[name].format(**kwargs)
51
51
@@ -26,7 +26,6 b' import formencode.htmlfill'
26 import peppercorn
26 import peppercorn
27
27
28 from pyramid.httpexceptions import HTTPNotFound, HTTPFound, HTTPBadRequest
28 from pyramid.httpexceptions import HTTPNotFound, HTTPFound, HTTPBadRequest
29 from pyramid.view import view_config
30 from pyramid.renderers import render
29 from pyramid.renderers import render
31 from pyramid.response import Response
30 from pyramid.response import Response
32
31
@@ -70,9 +69,6 b' class GistView(BaseAppView):'
70 return c
69 return c
71
70
72 @LoginRequired()
71 @LoginRequired()
73 @view_config(
74 route_name='gists_show', request_method='GET',
75 renderer='rhodecode:templates/admin/gists/gist_index.mako')
76 def gist_show_all(self):
72 def gist_show_all(self):
77 c = self.load_default_context()
73 c = self.load_default_context()
78
74
@@ -134,9 +130,6 b' class GistView(BaseAppView):'
134
130
135 @LoginRequired()
131 @LoginRequired()
136 @NotAnonymous()
132 @NotAnonymous()
137 @view_config(
138 route_name='gists_new', request_method='GET',
139 renderer='rhodecode:templates/admin/gists/gist_new.mako')
140 def gist_new(self):
133 def gist_new(self):
141 c = self.load_default_context()
134 c = self.load_default_context()
142 return self._get_template_context(c)
135 return self._get_template_context(c)
@@ -144,9 +137,6 b' class GistView(BaseAppView):'
144 @LoginRequired()
137 @LoginRequired()
145 @NotAnonymous()
138 @NotAnonymous()
146 @CSRFRequired()
139 @CSRFRequired()
147 @view_config(
148 route_name='gists_create', request_method='POST',
149 renderer='rhodecode:templates/admin/gists/gist_new.mako')
150 def gist_create(self):
140 def gist_create(self):
151 _ = self.request.translate
141 _ = self.request.translate
152 c = self.load_default_context()
142 c = self.load_default_context()
@@ -222,8 +212,6 b' class GistView(BaseAppView):'
222 @LoginRequired()
212 @LoginRequired()
223 @NotAnonymous()
213 @NotAnonymous()
224 @CSRFRequired()
214 @CSRFRequired()
225 @view_config(
226 route_name='gist_delete', request_method='POST')
227 def gist_delete(self):
215 def gist_delete(self):
228 _ = self.request.translate
216 _ = self.request.translate
229 gist_id = self.request.matchdict['gist_id']
217 gist_id = self.request.matchdict['gist_id']
@@ -263,18 +251,6 b' class GistView(BaseAppView):'
263 return gist
251 return gist
264
252
265 @LoginRequired()
253 @LoginRequired()
266 @view_config(
267 route_name='gist_show', request_method='GET',
268 renderer='rhodecode:templates/admin/gists/gist_show.mako')
269 @view_config(
270 route_name='gist_show_rev', request_method='GET',
271 renderer='rhodecode:templates/admin/gists/gist_show.mako')
272 @view_config(
273 route_name='gist_show_formatted', request_method='GET',
274 renderer=None)
275 @view_config(
276 route_name='gist_show_formatted_path', request_method='GET',
277 renderer=None)
278 def gist_show(self):
254 def gist_show(self):
279 gist_id = self.request.matchdict['gist_id']
255 gist_id = self.request.matchdict['gist_id']
280
256
@@ -307,9 +283,6 b' class GistView(BaseAppView):'
307
283
308 @LoginRequired()
284 @LoginRequired()
309 @NotAnonymous()
285 @NotAnonymous()
310 @view_config(
311 route_name='gist_edit', request_method='GET',
312 renderer='rhodecode:templates/admin/gists/gist_edit.mako')
313 def gist_edit(self):
286 def gist_edit(self):
314 _ = self.request.translate
287 _ = self.request.translate
315 gist_id = self.request.matchdict['gist_id']
288 gist_id = self.request.matchdict['gist_id']
@@ -341,9 +314,6 b' class GistView(BaseAppView):'
341 @LoginRequired()
314 @LoginRequired()
342 @NotAnonymous()
315 @NotAnonymous()
343 @CSRFRequired()
316 @CSRFRequired()
344 @view_config(
345 route_name='gist_update', request_method='POST',
346 renderer='rhodecode:templates/admin/gists/gist_edit.mako')
347 def gist_update(self):
317 def gist_update(self):
348 _ = self.request.translate
318 _ = self.request.translate
349 gist_id = self.request.matchdict['gist_id']
319 gist_id = self.request.matchdict['gist_id']
@@ -397,9 +367,6 b' class GistView(BaseAppView):'
397
367
398 @LoginRequired()
368 @LoginRequired()
399 @NotAnonymous()
369 @NotAnonymous()
400 @view_config(
401 route_name='gist_edit_check_revision', request_method='GET',
402 renderer='json_ext')
403 def gist_edit_check_revision(self):
370 def gist_edit_check_revision(self):
404 _ = self.request.translate
371 _ = self.request.translate
405 gist_id = self.request.matchdict['gist_id']
372 gist_id = self.request.matchdict['gist_id']
@@ -38,56 +38,110 b' class VCSCallPredicate(object):'
38
38
39
39
40 def includeme(config):
40 def includeme(config):
41 from rhodecode.apps.home.views import HomeView
42
43 config.add_route_predicate(
44 'skip_vcs_call', VCSCallPredicate)
41
45
42 config.add_route(
46 config.add_route(
43 name='home',
47 name='home',
44 pattern='/')
48 pattern='/')
49 config.add_view(
50 HomeView,
51 attr='main_page',
52 route_name='home', request_method='GET',
53 renderer='rhodecode:templates/index.mako')
45
54
46 config.add_route(
55 config.add_route(
47 name='main_page_repos_data',
56 name='main_page_repos_data',
48 pattern='/_home_repos')
57 pattern='/_home_repos')
58 config.add_view(
59 HomeView,
60 attr='main_page_repos_data',
61 route_name='main_page_repos_data',
62 request_method='GET', renderer='json_ext', xhr=True)
49
63
50 config.add_route(
64 config.add_route(
51 name='main_page_repo_groups_data',
65 name='main_page_repo_groups_data',
52 pattern='/_home_repo_groups')
66 pattern='/_home_repo_groups')
67 config.add_view(
68 HomeView,
69 attr='main_page_repo_groups_data',
70 route_name='main_page_repo_groups_data',
71 request_method='GET', renderer='json_ext', xhr=True)
53
72
54 config.add_route(
73 config.add_route(
55 name='user_autocomplete_data',
74 name='user_autocomplete_data',
56 pattern='/_users')
75 pattern='/_users')
76 config.add_view(
77 HomeView,
78 attr='user_autocomplete_data',
79 route_name='user_autocomplete_data', request_method='GET',
80 renderer='json_ext', xhr=True)
57
81
58 config.add_route(
82 config.add_route(
59 name='user_group_autocomplete_data',
83 name='user_group_autocomplete_data',
60 pattern='/_user_groups')
84 pattern='/_user_groups')
85 config.add_view(
86 HomeView,
87 attr='user_group_autocomplete_data',
88 route_name='user_group_autocomplete_data', request_method='GET',
89 renderer='json_ext', xhr=True)
61
90
62 config.add_route(
91 config.add_route(
63 name='repo_list_data',
92 name='repo_list_data',
64 pattern='/_repos')
93 pattern='/_repos')
94 config.add_view(
95 HomeView,
96 attr='repo_list_data',
97 route_name='repo_list_data', request_method='GET',
98 renderer='json_ext', xhr=True)
65
99
66 config.add_route(
100 config.add_route(
67 name='repo_group_list_data',
101 name='repo_group_list_data',
68 pattern='/_repo_groups')
102 pattern='/_repo_groups')
103 config.add_view(
104 HomeView,
105 attr='repo_group_list_data',
106 route_name='repo_group_list_data', request_method='GET',
107 renderer='json_ext', xhr=True)
69
108
70 config.add_route(
109 config.add_route(
71 name='goto_switcher_data',
110 name='goto_switcher_data',
72 pattern='/_goto_data')
111 pattern='/_goto_data')
112 config.add_view(
113 HomeView,
114 attr='goto_switcher_data',
115 route_name='goto_switcher_data', request_method='GET',
116 renderer='json_ext', xhr=True)
73
117
74 config.add_route(
118 config.add_route(
75 name='markup_preview',
119 name='markup_preview',
76 pattern='/_markup_preview')
120 pattern='/_markup_preview')
121 config.add_view(
122 HomeView,
123 attr='markup_preview',
124 route_name='markup_preview', request_method='POST',
125 renderer='string', xhr=True)
77
126
78 config.add_route(
127 config.add_route(
79 name='file_preview',
128 name='file_preview',
80 pattern='/_file_preview')
129 pattern='/_file_preview')
130 config.add_view(
131 HomeView,
132 attr='file_preview',
133 route_name='file_preview', request_method='POST',
134 renderer='string', xhr=True)
81
135
82 config.add_route(
136 config.add_route(
83 name='store_user_session_value',
137 name='store_user_session_value',
84 pattern='/_store_session_attr')
138 pattern='/_store_session_attr')
139 config.add_view(
140 HomeView,
141 attr='store_user_session_attr',
142 route_name='store_user_session_value', request_method='POST',
143 renderer='string', xhr=True)
85
144
86 # register our static links via redirection mechanism
145 # register our static links via redirection mechanism
87 routing_links.connect_redirection_links(config)
146 routing_links.connect_redirection_links(config)
88
147
89 # Scan module for configuration decorators.
90 config.scan('.views', ignore='.tests')
91
92 config.add_route_predicate(
93 'skip_vcs_call', VCSCallPredicate)
@@ -23,7 +23,6 b' import logging'
23 import collections
23 import collections
24
24
25 from pyramid.httpexceptions import HTTPNotFound
25 from pyramid.httpexceptions import HTTPNotFound
26 from pyramid.view import view_config
27
26
28 from rhodecode.apps._base import BaseAppView, DataGridAppView
27 from rhodecode.apps._base import BaseAppView, DataGridAppView
29 from rhodecode.lib import helpers as h
28 from rhodecode.lib import helpers as h
@@ -50,13 +49,9 b' class HomeView(BaseAppView, DataGridAppV'
50 def load_default_context(self):
49 def load_default_context(self):
51 c = self._get_local_tmpl_context()
50 c = self._get_local_tmpl_context()
52 c.user = c.auth_user.get_instance()
51 c.user = c.auth_user.get_instance()
53
54 return c
52 return c
55
53
56 @LoginRequired()
54 @LoginRequired()
57 @view_config(
58 route_name='user_autocomplete_data', request_method='GET',
59 renderer='json_ext', xhr=True)
60 def user_autocomplete_data(self):
55 def user_autocomplete_data(self):
61 self.load_default_context()
56 self.load_default_context()
62 query = self.request.GET.get('query')
57 query = self.request.GET.get('query')
@@ -88,9 +83,6 b' class HomeView(BaseAppView, DataGridAppV'
88
83
89 @LoginRequired()
84 @LoginRequired()
90 @NotAnonymous()
85 @NotAnonymous()
91 @view_config(
92 route_name='user_group_autocomplete_data', request_method='GET',
93 renderer='json_ext', xhr=True)
94 def user_group_autocomplete_data(self):
86 def user_group_autocomplete_data(self):
95 self.load_default_context()
87 self.load_default_context()
96 query = self.request.GET.get('query')
88 query = self.request.GET.get('query')
@@ -434,9 +426,6 b' class HomeView(BaseAppView, DataGridAppV'
434 return files, True
426 return files, True
435
427
436 @LoginRequired()
428 @LoginRequired()
437 @view_config(
438 route_name='repo_list_data', request_method='GET',
439 renderer='json_ext', xhr=True)
440 def repo_list_data(self):
429 def repo_list_data(self):
441 _ = self.request.translate
430 _ = self.request.translate
442 self.load_default_context()
431 self.load_default_context()
@@ -461,9 +450,6 b' class HomeView(BaseAppView, DataGridAppV'
461 return data
450 return data
462
451
463 @LoginRequired()
452 @LoginRequired()
464 @view_config(
465 route_name='repo_group_list_data', request_method='GET',
466 renderer='json_ext', xhr=True)
467 def repo_group_list_data(self):
453 def repo_group_list_data(self):
468 _ = self.request.translate
454 _ = self.request.translate
469 self.load_default_context()
455 self.load_default_context()
@@ -619,9 +605,6 b' class HomeView(BaseAppView, DataGridAppV'
619 return queries
605 return queries
620
606
621 @LoginRequired()
607 @LoginRequired()
622 @view_config(
623 route_name='goto_switcher_data', request_method='GET',
624 renderer='json_ext', xhr=True)
625 def goto_switcher_data(self):
608 def goto_switcher_data(self):
626 c = self.load_default_context()
609 c = self.load_default_context()
627
610
@@ -750,9 +733,6 b' class HomeView(BaseAppView, DataGridAppV'
750 return {'suggestions': res}
733 return {'suggestions': res}
751
734
752 @LoginRequired()
735 @LoginRequired()
753 @view_config(
754 route_name='home', request_method='GET',
755 renderer='rhodecode:templates/index.mako')
756 def main_page(self):
736 def main_page(self):
757 c = self.load_default_context()
737 c = self.load_default_context()
758 c.repo_group = None
738 c.repo_group = None
@@ -789,9 +769,6 b' class HomeView(BaseAppView, DataGridAppV'
789 self._rhodecode_user, repo_group_id)
769 self._rhodecode_user, repo_group_id)
790
770
791 @LoginRequired()
771 @LoginRequired()
792 @view_config(
793 route_name='main_page_repo_groups_data',
794 request_method='GET', renderer='json_ext', xhr=True)
795 def main_page_repo_groups_data(self):
772 def main_page_repo_groups_data(self):
796 self.load_default_context()
773 self.load_default_context()
797 repo_group_id = safe_int(self.request.GET.get('repo_group_id'))
774 repo_group_id = safe_int(self.request.GET.get('repo_group_id'))
@@ -806,9 +783,6 b' class HomeView(BaseAppView, DataGridAppV'
806 return self._main_page_repo_groups_data(repo_group_id)
783 return self._main_page_repo_groups_data(repo_group_id)
807
784
808 @LoginRequired()
785 @LoginRequired()
809 @view_config(
810 route_name='main_page_repos_data',
811 request_method='GET', renderer='json_ext', xhr=True)
812 def main_page_repos_data(self):
786 def main_page_repos_data(self):
813 self.load_default_context()
787 self.load_default_context()
814 repo_group_id = safe_int(self.request.GET.get('repo_group_id'))
788 repo_group_id = safe_int(self.request.GET.get('repo_group_id'))
@@ -824,12 +798,6 b' class HomeView(BaseAppView, DataGridAppV'
824
798
825 @LoginRequired()
799 @LoginRequired()
826 @HasRepoGroupPermissionAnyDecorator(*AuthUser.repo_group_read_perms)
800 @HasRepoGroupPermissionAnyDecorator(*AuthUser.repo_group_read_perms)
827 @view_config(
828 route_name='repo_group_home', request_method='GET',
829 renderer='rhodecode:templates/index_repo_group.mako')
830 @view_config(
831 route_name='repo_group_home_slash', request_method='GET',
832 renderer='rhodecode:templates/index_repo_group.mako')
833 def repo_group_main_page(self):
801 def repo_group_main_page(self):
834 c = self.load_default_context()
802 c = self.load_default_context()
835 c.repo_group = self.request.db_repo_group
803 c.repo_group = self.request.db_repo_group
@@ -837,9 +805,6 b' class HomeView(BaseAppView, DataGridAppV'
837
805
838 @LoginRequired()
806 @LoginRequired()
839 @CSRFRequired()
807 @CSRFRequired()
840 @view_config(
841 route_name='markup_preview', request_method='POST',
842 renderer='string', xhr=True)
843 def markup_preview(self):
808 def markup_preview(self):
844 # Technically a CSRF token is not needed as no state changes with this
809 # Technically a CSRF token is not needed as no state changes with this
845 # call. However, as this is a POST is better to have it, so automated
810 # call. However, as this is a POST is better to have it, so automated
@@ -855,9 +820,6 b' class HomeView(BaseAppView, DataGridAppV'
855
820
856 @LoginRequired()
821 @LoginRequired()
857 @CSRFRequired()
822 @CSRFRequired()
858 @view_config(
859 route_name='file_preview', request_method='POST',
860 renderer='string', xhr=True)
861 def file_preview(self):
823 def file_preview(self):
862 # Technically a CSRF token is not needed as no state changes with this
824 # Technically a CSRF token is not needed as no state changes with this
863 # call. However, as this is a POST is better to have it, so automated
825 # call. However, as this is a POST is better to have it, so automated
@@ -883,9 +845,6 b' class HomeView(BaseAppView, DataGridAppV'
883
845
884 @LoginRequired()
846 @LoginRequired()
885 @CSRFRequired()
847 @CSRFRequired()
886 @view_config(
887 route_name='store_user_session_value', request_method='POST',
888 renderer='string', xhr=True)
889 def store_user_session_attr(self):
848 def store_user_session_attr(self):
890 key = self.request.POST.get('key')
849 key = self.request.POST.get('key')
891 val = self.request.POST.get('val')
850 val = self.request.POST.get('val')
@@ -20,26 +20,48 b''
20
20
21
21
22 def includeme(config):
22 def includeme(config):
23
23 from rhodecode.apps.hovercards.views import HoverCardsView, HoverCardsRepoView
24 config.add_route(
24 config.add_route(
25 name='hovercard_user',
25 name='hovercard_user',
26 pattern='/_hovercard/user/{user_id}')
26 pattern='/_hovercard/user/{user_id}')
27 config.add_view(
28 HoverCardsView,
29 attr='hovercard_user',
30 route_name='hovercard_user', request_method='GET', xhr=True,
31 renderer='rhodecode:templates/hovercards/hovercard_user.mako')
27
32
28 config.add_route(
33 config.add_route(
29 name='hovercard_username',
34 name='hovercard_username',
30 pattern='/_hovercard/username/{username}')
35 pattern='/_hovercard/username/{username}')
36 config.add_view(
37 HoverCardsView,
38 attr='hovercard_username',
39 route_name='hovercard_username', request_method='GET', xhr=True,
40 renderer='rhodecode:templates/hovercards/hovercard_user.mako')
31
41
32 config.add_route(
42 config.add_route(
33 name='hovercard_user_group',
43 name='hovercard_user_group',
34 pattern='/_hovercard/user_group/{user_group_id}')
44 pattern='/_hovercard/user_group/{user_group_id}')
45 config.add_view(
46 HoverCardsView,
47 attr='hovercard_user_group',
48 route_name='hovercard_user_group', request_method='GET', xhr=True,
49 renderer='rhodecode:templates/hovercards/hovercard_user_group.mako')
35
50
36 config.add_route(
51 config.add_route(
37 name='hovercard_pull_request',
52 name='hovercard_pull_request',
38 pattern='/_hovercard/pull_request/{pull_request_id}')
53 pattern='/_hovercard/pull_request/{pull_request_id}')
54 config.add_view(
55 HoverCardsView,
56 attr='hovercard_pull_request',
57 route_name='hovercard_pull_request', request_method='GET', xhr=True,
58 renderer='rhodecode:templates/hovercards/hovercard_pull_request.mako')
39
59
40 config.add_route(
60 config.add_route(
41 name='hovercard_repo_commit',
61 name='hovercard_repo_commit',
42 pattern='/_hovercard/commit/{repo_name:.*?[^/]}/{commit_id}', repo_route=True)
62 pattern='/_hovercard/commit/{repo_name:.*?[^/]}/{commit_id}', repo_route=True)
43
63 config.add_view(
44 # Scan module for configuration decorators.
64 HoverCardsRepoView,
45 config.scan('.views', ignore='.tests')
65 attr='hovercard_repo_commit',
66 route_name='hovercard_repo_commit', request_method='GET', xhr=True,
67 renderer='rhodecode:templates/hovercards/hovercard_repo_commit.mako')
@@ -23,7 +23,7 b' import logging'
23 import collections
23 import collections
24
24
25 from pyramid.httpexceptions import HTTPNotFound
25 from pyramid.httpexceptions import HTTPNotFound
26 from pyramid.view import view_config
26
27
27
28 from rhodecode.apps._base import BaseAppView, RepoAppView
28 from rhodecode.apps._base import BaseAppView, RepoAppView
29 from rhodecode.lib import helpers as h
29 from rhodecode.lib import helpers as h
@@ -54,9 +54,6 b' class HoverCardsView(BaseAppView):'
54 return c
54 return c
55
55
56 @LoginRequired()
56 @LoginRequired()
57 @view_config(
58 route_name='hovercard_user', request_method='GET', xhr=True,
59 renderer='rhodecode:templates/hovercards/hovercard_user.mako')
60 def hovercard_user(self):
57 def hovercard_user(self):
61 c = self.load_default_context()
58 c = self.load_default_context()
62 user_id = self.request.matchdict['user_id']
59 user_id = self.request.matchdict['user_id']
@@ -64,9 +61,6 b' class HoverCardsView(BaseAppView):'
64 return self._get_template_context(c)
61 return self._get_template_context(c)
65
62
66 @LoginRequired()
63 @LoginRequired()
67 @view_config(
68 route_name='hovercard_username', request_method='GET', xhr=True,
69 renderer='rhodecode:templates/hovercards/hovercard_user.mako')
70 def hovercard_username(self):
64 def hovercard_username(self):
71 c = self.load_default_context()
65 c = self.load_default_context()
72 username = self.request.matchdict['username']
66 username = self.request.matchdict['username']
@@ -77,9 +71,6 b' class HoverCardsView(BaseAppView):'
77 return self._get_template_context(c)
71 return self._get_template_context(c)
78
72
79 @LoginRequired()
73 @LoginRequired()
80 @view_config(
81 route_name='hovercard_user_group', request_method='GET', xhr=True,
82 renderer='rhodecode:templates/hovercards/hovercard_user_group.mako')
83 def hovercard_user_group(self):
74 def hovercard_user_group(self):
84 c = self.load_default_context()
75 c = self.load_default_context()
85 user_group_id = self.request.matchdict['user_group_id']
76 user_group_id = self.request.matchdict['user_group_id']
@@ -87,9 +78,6 b' class HoverCardsView(BaseAppView):'
87 return self._get_template_context(c)
78 return self._get_template_context(c)
88
79
89 @LoginRequired()
80 @LoginRequired()
90 @view_config(
91 route_name='hovercard_pull_request', request_method='GET', xhr=True,
92 renderer='rhodecode:templates/hovercards/hovercard_pull_request.mako')
93 def hovercard_pull_request(self):
81 def hovercard_pull_request(self):
94 c = self.load_default_context()
82 c = self.load_default_context()
95 c.pull_request = PullRequest.get_or_404(
83 c.pull_request = PullRequest.get_or_404(
@@ -107,9 +95,6 b' class HoverCardsRepoView(RepoAppView):'
107
95
108 @LoginRequired()
96 @LoginRequired()
109 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', 'repository.admin')
97 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', 'repository.admin')
110 @view_config(
111 route_name='hovercard_repo_commit', request_method='GET', xhr=True,
112 renderer='rhodecode:templates/hovercards/hovercard_repo_commit.mako')
113 def hovercard_repo_commit(self):
98 def hovercard_repo_commit(self):
114 c = self.load_default_context()
99 c = self.load_default_context()
115 commit_id = self.request.matchdict['commit_id']
100 commit_id = self.request.matchdict['commit_id']
@@ -23,31 +23,80 b' from rhodecode.apps._base import ADMIN_P'
23
23
24
24
25 def admin_routes(config):
25 def admin_routes(config):
26 from rhodecode.apps.journal.views import JournalView
26
27
27 config.add_route(
28 config.add_route(
28 name='journal', pattern='/journal')
29 name='journal', pattern='/journal')
30 config.add_view(
31 JournalView,
32 attr='journal',
33 route_name='journal', request_method='GET',
34 renderer=None)
35
29 config.add_route(
36 config.add_route(
30 name='journal_rss', pattern='/journal/rss')
37 name='journal_rss', pattern='/journal/rss')
38 config.add_view(
39 JournalView,
40 attr='journal_rss',
41 route_name='journal_rss', request_method='GET',
42 renderer=None)
43
31 config.add_route(
44 config.add_route(
32 name='journal_atom', pattern='/journal/atom')
45 name='journal_atom', pattern='/journal/atom')
46 config.add_view(
47 JournalView,
48 attr='journal_atom',
49 route_name='journal_atom', request_method='GET',
50 renderer=None)
33
51
34 config.add_route(
52 config.add_route(
35 name='journal_public', pattern='/public_journal')
53 name='journal_public', pattern='/public_journal')
54 config.add_view(
55 JournalView,
56 attr='journal_public',
57 route_name='journal_public', request_method='GET',
58 renderer=None)
59
36 config.add_route(
60 config.add_route(
37 name='journal_public_atom', pattern='/public_journal/atom')
61 name='journal_public_atom', pattern='/public_journal/atom')
62 config.add_view(
63 JournalView,
64 attr='journal_public_atom',
65 route_name='journal_public_atom', request_method='GET',
66 renderer=None)
67
38 config.add_route(
68 config.add_route(
39 name='journal_public_atom_old', pattern='/public_journal_atom')
69 name='journal_public_atom_old', pattern='/public_journal_atom')
70 config.add_view(
71 JournalView,
72 attr='journal_public_atom',
73 route_name='journal_public_atom_old', request_method='GET',
74 renderer=None)
40
75
41 config.add_route(
76 config.add_route(
42 name='journal_public_rss', pattern='/public_journal/rss')
77 name='journal_public_rss', pattern='/public_journal/rss')
78 config.add_view(
79 JournalView,
80 attr='journal_public_rss',
81 route_name='journal_public_rss', request_method='GET',
82 renderer=None)
83
43 config.add_route(
84 config.add_route(
44 name='journal_public_rss_old', pattern='/public_journal_rss')
85 name='journal_public_rss_old', pattern='/public_journal_rss')
86 config.add_view(
87 JournalView,
88 attr='journal_public_rss',
89 route_name='journal_public_rss_old', request_method='GET',
90 renderer=None)
45
91
46 config.add_route(
92 config.add_route(
47 name='toggle_following', pattern='/toggle_following')
93 name='toggle_following', pattern='/toggle_following')
94 config.add_view(
95 JournalView,
96 attr='toggle_following',
97 route_name='toggle_following', request_method='POST',
98 renderer='json_ext')
48
99
49
100
50 def includeme(config):
101 def includeme(config):
51 config.include(admin_routes, route_prefix=ADMIN_PREFIX)
102 config.include(admin_routes, route_prefix=ADMIN_PREFIX)
52 # Scan module for configuration decorators.
53 config.scan('.views', ignore='.tests')
@@ -18,13 +18,9 b''
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21
22 import logging
21 import logging
23 import itertools
22 import itertools
24
23
25
26
27 from pyramid.view import view_config
28 from pyramid.httpexceptions import HTTPBadRequest
24 from pyramid.httpexceptions import HTTPBadRequest
29 from pyramid.response import Response
25 from pyramid.response import Response
30 from pyramid.renderers import render
26 from pyramid.renderers import render
@@ -218,9 +214,6 b' class JournalView(BaseAppView):'
218
214
219 @LoginRequired()
215 @LoginRequired()
220 @NotAnonymous()
216 @NotAnonymous()
221 @view_config(
222 route_name='journal', request_method='GET',
223 renderer=None)
224 def journal(self):
217 def journal(self):
225 c = self.load_default_context()
218 c = self.load_default_context()
226
219
@@ -258,9 +251,6 b' class JournalView(BaseAppView):'
258
251
259 @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED])
252 @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED])
260 @NotAnonymous()
253 @NotAnonymous()
261 @view_config(
262 route_name='journal_atom', request_method='GET',
263 renderer=None)
264 def journal_atom(self):
254 def journal_atom(self):
265 """
255 """
266 Produce an atom-1.0 feed via feedgenerator module
256 Produce an atom-1.0 feed via feedgenerator module
@@ -274,9 +264,6 b' class JournalView(BaseAppView):'
274
264
275 @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED])
265 @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED])
276 @NotAnonymous()
266 @NotAnonymous()
277 @view_config(
278 route_name='journal_rss', request_method='GET',
279 renderer=None)
280 def journal_rss(self):
267 def journal_rss(self):
281 """
268 """
282 Produce an rss feed via feedgenerator module
269 Produce an rss feed via feedgenerator module
@@ -289,39 +276,6 b' class JournalView(BaseAppView):'
289 return self._rss_feed(following_repos, c.search_term, public=False)
276 return self._rss_feed(following_repos, c.search_term, public=False)
290
277
291 @LoginRequired()
278 @LoginRequired()
292 @NotAnonymous()
293 @CSRFRequired()
294 @view_config(
295 route_name='toggle_following', request_method='POST',
296 renderer='json_ext')
297 def toggle_following(self):
298 user_id = self.request.POST.get('follows_user_id')
299 if user_id:
300 try:
301 ScmModel().toggle_following_user(user_id, self._rhodecode_user.user_id)
302 Session().commit()
303 return 'ok'
304 except Exception:
305 raise HTTPBadRequest()
306
307 repo_id = self.request.POST.get('follows_repo_id')
308 repo = Repository.get_or_404(repo_id)
309 perm_set = ['repository.read', 'repository.write', 'repository.admin']
310 has_perm = HasRepoPermissionAny(*perm_set)(repo.repo_name, 'RepoWatch check')
311 if repo and has_perm:
312 try:
313 ScmModel().toggle_following_repo(repo_id, self._rhodecode_user.user_id)
314 Session().commit()
315 return 'ok'
316 except Exception:
317 raise HTTPBadRequest()
318
319 raise HTTPBadRequest()
320
321 @LoginRequired()
322 @view_config(
323 route_name='journal_public', request_method='GET',
324 renderer=None)
325 def journal_public(self):
279 def journal_public(self):
326 c = self.load_default_context()
280 c = self.load_default_context()
327 # Return a rendered template
281 # Return a rendered template
@@ -357,9 +311,6 b' class JournalView(BaseAppView):'
357 return Response(html)
311 return Response(html)
358
312
359 @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED])
313 @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED])
360 @view_config(
361 route_name='journal_public_atom', request_method='GET',
362 renderer=None)
363 def journal_public_atom(self):
314 def journal_public_atom(self):
364 """
315 """
365 Produce an atom-1.0 feed via feedgenerator module
316 Produce an atom-1.0 feed via feedgenerator module
@@ -373,9 +324,6 b' class JournalView(BaseAppView):'
373 return self._atom_feed(following_repos, c.search_term)
324 return self._atom_feed(following_repos, c.search_term)
374
325
375 @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED])
326 @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED])
376 @view_config(
377 route_name='journal_public_rss', request_method='GET',
378 renderer=None)
379 def journal_public_rss(self):
327 def journal_public_rss(self):
380 """
328 """
381 Produce an rss2 feed via feedgenerator module
329 Produce an rss2 feed via feedgenerator module
@@ -387,3 +335,30 b' class JournalView(BaseAppView):'
387 .all()
335 .all()
388
336
389 return self._rss_feed(following_repos, c.search_term)
337 return self._rss_feed(following_repos, c.search_term)
338
339 @LoginRequired()
340 @NotAnonymous()
341 @CSRFRequired()
342 def toggle_following(self):
343 user_id = self.request.POST.get('follows_user_id')
344 if user_id:
345 try:
346 ScmModel().toggle_following_user(user_id, self._rhodecode_user.user_id)
347 Session().commit()
348 return 'ok'
349 except Exception:
350 raise HTTPBadRequest()
351
352 repo_id = self.request.POST.get('follows_repo_id')
353 repo = Repository.get_or_404(repo_id)
354 perm_set = ['repository.read', 'repository.write', 'repository.admin']
355 has_perm = HasRepoPermissionAny(*perm_set)(repo.repo_name, 'RepoWatch check')
356 if repo and has_perm:
357 try:
358 ScmModel().toggle_following_repo(repo_id, self._rhodecode_user.user_id)
359 Session().commit()
360 return 'ok'
361 except Exception:
362 raise HTTPBadRequest()
363
364 raise HTTPBadRequest()
@@ -23,22 +23,57 b' from rhodecode.apps._base import ADMIN_P'
23
23
24
24
25 def includeme(config):
25 def includeme(config):
26
26 from rhodecode.apps.login.views import LoginView
27
27 config.add_route(
28 config.add_route(
28 name='login',
29 name='login',
29 pattern=ADMIN_PREFIX + '/login')
30 pattern=ADMIN_PREFIX + '/login')
31 config.add_view(
32 LoginView,
33 attr='login',
34 route_name='login', request_method='GET',
35 renderer='rhodecode:templates/login.mako')
36 config.add_view(
37 LoginView,
38 attr='login_post',
39 route_name='login', request_method='POST',
40 renderer='rhodecode:templates/login.mako')
41
30 config.add_route(
42 config.add_route(
31 name='logout',
43 name='logout',
32 pattern=ADMIN_PREFIX + '/logout')
44 pattern=ADMIN_PREFIX + '/logout')
45 config.add_view(
46 LoginView,
47 attr='logout',
48 route_name='logout', request_method='POST')
49
33 config.add_route(
50 config.add_route(
34 name='register',
51 name='register',
35 pattern=ADMIN_PREFIX + '/register')
52 pattern=ADMIN_PREFIX + '/register')
53 config.add_view(
54 LoginView,
55 attr='register',
56 route_name='register', request_method='GET',
57 renderer='rhodecode:templates/register.mako')
58 config.add_view(
59 LoginView,
60 attr='register_post',
61 route_name='register', request_method='POST',
62 renderer='rhodecode:templates/register.mako')
63
36 config.add_route(
64 config.add_route(
37 name='reset_password',
65 name='reset_password',
38 pattern=ADMIN_PREFIX + '/password_reset')
66 pattern=ADMIN_PREFIX + '/password_reset')
67 config.add_view(
68 LoginView,
69 attr='password_reset',
70 route_name='reset_password', request_method=('GET', 'POST'),
71 renderer='rhodecode:templates/password_reset.mako')
72
39 config.add_route(
73 config.add_route(
40 name='reset_password_confirmation',
74 name='reset_password_confirmation',
41 pattern=ADMIN_PREFIX + '/password_reset_confirmation')
75 pattern=ADMIN_PREFIX + '/password_reset_confirmation')
42
76 config.add_view(
43 # Scan module for configuration decorators.
77 LoginView,
44 config.scan('.views', ignore='.tests')
78 attr='password_reset_confirmation',
79 route_name='reset_password_confirmation', request_method='GET')
@@ -28,7 +28,7 b' import urlparse'
28 import requests
28 import requests
29
29
30 from pyramid.httpexceptions import HTTPFound
30 from pyramid.httpexceptions import HTTPFound
31 from pyramid.view import view_config
31
32
32
33 from rhodecode.apps._base import BaseAppView
33 from rhodecode.apps._base import BaseAppView
34 from rhodecode.authentication.base import authenticate, HTTP_TYPE
34 from rhodecode.authentication.base import authenticate, HTTP_TYPE
@@ -114,7 +114,6 b' class LoginView(BaseAppView):'
114 def load_default_context(self):
114 def load_default_context(self):
115 c = self._get_local_tmpl_context()
115 c = self._get_local_tmpl_context()
116 c.came_from = get_came_from(self.request)
116 c.came_from = get_came_from(self.request)
117
118 return c
117 return c
119
118
120 def _get_captcha_data(self):
119 def _get_captcha_data(self):
@@ -148,9 +147,6 b' class LoginView(BaseAppView):'
148
147
149 return captcha_status, captcha_message
148 return captcha_status, captcha_message
150
149
151 @view_config(
152 route_name='login', request_method='GET',
153 renderer='rhodecode:templates/login.mako')
154 def login(self):
150 def login(self):
155 c = self.load_default_context()
151 c = self.load_default_context()
156 auth_user = self._rhodecode_user
152 auth_user = self._rhodecode_user
@@ -175,9 +171,6 b' class LoginView(BaseAppView):'
175
171
176 return self._get_template_context(c)
172 return self._get_template_context(c)
177
173
178 @view_config(
179 route_name='login', request_method='POST',
180 renderer='rhodecode:templates/login.mako')
181 def login_post(self):
174 def login_post(self):
182 c = self.load_default_context()
175 c = self.load_default_context()
183
176
@@ -229,7 +222,6 b' class LoginView(BaseAppView):'
229 return self._get_template_context(c)
222 return self._get_template_context(c)
230
223
231 @CSRFRequired()
224 @CSRFRequired()
232 @view_config(route_name='logout', request_method='POST')
233 def logout(self):
225 def logout(self):
234 auth_user = self._rhodecode_user
226 auth_user = self._rhodecode_user
235 log.info('Deleting session for user: `%s`', auth_user)
227 log.info('Deleting session for user: `%s`', auth_user)
@@ -243,9 +235,6 b' class LoginView(BaseAppView):'
243
235
244 @HasPermissionAnyDecorator(
236 @HasPermissionAnyDecorator(
245 'hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')
237 'hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')
246 @view_config(
247 route_name='register', request_method='GET',
248 renderer='rhodecode:templates/register.mako',)
249 def register(self, defaults=None, errors=None):
238 def register(self, defaults=None, errors=None):
250 c = self.load_default_context()
239 c = self.load_default_context()
251 defaults = defaults or {}
240 defaults = defaults or {}
@@ -270,9 +259,6 b' class LoginView(BaseAppView):'
270
259
271 @HasPermissionAnyDecorator(
260 @HasPermissionAnyDecorator(
272 'hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')
261 'hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')
273 @view_config(
274 route_name='register', request_method='POST',
275 renderer='rhodecode:templates/register.mako')
276 def register_post(self):
262 def register_post(self):
277 from rhodecode.authentication.plugins import auth_rhodecode
263 from rhodecode.authentication.plugins import auth_rhodecode
278
264
@@ -353,9 +339,6 b' class LoginView(BaseAppView):'
353 h.flash(e, category='error')
339 h.flash(e, category='error')
354 return self.register()
340 return self.register()
355
341
356 @view_config(
357 route_name='reset_password', request_method=('GET', 'POST'),
358 renderer='rhodecode:templates/password_reset.mako')
359 def password_reset(self):
342 def password_reset(self):
360 c = self.load_default_context()
343 c = self.load_default_context()
361 captcha = self._get_captcha_data()
344 captcha = self._get_captcha_data()
@@ -454,8 +437,6 b' class LoginView(BaseAppView):'
454
437
455 return self._get_template_context(c, **template_context)
438 return self._get_template_context(c, **template_context)
456
439
457 @view_config(route_name='reset_password_confirmation',
458 request_method='GET')
459 def password_reset_confirmation(self):
440 def password_reset_confirmation(self):
460 self.load_default_context()
441 self.load_default_context()
461 if self.request.GET and self.request.GET.get('key'):
442 if self.request.GET and self.request.GET.get('key'):
@@ -23,138 +23,311 b' from rhodecode.apps._base import ADMIN_P'
23
23
24
24
25 def includeme(config):
25 def includeme(config):
26 from rhodecode.apps.my_account.views.my_account import MyAccountView
27 from rhodecode.apps.my_account.views.my_account_notifications import MyAccountNotificationsView
28 from rhodecode.apps.my_account.views.my_account_ssh_keys import MyAccountSshKeysView
26
29
27 config.add_route(
30 config.add_route(
28 name='my_account_profile',
31 name='my_account_profile',
29 pattern=ADMIN_PREFIX + '/my_account/profile')
32 pattern=ADMIN_PREFIX + '/my_account/profile')
33 config.add_view(
34 MyAccountView,
35 attr='my_account_profile',
36 route_name='my_account_profile', request_method='GET',
37 renderer='rhodecode:templates/admin/my_account/my_account.mako')
30
38
31 # my account edit details
39 # my account edit details
32 config.add_route(
40 config.add_route(
33 name='my_account_edit',
41 name='my_account_edit',
34 pattern=ADMIN_PREFIX + '/my_account/edit')
42 pattern=ADMIN_PREFIX + '/my_account/edit')
43 config.add_view(
44 MyAccountView,
45 attr='my_account_edit',
46 route_name='my_account_edit',
47 request_method='GET',
48 renderer='rhodecode:templates/admin/my_account/my_account.mako')
49
35 config.add_route(
50 config.add_route(
36 name='my_account_update',
51 name='my_account_update',
37 pattern=ADMIN_PREFIX + '/my_account/update')
52 pattern=ADMIN_PREFIX + '/my_account/update')
53 config.add_view(
54 MyAccountView,
55 attr='my_account_update',
56 route_name='my_account_update',
57 request_method='POST',
58 renderer='rhodecode:templates/admin/my_account/my_account.mako')
38
59
39 # my account password
60 # my account password
40 config.add_route(
61 config.add_route(
41 name='my_account_password',
62 name='my_account_password',
42 pattern=ADMIN_PREFIX + '/my_account/password')
63 pattern=ADMIN_PREFIX + '/my_account/password')
64 config.add_view(
65 MyAccountView,
66 attr='my_account_password',
67 route_name='my_account_password', request_method='GET',
68 renderer='rhodecode:templates/admin/my_account/my_account.mako')
43
69
44 config.add_route(
70 config.add_route(
45 name='my_account_password_update',
71 name='my_account_password_update',
46 pattern=ADMIN_PREFIX + '/my_account/password/update')
72 pattern=ADMIN_PREFIX + '/my_account/password/update')
73 config.add_view(
74 MyAccountView,
75 attr='my_account_password_update',
76 route_name='my_account_password_update', request_method='POST',
77 renderer='rhodecode:templates/admin/my_account/my_account.mako')
47
78
48 # my account tokens
79 # my account tokens
49 config.add_route(
80 config.add_route(
50 name='my_account_auth_tokens',
81 name='my_account_auth_tokens',
51 pattern=ADMIN_PREFIX + '/my_account/auth_tokens')
82 pattern=ADMIN_PREFIX + '/my_account/auth_tokens')
83 config.add_view(
84 MyAccountView,
85 attr='my_account_auth_tokens',
86 route_name='my_account_auth_tokens', request_method='GET',
87 renderer='rhodecode:templates/admin/my_account/my_account.mako')
88
52 config.add_route(
89 config.add_route(
53 name='my_account_auth_tokens_view',
90 name='my_account_auth_tokens_view',
54 pattern=ADMIN_PREFIX + '/my_account/auth_tokens/view')
91 pattern=ADMIN_PREFIX + '/my_account/auth_tokens/view')
92 config.add_view(
93 MyAccountView,
94 attr='my_account_auth_tokens_view',
95 route_name='my_account_auth_tokens_view', request_method='POST', xhr=True,
96 renderer='json_ext')
97
55 config.add_route(
98 config.add_route(
56 name='my_account_auth_tokens_add',
99 name='my_account_auth_tokens_add',
57 pattern=ADMIN_PREFIX + '/my_account/auth_tokens/new')
100 pattern=ADMIN_PREFIX + '/my_account/auth_tokens/new')
101 config.add_view(
102 MyAccountView,
103 attr='my_account_auth_tokens_add',
104 route_name='my_account_auth_tokens_add', request_method='POST')
105
58 config.add_route(
106 config.add_route(
59 name='my_account_auth_tokens_delete',
107 name='my_account_auth_tokens_delete',
60 pattern=ADMIN_PREFIX + '/my_account/auth_tokens/delete')
108 pattern=ADMIN_PREFIX + '/my_account/auth_tokens/delete')
109 config.add_view(
110 MyAccountView,
111 attr='my_account_auth_tokens_delete',
112 route_name='my_account_auth_tokens_delete', request_method='POST')
61
113
62 # my account ssh keys
114 # my account ssh keys
63 config.add_route(
115 config.add_route(
64 name='my_account_ssh_keys',
116 name='my_account_ssh_keys',
65 pattern=ADMIN_PREFIX + '/my_account/ssh_keys')
117 pattern=ADMIN_PREFIX + '/my_account/ssh_keys')
118 config.add_view(
119 MyAccountSshKeysView,
120 attr='my_account_ssh_keys',
121 route_name='my_account_ssh_keys', request_method='GET',
122 renderer='rhodecode:templates/admin/my_account/my_account.mako')
123
66 config.add_route(
124 config.add_route(
67 name='my_account_ssh_keys_generate',
125 name='my_account_ssh_keys_generate',
68 pattern=ADMIN_PREFIX + '/my_account/ssh_keys/generate')
126 pattern=ADMIN_PREFIX + '/my_account/ssh_keys/generate')
127 config.add_view(
128 MyAccountSshKeysView,
129 attr='ssh_keys_generate_keypair',
130 route_name='my_account_ssh_keys_generate', request_method='GET',
131 renderer='rhodecode:templates/admin/my_account/my_account.mako')
132
69 config.add_route(
133 config.add_route(
70 name='my_account_ssh_keys_add',
134 name='my_account_ssh_keys_add',
71 pattern=ADMIN_PREFIX + '/my_account/ssh_keys/new')
135 pattern=ADMIN_PREFIX + '/my_account/ssh_keys/new')
136 config.add_view(
137 MyAccountSshKeysView,
138 attr='my_account_ssh_keys_add',
139 route_name='my_account_ssh_keys_add', request_method='POST',)
140
72 config.add_route(
141 config.add_route(
73 name='my_account_ssh_keys_delete',
142 name='my_account_ssh_keys_delete',
74 pattern=ADMIN_PREFIX + '/my_account/ssh_keys/delete')
143 pattern=ADMIN_PREFIX + '/my_account/ssh_keys/delete')
144 config.add_view(
145 MyAccountSshKeysView,
146 attr='my_account_ssh_keys_delete',
147 route_name='my_account_ssh_keys_delete', request_method='POST')
75
148
76 # my account user group membership
149 # my account user group membership
77 config.add_route(
150 config.add_route(
78 name='my_account_user_group_membership',
151 name='my_account_user_group_membership',
79 pattern=ADMIN_PREFIX + '/my_account/user_group_membership')
152 pattern=ADMIN_PREFIX + '/my_account/user_group_membership')
153 config.add_view(
154 MyAccountView,
155 attr='my_account_user_group_membership',
156 route_name='my_account_user_group_membership',
157 request_method='GET',
158 renderer='rhodecode:templates/admin/my_account/my_account.mako')
80
159
81 # my account emails
160 # my account emails
82 config.add_route(
161 config.add_route(
83 name='my_account_emails',
162 name='my_account_emails',
84 pattern=ADMIN_PREFIX + '/my_account/emails')
163 pattern=ADMIN_PREFIX + '/my_account/emails')
164 config.add_view(
165 MyAccountView,
166 attr='my_account_emails',
167 route_name='my_account_emails', request_method='GET',
168 renderer='rhodecode:templates/admin/my_account/my_account.mako')
169
85 config.add_route(
170 config.add_route(
86 name='my_account_emails_add',
171 name='my_account_emails_add',
87 pattern=ADMIN_PREFIX + '/my_account/emails/new')
172 pattern=ADMIN_PREFIX + '/my_account/emails/new')
173 config.add_view(
174 MyAccountView,
175 attr='my_account_emails_add',
176 route_name='my_account_emails_add', request_method='POST',
177 renderer='rhodecode:templates/admin/my_account/my_account.mako')
178
88 config.add_route(
179 config.add_route(
89 name='my_account_emails_delete',
180 name='my_account_emails_delete',
90 pattern=ADMIN_PREFIX + '/my_account/emails/delete')
181 pattern=ADMIN_PREFIX + '/my_account/emails/delete')
182 config.add_view(
183 MyAccountView,
184 attr='my_account_emails_delete',
185 route_name='my_account_emails_delete', request_method='POST')
91
186
92 config.add_route(
187 config.add_route(
93 name='my_account_repos',
188 name='my_account_repos',
94 pattern=ADMIN_PREFIX + '/my_account/repos')
189 pattern=ADMIN_PREFIX + '/my_account/repos')
190 config.add_view(
191 MyAccountView,
192 attr='my_account_repos',
193 route_name='my_account_repos', request_method='GET',
194 renderer='rhodecode:templates/admin/my_account/my_account.mako')
95
195
96 config.add_route(
196 config.add_route(
97 name='my_account_watched',
197 name='my_account_watched',
98 pattern=ADMIN_PREFIX + '/my_account/watched')
198 pattern=ADMIN_PREFIX + '/my_account/watched')
199 config.add_view(
200 MyAccountView,
201 attr='my_account_watched',
202 route_name='my_account_watched', request_method='GET',
203 renderer='rhodecode:templates/admin/my_account/my_account.mako')
99
204
100 config.add_route(
205 config.add_route(
101 name='my_account_bookmarks',
206 name='my_account_bookmarks',
102 pattern=ADMIN_PREFIX + '/my_account/bookmarks')
207 pattern=ADMIN_PREFIX + '/my_account/bookmarks')
208 config.add_view(
209 MyAccountView,
210 attr='my_account_bookmarks',
211 route_name='my_account_bookmarks', request_method='GET',
212 renderer='rhodecode:templates/admin/my_account/my_account.mako')
103
213
104 config.add_route(
214 config.add_route(
105 name='my_account_bookmarks_update',
215 name='my_account_bookmarks_update',
106 pattern=ADMIN_PREFIX + '/my_account/bookmarks/update')
216 pattern=ADMIN_PREFIX + '/my_account/bookmarks/update')
217 config.add_view(
218 MyAccountView,
219 attr='my_account_bookmarks_update',
220 route_name='my_account_bookmarks_update', request_method='POST')
107
221
108 config.add_route(
222 config.add_route(
109 name='my_account_goto_bookmark',
223 name='my_account_goto_bookmark',
110 pattern=ADMIN_PREFIX + '/my_account/bookmark/{bookmark_id}')
224 pattern=ADMIN_PREFIX + '/my_account/bookmark/{bookmark_id}')
225 config.add_view(
226 MyAccountView,
227 attr='my_account_goto_bookmark',
228 route_name='my_account_goto_bookmark', request_method='GET',
229 renderer='rhodecode:templates/admin/my_account/my_account.mako')
111
230
112 config.add_route(
231 config.add_route(
113 name='my_account_perms',
232 name='my_account_perms',
114 pattern=ADMIN_PREFIX + '/my_account/perms')
233 pattern=ADMIN_PREFIX + '/my_account/perms')
234 config.add_view(
235 MyAccountView,
236 attr='my_account_perms',
237 route_name='my_account_perms', request_method='GET',
238 renderer='rhodecode:templates/admin/my_account/my_account.mako')
115
239
116 config.add_route(
240 config.add_route(
117 name='my_account_notifications',
241 name='my_account_notifications',
118 pattern=ADMIN_PREFIX + '/my_account/notifications')
242 pattern=ADMIN_PREFIX + '/my_account/notifications')
243 config.add_view(
244 MyAccountView,
245 attr='my_notifications',
246 route_name='my_account_notifications', request_method='GET',
247 renderer='rhodecode:templates/admin/my_account/my_account.mako')
119
248
120 config.add_route(
249 config.add_route(
121 name='my_account_notifications_toggle_visibility',
250 name='my_account_notifications_toggle_visibility',
122 pattern=ADMIN_PREFIX + '/my_account/toggle_visibility')
251 pattern=ADMIN_PREFIX + '/my_account/toggle_visibility')
252 config.add_view(
253 MyAccountView,
254 attr='my_notifications_toggle_visibility',
255 route_name='my_account_notifications_toggle_visibility',
256 request_method='POST', renderer='json_ext')
123
257
124 # my account pull requests
258 # my account pull requests
125 config.add_route(
259 config.add_route(
126 name='my_account_pullrequests',
260 name='my_account_pullrequests',
127 pattern=ADMIN_PREFIX + '/my_account/pull_requests')
261 pattern=ADMIN_PREFIX + '/my_account/pull_requests')
262 config.add_view(
263 MyAccountView,
264 attr='my_account_pullrequests',
265 route_name='my_account_pullrequests',
266 request_method='GET',
267 renderer='rhodecode:templates/admin/my_account/my_account.mako')
268
128 config.add_route(
269 config.add_route(
129 name='my_account_pullrequests_data',
270 name='my_account_pullrequests_data',
130 pattern=ADMIN_PREFIX + '/my_account/pull_requests/data')
271 pattern=ADMIN_PREFIX + '/my_account/pull_requests/data')
272 config.add_view(
273 MyAccountView,
274 attr='my_account_pullrequests_data',
275 route_name='my_account_pullrequests_data',
276 request_method='GET', renderer='json_ext')
277
278 # channelstream test
279 config.add_route(
280 name='my_account_notifications_test_channelstream',
281 pattern=ADMIN_PREFIX + '/my_account/test_channelstream')
282 config.add_view(
283 MyAccountView,
284 attr='my_account_notifications_test_channelstream',
285 route_name='my_account_notifications_test_channelstream',
286 request_method='POST', renderer='json_ext')
131
287
132 # notifications
288 # notifications
133 config.add_route(
289 config.add_route(
134 name='notifications_show_all',
290 name='notifications_show_all',
135 pattern=ADMIN_PREFIX + '/notifications')
291 pattern=ADMIN_PREFIX + '/notifications')
292 config.add_view(
293 MyAccountNotificationsView,
294 attr='notifications_show_all',
295 route_name='notifications_show_all', request_method='GET',
296 renderer='rhodecode:templates/admin/notifications/notifications_show_all.mako')
136
297
137 # notifications
298 # notifications
138 config.add_route(
299 config.add_route(
139 name='notifications_mark_all_read',
300 name='notifications_mark_all_read',
140 pattern=ADMIN_PREFIX + '/notifications/mark_all_read')
301 pattern=ADMIN_PREFIX + '/notifications_mark_all_read')
302 config.add_view(
303 MyAccountNotificationsView,
304 attr='notifications_mark_all_read',
305 route_name='notifications_mark_all_read', request_method='POST',
306 renderer='rhodecode:templates/admin/notifications/notifications_show_all.mako')
141
307
142 config.add_route(
308 config.add_route(
143 name='notifications_show',
309 name='notifications_show',
144 pattern=ADMIN_PREFIX + '/notifications/{notification_id}')
310 pattern=ADMIN_PREFIX + '/notifications/{notification_id}')
311 config.add_view(
312 MyAccountNotificationsView,
313 attr='notifications_show',
314 route_name='notifications_show', request_method='GET',
315 renderer='rhodecode:templates/admin/notifications/notifications_show.mako')
145
316
146 config.add_route(
317 config.add_route(
147 name='notifications_update',
318 name='notifications_update',
148 pattern=ADMIN_PREFIX + '/notifications/{notification_id}/update')
319 pattern=ADMIN_PREFIX + '/notifications/{notification_id}/update')
320 config.add_view(
321 MyAccountNotificationsView,
322 attr='notification_update',
323 route_name='notifications_update', request_method='POST',
324 renderer='json_ext')
149
325
150 config.add_route(
326 config.add_route(
151 name='notifications_delete',
327 name='notifications_delete',
152 pattern=ADMIN_PREFIX + '/notifications/{notification_id}/delete')
328 pattern=ADMIN_PREFIX + '/notifications/{notification_id}/delete')
153
329 config.add_view(
154 # channelstream test
330 MyAccountNotificationsView,
155 config.add_route(
331 attr='notification_delete',
156 name='my_account_notifications_test_channelstream',
332 route_name='notifications_delete', request_method='POST',
157 pattern=ADMIN_PREFIX + '/my_account/test_channelstream')
333 renderer='json_ext')
158
159 # Scan module for configuration decorators.
160 config.scan('.views', ignore='.tests')
@@ -40,7 +40,7 b' def route_path(name, params=None, **kwar'
40
40
41 base_url = {
41 base_url = {
42 'notifications_show_all': ADMIN_PREFIX + '/notifications',
42 'notifications_show_all': ADMIN_PREFIX + '/notifications',
43 'notifications_mark_all_read': ADMIN_PREFIX + '/notifications/mark_all_read',
43 'notifications_mark_all_read': ADMIN_PREFIX + '/notifications_mark_all_read',
44 'notifications_show': ADMIN_PREFIX + '/notifications/{notification_id}',
44 'notifications_show': ADMIN_PREFIX + '/notifications/{notification_id}',
45 'notifications_update': ADMIN_PREFIX + '/notifications/{notification_id}/update',
45 'notifications_update': ADMIN_PREFIX + '/notifications/{notification_id}/update',
46 'notifications_delete': ADMIN_PREFIX + '/notifications/{notification_id}/delete',
46 'notifications_delete': ADMIN_PREFIX + '/notifications/{notification_id}/delete',
@@ -60,6 +60,15 b' class TestNotificationsController(TestCo'
60 Session().delete(inst)
60 Session().delete(inst)
61 Session().commit()
61 Session().commit()
62
62
63 def test_mark_all_read(self, user_util):
64 user = user_util.create_user(password='qweqwe')
65 self.log_user(user.username, 'qweqwe')
66
67 self.app.post(
68 route_path('notifications_mark_all_read'), status=302,
69 params={'csrf_token': self.csrf_token}
70 )
71
63 def test_show_all(self, user_util):
72 def test_show_all(self, user_util):
64 user = user_util.create_user(password='qweqwe')
73 user = user_util.create_user(password='qweqwe')
65 user_id = user.user_id
74 user_id = user.user_id
@@ -26,7 +26,6 b' import formencode'
26 import formencode.htmlfill
26 import formencode.htmlfill
27 import peppercorn
27 import peppercorn
28 from pyramid.httpexceptions import HTTPFound, HTTPNotFound
28 from pyramid.httpexceptions import HTTPFound, HTTPNotFound
29 from pyramid.view import view_config
30
29
31 from rhodecode.apps._base import BaseAppView, DataGridAppView
30 from rhodecode.apps._base import BaseAppView, DataGridAppView
32 from rhodecode import forms
31 from rhodecode import forms
@@ -65,14 +64,10 b' class MyAccountView(BaseAppView, DataGri'
65 c = self._get_local_tmpl_context()
64 c = self._get_local_tmpl_context()
66 c.user = c.auth_user.get_instance()
65 c.user = c.auth_user.get_instance()
67 c.allow_scoped_tokens = self.ALLOW_SCOPED_TOKENS
66 c.allow_scoped_tokens = self.ALLOW_SCOPED_TOKENS
68
69 return c
67 return c
70
68
71 @LoginRequired()
69 @LoginRequired()
72 @NotAnonymous()
70 @NotAnonymous()
73 @view_config(
74 route_name='my_account_profile', request_method='GET',
75 renderer='rhodecode:templates/admin/my_account/my_account.mako')
76 def my_account_profile(self):
71 def my_account_profile(self):
77 c = self.load_default_context()
72 c = self.load_default_context()
78 c.active = 'profile'
73 c.active = 'profile'
@@ -81,9 +76,75 b' class MyAccountView(BaseAppView, DataGri'
81
76
82 @LoginRequired()
77 @LoginRequired()
83 @NotAnonymous()
78 @NotAnonymous()
84 @view_config(
79 def my_account_edit(self):
85 route_name='my_account_password', request_method='GET',
80 c = self.load_default_context()
86 renderer='rhodecode:templates/admin/my_account/my_account.mako')
81 c.active = 'profile_edit'
82 c.extern_type = c.user.extern_type
83 c.extern_name = c.user.extern_name
84
85 schema = user_schema.UserProfileSchema().bind(
86 username=c.user.username, user_emails=c.user.emails)
87 appstruct = {
88 'username': c.user.username,
89 'email': c.user.email,
90 'firstname': c.user.firstname,
91 'lastname': c.user.lastname,
92 'description': c.user.description,
93 }
94 c.form = forms.RcForm(
95 schema, appstruct=appstruct,
96 action=h.route_path('my_account_update'),
97 buttons=(forms.buttons.save, forms.buttons.reset))
98
99 return self._get_template_context(c)
100
101 @LoginRequired()
102 @NotAnonymous()
103 @CSRFRequired()
104 def my_account_update(self):
105 _ = self.request.translate
106 c = self.load_default_context()
107 c.active = 'profile_edit'
108 c.perm_user = c.auth_user
109 c.extern_type = c.user.extern_type
110 c.extern_name = c.user.extern_name
111
112 schema = user_schema.UserProfileSchema().bind(
113 username=c.user.username, user_emails=c.user.emails)
114 form = forms.RcForm(
115 schema, buttons=(forms.buttons.save, forms.buttons.reset))
116
117 controls = self.request.POST.items()
118 try:
119 valid_data = form.validate(controls)
120 skip_attrs = ['admin', 'active', 'extern_type', 'extern_name',
121 'new_password', 'password_confirmation']
122 if c.extern_type != "rhodecode":
123 # forbid updating username for external accounts
124 skip_attrs.append('username')
125 old_email = c.user.email
126 UserModel().update_user(
127 self._rhodecode_user.user_id, skip_attrs=skip_attrs,
128 **valid_data)
129 if old_email != valid_data['email']:
130 old = UserEmailMap.query() \
131 .filter(UserEmailMap.user == c.user)\
132 .filter(UserEmailMap.email == valid_data['email'])\
133 .first()
134 old.email = old_email
135 h.flash(_('Your account was updated successfully'), category='success')
136 Session().commit()
137 except forms.ValidationFailure as e:
138 c.form = e
139 return self._get_template_context(c)
140 except Exception:
141 log.exception("Exception updating user")
142 h.flash(_('Error occurred during update of user'),
143 category='error')
144 raise HTTPFound(h.route_path('my_account_profile'))
145
146 @LoginRequired()
147 @NotAnonymous()
87 def my_account_password(self):
148 def my_account_password(self):
88 c = self.load_default_context()
149 c = self.load_default_context()
89 c.active = 'password'
150 c.active = 'password'
@@ -103,9 +164,6 b' class MyAccountView(BaseAppView, DataGri'
103 @LoginRequired()
164 @LoginRequired()
104 @NotAnonymous()
165 @NotAnonymous()
105 @CSRFRequired()
166 @CSRFRequired()
106 @view_config(
107 route_name='my_account_password_update', request_method='POST',
108 renderer='rhodecode:templates/admin/my_account/my_account.mako')
109 def my_account_password_update(self):
167 def my_account_password_update(self):
110 _ = self.request.translate
168 _ = self.request.translate
111 c = self.load_default_context()
169 c = self.load_default_context()
@@ -146,9 +204,6 b' class MyAccountView(BaseAppView, DataGri'
146
204
147 @LoginRequired()
205 @LoginRequired()
148 @NotAnonymous()
206 @NotAnonymous()
149 @view_config(
150 route_name='my_account_auth_tokens', request_method='GET',
151 renderer='rhodecode:templates/admin/my_account/my_account.mako')
152 def my_account_auth_tokens(self):
207 def my_account_auth_tokens(self):
153 _ = self.request.translate
208 _ = self.request.translate
154
209
@@ -167,9 +222,6 b' class MyAccountView(BaseAppView, DataGri'
167 @LoginRequired()
222 @LoginRequired()
168 @NotAnonymous()
223 @NotAnonymous()
169 @CSRFRequired()
224 @CSRFRequired()
170 @view_config(
171 route_name='my_account_auth_tokens_view', request_method='POST', xhr=True,
172 renderer='json_ext')
173 def my_account_auth_tokens_view(self):
225 def my_account_auth_tokens_view(self):
174 _ = self.request.translate
226 _ = self.request.translate
175 c = self.load_default_context()
227 c = self.load_default_context()
@@ -192,8 +244,6 b' class MyAccountView(BaseAppView, DataGri'
192 @LoginRequired()
244 @LoginRequired()
193 @NotAnonymous()
245 @NotAnonymous()
194 @CSRFRequired()
246 @CSRFRequired()
195 @view_config(
196 route_name='my_account_auth_tokens_add', request_method='POST',)
197 def my_account_auth_tokens_add(self):
247 def my_account_auth_tokens_add(self):
198 _ = self.request.translate
248 _ = self.request.translate
199 c = self.load_default_context()
249 c = self.load_default_context()
@@ -220,8 +270,6 b' class MyAccountView(BaseAppView, DataGri'
220 @LoginRequired()
270 @LoginRequired()
221 @NotAnonymous()
271 @NotAnonymous()
222 @CSRFRequired()
272 @CSRFRequired()
223 @view_config(
224 route_name='my_account_auth_tokens_delete', request_method='POST')
225 def my_account_auth_tokens_delete(self):
273 def my_account_auth_tokens_delete(self):
226 _ = self.request.translate
274 _ = self.request.translate
227 c = self.load_default_context()
275 c = self.load_default_context()
@@ -244,9 +292,6 b' class MyAccountView(BaseAppView, DataGri'
244
292
245 @LoginRequired()
293 @LoginRequired()
246 @NotAnonymous()
294 @NotAnonymous()
247 @view_config(
248 route_name='my_account_emails', request_method='GET',
249 renderer='rhodecode:templates/admin/my_account/my_account.mako')
250 def my_account_emails(self):
295 def my_account_emails(self):
251 _ = self.request.translate
296 _ = self.request.translate
252
297
@@ -269,9 +314,6 b' class MyAccountView(BaseAppView, DataGri'
269 @LoginRequired()
314 @LoginRequired()
270 @NotAnonymous()
315 @NotAnonymous()
271 @CSRFRequired()
316 @CSRFRequired()
272 @view_config(
273 route_name='my_account_emails_add', request_method='POST',
274 renderer='rhodecode:templates/admin/my_account/my_account.mako')
275 def my_account_emails_add(self):
317 def my_account_emails_add(self):
276 _ = self.request.translate
318 _ = self.request.translate
277 c = self.load_default_context()
319 c = self.load_default_context()
@@ -312,8 +354,6 b' class MyAccountView(BaseAppView, DataGri'
312 @LoginRequired()
354 @LoginRequired()
313 @NotAnonymous()
355 @NotAnonymous()
314 @CSRFRequired()
356 @CSRFRequired()
315 @view_config(
316 route_name='my_account_emails_delete', request_method='POST')
317 def my_account_emails_delete(self):
357 def my_account_emails_delete(self):
318 _ = self.request.translate
358 _ = self.request.translate
319 c = self.load_default_context()
359 c = self.load_default_context()
@@ -334,9 +374,6 b' class MyAccountView(BaseAppView, DataGri'
334 @LoginRequired()
374 @LoginRequired()
335 @NotAnonymous()
375 @NotAnonymous()
336 @CSRFRequired()
376 @CSRFRequired()
337 @view_config(
338 route_name='my_account_notifications_test_channelstream',
339 request_method='POST', renderer='json_ext')
340 def my_account_notifications_test_channelstream(self):
377 def my_account_notifications_test_channelstream(self):
341 message = 'Test message sent via Channelstream by user: {}, on {}'.format(
378 message = 'Test message sent via Channelstream by user: {}, on {}'.format(
342 self._rhodecode_user.username, datetime.datetime.now())
379 self._rhodecode_user.username, datetime.datetime.now())
@@ -424,9 +461,6 b' class MyAccountView(BaseAppView, DataGri'
424
461
425 @LoginRequired()
462 @LoginRequired()
426 @NotAnonymous()
463 @NotAnonymous()
427 @view_config(
428 route_name='my_account_repos', request_method='GET',
429 renderer='rhodecode:templates/admin/my_account/my_account.mako')
430 def my_account_repos(self):
464 def my_account_repos(self):
431 c = self.load_default_context()
465 c = self.load_default_context()
432 c.active = 'repos'
466 c.active = 'repos'
@@ -437,9 +471,6 b' class MyAccountView(BaseAppView, DataGri'
437
471
438 @LoginRequired()
472 @LoginRequired()
439 @NotAnonymous()
473 @NotAnonymous()
440 @view_config(
441 route_name='my_account_watched', request_method='GET',
442 renderer='rhodecode:templates/admin/my_account/my_account.mako')
443 def my_account_watched(self):
474 def my_account_watched(self):
444 c = self.load_default_context()
475 c = self.load_default_context()
445 c.active = 'watched'
476 c.active = 'watched'
@@ -450,9 +481,6 b' class MyAccountView(BaseAppView, DataGri'
450
481
451 @LoginRequired()
482 @LoginRequired()
452 @NotAnonymous()
483 @NotAnonymous()
453 @view_config(
454 route_name='my_account_bookmarks', request_method='GET',
455 renderer='rhodecode:templates/admin/my_account/my_account.mako')
456 def my_account_bookmarks(self):
484 def my_account_bookmarks(self):
457 c = self.load_default_context()
485 c = self.load_default_context()
458 c.active = 'bookmarks'
486 c.active = 'bookmarks'
@@ -519,8 +547,6 b' class MyAccountView(BaseAppView, DataGri'
519 @LoginRequired()
547 @LoginRequired()
520 @NotAnonymous()
548 @NotAnonymous()
521 @CSRFRequired()
549 @CSRFRequired()
522 @view_config(
523 route_name='my_account_bookmarks_update', request_method='POST')
524 def my_account_bookmarks_update(self):
550 def my_account_bookmarks_update(self):
525 _ = self.request.translate
551 _ = self.request.translate
526 c = self.load_default_context()
552 c = self.load_default_context()
@@ -559,9 +585,6 b' class MyAccountView(BaseAppView, DataGri'
559
585
560 @LoginRequired()
586 @LoginRequired()
561 @NotAnonymous()
587 @NotAnonymous()
562 @view_config(
563 route_name='my_account_goto_bookmark', request_method='GET',
564 renderer='rhodecode:templates/admin/my_account/my_account.mako')
565 def my_account_goto_bookmark(self):
588 def my_account_goto_bookmark(self):
566
589
567 bookmark_id = self.request.matchdict['bookmark_id']
590 bookmark_id = self.request.matchdict['bookmark_id']
@@ -606,9 +629,6 b' class MyAccountView(BaseAppView, DataGri'
606
629
607 @LoginRequired()
630 @LoginRequired()
608 @NotAnonymous()
631 @NotAnonymous()
609 @view_config(
610 route_name='my_account_perms', request_method='GET',
611 renderer='rhodecode:templates/admin/my_account/my_account.mako')
612 def my_account_perms(self):
632 def my_account_perms(self):
613 c = self.load_default_context()
633 c = self.load_default_context()
614 c.active = 'perms'
634 c.active = 'perms'
@@ -618,9 +638,6 b' class MyAccountView(BaseAppView, DataGri'
618
638
619 @LoginRequired()
639 @LoginRequired()
620 @NotAnonymous()
640 @NotAnonymous()
621 @view_config(
622 route_name='my_account_notifications', request_method='GET',
623 renderer='rhodecode:templates/admin/my_account/my_account.mako')
624 def my_notifications(self):
641 def my_notifications(self):
625 c = self.load_default_context()
642 c = self.load_default_context()
626 c.active = 'notifications'
643 c.active = 'notifications'
@@ -630,9 +647,6 b' class MyAccountView(BaseAppView, DataGri'
630 @LoginRequired()
647 @LoginRequired()
631 @NotAnonymous()
648 @NotAnonymous()
632 @CSRFRequired()
649 @CSRFRequired()
633 @view_config(
634 route_name='my_account_notifications_toggle_visibility',
635 request_method='POST', renderer='json_ext')
636 def my_notifications_toggle_visibility(self):
650 def my_notifications_toggle_visibility(self):
637 user = self._rhodecode_db_user
651 user = self._rhodecode_db_user
638 new_status = not user.user_data.get('notification_status', True)
652 new_status = not user.user_data.get('notification_status', True)
@@ -640,83 +654,6 b' class MyAccountView(BaseAppView, DataGri'
640 Session().commit()
654 Session().commit()
641 return user.user_data['notification_status']
655 return user.user_data['notification_status']
642
656
643 @LoginRequired()
644 @NotAnonymous()
645 @view_config(
646 route_name='my_account_edit',
647 request_method='GET',
648 renderer='rhodecode:templates/admin/my_account/my_account.mako')
649 def my_account_edit(self):
650 c = self.load_default_context()
651 c.active = 'profile_edit'
652 c.extern_type = c.user.extern_type
653 c.extern_name = c.user.extern_name
654
655 schema = user_schema.UserProfileSchema().bind(
656 username=c.user.username, user_emails=c.user.emails)
657 appstruct = {
658 'username': c.user.username,
659 'email': c.user.email,
660 'firstname': c.user.firstname,
661 'lastname': c.user.lastname,
662 'description': c.user.description,
663 }
664 c.form = forms.RcForm(
665 schema, appstruct=appstruct,
666 action=h.route_path('my_account_update'),
667 buttons=(forms.buttons.save, forms.buttons.reset))
668
669 return self._get_template_context(c)
670
671 @LoginRequired()
672 @NotAnonymous()
673 @CSRFRequired()
674 @view_config(
675 route_name='my_account_update',
676 request_method='POST',
677 renderer='rhodecode:templates/admin/my_account/my_account.mako')
678 def my_account_update(self):
679 _ = self.request.translate
680 c = self.load_default_context()
681 c.active = 'profile_edit'
682 c.perm_user = c.auth_user
683 c.extern_type = c.user.extern_type
684 c.extern_name = c.user.extern_name
685
686 schema = user_schema.UserProfileSchema().bind(
687 username=c.user.username, user_emails=c.user.emails)
688 form = forms.RcForm(
689 schema, buttons=(forms.buttons.save, forms.buttons.reset))
690
691 controls = self.request.POST.items()
692 try:
693 valid_data = form.validate(controls)
694 skip_attrs = ['admin', 'active', 'extern_type', 'extern_name',
695 'new_password', 'password_confirmation']
696 if c.extern_type != "rhodecode":
697 # forbid updating username for external accounts
698 skip_attrs.append('username')
699 old_email = c.user.email
700 UserModel().update_user(
701 self._rhodecode_user.user_id, skip_attrs=skip_attrs,
702 **valid_data)
703 if old_email != valid_data['email']:
704 old = UserEmailMap.query() \
705 .filter(UserEmailMap.user == c.user)\
706 .filter(UserEmailMap.email == valid_data['email'])\
707 .first()
708 old.email = old_email
709 h.flash(_('Your account was updated successfully'), category='success')
710 Session().commit()
711 except forms.ValidationFailure as e:
712 c.form = e
713 return self._get_template_context(c)
714 except Exception:
715 log.exception("Exception updating user")
716 h.flash(_('Error occurred during update of user'),
717 category='error')
718 raise HTTPFound(h.route_path('my_account_profile'))
719
720 def _get_pull_requests_list(self, statuses):
657 def _get_pull_requests_list(self, statuses):
721 draw, start, limit = self._extract_chunk(self.request)
658 draw, start, limit = self._extract_chunk(self.request)
722 search_q, order_by, order_dir = self._extract_ordering(self.request)
659 search_q, order_by, order_dir = self._extract_ordering(self.request)
@@ -781,10 +718,6 b' class MyAccountView(BaseAppView, DataGri'
781
718
782 @LoginRequired()
719 @LoginRequired()
783 @NotAnonymous()
720 @NotAnonymous()
784 @view_config(
785 route_name='my_account_pullrequests',
786 request_method='GET',
787 renderer='rhodecode:templates/admin/my_account/my_account.mako')
788 def my_account_pullrequests(self):
721 def my_account_pullrequests(self):
789 c = self.load_default_context()
722 c = self.load_default_context()
790 c.active = 'pullrequests'
723 c.active = 'pullrequests'
@@ -796,9 +729,6 b' class MyAccountView(BaseAppView, DataGri'
796
729
797 @LoginRequired()
730 @LoginRequired()
798 @NotAnonymous()
731 @NotAnonymous()
799 @view_config(
800 route_name='my_account_pullrequests_data',
801 request_method='GET', renderer='json_ext')
802 def my_account_pullrequests_data(self):
732 def my_account_pullrequests_data(self):
803 self.load_default_context()
733 self.load_default_context()
804 req_get = self.request.GET
734 req_get = self.request.GET
@@ -813,10 +743,6 b' class MyAccountView(BaseAppView, DataGri'
813
743
814 @LoginRequired()
744 @LoginRequired()
815 @NotAnonymous()
745 @NotAnonymous()
816 @view_config(
817 route_name='my_account_user_group_membership',
818 request_method='GET',
819 renderer='rhodecode:templates/admin/my_account/my_account.mako')
820 def my_account_user_group_membership(self):
746 def my_account_user_group_membership(self):
821 c = self.load_default_context()
747 c = self.load_default_context()
822 c.active = 'user_group_membership'
748 c.active = 'user_group_membership'
@@ -22,7 +22,6 b' import logging'
22
22
23 from pyramid.httpexceptions import (
23 from pyramid.httpexceptions import (
24 HTTPFound, HTTPNotFound, HTTPInternalServerError)
24 HTTPFound, HTTPNotFound, HTTPInternalServerError)
25 from pyramid.view import view_config
26
25
27 from rhodecode.apps._base import BaseAppView
26 from rhodecode.apps._base import BaseAppView
28 from rhodecode.lib.auth import LoginRequired, NotAnonymous, CSRFRequired
27 from rhodecode.lib.auth import LoginRequired, NotAnonymous, CSRFRequired
@@ -57,9 +56,6 b' class MyAccountNotificationsView(BaseApp'
57
56
58 @LoginRequired()
57 @LoginRequired()
59 @NotAnonymous()
58 @NotAnonymous()
60 @view_config(
61 route_name='notifications_show_all', request_method='GET',
62 renderer='rhodecode:templates/admin/notifications/notifications_show_all.mako')
63 def notifications_show_all(self):
59 def notifications_show_all(self):
64 c = self.load_default_context()
60 c = self.load_default_context()
65
61
@@ -105,22 +101,6 b' class MyAccountNotificationsView(BaseApp'
105
101
106 @LoginRequired()
102 @LoginRequired()
107 @NotAnonymous()
103 @NotAnonymous()
108 @CSRFRequired()
109 @view_config(
110 route_name='notifications_mark_all_read', request_method='POST',
111 renderer='rhodecode:templates/admin/notifications/notifications_show_all.mako')
112 def notifications_mark_all_read(self):
113 NotificationModel().mark_all_read_for_user(
114 self._rhodecode_db_user.user_id,
115 filter_=self.request.GET.getall('type'))
116 Session().commit()
117 raise HTTPFound(h.route_path('notifications_show_all'))
118
119 @LoginRequired()
120 @NotAnonymous()
121 @view_config(
122 route_name='notifications_show', request_method='GET',
123 renderer='rhodecode:templates/admin/notifications/notifications_show.mako')
124 def notifications_show(self):
104 def notifications_show(self):
125 c = self.load_default_context()
105 c = self.load_default_context()
126 notification_id = self.request.matchdict['notification_id']
106 notification_id = self.request.matchdict['notification_id']
@@ -150,9 +130,16 b' class MyAccountNotificationsView(BaseApp'
150 @LoginRequired()
130 @LoginRequired()
151 @NotAnonymous()
131 @NotAnonymous()
152 @CSRFRequired()
132 @CSRFRequired()
153 @view_config(
133 def notifications_mark_all_read(self):
154 route_name='notifications_update', request_method='POST',
134 NotificationModel().mark_all_read_for_user(
155 renderer='json_ext')
135 self._rhodecode_db_user.user_id,
136 filter_=self.request.GET.getall('type'))
137 Session().commit()
138 raise HTTPFound(h.route_path('notifications_show_all'))
139
140 @LoginRequired()
141 @NotAnonymous()
142 @CSRFRequired()
156 def notification_update(self):
143 def notification_update(self):
157 notification_id = self.request.matchdict['notification_id']
144 notification_id = self.request.matchdict['notification_id']
158 notification = Notification.get_or_404(notification_id)
145 notification = Notification.get_or_404(notification_id)
@@ -177,9 +164,6 b' class MyAccountNotificationsView(BaseApp'
177 @LoginRequired()
164 @LoginRequired()
178 @NotAnonymous()
165 @NotAnonymous()
179 @CSRFRequired()
166 @CSRFRequired()
180 @view_config(
181 route_name='notifications_delete', request_method='POST',
182 renderer='json_ext')
183 def notification_delete(self):
167 def notification_delete(self):
184 notification_id = self.request.matchdict['notification_id']
168 notification_id = self.request.matchdict['notification_id']
185 notification = Notification.get_or_404(notification_id)
169 notification = Notification.get_or_404(notification_id)
@@ -21,7 +21,6 b''
21 import logging
21 import logging
22
22
23 from pyramid.httpexceptions import HTTPFound
23 from pyramid.httpexceptions import HTTPFound
24 from pyramid.view import view_config
25
24
26 from rhodecode.apps._base import BaseAppView, DataGridAppView
25 from rhodecode.apps._base import BaseAppView, DataGridAppView
27 from rhodecode.apps.ssh_support import SshKeyFileChangeEvent
26 from rhodecode.apps.ssh_support import SshKeyFileChangeEvent
@@ -41,17 +40,12 b' class MyAccountSshKeysView(BaseAppView, '
41 def load_default_context(self):
40 def load_default_context(self):
42 c = self._get_local_tmpl_context()
41 c = self._get_local_tmpl_context()
43 c.user = c.auth_user.get_instance()
42 c.user = c.auth_user.get_instance()
44
45 c.ssh_enabled = self.request.registry.settings.get(
43 c.ssh_enabled = self.request.registry.settings.get(
46 'ssh.generate_authorized_keyfile')
44 'ssh.generate_authorized_keyfile')
47
48 return c
45 return c
49
46
50 @LoginRequired()
47 @LoginRequired()
51 @NotAnonymous()
48 @NotAnonymous()
52 @view_config(
53 route_name='my_account_ssh_keys', request_method='GET',
54 renderer='rhodecode:templates/admin/my_account/my_account.mako')
55 def my_account_ssh_keys(self):
49 def my_account_ssh_keys(self):
56 _ = self.request.translate
50 _ = self.request.translate
57
51
@@ -63,9 +57,6 b' class MyAccountSshKeysView(BaseAppView, '
63
57
64 @LoginRequired()
58 @LoginRequired()
65 @NotAnonymous()
59 @NotAnonymous()
66 @view_config(
67 route_name='my_account_ssh_keys_generate', request_method='GET',
68 renderer='rhodecode:templates/admin/my_account/my_account.mako')
69 def ssh_keys_generate_keypair(self):
60 def ssh_keys_generate_keypair(self):
70 _ = self.request.translate
61 _ = self.request.translate
71 c = self.load_default_context()
62 c = self.load_default_context()
@@ -84,8 +75,6 b' class MyAccountSshKeysView(BaseAppView, '
84 @LoginRequired()
75 @LoginRequired()
85 @NotAnonymous()
76 @NotAnonymous()
86 @CSRFRequired()
77 @CSRFRequired()
87 @view_config(
88 route_name='my_account_ssh_keys_add', request_method='POST',)
89 def my_account_ssh_keys_add(self):
78 def my_account_ssh_keys_add(self):
90 _ = self.request.translate
79 _ = self.request.translate
91 c = self.load_default_context()
80 c = self.load_default_context()
@@ -132,8 +121,6 b' class MyAccountSshKeysView(BaseAppView, '
132 @LoginRequired()
121 @LoginRequired()
133 @NotAnonymous()
122 @NotAnonymous()
134 @CSRFRequired()
123 @CSRFRequired()
135 @view_config(
136 route_name='my_account_ssh_keys_delete', request_method='POST')
137 def my_account_ssh_keys_delete(self):
124 def my_account_ssh_keys_delete(self):
138 _ = self.request.translate
125 _ = self.request.translate
139 c = self.load_default_context()
126 c = self.load_default_context()
@@ -22,25 +22,35 b' from rhodecode.apps._base import ADMIN_P'
22
22
23
23
24 def admin_routes(config):
24 def admin_routes(config):
25 from rhodecode.apps.ops.views import OpsView
26
25 config.add_route(
27 config.add_route(
26 name='ops_ping',
28 name='ops_ping',
27 pattern='/ping')
29 pattern='/ping')
30 config.add_view(
31 OpsView,
32 attr='ops_ping',
33 route_name='ops_ping', request_method='GET',
34 renderer='json_ext')
35
28 config.add_route(
36 config.add_route(
29 name='ops_error_test',
37 name='ops_error_test',
30 pattern='/error')
38 pattern='/error')
39 config.add_view(
40 OpsView,
41 attr='ops_error_test',
42 route_name='ops_error_test', request_method='GET',
43 renderer='json_ext')
44
31 config.add_route(
45 config.add_route(
32 name='ops_redirect_test',
46 name='ops_redirect_test',
33 pattern='/redirect')
47 pattern='/redirect')
48 config.add_view(
49 OpsView,
50 attr='ops_redirect_test',
51 route_name='ops_redirect_test', request_method='GET',
52 renderer='json_ext')
34
53
35
54
36 def includeme(config):
55 def includeme(config):
37
38 config.include(admin_routes, route_prefix=ADMIN_PREFIX + '/ops')
56 config.include(admin_routes, route_prefix=ADMIN_PREFIX + '/ops')
39 # make OLD entries from <4.10.0 work
40 config.add_route(
41 name='ops_ping_legacy', pattern=ADMIN_PREFIX + '/ping')
42 config.add_route(
43 name='ops_error_test_legacy', pattern=ADMIN_PREFIX + '/error_test')
44
45 # Scan module for configuration decorators.
46 config.scan('.views', ignore='.tests')
@@ -21,7 +21,7 b''
21 import time
21 import time
22 import logging
22 import logging
23
23
24 from pyramid.view import view_config
24
25 from pyramid.httpexceptions import HTTPFound
25 from pyramid.httpexceptions import HTTPFound
26
26
27 from rhodecode.apps._base import BaseAppView
27 from rhodecode.apps._base import BaseAppView
@@ -38,12 +38,6 b' class OpsView(BaseAppView):'
38
38
39 return c
39 return c
40
40
41 @view_config(
42 route_name='ops_ping', request_method='GET',
43 renderer='json_ext')
44 @view_config(
45 route_name='ops_ping_legacy', request_method='GET',
46 renderer='json_ext')
47 def ops_ping(self):
41 def ops_ping(self):
48 data = {
42 data = {
49 'instance': self.request.registry.settings.get('instance_id'),
43 'instance': self.request.registry.settings.get('instance_id'),
@@ -59,12 +53,6 b' class OpsView(BaseAppView):'
59 })
53 })
60 return {'ok': data}
54 return {'ok': data}
61
55
62 @view_config(
63 route_name='ops_error_test', request_method='GET',
64 renderer='json_ext')
65 @view_config(
66 route_name='ops_error_test_legacy', request_method='GET',
67 renderer='json_ext')
68 def ops_error_test(self):
56 def ops_error_test(self):
69 """
57 """
70 Test exception handling and emails on errors
58 Test exception handling and emails on errors
@@ -78,9 +66,6 b' class OpsView(BaseAppView):'
78 'Client:{}. Generation time: {}.'.format(self.request.user, time.time()))
66 'Client:{}. Generation time: {}.'.format(self.request.user, time.time()))
79 raise TestException(msg)
67 raise TestException(msg)
80
68
81 @view_config(
82 route_name='ops_redirect_test', request_method='GET',
83 renderer='json_ext')
84 def ops_redirect_test(self):
69 def ops_redirect_test(self):
85 """
70 """
86 Test redirect handling
71 Test redirect handling
@@ -18,6 +18,10 b''
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20 from rhodecode.apps._base import add_route_with_slash
20 from rhodecode.apps._base import add_route_with_slash
21 from rhodecode.apps.repo_group.views.repo_group_settings import RepoGroupSettingsView
22 from rhodecode.apps.repo_group.views.repo_group_advanced import RepoGroupAdvancedSettingsView
23 from rhodecode.apps.repo_group.views.repo_group_permissions import RepoGroupPermissionsView
24 from rhodecode.apps.home.views import HomeView
21
25
22
26
23 def includeme(config):
27 def includeme(config):
@@ -27,35 +31,72 b' def includeme(config):'
27 name='edit_repo_group',
31 name='edit_repo_group',
28 pattern='/{repo_group_name:.*?[^/]}/_edit',
32 pattern='/{repo_group_name:.*?[^/]}/_edit',
29 repo_group_route=True)
33 repo_group_route=True)
30 # update is POST on edit_repo_group
34 config.add_view(
35 RepoGroupSettingsView,
36 attr='edit_settings',
37 route_name='edit_repo_group', request_method='GET',
38 renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako')
39 config.add_view(
40 RepoGroupSettingsView,
41 attr='edit_settings_update',
42 route_name='edit_repo_group', request_method='POST',
43 renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako')
31
44
32 # Settings advanced
45 # Settings advanced
33 config.add_route(
46 config.add_route(
34 name='edit_repo_group_advanced',
47 name='edit_repo_group_advanced',
35 pattern='/{repo_group_name:.*?[^/]}/_settings/advanced',
48 pattern='/{repo_group_name:.*?[^/]}/_settings/advanced',
36 repo_group_route=True)
49 repo_group_route=True)
50 config.add_view(
51 RepoGroupAdvancedSettingsView,
52 attr='edit_repo_group_advanced',
53 route_name='edit_repo_group_advanced', request_method='GET',
54 renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako')
37
55
38 config.add_route(
56 config.add_route(
39 name='edit_repo_group_advanced_delete',
57 name='edit_repo_group_advanced_delete',
40 pattern='/{repo_group_name:.*?[^/]}/_settings/advanced/delete',
58 pattern='/{repo_group_name:.*?[^/]}/_settings/advanced/delete',
41 repo_group_route=True)
59 repo_group_route=True)
60 config.add_view(
61 RepoGroupAdvancedSettingsView,
62 attr='edit_repo_group_delete',
63 route_name='edit_repo_group_advanced_delete', request_method='POST',
64 renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako')
42
65
43 # settings permissions
66 # settings permissions
44 config.add_route(
67 config.add_route(
45 name='edit_repo_group_perms',
68 name='edit_repo_group_perms',
46 pattern='/{repo_group_name:.*?[^/]}/_settings/permissions',
69 pattern='/{repo_group_name:.*?[^/]}/_settings/permissions',
47 repo_group_route=True)
70 repo_group_route=True)
71 config.add_view(
72 RepoGroupPermissionsView,
73 attr='edit_repo_group_permissions',
74 route_name='edit_repo_group_perms', request_method='GET',
75 renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako')
48
76
49 config.add_route(
77 config.add_route(
50 name='edit_repo_group_perms_update',
78 name='edit_repo_group_perms_update',
51 pattern='/{repo_group_name:.*?[^/]}/_settings/permissions/update',
79 pattern='/{repo_group_name:.*?[^/]}/_settings/permissions/update',
52 repo_group_route=True)
80 repo_group_route=True)
81 config.add_view(
82 RepoGroupPermissionsView,
83 attr='edit_repo_groups_permissions_update',
84 route_name='edit_repo_group_perms_update', request_method='POST',
85 renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako')
53
86
54 # Summary, NOTE(marcink): needs to be at the end for catch-all
87 # Summary, NOTE(marcink): needs to be at the end for catch-all
55 add_route_with_slash(
88 add_route_with_slash(
56 config,
89 config,
57 name='repo_group_home',
90 name='repo_group_home',
58 pattern='/{repo_group_name:.*?[^/]}', repo_group_route=True)
91 pattern='/{repo_group_name:.*?[^/]}', repo_group_route=True)
92 config.add_view(
93 HomeView,
94 attr='repo_group_main_page',
95 route_name='repo_group_home', request_method='GET',
96 renderer='rhodecode:templates/index_repo_group.mako')
97 config.add_view(
98 HomeView,
99 attr='repo_group_main_page',
100 route_name='repo_group_home_slash', request_method='GET',
101 renderer='rhodecode:templates/index_repo_group.mako')
59
102
60 # Scan module for configuration decorators.
61 config.scan('.views', ignore='.tests')
@@ -20,7 +20,7 b''
20
20
21 import logging
21 import logging
22
22
23 from pyramid.view import view_config
23
24 from pyramid.httpexceptions import HTTPFound
24 from pyramid.httpexceptions import HTTPFound
25
25
26 from rhodecode.apps._base import RepoGroupAppView
26 from rhodecode.apps._base import RepoGroupAppView
@@ -34,17 +34,13 b' from rhodecode.model.meta import Session'
34 log = logging.getLogger(__name__)
34 log = logging.getLogger(__name__)
35
35
36
36
37 class RepoGroupSettingsView(RepoGroupAppView):
37 class RepoGroupAdvancedSettingsView(RepoGroupAppView):
38 def load_default_context(self):
38 def load_default_context(self):
39 c = self._get_local_tmpl_context()
39 c = self._get_local_tmpl_context()
40
41 return c
40 return c
42
41
43 @LoginRequired()
42 @LoginRequired()
44 @HasRepoGroupPermissionAnyDecorator('group.admin')
43 @HasRepoGroupPermissionAnyDecorator('group.admin')
45 @view_config(
46 route_name='edit_repo_group_advanced', request_method='GET',
47 renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako')
48 def edit_repo_group_advanced(self):
44 def edit_repo_group_advanced(self):
49 _ = self.request.translate
45 _ = self.request.translate
50 c = self.load_default_context()
46 c = self.load_default_context()
@@ -61,9 +57,6 b' class RepoGroupSettingsView(RepoGroupApp'
61 @LoginRequired()
57 @LoginRequired()
62 @HasRepoGroupPermissionAnyDecorator('group.admin')
58 @HasRepoGroupPermissionAnyDecorator('group.admin')
63 @CSRFRequired()
59 @CSRFRequired()
64 @view_config(
65 route_name='edit_repo_group_advanced_delete', request_method='POST',
66 renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako')
67 def edit_repo_group_delete(self):
60 def edit_repo_group_delete(self):
68 _ = self.request.translate
61 _ = self.request.translate
69 _ungettext = self.request.plularize
62 _ungettext = self.request.plularize
@@ -20,7 +20,7 b''
20
20
21 import logging
21 import logging
22
22
23 from pyramid.view import view_config
23
24 from pyramid.httpexceptions import HTTPFound
24 from pyramid.httpexceptions import HTTPFound
25
25
26 from rhodecode.apps._base import RepoGroupAppView
26 from rhodecode.apps._base import RepoGroupAppView
@@ -45,9 +45,6 b' class RepoGroupPermissionsView(RepoGroup'
45
45
46 @LoginRequired()
46 @LoginRequired()
47 @HasRepoGroupPermissionAnyDecorator('group.admin')
47 @HasRepoGroupPermissionAnyDecorator('group.admin')
48 @view_config(
49 route_name='edit_repo_group_perms', request_method='GET',
50 renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako')
51 def edit_repo_group_permissions(self):
48 def edit_repo_group_permissions(self):
52 c = self.load_default_context()
49 c = self.load_default_context()
53 c.active = 'permissions'
50 c.active = 'permissions'
@@ -57,9 +54,6 b' class RepoGroupPermissionsView(RepoGroup'
57 @LoginRequired()
54 @LoginRequired()
58 @HasRepoGroupPermissionAnyDecorator('group.admin')
55 @HasRepoGroupPermissionAnyDecorator('group.admin')
59 @CSRFRequired()
56 @CSRFRequired()
60 @view_config(
61 route_name='edit_repo_group_perms_update', request_method='POST',
62 renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako')
63 def edit_repo_groups_permissions_update(self):
57 def edit_repo_groups_permissions_update(self):
64 _ = self.request.translate
58 _ = self.request.translate
65 c = self.load_default_context()
59 c = self.load_default_context()
@@ -21,7 +21,7 b''
21 import logging
21 import logging
22 import deform
22 import deform
23
23
24 from pyramid.view import view_config
24
25 from pyramid.httpexceptions import HTTPFound
25 from pyramid.httpexceptions import HTTPFound
26
26
27 from rhodecode import events
27 from rhodecode import events
@@ -109,9 +109,6 b' class RepoGroupSettingsView(RepoGroupApp'
109
109
110 @LoginRequired()
110 @LoginRequired()
111 @HasRepoGroupPermissionAnyDecorator('group.admin')
111 @HasRepoGroupPermissionAnyDecorator('group.admin')
112 @view_config(
113 route_name='edit_repo_group', request_method='GET',
114 renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako')
115 def edit_settings(self):
112 def edit_settings(self):
116 c = self.load_default_context()
113 c = self.load_default_context()
117 c.active = 'settings'
114 c.active = 'settings'
@@ -126,9 +123,6 b' class RepoGroupSettingsView(RepoGroupApp'
126 @LoginRequired()
123 @LoginRequired()
127 @HasRepoGroupPermissionAnyDecorator('group.admin')
124 @HasRepoGroupPermissionAnyDecorator('group.admin')
128 @CSRFRequired()
125 @CSRFRequired()
129 @view_config(
130 route_name='edit_repo_group', request_method='POST',
131 renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako')
132 def edit_settings_update(self):
126 def edit_settings_update(self):
133 _ = self.request.translate
127 _ = self.request.translate
134 c = self.load_default_context()
128 c = self.load_default_context()
This diff has been collapsed as it changes many lines, (707 lines changed) Show them Hide them
@@ -21,15 +21,52 b' from rhodecode.apps._base import add_rou'
21
21
22
22
23 def includeme(config):
23 def includeme(config):
24 from rhodecode.apps.repository.views.repo_artifacts import RepoArtifactsView
25 from rhodecode.apps.repository.views.repo_audit_logs import AuditLogsView
26 from rhodecode.apps.repository.views.repo_automation import RepoAutomationView
27 from rhodecode.apps.repository.views.repo_bookmarks import RepoBookmarksView
28 from rhodecode.apps.repository.views.repo_branch_permissions import RepoSettingsBranchPermissionsView
29 from rhodecode.apps.repository.views.repo_branches import RepoBranchesView
30 from rhodecode.apps.repository.views.repo_caches import RepoCachesView
31 from rhodecode.apps.repository.views.repo_changelog import RepoChangelogView
32 from rhodecode.apps.repository.views.repo_checks import RepoChecksView
33 from rhodecode.apps.repository.views.repo_commits import RepoCommitsView
34 from rhodecode.apps.repository.views.repo_compare import RepoCompareView
35 from rhodecode.apps.repository.views.repo_feed import RepoFeedView
36 from rhodecode.apps.repository.views.repo_files import RepoFilesView
37 from rhodecode.apps.repository.views.repo_forks import RepoForksView
38 from rhodecode.apps.repository.views.repo_maintainance import RepoMaintenanceView
39 from rhodecode.apps.repository.views.repo_permissions import RepoSettingsPermissionsView
40 from rhodecode.apps.repository.views.repo_pull_requests import RepoPullRequestsView
41 from rhodecode.apps.repository.views.repo_review_rules import RepoReviewRulesView
42 from rhodecode.apps.repository.views.repo_settings import RepoSettingsView
43 from rhodecode.apps.repository.views.repo_settings_advanced import RepoSettingsAdvancedView
44 from rhodecode.apps.repository.views.repo_settings_fields import RepoSettingsFieldsView
45 from rhodecode.apps.repository.views.repo_settings_issue_trackers import RepoSettingsIssueTrackersView
46 from rhodecode.apps.repository.views.repo_settings_remote import RepoSettingsRemoteView
47 from rhodecode.apps.repository.views.repo_settings_vcs import RepoSettingsVcsView
48 from rhodecode.apps.repository.views.repo_strip import RepoStripView
49 from rhodecode.apps.repository.views.repo_summary import RepoSummaryView
50 from rhodecode.apps.repository.views.repo_tags import RepoTagsView
24
51
25 # repo creating checks, special cases that aren't repo routes
52 # repo creating checks, special cases that aren't repo routes
26 config.add_route(
53 config.add_route(
27 name='repo_creating',
54 name='repo_creating',
28 pattern='/{repo_name:.*?[^/]}/repo_creating')
55 pattern='/{repo_name:.*?[^/]}/repo_creating')
56 config.add_view(
57 RepoChecksView,
58 attr='repo_creating',
59 route_name='repo_creating', request_method='GET',
60 renderer='rhodecode:templates/admin/repos/repo_creating.mako')
29
61
30 config.add_route(
62 config.add_route(
31 name='repo_creating_check',
63 name='repo_creating_check',
32 pattern='/{repo_name:.*?[^/]}/repo_creating_check')
64 pattern='/{repo_name:.*?[^/]}/repo_creating_check')
65 config.add_view(
66 RepoChecksView,
67 attr='repo_creating_check',
68 route_name='repo_creating_check', request_method='GET',
69 renderer='json_ext')
33
70
34 # Summary
71 # Summary
35 # NOTE(marcink): one additional route is defined in very bottom, catch
72 # NOTE(marcink): one additional route is defined in very bottom, catch
@@ -37,191 +74,467 b' def includeme(config):'
37 config.add_route(
74 config.add_route(
38 name='repo_summary_explicit',
75 name='repo_summary_explicit',
39 pattern='/{repo_name:.*?[^/]}/summary', repo_route=True)
76 pattern='/{repo_name:.*?[^/]}/summary', repo_route=True)
77 config.add_view(
78 RepoSummaryView,
79 attr='summary',
80 route_name='repo_summary_explicit', request_method='GET',
81 renderer='rhodecode:templates/summary/summary.mako')
82
40 config.add_route(
83 config.add_route(
41 name='repo_summary_commits',
84 name='repo_summary_commits',
42 pattern='/{repo_name:.*?[^/]}/summary-commits', repo_route=True)
85 pattern='/{repo_name:.*?[^/]}/summary-commits', repo_route=True)
43
86 config.add_view(
87 RepoSummaryView,
88 attr='summary_commits',
89 route_name='repo_summary_commits', request_method='GET',
90 renderer='rhodecode:templates/summary/summary_commits.mako')
91
44 # Commits
92 # Commits
45 config.add_route(
93 config.add_route(
46 name='repo_commit',
94 name='repo_commit',
47 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}', repo_route=True)
95 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}', repo_route=True)
96 config.add_view(
97 RepoCommitsView,
98 attr='repo_commit_show',
99 route_name='repo_commit', request_method='GET',
100 renderer=None)
48
101
49 config.add_route(
102 config.add_route(
50 name='repo_commit_children',
103 name='repo_commit_children',
51 pattern='/{repo_name:.*?[^/]}/changeset_children/{commit_id}', repo_route=True)
104 pattern='/{repo_name:.*?[^/]}/changeset_children/{commit_id}', repo_route=True)
105 config.add_view(
106 RepoCommitsView,
107 attr='repo_commit_children',
108 route_name='repo_commit_children', request_method='GET',
109 renderer='json_ext', xhr=True)
52
110
53 config.add_route(
111 config.add_route(
54 name='repo_commit_parents',
112 name='repo_commit_parents',
55 pattern='/{repo_name:.*?[^/]}/changeset_parents/{commit_id}', repo_route=True)
113 pattern='/{repo_name:.*?[^/]}/changeset_parents/{commit_id}', repo_route=True)
114 config.add_view(
115 RepoCommitsView,
116 attr='repo_commit_parents',
117 route_name='repo_commit_parents', request_method='GET',
118 renderer='json_ext')
56
119
57 config.add_route(
120 config.add_route(
58 name='repo_commit_raw',
121 name='repo_commit_raw',
59 pattern='/{repo_name:.*?[^/]}/changeset-diff/{commit_id}', repo_route=True)
122 pattern='/{repo_name:.*?[^/]}/changeset-diff/{commit_id}', repo_route=True)
123 config.add_view(
124 RepoCommitsView,
125 attr='repo_commit_raw',
126 route_name='repo_commit_raw', request_method='GET',
127 renderer=None)
60
128
61 config.add_route(
129 config.add_route(
62 name='repo_commit_patch',
130 name='repo_commit_patch',
63 pattern='/{repo_name:.*?[^/]}/changeset-patch/{commit_id}', repo_route=True)
131 pattern='/{repo_name:.*?[^/]}/changeset-patch/{commit_id}', repo_route=True)
132 config.add_view(
133 RepoCommitsView,
134 attr='repo_commit_patch',
135 route_name='repo_commit_patch', request_method='GET',
136 renderer=None)
64
137
65 config.add_route(
138 config.add_route(
66 name='repo_commit_download',
139 name='repo_commit_download',
67 pattern='/{repo_name:.*?[^/]}/changeset-download/{commit_id}', repo_route=True)
140 pattern='/{repo_name:.*?[^/]}/changeset-download/{commit_id}', repo_route=True)
141 config.add_view(
142 RepoCommitsView,
143 attr='repo_commit_download',
144 route_name='repo_commit_download', request_method='GET',
145 renderer=None)
68
146
69 config.add_route(
147 config.add_route(
70 name='repo_commit_data',
148 name='repo_commit_data',
71 pattern='/{repo_name:.*?[^/]}/changeset-data/{commit_id}', repo_route=True)
149 pattern='/{repo_name:.*?[^/]}/changeset-data/{commit_id}', repo_route=True)
150 config.add_view(
151 RepoCommitsView,
152 attr='repo_commit_data',
153 route_name='repo_commit_data', request_method='GET',
154 renderer='json_ext', xhr=True)
72
155
73 config.add_route(
156 config.add_route(
74 name='repo_commit_comment_create',
157 name='repo_commit_comment_create',
75 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/create', repo_route=True)
158 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/create', repo_route=True)
159 config.add_view(
160 RepoCommitsView,
161 attr='repo_commit_comment_create',
162 route_name='repo_commit_comment_create', request_method='POST',
163 renderer='json_ext')
76
164
77 config.add_route(
165 config.add_route(
78 name='repo_commit_comment_preview',
166 name='repo_commit_comment_preview',
79 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/preview', repo_route=True)
167 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/preview', repo_route=True)
168 config.add_view(
169 RepoCommitsView,
170 attr='repo_commit_comment_preview',
171 route_name='repo_commit_comment_preview', request_method='POST',
172 renderer='string', xhr=True)
80
173
81 config.add_route(
174 config.add_route(
82 name='repo_commit_comment_history_view',
175 name='repo_commit_comment_history_view',
83 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_history_id}/history_view', repo_route=True)
176 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_history_id}/history_view', repo_route=True)
177 config.add_view(
178 RepoCommitsView,
179 attr='repo_commit_comment_history_view',
180 route_name='repo_commit_comment_history_view', request_method='POST',
181 renderer='string', xhr=True)
84
182
85 config.add_route(
183 config.add_route(
86 name='repo_commit_comment_attachment_upload',
184 name='repo_commit_comment_attachment_upload',
87 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/attachment_upload', repo_route=True)
185 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/attachment_upload', repo_route=True)
186 config.add_view(
187 RepoCommitsView,
188 attr='repo_commit_comment_attachment_upload',
189 route_name='repo_commit_comment_attachment_upload', request_method='POST',
190 renderer='json_ext', xhr=True)
88
191
89 config.add_route(
192 config.add_route(
90 name='repo_commit_comment_delete',
193 name='repo_commit_comment_delete',
91 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/delete', repo_route=True)
194 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/delete', repo_route=True)
195 config.add_view(
196 RepoCommitsView,
197 attr='repo_commit_comment_delete',
198 route_name='repo_commit_comment_delete', request_method='POST',
199 renderer='json_ext')
92
200
93 config.add_route(
201 config.add_route(
94 name='repo_commit_comment_edit',
202 name='repo_commit_comment_edit',
95 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/edit', repo_route=True)
203 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/edit', repo_route=True)
204 config.add_view(
205 RepoCommitsView,
206 attr='repo_commit_comment_edit',
207 route_name='repo_commit_comment_edit', request_method='POST',
208 renderer='json_ext')
96
209
97 # still working url for backward compat.
210 # still working url for backward compat.
98 config.add_route(
211 config.add_route(
99 name='repo_commit_raw_deprecated',
212 name='repo_commit_raw_deprecated',
100 pattern='/{repo_name:.*?[^/]}/raw-changeset/{commit_id}', repo_route=True)
213 pattern='/{repo_name:.*?[^/]}/raw-changeset/{commit_id}', repo_route=True)
214 config.add_view(
215 RepoCommitsView,
216 attr='repo_commit_raw',
217 route_name='repo_commit_raw_deprecated', request_method='GET',
218 renderer=None)
101
219
102 # Files
220 # Files
103 config.add_route(
221 config.add_route(
104 name='repo_archivefile',
222 name='repo_archivefile',
105 pattern='/{repo_name:.*?[^/]}/archive/{fname:.*}', repo_route=True)
223 pattern='/{repo_name:.*?[^/]}/archive/{fname:.*}', repo_route=True)
224 config.add_view(
225 RepoFilesView,
226 attr='repo_archivefile',
227 route_name='repo_archivefile', request_method='GET',
228 renderer=None)
106
229
107 config.add_route(
230 config.add_route(
108 name='repo_files_diff',
231 name='repo_files_diff',
109 pattern='/{repo_name:.*?[^/]}/diff/{f_path:.*}', repo_route=True)
232 pattern='/{repo_name:.*?[^/]}/diff/{f_path:.*}', repo_route=True)
233 config.add_view(
234 RepoFilesView,
235 attr='repo_files_diff',
236 route_name='repo_files_diff', request_method='GET',
237 renderer=None)
238
110 config.add_route( # legacy route to make old links work
239 config.add_route( # legacy route to make old links work
111 name='repo_files_diff_2way_redirect',
240 name='repo_files_diff_2way_redirect',
112 pattern='/{repo_name:.*?[^/]}/diff-2way/{f_path:.*}', repo_route=True)
241 pattern='/{repo_name:.*?[^/]}/diff-2way/{f_path:.*}', repo_route=True)
242 config.add_view(
243 RepoFilesView,
244 attr='repo_files_diff_2way_redirect',
245 route_name='repo_files_diff_2way_redirect', request_method='GET',
246 renderer=None)
113
247
114 config.add_route(
248 config.add_route(
115 name='repo_files',
249 name='repo_files',
116 pattern='/{repo_name:.*?[^/]}/files/{commit_id}/{f_path:.*}', repo_route=True)
250 pattern='/{repo_name:.*?[^/]}/files/{commit_id}/{f_path:.*}', repo_route=True)
251 config.add_view(
252 RepoFilesView,
253 attr='repo_files',
254 route_name='repo_files', request_method='GET',
255 renderer=None)
256
117 config.add_route(
257 config.add_route(
118 name='repo_files:default_path',
258 name='repo_files:default_path',
119 pattern='/{repo_name:.*?[^/]}/files/{commit_id}/', repo_route=True)
259 pattern='/{repo_name:.*?[^/]}/files/{commit_id}/', repo_route=True)
260 config.add_view(
261 RepoFilesView,
262 attr='repo_files',
263 route_name='repo_files:default_path', request_method='GET',
264 renderer=None)
265
120 config.add_route(
266 config.add_route(
121 name='repo_files:default_commit',
267 name='repo_files:default_commit',
122 pattern='/{repo_name:.*?[^/]}/files', repo_route=True)
268 pattern='/{repo_name:.*?[^/]}/files', repo_route=True)
269 config.add_view(
270 RepoFilesView,
271 attr='repo_files',
272 route_name='repo_files:default_commit', request_method='GET',
273 renderer=None)
123
274
124 config.add_route(
275 config.add_route(
125 name='repo_files:rendered',
276 name='repo_files:rendered',
126 pattern='/{repo_name:.*?[^/]}/render/{commit_id}/{f_path:.*}', repo_route=True)
277 pattern='/{repo_name:.*?[^/]}/render/{commit_id}/{f_path:.*}', repo_route=True)
278 config.add_view(
279 RepoFilesView,
280 attr='repo_files',
281 route_name='repo_files:rendered', request_method='GET',
282 renderer=None)
127
283
128 config.add_route(
284 config.add_route(
129 name='repo_files:annotated',
285 name='repo_files:annotated',
130 pattern='/{repo_name:.*?[^/]}/annotate/{commit_id}/{f_path:.*}', repo_route=True)
286 pattern='/{repo_name:.*?[^/]}/annotate/{commit_id}/{f_path:.*}', repo_route=True)
287 config.add_view(
288 RepoFilesView,
289 attr='repo_files',
290 route_name='repo_files:annotated', request_method='GET',
291 renderer=None)
292
131 config.add_route(
293 config.add_route(
132 name='repo_files:annotated_previous',
294 name='repo_files:annotated_previous',
133 pattern='/{repo_name:.*?[^/]}/annotate-previous/{commit_id}/{f_path:.*}', repo_route=True)
295 pattern='/{repo_name:.*?[^/]}/annotate-previous/{commit_id}/{f_path:.*}', repo_route=True)
296 config.add_view(
297 RepoFilesView,
298 attr='repo_files_annotated_previous',
299 route_name='repo_files:annotated_previous', request_method='GET',
300 renderer=None)
134
301
135 config.add_route(
302 config.add_route(
136 name='repo_nodetree_full',
303 name='repo_nodetree_full',
137 pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/{f_path:.*}', repo_route=True)
304 pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/{f_path:.*}', repo_route=True)
305 config.add_view(
306 RepoFilesView,
307 attr='repo_nodetree_full',
308 route_name='repo_nodetree_full', request_method='GET',
309 renderer=None, xhr=True)
310
138 config.add_route(
311 config.add_route(
139 name='repo_nodetree_full:default_path',
312 name='repo_nodetree_full:default_path',
140 pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/', repo_route=True)
313 pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/', repo_route=True)
314 config.add_view(
315 RepoFilesView,
316 attr='repo_nodetree_full',
317 route_name='repo_nodetree_full:default_path', request_method='GET',
318 renderer=None, xhr=True)
141
319
142 config.add_route(
320 config.add_route(
143 name='repo_files_nodelist',
321 name='repo_files_nodelist',
144 pattern='/{repo_name:.*?[^/]}/nodelist/{commit_id}/{f_path:.*}', repo_route=True)
322 pattern='/{repo_name:.*?[^/]}/nodelist/{commit_id}/{f_path:.*}', repo_route=True)
323 config.add_view(
324 RepoFilesView,
325 attr='repo_nodelist',
326 route_name='repo_files_nodelist', request_method='GET',
327 renderer='json_ext', xhr=True)
145
328
146 config.add_route(
329 config.add_route(
147 name='repo_file_raw',
330 name='repo_file_raw',
148 pattern='/{repo_name:.*?[^/]}/raw/{commit_id}/{f_path:.*}', repo_route=True)
331 pattern='/{repo_name:.*?[^/]}/raw/{commit_id}/{f_path:.*}', repo_route=True)
332 config.add_view(
333 RepoFilesView,
334 attr='repo_file_raw',
335 route_name='repo_file_raw', request_method='GET',
336 renderer=None)
149
337
150 config.add_route(
338 config.add_route(
151 name='repo_file_download',
339 name='repo_file_download',
152 pattern='/{repo_name:.*?[^/]}/download/{commit_id}/{f_path:.*}', repo_route=True)
340 pattern='/{repo_name:.*?[^/]}/download/{commit_id}/{f_path:.*}', repo_route=True)
341 config.add_view(
342 RepoFilesView,
343 attr='repo_file_download',
344 route_name='repo_file_download', request_method='GET',
345 renderer=None)
346
153 config.add_route( # backward compat to keep old links working
347 config.add_route( # backward compat to keep old links working
154 name='repo_file_download:legacy',
348 name='repo_file_download:legacy',
155 pattern='/{repo_name:.*?[^/]}/rawfile/{commit_id}/{f_path:.*}',
349 pattern='/{repo_name:.*?[^/]}/rawfile/{commit_id}/{f_path:.*}',
156 repo_route=True)
350 repo_route=True)
351 config.add_view(
352 RepoFilesView,
353 attr='repo_file_download',
354 route_name='repo_file_download:legacy', request_method='GET',
355 renderer=None)
157
356
158 config.add_route(
357 config.add_route(
159 name='repo_file_history',
358 name='repo_file_history',
160 pattern='/{repo_name:.*?[^/]}/history/{commit_id}/{f_path:.*}', repo_route=True)
359 pattern='/{repo_name:.*?[^/]}/history/{commit_id}/{f_path:.*}', repo_route=True)
360 config.add_view(
361 RepoFilesView,
362 attr='repo_file_history',
363 route_name='repo_file_history', request_method='GET',
364 renderer='json_ext')
161
365
162 config.add_route(
366 config.add_route(
163 name='repo_file_authors',
367 name='repo_file_authors',
164 pattern='/{repo_name:.*?[^/]}/authors/{commit_id}/{f_path:.*}', repo_route=True)
368 pattern='/{repo_name:.*?[^/]}/authors/{commit_id}/{f_path:.*}', repo_route=True)
369 config.add_view(
370 RepoFilesView,
371 attr='repo_file_authors',
372 route_name='repo_file_authors', request_method='GET',
373 renderer='rhodecode:templates/files/file_authors_box.mako')
165
374
166 config.add_route(
375 config.add_route(
167 name='repo_files_check_head',
376 name='repo_files_check_head',
168 pattern='/{repo_name:.*?[^/]}/check_head/{commit_id}/{f_path:.*}',
377 pattern='/{repo_name:.*?[^/]}/check_head/{commit_id}/{f_path:.*}',
169 repo_route=True)
378 repo_route=True)
379 config.add_view(
380 RepoFilesView,
381 attr='repo_files_check_head',
382 route_name='repo_files_check_head', request_method='POST',
383 renderer='json_ext', xhr=True)
384
170 config.add_route(
385 config.add_route(
171 name='repo_files_remove_file',
386 name='repo_files_remove_file',
172 pattern='/{repo_name:.*?[^/]}/remove_file/{commit_id}/{f_path:.*}',
387 pattern='/{repo_name:.*?[^/]}/remove_file/{commit_id}/{f_path:.*}',
173 repo_route=True)
388 repo_route=True)
389 config.add_view(
390 RepoFilesView,
391 attr='repo_files_remove_file',
392 route_name='repo_files_remove_file', request_method='GET',
393 renderer='rhodecode:templates/files/files_delete.mako')
394
174 config.add_route(
395 config.add_route(
175 name='repo_files_delete_file',
396 name='repo_files_delete_file',
176 pattern='/{repo_name:.*?[^/]}/delete_file/{commit_id}/{f_path:.*}',
397 pattern='/{repo_name:.*?[^/]}/delete_file/{commit_id}/{f_path:.*}',
177 repo_route=True)
398 repo_route=True)
399 config.add_view(
400 RepoFilesView,
401 attr='repo_files_delete_file',
402 route_name='repo_files_delete_file', request_method='POST',
403 renderer=None)
404
178 config.add_route(
405 config.add_route(
179 name='repo_files_edit_file',
406 name='repo_files_edit_file',
180 pattern='/{repo_name:.*?[^/]}/edit_file/{commit_id}/{f_path:.*}',
407 pattern='/{repo_name:.*?[^/]}/edit_file/{commit_id}/{f_path:.*}',
181 repo_route=True)
408 repo_route=True)
409 config.add_view(
410 RepoFilesView,
411 attr='repo_files_edit_file',
412 route_name='repo_files_edit_file', request_method='GET',
413 renderer='rhodecode:templates/files/files_edit.mako')
414
182 config.add_route(
415 config.add_route(
183 name='repo_files_update_file',
416 name='repo_files_update_file',
184 pattern='/{repo_name:.*?[^/]}/update_file/{commit_id}/{f_path:.*}',
417 pattern='/{repo_name:.*?[^/]}/update_file/{commit_id}/{f_path:.*}',
185 repo_route=True)
418 repo_route=True)
419 config.add_view(
420 RepoFilesView,
421 attr='repo_files_update_file',
422 route_name='repo_files_update_file', request_method='POST',
423 renderer=None)
424
186 config.add_route(
425 config.add_route(
187 name='repo_files_add_file',
426 name='repo_files_add_file',
188 pattern='/{repo_name:.*?[^/]}/add_file/{commit_id}/{f_path:.*}',
427 pattern='/{repo_name:.*?[^/]}/add_file/{commit_id}/{f_path:.*}',
189 repo_route=True)
428 repo_route=True)
429 config.add_view(
430 RepoFilesView,
431 attr='repo_files_add_file',
432 route_name='repo_files_add_file', request_method='GET',
433 renderer='rhodecode:templates/files/files_add.mako')
434
190 config.add_route(
435 config.add_route(
191 name='repo_files_upload_file',
436 name='repo_files_upload_file',
192 pattern='/{repo_name:.*?[^/]}/upload_file/{commit_id}/{f_path:.*}',
437 pattern='/{repo_name:.*?[^/]}/upload_file/{commit_id}/{f_path:.*}',
193 repo_route=True)
438 repo_route=True)
439 config.add_view(
440 RepoFilesView,
441 attr='repo_files_add_file',
442 route_name='repo_files_upload_file', request_method='GET',
443 renderer='rhodecode:templates/files/files_upload.mako')
444 config.add_view( # POST creates
445 RepoFilesView,
446 attr='repo_files_upload_file',
447 route_name='repo_files_upload_file', request_method='POST',
448 renderer='json_ext')
449
194 config.add_route(
450 config.add_route(
195 name='repo_files_create_file',
451 name='repo_files_create_file',
196 pattern='/{repo_name:.*?[^/]}/create_file/{commit_id}/{f_path:.*}',
452 pattern='/{repo_name:.*?[^/]}/create_file/{commit_id}/{f_path:.*}',
197 repo_route=True)
453 repo_route=True)
454 config.add_view( # POST creates
455 RepoFilesView,
456 attr='repo_files_create_file',
457 route_name='repo_files_create_file', request_method='POST',
458 renderer=None)
198
459
199 # Refs data
460 # Refs data
200 config.add_route(
461 config.add_route(
201 name='repo_refs_data',
462 name='repo_refs_data',
202 pattern='/{repo_name:.*?[^/]}/refs-data', repo_route=True)
463 pattern='/{repo_name:.*?[^/]}/refs-data', repo_route=True)
464 config.add_view(
465 RepoSummaryView,
466 attr='repo_refs_data',
467 route_name='repo_refs_data', request_method='GET',
468 renderer='json_ext')
203
469
204 config.add_route(
470 config.add_route(
205 name='repo_refs_changelog_data',
471 name='repo_refs_changelog_data',
206 pattern='/{repo_name:.*?[^/]}/refs-data-changelog', repo_route=True)
472 pattern='/{repo_name:.*?[^/]}/refs-data-changelog', repo_route=True)
473 config.add_view(
474 RepoSummaryView,
475 attr='repo_refs_changelog_data',
476 route_name='repo_refs_changelog_data', request_method='GET',
477 renderer='json_ext')
207
478
208 config.add_route(
479 config.add_route(
209 name='repo_stats',
480 name='repo_stats',
210 pattern='/{repo_name:.*?[^/]}/repo_stats/{commit_id}', repo_route=True)
481 pattern='/{repo_name:.*?[^/]}/repo_stats/{commit_id}', repo_route=True)
482 config.add_view(
483 RepoSummaryView,
484 attr='repo_stats',
485 route_name='repo_stats', request_method='GET',
486 renderer='json_ext')
211
487
212 # Commits
488 # Commits
213 config.add_route(
489 config.add_route(
214 name='repo_commits',
490 name='repo_commits',
215 pattern='/{repo_name:.*?[^/]}/commits', repo_route=True)
491 pattern='/{repo_name:.*?[^/]}/commits', repo_route=True)
492 config.add_view(
493 RepoChangelogView,
494 attr='repo_changelog',
495 route_name='repo_commits', request_method='GET',
496 renderer='rhodecode:templates/commits/changelog.mako')
497 # old routes for backward compat
498 config.add_view(
499 RepoChangelogView,
500 attr='repo_changelog',
501 route_name='repo_changelog', request_method='GET',
502 renderer='rhodecode:templates/commits/changelog.mako')
503
504 config.add_route(
505 name='repo_commits_elements',
506 pattern='/{repo_name:.*?[^/]}/commits_elements', repo_route=True)
507 config.add_view(
508 RepoChangelogView,
509 attr='repo_commits_elements',
510 route_name='repo_commits_elements', request_method=('GET', 'POST'),
511 renderer='rhodecode:templates/commits/changelog_elements.mako',
512 xhr=True)
513
514 config.add_route(
515 name='repo_commits_elements_file',
516 pattern='/{repo_name:.*?[^/]}/commits_elements/{commit_id}/{f_path:.*}', repo_route=True)
517 config.add_view(
518 RepoChangelogView,
519 attr='repo_commits_elements',
520 route_name='repo_commits_elements_file', request_method=('GET', 'POST'),
521 renderer='rhodecode:templates/commits/changelog_elements.mako',
522 xhr=True)
523
216 config.add_route(
524 config.add_route(
217 name='repo_commits_file',
525 name='repo_commits_file',
218 pattern='/{repo_name:.*?[^/]}/commits/{commit_id}/{f_path:.*}', repo_route=True)
526 pattern='/{repo_name:.*?[^/]}/commits/{commit_id}/{f_path:.*}', repo_route=True)
219 config.add_route(
527 config.add_view(
220 name='repo_commits_elements',
528 RepoChangelogView,
221 pattern='/{repo_name:.*?[^/]}/commits_elements', repo_route=True)
529 attr='repo_changelog',
222 config.add_route(
530 route_name='repo_commits_file', request_method='GET',
223 name='repo_commits_elements_file',
531 renderer='rhodecode:templates/commits/changelog.mako')
224 pattern='/{repo_name:.*?[^/]}/commits_elements/{commit_id}/{f_path:.*}', repo_route=True)
532 # old routes for backward compat
533 config.add_view(
534 RepoChangelogView,
535 attr='repo_changelog',
536 route_name='repo_changelog_file', request_method='GET',
537 renderer='rhodecode:templates/commits/changelog.mako')
225
538
226 # Changelog (old deprecated name for commits page)
539 # Changelog (old deprecated name for commits page)
227 config.add_route(
540 config.add_route(
@@ -235,25 +548,50 b' def includeme(config):'
235 config.add_route(
548 config.add_route(
236 name='repo_compare_select',
549 name='repo_compare_select',
237 pattern='/{repo_name:.*?[^/]}/compare', repo_route=True)
550 pattern='/{repo_name:.*?[^/]}/compare', repo_route=True)
551 config.add_view(
552 RepoCompareView,
553 attr='compare_select',
554 route_name='repo_compare_select', request_method='GET',
555 renderer='rhodecode:templates/compare/compare_diff.mako')
238
556
239 config.add_route(
557 config.add_route(
240 name='repo_compare',
558 name='repo_compare',
241 pattern='/{repo_name:.*?[^/]}/compare/{source_ref_type}@{source_ref:.*?}...{target_ref_type}@{target_ref:.*?}', repo_route=True)
559 pattern='/{repo_name:.*?[^/]}/compare/{source_ref_type}@{source_ref:.*?}...{target_ref_type}@{target_ref:.*?}', repo_route=True)
560 config.add_view(
561 RepoCompareView,
562 attr='compare',
563 route_name='repo_compare', request_method='GET',
564 renderer=None)
242
565
243 # Tags
566 # Tags
244 config.add_route(
567 config.add_route(
245 name='tags_home',
568 name='tags_home',
246 pattern='/{repo_name:.*?[^/]}/tags', repo_route=True)
569 pattern='/{repo_name:.*?[^/]}/tags', repo_route=True)
570 config.add_view(
571 RepoTagsView,
572 attr='tags',
573 route_name='tags_home', request_method='GET',
574 renderer='rhodecode:templates/tags/tags.mako')
247
575
248 # Branches
576 # Branches
249 config.add_route(
577 config.add_route(
250 name='branches_home',
578 name='branches_home',
251 pattern='/{repo_name:.*?[^/]}/branches', repo_route=True)
579 pattern='/{repo_name:.*?[^/]}/branches', repo_route=True)
580 config.add_view(
581 RepoBranchesView,
582 attr='branches',
583 route_name='branches_home', request_method='GET',
584 renderer='rhodecode:templates/branches/branches.mako')
252
585
253 # Bookmarks
586 # Bookmarks
254 config.add_route(
587 config.add_route(
255 name='bookmarks_home',
588 name='bookmarks_home',
256 pattern='/{repo_name:.*?[^/]}/bookmarks', repo_route=True)
589 pattern='/{repo_name:.*?[^/]}/bookmarks', repo_route=True)
590 config.add_view(
591 RepoBookmarksView,
592 attr='bookmarks',
593 route_name='bookmarks_home', request_method='GET',
594 renderer='rhodecode:templates/bookmarks/bookmarks.mako')
257
595
258 # Forks
596 # Forks
259 config.add_route(
597 config.add_route(
@@ -261,195 +599,426 b' def includeme(config):'
261 pattern='/{repo_name:.*?[^/]}/fork', repo_route=True,
599 pattern='/{repo_name:.*?[^/]}/fork', repo_route=True,
262 repo_forbid_when_archived=True,
600 repo_forbid_when_archived=True,
263 repo_accepted_types=['hg', 'git'])
601 repo_accepted_types=['hg', 'git'])
602 config.add_view(
603 RepoForksView,
604 attr='repo_fork_new',
605 route_name='repo_fork_new', request_method='GET',
606 renderer='rhodecode:templates/forks/forks.mako')
264
607
265 config.add_route(
608 config.add_route(
266 name='repo_fork_create',
609 name='repo_fork_create',
267 pattern='/{repo_name:.*?[^/]}/fork/create', repo_route=True,
610 pattern='/{repo_name:.*?[^/]}/fork/create', repo_route=True,
268 repo_forbid_when_archived=True,
611 repo_forbid_when_archived=True,
269 repo_accepted_types=['hg', 'git'])
612 repo_accepted_types=['hg', 'git'])
613 config.add_view(
614 RepoForksView,
615 attr='repo_fork_create',
616 route_name='repo_fork_create', request_method='POST',
617 renderer='rhodecode:templates/forks/fork.mako')
270
618
271 config.add_route(
619 config.add_route(
272 name='repo_forks_show_all',
620 name='repo_forks_show_all',
273 pattern='/{repo_name:.*?[^/]}/forks', repo_route=True,
621 pattern='/{repo_name:.*?[^/]}/forks', repo_route=True,
274 repo_accepted_types=['hg', 'git'])
622 repo_accepted_types=['hg', 'git'])
623 config.add_view(
624 RepoForksView,
625 attr='repo_forks_show_all',
626 route_name='repo_forks_show_all', request_method='GET',
627 renderer='rhodecode:templates/forks/forks.mako')
628
275 config.add_route(
629 config.add_route(
276 name='repo_forks_data',
630 name='repo_forks_data',
277 pattern='/{repo_name:.*?[^/]}/forks/data', repo_route=True,
631 pattern='/{repo_name:.*?[^/]}/forks/data', repo_route=True,
278 repo_accepted_types=['hg', 'git'])
632 repo_accepted_types=['hg', 'git'])
633 config.add_view(
634 RepoForksView,
635 attr='repo_forks_data',
636 route_name='repo_forks_data', request_method='GET',
637 renderer='json_ext', xhr=True)
279
638
280 # Pull Requests
639 # Pull Requests
281 config.add_route(
640 config.add_route(
282 name='pullrequest_show',
641 name='pullrequest_show',
283 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}',
642 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}',
284 repo_route=True)
643 repo_route=True)
644 config.add_view(
645 RepoPullRequestsView,
646 attr='pull_request_show',
647 route_name='pullrequest_show', request_method='GET',
648 renderer='rhodecode:templates/pullrequests/pullrequest_show.mako')
285
649
286 config.add_route(
650 config.add_route(
287 name='pullrequest_show_all',
651 name='pullrequest_show_all',
288 pattern='/{repo_name:.*?[^/]}/pull-request',
652 pattern='/{repo_name:.*?[^/]}/pull-request',
289 repo_route=True, repo_accepted_types=['hg', 'git'])
653 repo_route=True, repo_accepted_types=['hg', 'git'])
654 config.add_view(
655 RepoPullRequestsView,
656 attr='pull_request_list',
657 route_name='pullrequest_show_all', request_method='GET',
658 renderer='rhodecode:templates/pullrequests/pullrequests.mako')
290
659
291 config.add_route(
660 config.add_route(
292 name='pullrequest_show_all_data',
661 name='pullrequest_show_all_data',
293 pattern='/{repo_name:.*?[^/]}/pull-request-data',
662 pattern='/{repo_name:.*?[^/]}/pull-request-data',
294 repo_route=True, repo_accepted_types=['hg', 'git'])
663 repo_route=True, repo_accepted_types=['hg', 'git'])
664 config.add_view(
665 RepoPullRequestsView,
666 attr='pull_request_list_data',
667 route_name='pullrequest_show_all_data', request_method='GET',
668 renderer='json_ext', xhr=True)
295
669
296 config.add_route(
670 config.add_route(
297 name='pullrequest_repo_refs',
671 name='pullrequest_repo_refs',
298 pattern='/{repo_name:.*?[^/]}/pull-request/refs/{target_repo_name:.*?[^/]}',
672 pattern='/{repo_name:.*?[^/]}/pull-request/refs/{target_repo_name:.*?[^/]}',
299 repo_route=True)
673 repo_route=True)
674 config.add_view(
675 RepoPullRequestsView,
676 attr='pull_request_repo_refs',
677 route_name='pullrequest_repo_refs', request_method='GET',
678 renderer='json_ext', xhr=True)
300
679
301 config.add_route(
680 config.add_route(
302 name='pullrequest_repo_targets',
681 name='pullrequest_repo_targets',
303 pattern='/{repo_name:.*?[^/]}/pull-request/repo-targets',
682 pattern='/{repo_name:.*?[^/]}/pull-request/repo-targets',
304 repo_route=True)
683 repo_route=True)
684 config.add_view(
685 RepoPullRequestsView,
686 attr='pullrequest_repo_targets',
687 route_name='pullrequest_repo_targets', request_method='GET',
688 renderer='json_ext', xhr=True)
305
689
306 config.add_route(
690 config.add_route(
307 name='pullrequest_new',
691 name='pullrequest_new',
308 pattern='/{repo_name:.*?[^/]}/pull-request/new',
692 pattern='/{repo_name:.*?[^/]}/pull-request/new',
309 repo_route=True, repo_accepted_types=['hg', 'git'],
693 repo_route=True, repo_accepted_types=['hg', 'git'],
310 repo_forbid_when_archived=True)
694 repo_forbid_when_archived=True)
695 config.add_view(
696 RepoPullRequestsView,
697 attr='pull_request_new',
698 route_name='pullrequest_new', request_method='GET',
699 renderer='rhodecode:templates/pullrequests/pullrequest.mako')
311
700
312 config.add_route(
701 config.add_route(
313 name='pullrequest_create',
702 name='pullrequest_create',
314 pattern='/{repo_name:.*?[^/]}/pull-request/create',
703 pattern='/{repo_name:.*?[^/]}/pull-request/create',
315 repo_route=True, repo_accepted_types=['hg', 'git'],
704 repo_route=True, repo_accepted_types=['hg', 'git'],
316 repo_forbid_when_archived=True)
705 repo_forbid_when_archived=True)
706 config.add_view(
707 RepoPullRequestsView,
708 attr='pull_request_create',
709 route_name='pullrequest_create', request_method='POST',
710 renderer=None)
317
711
318 config.add_route(
712 config.add_route(
319 name='pullrequest_update',
713 name='pullrequest_update',
320 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update',
714 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update',
321 repo_route=True, repo_forbid_when_archived=True)
715 repo_route=True, repo_forbid_when_archived=True)
716 config.add_view(
717 RepoPullRequestsView,
718 attr='pull_request_update',
719 route_name='pullrequest_update', request_method='POST',
720 renderer='json_ext')
322
721
323 config.add_route(
722 config.add_route(
324 name='pullrequest_merge',
723 name='pullrequest_merge',
325 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge',
724 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge',
326 repo_route=True, repo_forbid_when_archived=True)
725 repo_route=True, repo_forbid_when_archived=True)
726 config.add_view(
727 RepoPullRequestsView,
728 attr='pull_request_merge',
729 route_name='pullrequest_merge', request_method='POST',
730 renderer='json_ext')
327
731
328 config.add_route(
732 config.add_route(
329 name='pullrequest_delete',
733 name='pullrequest_delete',
330 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete',
734 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete',
331 repo_route=True, repo_forbid_when_archived=True)
735 repo_route=True, repo_forbid_when_archived=True)
736 config.add_view(
737 RepoPullRequestsView,
738 attr='pull_request_delete',
739 route_name='pullrequest_delete', request_method='POST',
740 renderer='json_ext')
332
741
333 config.add_route(
742 config.add_route(
334 name='pullrequest_comment_create',
743 name='pullrequest_comment_create',
335 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment',
744 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment',
336 repo_route=True)
745 repo_route=True)
746 config.add_view(
747 RepoPullRequestsView,
748 attr='pull_request_comment_create',
749 route_name='pullrequest_comment_create', request_method='POST',
750 renderer='json_ext')
337
751
338 config.add_route(
752 config.add_route(
339 name='pullrequest_comment_edit',
753 name='pullrequest_comment_edit',
340 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/edit',
754 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/edit',
341 repo_route=True, repo_accepted_types=['hg', 'git'])
755 repo_route=True, repo_accepted_types=['hg', 'git'])
756 config.add_view(
757 RepoPullRequestsView,
758 attr='pull_request_comment_edit',
759 route_name='pullrequest_comment_edit', request_method='POST',
760 renderer='json_ext')
342
761
343 config.add_route(
762 config.add_route(
344 name='pullrequest_comment_delete',
763 name='pullrequest_comment_delete',
345 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete',
764 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete',
346 repo_route=True, repo_accepted_types=['hg', 'git'])
765 repo_route=True, repo_accepted_types=['hg', 'git'])
766 config.add_view(
767 RepoPullRequestsView,
768 attr='pull_request_comment_delete',
769 route_name='pullrequest_comment_delete', request_method='POST',
770 renderer='json_ext')
347
771
348 config.add_route(
772 config.add_route(
349 name='pullrequest_comments',
773 name='pullrequest_comments',
350 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comments',
774 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comments',
351 repo_route=True)
775 repo_route=True)
776 config.add_view(
777 RepoPullRequestsView,
778 attr='pullrequest_comments',
779 route_name='pullrequest_comments', request_method='POST',
780 renderer='string_html', xhr=True)
352
781
353 config.add_route(
782 config.add_route(
354 name='pullrequest_todos',
783 name='pullrequest_todos',
355 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/todos',
784 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/todos',
356 repo_route=True)
785 repo_route=True)
786 config.add_view(
787 RepoPullRequestsView,
788 attr='pullrequest_todos',
789 route_name='pullrequest_todos', request_method='POST',
790 renderer='string_html', xhr=True)
357
791
358 config.add_route(
792 config.add_route(
359 name='pullrequest_drafts',
793 name='pullrequest_drafts',
360 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/drafts',
794 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/drafts',
361 repo_route=True)
795 repo_route=True)
796 config.add_view(
797 RepoPullRequestsView,
798 attr='pullrequest_drafts',
799 route_name='pullrequest_drafts', request_method='POST',
800 renderer='string_html', xhr=True)
362
801
363 # Artifacts, (EE feature)
802 # Artifacts, (EE feature)
364 config.add_route(
803 config.add_route(
365 name='repo_artifacts_list',
804 name='repo_artifacts_list',
366 pattern='/{repo_name:.*?[^/]}/artifacts', repo_route=True)
805 pattern='/{repo_name:.*?[^/]}/artifacts', repo_route=True)
806 config.add_view(
807 RepoArtifactsView,
808 attr='repo_artifacts',
809 route_name='repo_artifacts_list', request_method='GET',
810 renderer='rhodecode:templates/artifacts/artifact_list.mako')
367
811
368 # Settings
812 # Settings
369 config.add_route(
813 config.add_route(
370 name='edit_repo',
814 name='edit_repo',
371 pattern='/{repo_name:.*?[^/]}/settings', repo_route=True)
815 pattern='/{repo_name:.*?[^/]}/settings', repo_route=True)
816 config.add_view(
817 RepoSettingsView,
818 attr='edit_settings',
819 route_name='edit_repo', request_method='GET',
820 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
372 # update is POST on edit_repo
821 # update is POST on edit_repo
822 config.add_view(
823 RepoSettingsView,
824 attr='edit_settings_update',
825 route_name='edit_repo', request_method='POST',
826 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
373
827
374 # Settings advanced
828 # Settings advanced
375 config.add_route(
829 config.add_route(
376 name='edit_repo_advanced',
830 name='edit_repo_advanced',
377 pattern='/{repo_name:.*?[^/]}/settings/advanced', repo_route=True)
831 pattern='/{repo_name:.*?[^/]}/settings/advanced', repo_route=True)
832 config.add_view(
833 RepoSettingsAdvancedView,
834 attr='edit_advanced',
835 route_name='edit_repo_advanced', request_method='GET',
836 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
837
378 config.add_route(
838 config.add_route(
379 name='edit_repo_advanced_archive',
839 name='edit_repo_advanced_archive',
380 pattern='/{repo_name:.*?[^/]}/settings/advanced/archive', repo_route=True)
840 pattern='/{repo_name:.*?[^/]}/settings/advanced/archive', repo_route=True)
841 config.add_view(
842 RepoSettingsAdvancedView,
843 attr='edit_advanced_archive',
844 route_name='edit_repo_advanced_archive', request_method='POST',
845 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
846
381 config.add_route(
847 config.add_route(
382 name='edit_repo_advanced_delete',
848 name='edit_repo_advanced_delete',
383 pattern='/{repo_name:.*?[^/]}/settings/advanced/delete', repo_route=True)
849 pattern='/{repo_name:.*?[^/]}/settings/advanced/delete', repo_route=True)
850 config.add_view(
851 RepoSettingsAdvancedView,
852 attr='edit_advanced_delete',
853 route_name='edit_repo_advanced_delete', request_method='POST',
854 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
855
384 config.add_route(
856 config.add_route(
385 name='edit_repo_advanced_locking',
857 name='edit_repo_advanced_locking',
386 pattern='/{repo_name:.*?[^/]}/settings/advanced/locking', repo_route=True)
858 pattern='/{repo_name:.*?[^/]}/settings/advanced/locking', repo_route=True)
859 config.add_view(
860 RepoSettingsAdvancedView,
861 attr='edit_advanced_toggle_locking',
862 route_name='edit_repo_advanced_locking', request_method='POST',
863 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
864
387 config.add_route(
865 config.add_route(
388 name='edit_repo_advanced_journal',
866 name='edit_repo_advanced_journal',
389 pattern='/{repo_name:.*?[^/]}/settings/advanced/journal', repo_route=True)
867 pattern='/{repo_name:.*?[^/]}/settings/advanced/journal', repo_route=True)
868 config.add_view(
869 RepoSettingsAdvancedView,
870 attr='edit_advanced_journal',
871 route_name='edit_repo_advanced_journal', request_method='POST',
872 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
873
390 config.add_route(
874 config.add_route(
391 name='edit_repo_advanced_fork',
875 name='edit_repo_advanced_fork',
392 pattern='/{repo_name:.*?[^/]}/settings/advanced/fork', repo_route=True)
876 pattern='/{repo_name:.*?[^/]}/settings/advanced/fork', repo_route=True)
877 config.add_view(
878 RepoSettingsAdvancedView,
879 attr='edit_advanced_fork',
880 route_name='edit_repo_advanced_fork', request_method='POST',
881 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
393
882
394 config.add_route(
883 config.add_route(
395 name='edit_repo_advanced_hooks',
884 name='edit_repo_advanced_hooks',
396 pattern='/{repo_name:.*?[^/]}/settings/advanced/hooks', repo_route=True)
885 pattern='/{repo_name:.*?[^/]}/settings/advanced/hooks', repo_route=True)
886 config.add_view(
887 RepoSettingsAdvancedView,
888 attr='edit_advanced_install_hooks',
889 route_name='edit_repo_advanced_hooks', request_method='GET',
890 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
397
891
398 # Caches
892 # Caches
399 config.add_route(
893 config.add_route(
400 name='edit_repo_caches',
894 name='edit_repo_caches',
401 pattern='/{repo_name:.*?[^/]}/settings/caches', repo_route=True)
895 pattern='/{repo_name:.*?[^/]}/settings/caches', repo_route=True)
896 config.add_view(
897 RepoCachesView,
898 attr='repo_caches',
899 route_name='edit_repo_caches', request_method='GET',
900 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
901 config.add_view(
902 RepoCachesView,
903 attr='repo_caches_purge',
904 route_name='edit_repo_caches', request_method='POST')
402
905
403 # Permissions
906 # Permissions
404 config.add_route(
907 config.add_route(
405 name='edit_repo_perms',
908 name='edit_repo_perms',
406 pattern='/{repo_name:.*?[^/]}/settings/permissions', repo_route=True)
909 pattern='/{repo_name:.*?[^/]}/settings/permissions', repo_route=True)
910 config.add_view(
911 RepoSettingsPermissionsView,
912 attr='edit_permissions',
913 route_name='edit_repo_perms', request_method='GET',
914 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
915 config.add_view(
916 RepoSettingsPermissionsView,
917 attr='edit_permissions_update',
918 route_name='edit_repo_perms', request_method='POST',
919 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
407
920
408 config.add_route(
921 config.add_route(
409 name='edit_repo_perms_set_private',
922 name='edit_repo_perms_set_private',
410 pattern='/{repo_name:.*?[^/]}/settings/permissions/set_private', repo_route=True)
923 pattern='/{repo_name:.*?[^/]}/settings/permissions/set_private', repo_route=True)
924 config.add_view(
925 RepoSettingsPermissionsView,
926 attr='edit_permissions_set_private_repo',
927 route_name='edit_repo_perms_set_private', request_method='POST',
928 renderer='json_ext')
411
929
412 # Permissions Branch (EE feature)
930 # Permissions Branch (EE feature)
413 config.add_route(
931 config.add_route(
414 name='edit_repo_perms_branch',
932 name='edit_repo_perms_branch',
415 pattern='/{repo_name:.*?[^/]}/settings/branch_permissions', repo_route=True)
933 pattern='/{repo_name:.*?[^/]}/settings/branch_permissions', repo_route=True)
934 config.add_view(
935 RepoBranchesView,
936 attr='branches',
937 route_name='edit_repo_perms_branch', request_method='GET',
938 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
939
416 config.add_route(
940 config.add_route(
417 name='edit_repo_perms_branch_delete',
941 name='edit_repo_perms_branch_delete',
418 pattern='/{repo_name:.*?[^/]}/settings/branch_permissions/{rule_id}/delete',
942 pattern='/{repo_name:.*?[^/]}/settings/branch_permissions/{rule_id}/delete',
419 repo_route=True)
943 repo_route=True)
944 ## Only implemented in EE
420
945
421 # Maintenance
946 # Maintenance
422 config.add_route(
947 config.add_route(
423 name='edit_repo_maintenance',
948 name='edit_repo_maintenance',
424 pattern='/{repo_name:.*?[^/]}/settings/maintenance', repo_route=True)
949 pattern='/{repo_name:.*?[^/]}/settings/maintenance', repo_route=True)
950 config.add_view(
951 RepoMaintenanceView,
952 attr='repo_maintenance',
953 route_name='edit_repo_maintenance_execute', request_method='GET',
954 renderer='json', xhr=True)
425
955
426 config.add_route(
956 config.add_route(
427 name='edit_repo_maintenance_execute',
957 name='edit_repo_maintenance_execute',
428 pattern='/{repo_name:.*?[^/]}/settings/maintenance/execute', repo_route=True)
958 pattern='/{repo_name:.*?[^/]}/settings/maintenance/execute', repo_route=True)
959 config.add_view(
960 RepoMaintenanceView,
961 attr='repo_maintenance_execute',
962 route_name='edit_repo_maintenance', request_method='GET',
963 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
429
964
430 # Fields
965 # Fields
431 config.add_route(
966 config.add_route(
432 name='edit_repo_fields',
967 name='edit_repo_fields',
433 pattern='/{repo_name:.*?[^/]}/settings/fields', repo_route=True)
968 pattern='/{repo_name:.*?[^/]}/settings/fields', repo_route=True)
969 config.add_view(
970 RepoSettingsFieldsView,
971 attr='repo_field_edit',
972 route_name='edit_repo_fields', request_method='GET',
973 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
974
434 config.add_route(
975 config.add_route(
435 name='edit_repo_fields_create',
976 name='edit_repo_fields_create',
436 pattern='/{repo_name:.*?[^/]}/settings/fields/create', repo_route=True)
977 pattern='/{repo_name:.*?[^/]}/settings/fields/create', repo_route=True)
978 config.add_view(
979 RepoSettingsFieldsView,
980 attr='repo_field_create',
981 route_name='edit_repo_fields_create', request_method='POST',
982 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
983
437 config.add_route(
984 config.add_route(
438 name='edit_repo_fields_delete',
985 name='edit_repo_fields_delete',
439 pattern='/{repo_name:.*?[^/]}/settings/fields/{field_id}/delete', repo_route=True)
986 pattern='/{repo_name:.*?[^/]}/settings/fields/{field_id}/delete', repo_route=True)
987 config.add_view(
988 RepoSettingsFieldsView,
989 attr='repo_field_delete',
990 route_name='edit_repo_fields_delete', request_method='POST',
991 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
440
992
441 # Locking
993 # Locking
442 config.add_route(
994 config.add_route(
443 name='repo_edit_toggle_locking',
995 name='repo_edit_toggle_locking',
444 pattern='/{repo_name:.*?[^/]}/settings/toggle_locking', repo_route=True)
996 pattern='/{repo_name:.*?[^/]}/settings/toggle_locking', repo_route=True)
997 config.add_view(
998 RepoSettingsView,
999 attr='edit_advanced_toggle_locking',
1000 route_name='repo_edit_toggle_locking', request_method='GET',
1001 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
445
1002
446 # Remote
1003 # Remote
447 config.add_route(
1004 config.add_route(
448 name='edit_repo_remote',
1005 name='edit_repo_remote',
449 pattern='/{repo_name:.*?[^/]}/settings/remote', repo_route=True)
1006 pattern='/{repo_name:.*?[^/]}/settings/remote', repo_route=True)
1007 config.add_view(
1008 RepoSettingsRemoteView,
1009 attr='repo_remote_edit_form',
1010 route_name='edit_repo_remote', request_method='GET',
1011 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1012
450 config.add_route(
1013 config.add_route(
451 name='edit_repo_remote_pull',
1014 name='edit_repo_remote_pull',
452 pattern='/{repo_name:.*?[^/]}/settings/remote/pull', repo_route=True)
1015 pattern='/{repo_name:.*?[^/]}/settings/remote/pull', repo_route=True)
1016 config.add_view(
1017 RepoSettingsRemoteView,
1018 attr='repo_remote_pull_changes',
1019 route_name='edit_repo_remote_pull', request_method='POST',
1020 renderer=None)
1021
453 config.add_route(
1022 config.add_route(
454 name='edit_repo_remote_push',
1023 name='edit_repo_remote_push',
455 pattern='/{repo_name:.*?[^/]}/settings/remote/push', repo_route=True)
1024 pattern='/{repo_name:.*?[^/]}/settings/remote/push', repo_route=True)
@@ -458,91 +1027,201 b' def includeme(config):'
458 config.add_route(
1027 config.add_route(
459 name='edit_repo_statistics',
1028 name='edit_repo_statistics',
460 pattern='/{repo_name:.*?[^/]}/settings/statistics', repo_route=True)
1029 pattern='/{repo_name:.*?[^/]}/settings/statistics', repo_route=True)
1030 config.add_view(
1031 RepoSettingsView,
1032 attr='edit_statistics_form',
1033 route_name='edit_repo_statistics', request_method='GET',
1034 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1035
461 config.add_route(
1036 config.add_route(
462 name='edit_repo_statistics_reset',
1037 name='edit_repo_statistics_reset',
463 pattern='/{repo_name:.*?[^/]}/settings/statistics/update', repo_route=True)
1038 pattern='/{repo_name:.*?[^/]}/settings/statistics/update', repo_route=True)
1039 config.add_view(
1040 RepoSettingsView,
1041 attr='repo_statistics_reset',
1042 route_name='edit_repo_statistics_reset', request_method='POST',
1043 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
464
1044
465 # Issue trackers
1045 # Issue trackers
466 config.add_route(
1046 config.add_route(
467 name='edit_repo_issuetracker',
1047 name='edit_repo_issuetracker',
468 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers', repo_route=True)
1048 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers', repo_route=True)
1049 config.add_view(
1050 RepoSettingsIssueTrackersView,
1051 attr='repo_issuetracker',
1052 route_name='edit_repo_issuetracker', request_method='GET',
1053 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1054
469 config.add_route(
1055 config.add_route(
470 name='edit_repo_issuetracker_test',
1056 name='edit_repo_issuetracker_test',
471 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/test', repo_route=True)
1057 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/test', repo_route=True)
1058 config.add_view(
1059 RepoSettingsIssueTrackersView,
1060 attr='repo_issuetracker_test',
1061 route_name='edit_repo_issuetracker_test', request_method='POST',
1062 renderer='string', xhr=True)
1063
472 config.add_route(
1064 config.add_route(
473 name='edit_repo_issuetracker_delete',
1065 name='edit_repo_issuetracker_delete',
474 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/delete', repo_route=True)
1066 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/delete', repo_route=True)
1067 config.add_view(
1068 RepoSettingsIssueTrackersView,
1069 attr='repo_issuetracker_delete',
1070 route_name='edit_repo_issuetracker_delete', request_method='POST',
1071 renderer='json_ext', xhr=True)
1072
475 config.add_route(
1073 config.add_route(
476 name='edit_repo_issuetracker_update',
1074 name='edit_repo_issuetracker_update',
477 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/update', repo_route=True)
1075 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/update', repo_route=True)
1076 config.add_view(
1077 RepoSettingsIssueTrackersView,
1078 attr='repo_issuetracker_update',
1079 route_name='edit_repo_issuetracker_update', request_method='POST',
1080 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
478
1081
479 # VCS Settings
1082 # VCS Settings
480 config.add_route(
1083 config.add_route(
481 name='edit_repo_vcs',
1084 name='edit_repo_vcs',
482 pattern='/{repo_name:.*?[^/]}/settings/vcs', repo_route=True)
1085 pattern='/{repo_name:.*?[^/]}/settings/vcs', repo_route=True)
1086 config.add_view(
1087 RepoSettingsVcsView,
1088 attr='repo_vcs_settings',
1089 route_name='edit_repo_vcs', request_method='GET',
1090 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
1091
483 config.add_route(
1092 config.add_route(
484 name='edit_repo_vcs_update',
1093 name='edit_repo_vcs_update',
485 pattern='/{repo_name:.*?[^/]}/settings/vcs/update', repo_route=True)
1094 pattern='/{repo_name:.*?[^/]}/settings/vcs/update', repo_route=True)
1095 config.add_view(
1096 RepoSettingsVcsView,
1097 attr='repo_settings_vcs_update',
1098 route_name='edit_repo_vcs_update', request_method='POST',
1099 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
486
1100
487 # svn pattern
1101 # svn pattern
488 config.add_route(
1102 config.add_route(
489 name='edit_repo_vcs_svn_pattern_delete',
1103 name='edit_repo_vcs_svn_pattern_delete',
490 pattern='/{repo_name:.*?[^/]}/settings/vcs/svn_pattern/delete', repo_route=True)
1104 pattern='/{repo_name:.*?[^/]}/settings/vcs/svn_pattern/delete', repo_route=True)
1105 config.add_view(
1106 RepoSettingsVcsView,
1107 attr='repo_settings_delete_svn_pattern',
1108 route_name='edit_repo_vcs_svn_pattern_delete', request_method='POST',
1109 renderer='json_ext', xhr=True)
491
1110
492 # Repo Review Rules (EE feature)
1111 # Repo Review Rules (EE feature)
493 config.add_route(
1112 config.add_route(
494 name='repo_reviewers',
1113 name='repo_reviewers',
495 pattern='/{repo_name:.*?[^/]}/settings/review/rules', repo_route=True)
1114 pattern='/{repo_name:.*?[^/]}/settings/review/rules', repo_route=True)
1115 config.add_view(
1116 RepoReviewRulesView,
1117 attr='repo_review_rules',
1118 route_name='repo_reviewers', request_method='GET',
1119 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
496
1120
497 config.add_route(
1121 config.add_route(
498 name='repo_default_reviewers_data',
1122 name='repo_default_reviewers_data',
499 pattern='/{repo_name:.*?[^/]}/settings/review/default-reviewers', repo_route=True)
1123 pattern='/{repo_name:.*?[^/]}/settings/review/default-reviewers', repo_route=True)
1124 config.add_view(
1125 RepoReviewRulesView,
1126 attr='repo_default_reviewers_data',
1127 route_name='repo_default_reviewers_data', request_method='GET',
1128 renderer='json_ext')
500
1129
501 # Repo Automation (EE feature)
1130 # Repo Automation (EE feature)
502 config.add_route(
1131 config.add_route(
503 name='repo_automation',
1132 name='repo_automation',
504 pattern='/{repo_name:.*?[^/]}/settings/automation', repo_route=True)
1133 pattern='/{repo_name:.*?[^/]}/settings/automation', repo_route=True)
1134 config.add_view(
1135 RepoAutomationView,
1136 attr='repo_automation',
1137 route_name='repo_automation', request_method='GET',
1138 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
505
1139
506 # Strip
1140 # Strip
507 config.add_route(
1141 config.add_route(
508 name='edit_repo_strip',
1142 name='edit_repo_strip',
509 pattern='/{repo_name:.*?[^/]}/settings/strip', repo_route=True)
1143 pattern='/{repo_name:.*?[^/]}/settings/strip', repo_route=True)
1144 config.add_view(
1145 RepoStripView,
1146 attr='strip',
1147 route_name='edit_repo_strip', request_method='GET',
1148 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
510
1149
511 config.add_route(
1150 config.add_route(
512 name='strip_check',
1151 name='strip_check',
513 pattern='/{repo_name:.*?[^/]}/settings/strip_check', repo_route=True)
1152 pattern='/{repo_name:.*?[^/]}/settings/strip_check', repo_route=True)
1153 config.add_view(
1154 RepoStripView,
1155 attr='strip_check',
1156 route_name='strip_check', request_method='POST',
1157 renderer='json', xhr=True)
514
1158
515 config.add_route(
1159 config.add_route(
516 name='strip_execute',
1160 name='strip_execute',
517 pattern='/{repo_name:.*?[^/]}/settings/strip_execute', repo_route=True)
1161 pattern='/{repo_name:.*?[^/]}/settings/strip_execute', repo_route=True)
1162 config.add_view(
1163 RepoStripView,
1164 attr='strip_execute',
1165 route_name='strip_execute', request_method='POST',
1166 renderer='json', xhr=True)
518
1167
519 # Audit logs
1168 # Audit logs
520 config.add_route(
1169 config.add_route(
521 name='edit_repo_audit_logs',
1170 name='edit_repo_audit_logs',
522 pattern='/{repo_name:.*?[^/]}/settings/audit_logs', repo_route=True)
1171 pattern='/{repo_name:.*?[^/]}/settings/audit_logs', repo_route=True)
1172 config.add_view(
1173 AuditLogsView,
1174 attr='repo_audit_logs',
1175 route_name='edit_repo_audit_logs', request_method='GET',
1176 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
523
1177
524 # ATOM/RSS Feed, shouldn't contain slashes for outlook compatibility
1178 # ATOM/RSS Feed, shouldn't contain slashes for outlook compatibility
525 config.add_route(
1179 config.add_route(
526 name='rss_feed_home',
1180 name='rss_feed_home',
527 pattern='/{repo_name:.*?[^/]}/feed-rss', repo_route=True)
1181 pattern='/{repo_name:.*?[^/]}/feed-rss', repo_route=True)
1182 config.add_view(
1183 RepoFeedView,
1184 attr='rss',
1185 route_name='rss_feed_home', request_method='GET', renderer=None)
1186
1187 config.add_route(
1188 name='rss_feed_home_old',
1189 pattern='/{repo_name:.*?[^/]}/feed/rss', repo_route=True)
1190 config.add_view(
1191 RepoFeedView,
1192 attr='rss',
1193 route_name='rss_feed_home_old', request_method='GET', renderer=None)
528
1194
529 config.add_route(
1195 config.add_route(
530 name='atom_feed_home',
1196 name='atom_feed_home',
531 pattern='/{repo_name:.*?[^/]}/feed-atom', repo_route=True)
1197 pattern='/{repo_name:.*?[^/]}/feed-atom', repo_route=True)
532
1198 config.add_view(
533 config.add_route(
1199 RepoFeedView,
534 name='rss_feed_home_old',
1200 attr='atom',
535 pattern='/{repo_name:.*?[^/]}/feed/rss', repo_route=True)
1201 route_name='atom_feed_home', request_method='GET', renderer=None)
536
1202
537 config.add_route(
1203 config.add_route(
538 name='atom_feed_home_old',
1204 name='atom_feed_home_old',
539 pattern='/{repo_name:.*?[^/]}/feed/atom', repo_route=True)
1205 pattern='/{repo_name:.*?[^/]}/feed/atom', repo_route=True)
1206 config.add_view(
1207 RepoFeedView,
1208 attr='atom',
1209 route_name='atom_feed_home_old', request_method='GET', renderer=None)
540
1210
541 # NOTE(marcink): needs to be at the end for catch-all
1211 # NOTE(marcink): needs to be at the end for catch-all
542 add_route_with_slash(
1212 add_route_with_slash(
543 config,
1213 config,
544 name='repo_summary',
1214 name='repo_summary',
545 pattern='/{repo_name:.*?[^/]}', repo_route=True)
1215 pattern='/{repo_name:.*?[^/]}', repo_route=True)
546
1216 config.add_view(
547 # Scan module for configuration decorators.
1217 RepoSummaryView,
548 config.scan('.views', ignore='.tests')
1218 attr='summary',
1219 route_name='repo_summary', request_method='GET',
1220 renderer='rhodecode:templates/summary/summary.mako')
1221
1222 # TODO(marcink): there's no such route??
1223 config.add_view(
1224 RepoSummaryView,
1225 attr='summary',
1226 route_name='repo_summary_slash', request_method='GET',
1227 renderer='rhodecode:templates/summary/summary.mako') No newline at end of file
@@ -20,7 +20,7 b''
20
20
21 import logging
21 import logging
22
22
23 from pyramid.view import view_config
23
24
24
25 from rhodecode.apps._base import RepoAppView
25 from rhodecode.apps._base import RepoAppView
26 from rhodecode.lib.auth import (
26 from rhodecode.lib.auth import (
@@ -39,9 +39,6 b' class RepoArtifactsView(RepoAppView):'
39 @LoginRequired()
39 @LoginRequired()
40 @HasRepoPermissionAnyDecorator(
40 @HasRepoPermissionAnyDecorator(
41 'repository.read', 'repository.write', 'repository.admin')
41 'repository.read', 'repository.write', 'repository.admin')
42 @view_config(
43 route_name='repo_artifacts_list', request_method='GET',
44 renderer='rhodecode:templates/artifacts/artifact_list.mako')
45 def repo_artifacts(self):
42 def repo_artifacts(self):
46 c = self.load_default_context()
43 c = self.load_default_context()
47 c.active = 'artifacts'
44 c.active = 'artifacts'
@@ -19,7 +19,7 b''
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 import logging
21 import logging
22 from pyramid.view import view_config
22
23
23
24 from rhodecode.apps._base import RepoAppView
24 from rhodecode.apps._base import RepoAppView
25 from rhodecode.lib.helpers import SqlPage
25 from rhodecode.lib.helpers import SqlPage
@@ -38,9 +38,6 b' class AuditLogsView(RepoAppView):'
38
38
39 @LoginRequired()
39 @LoginRequired()
40 @HasRepoPermissionAnyDecorator('repository.admin')
40 @HasRepoPermissionAnyDecorator('repository.admin')
41 @view_config(
42 route_name='edit_repo_audit_logs', request_method='GET',
43 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
44 def repo_audit_logs(self):
41 def repo_audit_logs(self):
45 _ = self.request.translate
42 _ = self.request.translate
46 c = self.load_default_context()
43 c = self.load_default_context()
@@ -20,7 +20,7 b''
20
20
21 import logging
21 import logging
22
22
23 from pyramid.view import view_config
23
24
24
25 from rhodecode.apps._base import RepoAppView
25 from rhodecode.apps._base import RepoAppView
26 from rhodecode.apps.repository.utils import get_default_reviewers_data
26 from rhodecode.apps.repository.utils import get_default_reviewers_data
@@ -36,9 +36,6 b' class RepoAutomationView(RepoAppView):'
36
36
37 @LoginRequired()
37 @LoginRequired()
38 @HasRepoPermissionAnyDecorator('repository.admin')
38 @HasRepoPermissionAnyDecorator('repository.admin')
39 @view_config(
40 route_name='repo_automation', request_method='GET',
41 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
42 def repo_automation(self):
39 def repo_automation(self):
43 c = self.load_default_context()
40 c = self.load_default_context()
44 c.active = 'automation'
41 c.active = 'automation'
@@ -20,7 +20,7 b''
20 import logging
20 import logging
21
21
22 from pyramid.httpexceptions import HTTPNotFound
22 from pyramid.httpexceptions import HTTPNotFound
23 from pyramid.view import view_config
23
24
24
25 from rhodecode.apps._base import BaseReferencesView
25 from rhodecode.apps._base import BaseReferencesView
26 from rhodecode.lib.ext_json import json
26 from rhodecode.lib.ext_json import json
@@ -36,9 +36,6 b' class RepoBookmarksView(BaseReferencesVi'
36 @LoginRequired()
36 @LoginRequired()
37 @HasRepoPermissionAnyDecorator(
37 @HasRepoPermissionAnyDecorator(
38 'repository.read', 'repository.write', 'repository.admin')
38 'repository.read', 'repository.write', 'repository.admin')
39 @view_config(
40 route_name='bookmarks_home', request_method='GET',
41 renderer='rhodecode:templates/bookmarks/bookmarks.mako')
42 def bookmarks(self):
39 def bookmarks(self):
43 c = self.load_default_context()
40 c = self.load_default_context()
44
41
@@ -20,7 +20,7 b''
20
20
21 import logging
21 import logging
22
22
23 from pyramid.view import view_config
23
24
24
25 from rhodecode.apps._base import RepoAppView
25 from rhodecode.apps._base import RepoAppView
26 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
26 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
@@ -36,9 +36,6 b' class RepoSettingsBranchPermissionsView('
36
36
37 @LoginRequired()
37 @LoginRequired()
38 @HasRepoPermissionAnyDecorator('repository.admin')
38 @HasRepoPermissionAnyDecorator('repository.admin')
39 @view_config(
40 route_name='edit_repo_perms_branch', request_method='GET',
41 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
42 def branch_permissions(self):
39 def branch_permissions(self):
43 c = self.load_default_context()
40 c = self.load_default_context()
44 c.active = 'permissions_branch'
41 c.active = 'permissions_branch'
@@ -19,7 +19,7 b''
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 import logging
21 import logging
22 from pyramid.view import view_config
22
23
23
24 from rhodecode.apps._base import BaseReferencesView
24 from rhodecode.apps._base import BaseReferencesView
25 from rhodecode.lib.ext_json import json
25 from rhodecode.lib.ext_json import json
@@ -34,9 +34,6 b' class RepoBranchesView(BaseReferencesVie'
34 @LoginRequired()
34 @LoginRequired()
35 @HasRepoPermissionAnyDecorator(
35 @HasRepoPermissionAnyDecorator(
36 'repository.read', 'repository.write', 'repository.admin')
36 'repository.read', 'repository.write', 'repository.admin')
37 @view_config(
38 route_name='branches_home', request_method='GET',
39 renderer='rhodecode:templates/branches/branches.mako')
40 def branches(self):
37 def branches(self):
41 c = self.load_default_context()
38 c = self.load_default_context()
42
39
@@ -22,7 +22,7 b' import os'
22 import logging
22 import logging
23
23
24 from pyramid.httpexceptions import HTTPFound
24 from pyramid.httpexceptions import HTTPFound
25 from pyramid.view import view_config
25
26
26
27 from rhodecode.apps._base import RepoAppView
27 from rhodecode.apps._base import RepoAppView
28 from rhodecode.lib.auth import (
28 from rhodecode.lib.auth import (
@@ -42,9 +42,6 b' class RepoCachesView(RepoAppView):'
42
42
43 @LoginRequired()
43 @LoginRequired()
44 @HasRepoPermissionAnyDecorator('repository.admin')
44 @HasRepoPermissionAnyDecorator('repository.admin')
45 @view_config(
46 route_name='edit_repo_caches', request_method='GET',
47 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
48 def repo_caches(self):
45 def repo_caches(self):
49 c = self.load_default_context()
46 c = self.load_default_context()
50 c.active = 'caches'
47 c.active = 'caches'
@@ -65,8 +62,6 b' class RepoCachesView(RepoAppView):'
65 @LoginRequired()
62 @LoginRequired()
66 @HasRepoPermissionAnyDecorator('repository.admin')
63 @HasRepoPermissionAnyDecorator('repository.admin')
67 @CSRFRequired()
64 @CSRFRequired()
68 @view_config(
69 route_name='edit_repo_caches', request_method='POST')
70 def repo_caches_purge(self):
65 def repo_caches_purge(self):
71 _ = self.request.translate
66 _ = self.request.translate
72 c = self.load_default_context()
67 c = self.load_default_context()
@@ -22,7 +22,7 b''
22 import logging
22 import logging
23
23
24 from pyramid.httpexceptions import HTTPNotFound, HTTPFound
24 from pyramid.httpexceptions import HTTPNotFound, HTTPFound
25 from pyramid.view import view_config
25
26 from pyramid.renderers import render
26 from pyramid.renderers import render
27 from pyramid.response import Response
27 from pyramid.response import Response
28
28
@@ -176,19 +176,6 b' class RepoChangelogView(RepoAppView):'
176 @LoginRequired()
176 @LoginRequired()
177 @HasRepoPermissionAnyDecorator(
177 @HasRepoPermissionAnyDecorator(
178 'repository.read', 'repository.write', 'repository.admin')
178 'repository.read', 'repository.write', 'repository.admin')
179 @view_config(
180 route_name='repo_commits', request_method='GET',
181 renderer='rhodecode:templates/commits/changelog.mako')
182 @view_config(
183 route_name='repo_commits_file', request_method='GET',
184 renderer='rhodecode:templates/commits/changelog.mako')
185 # old routes for backward compat
186 @view_config(
187 route_name='repo_changelog', request_method='GET',
188 renderer='rhodecode:templates/commits/changelog.mako')
189 @view_config(
190 route_name='repo_changelog_file', request_method='GET',
191 renderer='rhodecode:templates/commits/changelog.mako')
192 def repo_changelog(self):
179 def repo_changelog(self):
193 c = self.load_default_context()
180 c = self.load_default_context()
194
181
@@ -291,14 +278,6 b' class RepoChangelogView(RepoAppView):'
291 @LoginRequired()
278 @LoginRequired()
292 @HasRepoPermissionAnyDecorator(
279 @HasRepoPermissionAnyDecorator(
293 'repository.read', 'repository.write', 'repository.admin')
280 'repository.read', 'repository.write', 'repository.admin')
294 @view_config(
295 route_name='repo_commits_elements', request_method=('GET', 'POST'),
296 renderer='rhodecode:templates/commits/changelog_elements.mako',
297 xhr=True)
298 @view_config(
299 route_name='repo_commits_elements_file', request_method=('GET', 'POST'),
300 renderer='rhodecode:templates/commits/changelog_elements.mako',
301 xhr=True)
302 def repo_commits_elements(self):
281 def repo_commits_elements(self):
303 c = self.load_default_context()
282 c = self.load_default_context()
304 commit_id = self.request.matchdict.get('commit_id')
283 commit_id = self.request.matchdict.get('commit_id')
@@ -20,10 +20,8 b''
20
20
21 import logging
21 import logging
22
22
23 from pyramid.view import view_config
24 from pyramid.httpexceptions import HTTPFound, HTTPNotFound
23 from pyramid.httpexceptions import HTTPFound, HTTPNotFound
25
24
26 from rhodecode import events
27 from rhodecode.apps._base import BaseAppView
25 from rhodecode.apps._base import BaseAppView
28 from rhodecode.lib import helpers as h
26 from rhodecode.lib import helpers as h
29 from rhodecode.lib.auth import (NotAnonymous, HasRepoPermissionAny)
27 from rhodecode.lib.auth import (NotAnonymous, HasRepoPermissionAny)
@@ -37,13 +35,9 b' log = logging.getLogger(__name__)'
37 class RepoChecksView(BaseAppView):
35 class RepoChecksView(BaseAppView):
38 def load_default_context(self):
36 def load_default_context(self):
39 c = self._get_local_tmpl_context()
37 c = self._get_local_tmpl_context()
40
41 return c
38 return c
42
39
43 @NotAnonymous()
40 @NotAnonymous()
44 @view_config(
45 route_name='repo_creating', request_method='GET',
46 renderer='rhodecode:templates/admin/repos/repo_creating.mako')
47 def repo_creating(self):
41 def repo_creating(self):
48 c = self.load_default_context()
42 c = self.load_default_context()
49 repo_name = self.request.matchdict['repo_name']
43 repo_name = self.request.matchdict['repo_name']
@@ -71,9 +65,6 b' class RepoChecksView(BaseAppView):'
71 return self._get_template_context(c)
65 return self._get_template_context(c)
72
66
73 @NotAnonymous()
67 @NotAnonymous()
74 @view_config(
75 route_name='repo_creating_check', request_method='GET',
76 renderer='json_ext')
77 def repo_creating_check(self):
68 def repo_creating_check(self):
78 _ = self.request.translate
69 _ = self.request.translate
79 task_id = self.request.GET.get('task_id')
70 task_id = self.request.GET.get('task_id')
@@ -23,7 +23,6 b' import collections'
23
23
24 from pyramid.httpexceptions import (
24 from pyramid.httpexceptions import (
25 HTTPNotFound, HTTPBadRequest, HTTPFound, HTTPForbidden, HTTPConflict)
25 HTTPNotFound, HTTPBadRequest, HTTPFound, HTTPForbidden, HTTPConflict)
26 from pyramid.view import view_config
27 from pyramid.renderers import render
26 from pyramid.renderers import render
28 from pyramid.response import Response
27 from pyramid.response import Response
29
28
@@ -340,9 +339,6 b' class RepoCommitsView(RepoAppView):'
340 @LoginRequired()
339 @LoginRequired()
341 @HasRepoPermissionAnyDecorator(
340 @HasRepoPermissionAnyDecorator(
342 'repository.read', 'repository.write', 'repository.admin')
341 'repository.read', 'repository.write', 'repository.admin')
343 @view_config(
344 route_name='repo_commit', request_method='GET',
345 renderer=None)
346 def repo_commit_show(self):
342 def repo_commit_show(self):
347 commit_id = self.request.matchdict['commit_id']
343 commit_id = self.request.matchdict['commit_id']
348 return self._commit(commit_id, method='show')
344 return self._commit(commit_id, method='show')
@@ -350,12 +346,6 b' class RepoCommitsView(RepoAppView):'
350 @LoginRequired()
346 @LoginRequired()
351 @HasRepoPermissionAnyDecorator(
347 @HasRepoPermissionAnyDecorator(
352 'repository.read', 'repository.write', 'repository.admin')
348 'repository.read', 'repository.write', 'repository.admin')
353 @view_config(
354 route_name='repo_commit_raw', request_method='GET',
355 renderer=None)
356 @view_config(
357 route_name='repo_commit_raw_deprecated', request_method='GET',
358 renderer=None)
359 def repo_commit_raw(self):
349 def repo_commit_raw(self):
360 commit_id = self.request.matchdict['commit_id']
350 commit_id = self.request.matchdict['commit_id']
361 return self._commit(commit_id, method='raw')
351 return self._commit(commit_id, method='raw')
@@ -363,9 +353,6 b' class RepoCommitsView(RepoAppView):'
363 @LoginRequired()
353 @LoginRequired()
364 @HasRepoPermissionAnyDecorator(
354 @HasRepoPermissionAnyDecorator(
365 'repository.read', 'repository.write', 'repository.admin')
355 'repository.read', 'repository.write', 'repository.admin')
366 @view_config(
367 route_name='repo_commit_patch', request_method='GET',
368 renderer=None)
369 def repo_commit_patch(self):
356 def repo_commit_patch(self):
370 commit_id = self.request.matchdict['commit_id']
357 commit_id = self.request.matchdict['commit_id']
371 return self._commit(commit_id, method='patch')
358 return self._commit(commit_id, method='patch')
@@ -373,9 +360,6 b' class RepoCommitsView(RepoAppView):'
373 @LoginRequired()
360 @LoginRequired()
374 @HasRepoPermissionAnyDecorator(
361 @HasRepoPermissionAnyDecorator(
375 'repository.read', 'repository.write', 'repository.admin')
362 'repository.read', 'repository.write', 'repository.admin')
376 @view_config(
377 route_name='repo_commit_download', request_method='GET',
378 renderer=None)
379 def repo_commit_download(self):
363 def repo_commit_download(self):
380 commit_id = self.request.matchdict['commit_id']
364 commit_id = self.request.matchdict['commit_id']
381 return self._commit(commit_id, method='download')
365 return self._commit(commit_id, method='download')
@@ -500,9 +484,6 b' class RepoCommitsView(RepoAppView):'
500 @HasRepoPermissionAnyDecorator(
484 @HasRepoPermissionAnyDecorator(
501 'repository.read', 'repository.write', 'repository.admin')
485 'repository.read', 'repository.write', 'repository.admin')
502 @CSRFRequired()
486 @CSRFRequired()
503 @view_config(
504 route_name='repo_commit_comment_create', request_method='POST',
505 renderer='json_ext')
506 def repo_commit_comment_create(self):
487 def repo_commit_comment_create(self):
507 _ = self.request.translate
488 _ = self.request.translate
508 commit_id = self.request.matchdict['commit_id']
489 commit_id = self.request.matchdict['commit_id']
@@ -538,9 +519,6 b' class RepoCommitsView(RepoAppView):'
538 @HasRepoPermissionAnyDecorator(
519 @HasRepoPermissionAnyDecorator(
539 'repository.read', 'repository.write', 'repository.admin')
520 'repository.read', 'repository.write', 'repository.admin')
540 @CSRFRequired()
521 @CSRFRequired()
541 @view_config(
542 route_name='repo_commit_comment_preview', request_method='POST',
543 renderer='string', xhr=True)
544 def repo_commit_comment_preview(self):
522 def repo_commit_comment_preview(self):
545 # Technically a CSRF token is not needed as no state changes with this
523 # Technically a CSRF token is not needed as no state changes with this
546 # call. However, as this is a POST is better to have it, so automated
524 # call. However, as this is a POST is better to have it, so automated
@@ -559,9 +537,6 b' class RepoCommitsView(RepoAppView):'
559 @HasRepoPermissionAnyDecorator(
537 @HasRepoPermissionAnyDecorator(
560 'repository.read', 'repository.write', 'repository.admin')
538 'repository.read', 'repository.write', 'repository.admin')
561 @CSRFRequired()
539 @CSRFRequired()
562 @view_config(
563 route_name='repo_commit_comment_history_view', request_method='POST',
564 renderer='string', xhr=True)
565 def repo_commit_comment_history_view(self):
540 def repo_commit_comment_history_view(self):
566 c = self.load_default_context()
541 c = self.load_default_context()
567
542
@@ -587,9 +562,6 b' class RepoCommitsView(RepoAppView):'
587 @HasRepoPermissionAnyDecorator(
562 @HasRepoPermissionAnyDecorator(
588 'repository.read', 'repository.write', 'repository.admin')
563 'repository.read', 'repository.write', 'repository.admin')
589 @CSRFRequired()
564 @CSRFRequired()
590 @view_config(
591 route_name='repo_commit_comment_attachment_upload', request_method='POST',
592 renderer='json_ext', xhr=True)
593 def repo_commit_comment_attachment_upload(self):
565 def repo_commit_comment_attachment_upload(self):
594 c = self.load_default_context()
566 c = self.load_default_context()
595 upload_key = 'attachment'
567 upload_key = 'attachment'
@@ -682,9 +654,6 b' class RepoCommitsView(RepoAppView):'
682 @HasRepoPermissionAnyDecorator(
654 @HasRepoPermissionAnyDecorator(
683 'repository.read', 'repository.write', 'repository.admin')
655 'repository.read', 'repository.write', 'repository.admin')
684 @CSRFRequired()
656 @CSRFRequired()
685 @view_config(
686 route_name='repo_commit_comment_delete', request_method='POST',
687 renderer='json_ext')
688 def repo_commit_comment_delete(self):
657 def repo_commit_comment_delete(self):
689 commit_id = self.request.matchdict['commit_id']
658 commit_id = self.request.matchdict['commit_id']
690 comment_id = self.request.matchdict['comment_id']
659 comment_id = self.request.matchdict['comment_id']
@@ -719,9 +688,6 b' class RepoCommitsView(RepoAppView):'
719 @HasRepoPermissionAnyDecorator(
688 @HasRepoPermissionAnyDecorator(
720 'repository.read', 'repository.write', 'repository.admin')
689 'repository.read', 'repository.write', 'repository.admin')
721 @CSRFRequired()
690 @CSRFRequired()
722 @view_config(
723 route_name='repo_commit_comment_edit', request_method='POST',
724 renderer='json_ext')
725 def repo_commit_comment_edit(self):
691 def repo_commit_comment_edit(self):
726 self.load_default_context()
692 self.load_default_context()
727
693
@@ -802,9 +768,6 b' class RepoCommitsView(RepoAppView):'
802 @LoginRequired()
768 @LoginRequired()
803 @HasRepoPermissionAnyDecorator(
769 @HasRepoPermissionAnyDecorator(
804 'repository.read', 'repository.write', 'repository.admin')
770 'repository.read', 'repository.write', 'repository.admin')
805 @view_config(
806 route_name='repo_commit_data', request_method='GET',
807 renderer='json_ext', xhr=True)
808 def repo_commit_data(self):
771 def repo_commit_data(self):
809 commit_id = self.request.matchdict['commit_id']
772 commit_id = self.request.matchdict['commit_id']
810 self.load_default_context()
773 self.load_default_context()
@@ -817,9 +780,6 b' class RepoCommitsView(RepoAppView):'
817 @LoginRequired()
780 @LoginRequired()
818 @HasRepoPermissionAnyDecorator(
781 @HasRepoPermissionAnyDecorator(
819 'repository.read', 'repository.write', 'repository.admin')
782 'repository.read', 'repository.write', 'repository.admin')
820 @view_config(
821 route_name='repo_commit_children', request_method='GET',
822 renderer='json_ext', xhr=True)
823 def repo_commit_children(self):
783 def repo_commit_children(self):
824 commit_id = self.request.matchdict['commit_id']
784 commit_id = self.request.matchdict['commit_id']
825 self.load_default_context()
785 self.load_default_context()
@@ -836,9 +796,6 b' class RepoCommitsView(RepoAppView):'
836 @LoginRequired()
796 @LoginRequired()
837 @HasRepoPermissionAnyDecorator(
797 @HasRepoPermissionAnyDecorator(
838 'repository.read', 'repository.write', 'repository.admin')
798 'repository.read', 'repository.write', 'repository.admin')
839 @view_config(
840 route_name='repo_commit_parents', request_method='GET',
841 renderer='json_ext')
842 def repo_commit_parents(self):
799 def repo_commit_parents(self):
843 commit_id = self.request.matchdict['commit_id']
800 commit_id = self.request.matchdict['commit_id']
844 self.load_default_context()
801 self.load_default_context()
@@ -22,7 +22,7 b''
22 import logging
22 import logging
23
23
24 from pyramid.httpexceptions import HTTPBadRequest, HTTPNotFound, HTTPFound
24 from pyramid.httpexceptions import HTTPBadRequest, HTTPNotFound, HTTPFound
25 from pyramid.view import view_config
25
26 from pyramid.renderers import render
26 from pyramid.renderers import render
27 from pyramid.response import Response
27 from pyramid.response import Response
28
28
@@ -79,9 +79,6 b' class RepoCompareView(RepoAppView):'
79 @LoginRequired()
79 @LoginRequired()
80 @HasRepoPermissionAnyDecorator(
80 @HasRepoPermissionAnyDecorator(
81 'repository.read', 'repository.write', 'repository.admin')
81 'repository.read', 'repository.write', 'repository.admin')
82 @view_config(
83 route_name='repo_compare_select', request_method='GET',
84 renderer='rhodecode:templates/compare/compare_diff.mako')
85 def compare_select(self):
82 def compare_select(self):
86 _ = self.request.translate
83 _ = self.request.translate
87 c = self.load_default_context()
84 c = self.load_default_context()
@@ -111,9 +108,6 b' class RepoCompareView(RepoAppView):'
111 @LoginRequired()
108 @LoginRequired()
112 @HasRepoPermissionAnyDecorator(
109 @HasRepoPermissionAnyDecorator(
113 'repository.read', 'repository.write', 'repository.admin')
110 'repository.read', 'repository.write', 'repository.admin')
114 @view_config(
115 route_name='repo_compare', request_method='GET',
116 renderer=None)
117 def compare(self):
111 def compare(self):
118 _ = self.request.translate
112 _ = self.request.translate
119 c = self.load_default_context()
113 c = self.load_default_context()
@@ -20,10 +20,8 b''
20 import pytz
20 import pytz
21 import logging
21 import logging
22
22
23 from pyramid.view import view_config
24 from pyramid.response import Response
23 from pyramid.response import Response
25
24
26
27 from rhodecode.apps._base import RepoAppView
25 from rhodecode.apps._base import RepoAppView
28 from rhodecode.lib.feedgenerator import Rss201rev2Feed, Atom1Feed
26 from rhodecode.lib.feedgenerator import Rss201rev2Feed, Atom1Feed
29 from rhodecode.lib import audit_logger
27 from rhodecode.lib import audit_logger
@@ -118,8 +116,6 b' class RepoFeedView(RepoAppView):'
118 @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED])
116 @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED])
119 @HasRepoPermissionAnyDecorator(
117 @HasRepoPermissionAnyDecorator(
120 'repository.read', 'repository.write', 'repository.admin')
118 'repository.read', 'repository.write', 'repository.admin')
121 @view_config(route_name='atom_feed_home', request_method='GET', renderer=None)
122 @view_config(route_name='atom_feed_home_old', request_method='GET', renderer=None)
123 def atom(self):
119 def atom(self):
124 """
120 """
125 Produce an atom-1.0 feed via feedgenerator module
121 Produce an atom-1.0 feed via feedgenerator module
@@ -166,8 +162,6 b' class RepoFeedView(RepoAppView):'
166 @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED])
162 @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED])
167 @HasRepoPermissionAnyDecorator(
163 @HasRepoPermissionAnyDecorator(
168 'repository.read', 'repository.write', 'repository.admin')
164 'repository.read', 'repository.write', 'repository.admin')
169 @view_config(route_name='rss_feed_home', request_method='GET', renderer=None)
170 @view_config(route_name='rss_feed_home_old', request_method='GET', renderer=None)
171 def rss(self):
165 def rss(self):
172 """
166 """
173 Produce an rss2 feed via feedgenerator module
167 Produce an rss2 feed via feedgenerator module
@@ -28,7 +28,7 b' import urllib'
28 import pathlib2
28 import pathlib2
29
29
30 from pyramid.httpexceptions import HTTPNotFound, HTTPBadRequest, HTTPFound
30 from pyramid.httpexceptions import HTTPNotFound, HTTPBadRequest, HTTPFound
31 from pyramid.view import view_config
31
32 from pyramid.renderers import render
32 from pyramid.renderers import render
33 from pyramid.response import Response
33 from pyramid.response import Response
34
34
@@ -343,9 +343,6 b' class RepoFilesView(RepoAppView):'
343 @LoginRequired()
343 @LoginRequired()
344 @HasRepoPermissionAnyDecorator(
344 @HasRepoPermissionAnyDecorator(
345 'repository.read', 'repository.write', 'repository.admin')
345 'repository.read', 'repository.write', 'repository.admin')
346 @view_config(
347 route_name='repo_archivefile', request_method='GET',
348 renderer=None)
349 def repo_archivefile(self):
346 def repo_archivefile(self):
350 # archive cache config
347 # archive cache config
351 from rhodecode import CONFIG
348 from rhodecode import CONFIG
@@ -496,9 +493,6 b' class RepoFilesView(RepoAppView):'
496 @LoginRequired()
493 @LoginRequired()
497 @HasRepoPermissionAnyDecorator(
494 @HasRepoPermissionAnyDecorator(
498 'repository.read', 'repository.write', 'repository.admin')
495 'repository.read', 'repository.write', 'repository.admin')
499 @view_config(
500 route_name='repo_files_diff', request_method='GET',
501 renderer=None)
502 def repo_files_diff(self):
496 def repo_files_diff(self):
503 c = self.load_default_context()
497 c = self.load_default_context()
504 f_path = self._get_f_path(self.request.matchdict)
498 f_path = self._get_f_path(self.request.matchdict)
@@ -581,9 +575,6 b' class RepoFilesView(RepoAppView):'
581 @LoginRequired()
575 @LoginRequired()
582 @HasRepoPermissionAnyDecorator(
576 @HasRepoPermissionAnyDecorator(
583 'repository.read', 'repository.write', 'repository.admin')
577 'repository.read', 'repository.write', 'repository.admin')
584 @view_config(
585 route_name='repo_files_diff_2way_redirect', request_method='GET',
586 renderer=None)
587 def repo_files_diff_2way_redirect(self):
578 def repo_files_diff_2way_redirect(self):
588 """
579 """
589 Kept only to make OLD links work
580 Kept only to make OLD links work
@@ -610,10 +601,11 b' class RepoFilesView(RepoAppView):'
610 raise HTTPFound(compare_url)
601 raise HTTPFound(compare_url)
611
602
612 @LoginRequired()
603 @LoginRequired()
613 @view_config(
604 def repo_files_default_commit_redirect(self):
614 route_name='repo_files:default_commit', request_method='GET',
605 """
615 renderer=None)
606 Special page that redirects to the landing page of files based on the default
616 def repo_files_default(self):
607 commit for repository
608 """
617 c = self.load_default_context()
609 c = self.load_default_context()
618 ref_name = c.rhodecode_db_repo.landing_ref_name
610 ref_name = c.rhodecode_db_repo.landing_ref_name
619 landing_url = h.repo_files_by_ref_url(
611 landing_url = h.repo_files_by_ref_url(
@@ -630,18 +622,6 b' class RepoFilesView(RepoAppView):'
630 @LoginRequired()
622 @LoginRequired()
631 @HasRepoPermissionAnyDecorator(
623 @HasRepoPermissionAnyDecorator(
632 'repository.read', 'repository.write', 'repository.admin')
624 'repository.read', 'repository.write', 'repository.admin')
633 @view_config(
634 route_name='repo_files', request_method='GET',
635 renderer=None)
636 @view_config(
637 route_name='repo_files:default_path', request_method='GET',
638 renderer=None)
639 @view_config(
640 route_name='repo_files:rendered', request_method='GET',
641 renderer=None)
642 @view_config(
643 route_name='repo_files:annotated', request_method='GET',
644 renderer=None)
645 def repo_files(self):
625 def repo_files(self):
646 c = self.load_default_context()
626 c = self.load_default_context()
647
627
@@ -759,9 +739,6 b' class RepoFilesView(RepoAppView):'
759
739
760 @HasRepoPermissionAnyDecorator(
740 @HasRepoPermissionAnyDecorator(
761 'repository.read', 'repository.write', 'repository.admin')
741 'repository.read', 'repository.write', 'repository.admin')
762 @view_config(
763 route_name='repo_files:annotated_previous', request_method='GET',
764 renderer=None)
765 def repo_files_annotated_previous(self):
742 def repo_files_annotated_previous(self):
766 self.load_default_context()
743 self.load_default_context()
767
744
@@ -790,12 +767,6 b' class RepoFilesView(RepoAppView):'
790 @LoginRequired()
767 @LoginRequired()
791 @HasRepoPermissionAnyDecorator(
768 @HasRepoPermissionAnyDecorator(
792 'repository.read', 'repository.write', 'repository.admin')
769 'repository.read', 'repository.write', 'repository.admin')
793 @view_config(
794 route_name='repo_nodetree_full', request_method='GET',
795 renderer=None, xhr=True)
796 @view_config(
797 route_name='repo_nodetree_full:default_path', request_method='GET',
798 renderer=None, xhr=True)
799 def repo_nodetree_full(self):
770 def repo_nodetree_full(self):
800 """
771 """
801 Returns rendered html of file tree that contains commit date,
772 Returns rendered html of file tree that contains commit date,
@@ -835,9 +806,6 b' class RepoFilesView(RepoAppView):'
835 @LoginRequired()
806 @LoginRequired()
836 @HasRepoPermissionAnyDecorator(
807 @HasRepoPermissionAnyDecorator(
837 'repository.read', 'repository.write', 'repository.admin')
808 'repository.read', 'repository.write', 'repository.admin')
838 @view_config(
839 route_name='repo_file_raw', request_method='GET',
840 renderer=None)
841 def repo_file_raw(self):
809 def repo_file_raw(self):
842 """
810 """
843 Action for show as raw, some mimetypes are "rendered",
811 Action for show as raw, some mimetypes are "rendered",
@@ -902,12 +870,6 b' class RepoFilesView(RepoAppView):'
902 @LoginRequired()
870 @LoginRequired()
903 @HasRepoPermissionAnyDecorator(
871 @HasRepoPermissionAnyDecorator(
904 'repository.read', 'repository.write', 'repository.admin')
872 'repository.read', 'repository.write', 'repository.admin')
905 @view_config(
906 route_name='repo_file_download', request_method='GET',
907 renderer=None)
908 @view_config(
909 route_name='repo_file_download:legacy', request_method='GET',
910 renderer=None)
911 def repo_file_download(self):
873 def repo_file_download(self):
912 c = self.load_default_context()
874 c = self.load_default_context()
913
875
@@ -972,9 +934,6 b' class RepoFilesView(RepoAppView):'
972 @LoginRequired()
934 @LoginRequired()
973 @HasRepoPermissionAnyDecorator(
935 @HasRepoPermissionAnyDecorator(
974 'repository.read', 'repository.write', 'repository.admin')
936 'repository.read', 'repository.write', 'repository.admin')
975 @view_config(
976 route_name='repo_files_nodelist', request_method='GET',
977 renderer='json_ext', xhr=True)
978 def repo_nodelist(self):
937 def repo_nodelist(self):
979 self.load_default_context()
938 self.load_default_context()
980
939
@@ -1059,9 +1018,6 b' class RepoFilesView(RepoAppView):'
1059 @LoginRequired()
1018 @LoginRequired()
1060 @HasRepoPermissionAnyDecorator(
1019 @HasRepoPermissionAnyDecorator(
1061 'repository.read', 'repository.write', 'repository.admin')
1020 'repository.read', 'repository.write', 'repository.admin')
1062 @view_config(
1063 route_name='repo_file_history', request_method='GET',
1064 renderer='json_ext')
1065 def repo_file_history(self):
1021 def repo_file_history(self):
1066 self.load_default_context()
1022 self.load_default_context()
1067
1023
@@ -1105,9 +1061,6 b' class RepoFilesView(RepoAppView):'
1105 @LoginRequired()
1061 @LoginRequired()
1106 @HasRepoPermissionAnyDecorator(
1062 @HasRepoPermissionAnyDecorator(
1107 'repository.read', 'repository.write', 'repository.admin')
1063 'repository.read', 'repository.write', 'repository.admin')
1108 @view_config(
1109 route_name='repo_file_authors', request_method='GET',
1110 renderer='rhodecode:templates/files/file_authors_box.mako')
1111 def repo_file_authors(self):
1064 def repo_file_authors(self):
1112 c = self.load_default_context()
1065 c = self.load_default_context()
1113
1066
@@ -1149,9 +1102,6 b' class RepoFilesView(RepoAppView):'
1149
1102
1150 @LoginRequired()
1103 @LoginRequired()
1151 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1104 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1152 @view_config(
1153 route_name='repo_files_check_head', request_method='POST',
1154 renderer='json_ext', xhr=True)
1155 def repo_files_check_head(self):
1105 def repo_files_check_head(self):
1156 self.load_default_context()
1106 self.load_default_context()
1157
1107
@@ -1186,9 +1136,6 b' class RepoFilesView(RepoAppView):'
1186
1136
1187 @LoginRequired()
1137 @LoginRequired()
1188 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1138 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1189 @view_config(
1190 route_name='repo_files_remove_file', request_method='GET',
1191 renderer='rhodecode:templates/files/files_delete.mako')
1192 def repo_files_remove_file(self):
1139 def repo_files_remove_file(self):
1193 _ = self.request.translate
1140 _ = self.request.translate
1194 c = self.load_default_context()
1141 c = self.load_default_context()
@@ -1214,9 +1161,6 b' class RepoFilesView(RepoAppView):'
1214 @LoginRequired()
1161 @LoginRequired()
1215 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1162 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1216 @CSRFRequired()
1163 @CSRFRequired()
1217 @view_config(
1218 route_name='repo_files_delete_file', request_method='POST',
1219 renderer=None)
1220 def repo_files_delete_file(self):
1164 def repo_files_delete_file(self):
1221 _ = self.request.translate
1165 _ = self.request.translate
1222
1166
@@ -1266,9 +1210,6 b' class RepoFilesView(RepoAppView):'
1266
1210
1267 @LoginRequired()
1211 @LoginRequired()
1268 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1212 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1269 @view_config(
1270 route_name='repo_files_edit_file', request_method='GET',
1271 renderer='rhodecode:templates/files/files_edit.mako')
1272 def repo_files_edit_file(self):
1213 def repo_files_edit_file(self):
1273 _ = self.request.translate
1214 _ = self.request.translate
1274 c = self.load_default_context()
1215 c = self.load_default_context()
@@ -1300,9 +1241,6 b' class RepoFilesView(RepoAppView):'
1300 @LoginRequired()
1241 @LoginRequired()
1301 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1242 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1302 @CSRFRequired()
1243 @CSRFRequired()
1303 @view_config(
1304 route_name='repo_files_update_file', request_method='POST',
1305 renderer=None)
1306 def repo_files_update_file(self):
1244 def repo_files_update_file(self):
1307 _ = self.request.translate
1245 _ = self.request.translate
1308 c = self.load_default_context()
1246 c = self.load_default_context()
@@ -1384,12 +1322,6 b' class RepoFilesView(RepoAppView):'
1384
1322
1385 @LoginRequired()
1323 @LoginRequired()
1386 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1324 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1387 @view_config(
1388 route_name='repo_files_add_file', request_method='GET',
1389 renderer='rhodecode:templates/files/files_add.mako')
1390 @view_config(
1391 route_name='repo_files_upload_file', request_method='GET',
1392 renderer='rhodecode:templates/files/files_upload.mako')
1393 def repo_files_add_file(self):
1325 def repo_files_add_file(self):
1394 _ = self.request.translate
1326 _ = self.request.translate
1395 c = self.load_default_context()
1327 c = self.load_default_context()
@@ -1421,9 +1353,6 b' class RepoFilesView(RepoAppView):'
1421 @LoginRequired()
1353 @LoginRequired()
1422 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1354 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1423 @CSRFRequired()
1355 @CSRFRequired()
1424 @view_config(
1425 route_name='repo_files_create_file', request_method='POST',
1426 renderer=None)
1427 def repo_files_create_file(self):
1356 def repo_files_create_file(self):
1428 _ = self.request.translate
1357 _ = self.request.translate
1429 c = self.load_default_context()
1358 c = self.load_default_context()
@@ -1518,9 +1447,6 b' class RepoFilesView(RepoAppView):'
1518 @LoginRequired()
1447 @LoginRequired()
1519 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1448 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
1520 @CSRFRequired()
1449 @CSRFRequired()
1521 @view_config(
1522 route_name='repo_files_upload_file', request_method='POST',
1523 renderer='json_ext')
1524 def repo_files_upload_file(self):
1450 def repo_files_upload_file(self):
1525 _ = self.request.translate
1451 _ = self.request.translate
1526 c = self.load_default_context()
1452 c = self.load_default_context()
@@ -24,7 +24,7 b' import formencode'
24 import formencode.htmlfill
24 import formencode.htmlfill
25
25
26 from pyramid.httpexceptions import HTTPFound
26 from pyramid.httpexceptions import HTTPFound
27 from pyramid.view import view_config
27
28 from pyramid.renderers import render
28 from pyramid.renderers import render
29 from pyramid.response import Response
29 from pyramid.response import Response
30
30
@@ -64,9 +64,6 b' class RepoForksView(RepoAppView, DataGri'
64 @LoginRequired()
64 @LoginRequired()
65 @HasRepoPermissionAnyDecorator(
65 @HasRepoPermissionAnyDecorator(
66 'repository.read', 'repository.write', 'repository.admin')
66 'repository.read', 'repository.write', 'repository.admin')
67 @view_config(
68 route_name='repo_forks_show_all', request_method='GET',
69 renderer='rhodecode:templates/forks/forks.mako')
70 def repo_forks_show_all(self):
67 def repo_forks_show_all(self):
71 c = self.load_default_context()
68 c = self.load_default_context()
72 return self._get_template_context(c)
69 return self._get_template_context(c)
@@ -74,9 +71,6 b' class RepoForksView(RepoAppView, DataGri'
74 @LoginRequired()
71 @LoginRequired()
75 @HasRepoPermissionAnyDecorator(
72 @HasRepoPermissionAnyDecorator(
76 'repository.read', 'repository.write', 'repository.admin')
73 'repository.read', 'repository.write', 'repository.admin')
77 @view_config(
78 route_name='repo_forks_data', request_method='GET',
79 renderer='json_ext', xhr=True)
80 def repo_forks_data(self):
74 def repo_forks_data(self):
81 _ = self.request.translate
75 _ = self.request.translate
82 self.load_default_context()
76 self.load_default_context()
@@ -174,9 +168,6 b' class RepoForksView(RepoAppView, DataGri'
174 @HasPermissionAnyDecorator('hg.admin', 'hg.fork.repository')
168 @HasPermissionAnyDecorator('hg.admin', 'hg.fork.repository')
175 @HasRepoPermissionAnyDecorator(
169 @HasRepoPermissionAnyDecorator(
176 'repository.read', 'repository.write', 'repository.admin')
170 'repository.read', 'repository.write', 'repository.admin')
177 @view_config(
178 route_name='repo_fork_new', request_method='GET',
179 renderer='rhodecode:templates/forks/forks.mako')
180 def repo_fork_new(self):
171 def repo_fork_new(self):
181 c = self.load_default_context()
172 c = self.load_default_context()
182
173
@@ -204,9 +195,6 b' class RepoForksView(RepoAppView, DataGri'
204 @HasRepoPermissionAnyDecorator(
195 @HasRepoPermissionAnyDecorator(
205 'repository.read', 'repository.write', 'repository.admin')
196 'repository.read', 'repository.write', 'repository.admin')
206 @CSRFRequired()
197 @CSRFRequired()
207 @view_config(
208 route_name='repo_fork_create', request_method='POST',
209 renderer='rhodecode:templates/forks/fork.mako')
210 def repo_fork_create(self):
198 def repo_fork_create(self):
211 _ = self.request.translate
199 _ = self.request.translate
212 c = self.load_default_context()
200 c = self.load_default_context()
@@ -20,7 +20,7 b''
20
20
21 import logging
21 import logging
22
22
23 from pyramid.view import view_config
23
24
24
25 from rhodecode.apps._base import RepoAppView
25 from rhodecode.apps._base import RepoAppView
26 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
26 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
@@ -36,9 +36,6 b' class RepoMaintenanceView(RepoAppView):'
36
36
37 @LoginRequired()
37 @LoginRequired()
38 @HasRepoPermissionAnyDecorator('repository.admin')
38 @HasRepoPermissionAnyDecorator('repository.admin')
39 @view_config(
40 route_name='edit_repo_maintenance', request_method='GET',
41 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
42 def repo_maintenance(self):
39 def repo_maintenance(self):
43 c = self.load_default_context()
40 c = self.load_default_context()
44 c.active = 'maintenance'
41 c.active = 'maintenance'
@@ -48,9 +45,6 b' class RepoMaintenanceView(RepoAppView):'
48
45
49 @LoginRequired()
46 @LoginRequired()
50 @HasRepoPermissionAnyDecorator('repository.admin')
47 @HasRepoPermissionAnyDecorator('repository.admin')
51 @view_config(
52 route_name='edit_repo_maintenance_execute', request_method='GET',
53 renderer='json', xhr=True)
54 def repo_maintenance_execute(self):
48 def repo_maintenance_execute(self):
55 c = self.load_default_context()
49 c = self.load_default_context()
56 c.active = 'maintenance'
50 c.active = 'maintenance'
@@ -21,7 +21,6 b''
21 import logging
21 import logging
22
22
23 from pyramid.httpexceptions import HTTPFound
23 from pyramid.httpexceptions import HTTPFound
24 from pyramid.view import view_config
25
24
26 from rhodecode.apps._base import RepoAppView
25 from rhodecode.apps._base import RepoAppView
27 from rhodecode.lib import helpers as h
26 from rhodecode.lib import helpers as h
@@ -46,9 +45,6 b' class RepoSettingsPermissionsView(RepoAp'
46
45
47 @LoginRequired()
46 @LoginRequired()
48 @HasRepoPermissionAnyDecorator('repository.admin')
47 @HasRepoPermissionAnyDecorator('repository.admin')
49 @view_config(
50 route_name='edit_repo_perms', request_method='GET',
51 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
52 def edit_permissions(self):
48 def edit_permissions(self):
53 _ = self.request.translate
49 _ = self.request.translate
54 c = self.load_default_context()
50 c = self.load_default_context()
@@ -62,9 +58,6 b' class RepoSettingsPermissionsView(RepoAp'
62 @LoginRequired()
58 @LoginRequired()
63 @HasRepoPermissionAnyDecorator('repository.admin')
59 @HasRepoPermissionAnyDecorator('repository.admin')
64 @CSRFRequired()
60 @CSRFRequired()
65 @view_config(
66 route_name='edit_repo_perms', request_method='POST',
67 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
68 def edit_permissions_update(self):
61 def edit_permissions_update(self):
69 _ = self.request.translate
62 _ = self.request.translate
70 c = self.load_default_context()
63 c = self.load_default_context()
@@ -104,9 +97,6 b' class RepoSettingsPermissionsView(RepoAp'
104 @LoginRequired()
97 @LoginRequired()
105 @HasRepoPermissionAnyDecorator('repository.admin')
98 @HasRepoPermissionAnyDecorator('repository.admin')
106 @CSRFRequired()
99 @CSRFRequired()
107 @view_config(
108 route_name='edit_repo_perms_set_private', request_method='POST',
109 renderer='json_ext')
110 def edit_permissions_set_private_repo(self):
100 def edit_permissions_set_private_repo(self):
111 _ = self.request.translate
101 _ = self.request.translate
112 self.load_default_context()
102 self.load_default_context()
@@ -26,7 +26,7 b' import formencode.htmlfill'
26 import peppercorn
26 import peppercorn
27 from pyramid.httpexceptions import (
27 from pyramid.httpexceptions import (
28 HTTPFound, HTTPNotFound, HTTPForbidden, HTTPBadRequest, HTTPConflict)
28 HTTPFound, HTTPNotFound, HTTPForbidden, HTTPBadRequest, HTTPConflict)
29 from pyramid.view import view_config
29
30 from pyramid.renderers import render
30 from pyramid.renderers import render
31
31
32 from rhodecode.apps._base import RepoAppView, DataGridAppView
32 from rhodecode.apps._base import RepoAppView, DataGridAppView
@@ -147,9 +147,6 b' class RepoPullRequestsView(RepoAppView, '
147 @LoginRequired()
147 @LoginRequired()
148 @HasRepoPermissionAnyDecorator(
148 @HasRepoPermissionAnyDecorator(
149 'repository.read', 'repository.write', 'repository.admin')
149 'repository.read', 'repository.write', 'repository.admin')
150 @view_config(
151 route_name='pullrequest_show_all', request_method='GET',
152 renderer='rhodecode:templates/pullrequests/pullrequests.mako')
153 def pull_request_list(self):
150 def pull_request_list(self):
154 c = self.load_default_context()
151 c = self.load_default_context()
155
152
@@ -177,9 +174,6 b' class RepoPullRequestsView(RepoAppView, '
177 @LoginRequired()
174 @LoginRequired()
178 @HasRepoPermissionAnyDecorator(
175 @HasRepoPermissionAnyDecorator(
179 'repository.read', 'repository.write', 'repository.admin')
176 'repository.read', 'repository.write', 'repository.admin')
180 @view_config(
181 route_name='pullrequest_show_all_data', request_method='GET',
182 renderer='json_ext', xhr=True)
183 def pull_request_list_data(self):
177 def pull_request_list_data(self):
184 self.load_default_context()
178 self.load_default_context()
185
179
@@ -311,9 +305,6 b' class RepoPullRequestsView(RepoAppView, '
311 @LoginRequired()
305 @LoginRequired()
312 @HasRepoPermissionAnyDecorator(
306 @HasRepoPermissionAnyDecorator(
313 'repository.read', 'repository.write', 'repository.admin')
307 'repository.read', 'repository.write', 'repository.admin')
314 @view_config(
315 route_name='pullrequest_show', request_method='GET',
316 renderer='rhodecode:templates/pullrequests/pullrequest_show.mako')
317 def pull_request_show(self):
308 def pull_request_show(self):
318 _ = self.request.translate
309 _ = self.request.translate
319 c = self.load_default_context()
310 c = self.load_default_context()
@@ -842,9 +833,6 b' class RepoPullRequestsView(RepoAppView, '
842 @NotAnonymous()
833 @NotAnonymous()
843 @HasRepoPermissionAnyDecorator(
834 @HasRepoPermissionAnyDecorator(
844 'repository.read', 'repository.write', 'repository.admin')
835 'repository.read', 'repository.write', 'repository.admin')
845 @view_config(
846 route_name='pullrequest_new', request_method='GET',
847 renderer='rhodecode:templates/pullrequests/pullrequest.mako')
848 def pull_request_new(self):
836 def pull_request_new(self):
849 _ = self.request.translate
837 _ = self.request.translate
850 c = self.load_default_context()
838 c = self.load_default_context()
@@ -902,9 +890,6 b' class RepoPullRequestsView(RepoAppView, '
902 @NotAnonymous()
890 @NotAnonymous()
903 @HasRepoPermissionAnyDecorator(
891 @HasRepoPermissionAnyDecorator(
904 'repository.read', 'repository.write', 'repository.admin')
892 'repository.read', 'repository.write', 'repository.admin')
905 @view_config(
906 route_name='pullrequest_repo_refs', request_method='GET',
907 renderer='json_ext', xhr=True)
908 def pull_request_repo_refs(self):
893 def pull_request_repo_refs(self):
909 self.load_default_context()
894 self.load_default_context()
910 target_repo_name = self.request.matchdict['target_repo_name']
895 target_repo_name = self.request.matchdict['target_repo_name']
@@ -925,9 +910,6 b' class RepoPullRequestsView(RepoAppView, '
925 @NotAnonymous()
910 @NotAnonymous()
926 @HasRepoPermissionAnyDecorator(
911 @HasRepoPermissionAnyDecorator(
927 'repository.read', 'repository.write', 'repository.admin')
912 'repository.read', 'repository.write', 'repository.admin')
928 @view_config(
929 route_name='pullrequest_repo_targets', request_method='GET',
930 renderer='json_ext', xhr=True)
931 def pullrequest_repo_targets(self):
913 def pullrequest_repo_targets(self):
932 _ = self.request.translate
914 _ = self.request.translate
933 filter_query = self.request.GET.get('query')
915 filter_query = self.request.GET.get('query')
@@ -998,9 +980,6 b' class RepoPullRequestsView(RepoAppView, '
998 @NotAnonymous()
980 @NotAnonymous()
999 @HasRepoPermissionAnyDecorator(
981 @HasRepoPermissionAnyDecorator(
1000 'repository.read', 'repository.write', 'repository.admin')
982 'repository.read', 'repository.write', 'repository.admin')
1001 @view_config(
1002 route_name='pullrequest_comments', request_method='POST',
1003 renderer='string_html', xhr=True)
1004 def pullrequest_comments(self):
983 def pullrequest_comments(self):
1005 self.load_default_context()
984 self.load_default_context()
1006
985
@@ -1038,9 +1017,6 b' class RepoPullRequestsView(RepoAppView, '
1038 @NotAnonymous()
1017 @NotAnonymous()
1039 @HasRepoPermissionAnyDecorator(
1018 @HasRepoPermissionAnyDecorator(
1040 'repository.read', 'repository.write', 'repository.admin')
1019 'repository.read', 'repository.write', 'repository.admin')
1041 @view_config(
1042 route_name='pullrequest_todos', request_method='POST',
1043 renderer='string_html', xhr=True)
1044 def pullrequest_todos(self):
1020 def pullrequest_todos(self):
1045 self.load_default_context()
1021 self.load_default_context()
1046
1022
@@ -1080,9 +1056,6 b' class RepoPullRequestsView(RepoAppView, '
1080 @NotAnonymous()
1056 @NotAnonymous()
1081 @HasRepoPermissionAnyDecorator(
1057 @HasRepoPermissionAnyDecorator(
1082 'repository.read', 'repository.write', 'repository.admin')
1058 'repository.read', 'repository.write', 'repository.admin')
1083 @view_config(
1084 route_name='pullrequest_drafts', request_method='POST',
1085 renderer='string_html', xhr=True)
1086 def pullrequest_drafts(self):
1059 def pullrequest_drafts(self):
1087 self.load_default_context()
1060 self.load_default_context()
1088
1061
@@ -1123,9 +1096,6 b' class RepoPullRequestsView(RepoAppView, '
1123 @HasRepoPermissionAnyDecorator(
1096 @HasRepoPermissionAnyDecorator(
1124 'repository.read', 'repository.write', 'repository.admin')
1097 'repository.read', 'repository.write', 'repository.admin')
1125 @CSRFRequired()
1098 @CSRFRequired()
1126 @view_config(
1127 route_name='pullrequest_create', request_method='POST',
1128 renderer=None)
1129 def pull_request_create(self):
1099 def pull_request_create(self):
1130 _ = self.request.translate
1100 _ = self.request.translate
1131 self.assure_not_empty_repo()
1101 self.assure_not_empty_repo()
@@ -1281,9 +1251,6 b' class RepoPullRequestsView(RepoAppView, '
1281 @HasRepoPermissionAnyDecorator(
1251 @HasRepoPermissionAnyDecorator(
1282 'repository.read', 'repository.write', 'repository.admin')
1252 'repository.read', 'repository.write', 'repository.admin')
1283 @CSRFRequired()
1253 @CSRFRequired()
1284 @view_config(
1285 route_name='pullrequest_update', request_method='POST',
1286 renderer='json_ext')
1287 def pull_request_update(self):
1254 def pull_request_update(self):
1288 pull_request = PullRequest.get_or_404(
1255 pull_request = PullRequest.get_or_404(
1289 self.request.matchdict['pull_request_id'])
1256 self.request.matchdict['pull_request_id'])
@@ -1465,9 +1432,6 b' class RepoPullRequestsView(RepoAppView, '
1465 @HasRepoPermissionAnyDecorator(
1432 @HasRepoPermissionAnyDecorator(
1466 'repository.read', 'repository.write', 'repository.admin')
1433 'repository.read', 'repository.write', 'repository.admin')
1467 @CSRFRequired()
1434 @CSRFRequired()
1468 @view_config(
1469 route_name='pullrequest_merge', request_method='POST',
1470 renderer='json_ext')
1471 def pull_request_merge(self):
1435 def pull_request_merge(self):
1472 """
1436 """
1473 Merge will perform a server-side merge of the specified
1437 Merge will perform a server-side merge of the specified
@@ -1541,9 +1505,6 b' class RepoPullRequestsView(RepoAppView, '
1541 @HasRepoPermissionAnyDecorator(
1505 @HasRepoPermissionAnyDecorator(
1542 'repository.read', 'repository.write', 'repository.admin')
1506 'repository.read', 'repository.write', 'repository.admin')
1543 @CSRFRequired()
1507 @CSRFRequired()
1544 @view_config(
1545 route_name='pullrequest_delete', request_method='POST',
1546 renderer='json_ext')
1547 def pull_request_delete(self):
1508 def pull_request_delete(self):
1548 _ = self.request.translate
1509 _ = self.request.translate
1549
1510
@@ -1719,9 +1680,6 b' class RepoPullRequestsView(RepoAppView, '
1719 @HasRepoPermissionAnyDecorator(
1680 @HasRepoPermissionAnyDecorator(
1720 'repository.read', 'repository.write', 'repository.admin')
1681 'repository.read', 'repository.write', 'repository.admin')
1721 @CSRFRequired()
1682 @CSRFRequired()
1722 @view_config(
1723 route_name='pullrequest_comment_create', request_method='POST',
1724 renderer='json_ext')
1725 def pull_request_comment_create(self):
1683 def pull_request_comment_create(self):
1726 _ = self.request.translate
1684 _ = self.request.translate
1727
1685
@@ -1756,9 +1714,6 b' class RepoPullRequestsView(RepoAppView, '
1756 @HasRepoPermissionAnyDecorator(
1714 @HasRepoPermissionAnyDecorator(
1757 'repository.read', 'repository.write', 'repository.admin')
1715 'repository.read', 'repository.write', 'repository.admin')
1758 @CSRFRequired()
1716 @CSRFRequired()
1759 @view_config(
1760 route_name='pullrequest_comment_delete', request_method='POST',
1761 renderer='json_ext')
1762 def pull_request_comment_delete(self):
1717 def pull_request_comment_delete(self):
1763 pull_request = PullRequest.get_or_404(
1718 pull_request = PullRequest.get_or_404(
1764 self.request.matchdict['pull_request_id'])
1719 self.request.matchdict['pull_request_id'])
@@ -1810,9 +1765,6 b' class RepoPullRequestsView(RepoAppView, '
1810 @HasRepoPermissionAnyDecorator(
1765 @HasRepoPermissionAnyDecorator(
1811 'repository.read', 'repository.write', 'repository.admin')
1766 'repository.read', 'repository.write', 'repository.admin')
1812 @CSRFRequired()
1767 @CSRFRequired()
1813 @view_config(
1814 route_name='pullrequest_comment_edit', request_method='POST',
1815 renderer='json_ext')
1816 def pull_request_comment_edit(self):
1768 def pull_request_comment_edit(self):
1817 self.load_default_context()
1769 self.load_default_context()
1818
1770
@@ -20,7 +20,7 b''
20
20
21 import logging
21 import logging
22
22
23 from pyramid.view import view_config
23
24
24
25 from rhodecode.apps._base import RepoAppView
25 from rhodecode.apps._base import RepoAppView
26 from rhodecode.apps.repository.utils import get_default_reviewers_data
26 from rhodecode.apps.repository.utils import get_default_reviewers_data
@@ -38,9 +38,6 b' class RepoReviewRulesView(RepoAppView):'
38
38
39 @LoginRequired()
39 @LoginRequired()
40 @HasRepoPermissionAnyDecorator('repository.admin')
40 @HasRepoPermissionAnyDecorator('repository.admin')
41 @view_config(
42 route_name='repo_reviewers', request_method='GET',
43 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
44 def repo_review_rules(self):
41 def repo_review_rules(self):
45 c = self.load_default_context()
42 c = self.load_default_context()
46 c.active = 'reviewers'
43 c.active = 'reviewers'
@@ -50,9 +47,6 b' class RepoReviewRulesView(RepoAppView):'
50 @LoginRequired()
47 @LoginRequired()
51 @HasRepoPermissionAnyDecorator(
48 @HasRepoPermissionAnyDecorator(
52 'repository.read', 'repository.write', 'repository.admin')
49 'repository.read', 'repository.write', 'repository.admin')
53 @view_config(
54 route_name='repo_default_reviewers_data', request_method='GET',
55 renderer='json_ext')
56 def repo_default_reviewers_data(self):
50 def repo_default_reviewers_data(self):
57 self.load_default_context()
51 self.load_default_context()
58
52
@@ -22,7 +22,6 b' import logging'
22
22
23 import deform
23 import deform
24 from pyramid.httpexceptions import HTTPFound
24 from pyramid.httpexceptions import HTTPFound
25 from pyramid.view import view_config
26
25
27 from rhodecode import events
26 from rhodecode import events
28 from rhodecode.apps._base import RepoAppView
27 from rhodecode.apps._base import RepoAppView
@@ -90,9 +89,6 b' class RepoSettingsView(RepoAppView):'
90
89
91 @LoginRequired()
90 @LoginRequired()
92 @HasRepoPermissionAnyDecorator('repository.admin')
91 @HasRepoPermissionAnyDecorator('repository.admin')
93 @view_config(
94 route_name='edit_repo', request_method='GET',
95 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
96 def edit_settings(self):
92 def edit_settings(self):
97 c = self.load_default_context()
93 c = self.load_default_context()
98 c.active = 'settings'
94 c.active = 'settings'
@@ -108,9 +104,6 b' class RepoSettingsView(RepoAppView):'
108 @LoginRequired()
104 @LoginRequired()
109 @HasRepoPermissionAnyDecorator('repository.admin')
105 @HasRepoPermissionAnyDecorator('repository.admin')
110 @CSRFRequired()
106 @CSRFRequired()
111 @view_config(
112 route_name='edit_repo', request_method='POST',
113 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
114 def edit_settings_update(self):
107 def edit_settings_update(self):
115 _ = self.request.translate
108 _ = self.request.translate
116 c = self.load_default_context()
109 c = self.load_default_context()
@@ -192,9 +185,6 b' class RepoSettingsView(RepoAppView):'
192
185
193 @LoginRequired()
186 @LoginRequired()
194 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
187 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
195 @view_config(
196 route_name='repo_edit_toggle_locking', request_method='GET',
197 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
198 def toggle_locking(self):
188 def toggle_locking(self):
199 """
189 """
200 Toggle locking of repository by simple GET call to url
190 Toggle locking of repository by simple GET call to url
@@ -224,9 +214,6 b' class RepoSettingsView(RepoAppView):'
224
214
225 @LoginRequired()
215 @LoginRequired()
226 @HasRepoPermissionAnyDecorator('repository.admin')
216 @HasRepoPermissionAnyDecorator('repository.admin')
227 @view_config(
228 route_name='edit_repo_statistics', request_method='GET',
229 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
230 def edit_statistics_form(self):
217 def edit_statistics_form(self):
231 c = self.load_default_context()
218 c = self.load_default_context()
232
219
@@ -250,9 +237,6 b' class RepoSettingsView(RepoAppView):'
250 @LoginRequired()
237 @LoginRequired()
251 @HasRepoPermissionAnyDecorator('repository.admin')
238 @HasRepoPermissionAnyDecorator('repository.admin')
252 @CSRFRequired()
239 @CSRFRequired()
253 @view_config(
254 route_name='edit_repo_statistics_reset', request_method='POST',
255 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
256 def repo_statistics_reset(self):
240 def repo_statistics_reset(self):
257 _ = self.request.translate
241 _ = self.request.translate
258
242
@@ -20,7 +20,7 b''
20
20
21 import logging
21 import logging
22
22
23 from pyramid.view import view_config
23
24 from pyramid.httpexceptions import HTTPFound
24 from pyramid.httpexceptions import HTTPFound
25 from packaging.version import Version
25 from packaging.version import Version
26
26
@@ -42,7 +42,7 b' from rhodecode.model.scm import ScmModel'
42 log = logging.getLogger(__name__)
42 log = logging.getLogger(__name__)
43
43
44
44
45 class RepoSettingsView(RepoAppView):
45 class RepoSettingsAdvancedView(RepoAppView):
46
46
47 def load_default_context(self):
47 def load_default_context(self):
48 c = self._get_local_tmpl_context()
48 c = self._get_local_tmpl_context()
@@ -57,9 +57,6 b' class RepoSettingsView(RepoAppView):'
57
57
58 @LoginRequired()
58 @LoginRequired()
59 @HasRepoPermissionAnyDecorator('repository.admin')
59 @HasRepoPermissionAnyDecorator('repository.admin')
60 @view_config(
61 route_name='edit_repo_advanced', request_method='GET',
62 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
63 def edit_advanced(self):
60 def edit_advanced(self):
64 _ = self.request.translate
61 _ = self.request.translate
65 c = self.load_default_context()
62 c = self.load_default_context()
@@ -89,9 +86,6 b' class RepoSettingsView(RepoAppView):'
89 @LoginRequired()
86 @LoginRequired()
90 @HasRepoPermissionAnyDecorator('repository.admin')
87 @HasRepoPermissionAnyDecorator('repository.admin')
91 @CSRFRequired()
88 @CSRFRequired()
92 @view_config(
93 route_name='edit_repo_advanced_archive', request_method='POST',
94 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
95 def edit_advanced_archive(self):
89 def edit_advanced_archive(self):
96 """
90 """
97 Archives the repository. It will become read-only, and not visible in search
91 Archives the repository. It will become read-only, and not visible in search
@@ -132,9 +126,6 b' class RepoSettingsView(RepoAppView):'
132 @LoginRequired()
126 @LoginRequired()
133 @HasRepoPermissionAnyDecorator('repository.admin')
127 @HasRepoPermissionAnyDecorator('repository.admin')
134 @CSRFRequired()
128 @CSRFRequired()
135 @view_config(
136 route_name='edit_repo_advanced_delete', request_method='POST',
137 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
138 def edit_advanced_delete(self):
129 def edit_advanced_delete(self):
139 """
130 """
140 Deletes the repository, or shows warnings if deletion is not possible
131 Deletes the repository, or shows warnings if deletion is not possible
@@ -209,9 +200,6 b' class RepoSettingsView(RepoAppView):'
209 @LoginRequired()
200 @LoginRequired()
210 @HasRepoPermissionAnyDecorator('repository.admin')
201 @HasRepoPermissionAnyDecorator('repository.admin')
211 @CSRFRequired()
202 @CSRFRequired()
212 @view_config(
213 route_name='edit_repo_advanced_journal', request_method='POST',
214 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
215 def edit_advanced_journal(self):
203 def edit_advanced_journal(self):
216 """
204 """
217 Set's this repository to be visible in public journal,
205 Set's this repository to be visible in public journal,
@@ -236,9 +224,6 b' class RepoSettingsView(RepoAppView):'
236 @LoginRequired()
224 @LoginRequired()
237 @HasRepoPermissionAnyDecorator('repository.admin')
225 @HasRepoPermissionAnyDecorator('repository.admin')
238 @CSRFRequired()
226 @CSRFRequired()
239 @view_config(
240 route_name='edit_repo_advanced_fork', request_method='POST',
241 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
242 def edit_advanced_fork(self):
227 def edit_advanced_fork(self):
243 """
228 """
244 Mark given repository as a fork of another
229 Mark given repository as a fork of another
@@ -281,10 +266,7 b' class RepoSettingsView(RepoAppView):'
281 @LoginRequired()
266 @LoginRequired()
282 @HasRepoPermissionAnyDecorator('repository.admin')
267 @HasRepoPermissionAnyDecorator('repository.admin')
283 @CSRFRequired()
268 @CSRFRequired()
284 @view_config(
269 def edit_advanced_toggle_locking(self):
285 route_name='edit_repo_advanced_locking', request_method='POST',
286 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
287 def edit_advanced_locking(self):
288 """
270 """
289 Toggle locking of repository
271 Toggle locking of repository
290 """
272 """
@@ -309,9 +291,6 b' class RepoSettingsView(RepoAppView):'
309
291
310 @LoginRequired()
292 @LoginRequired()
311 @HasRepoPermissionAnyDecorator('repository.admin')
293 @HasRepoPermissionAnyDecorator('repository.admin')
312 @view_config(
313 route_name='edit_repo_advanced_hooks', request_method='GET',
314 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
315 def edit_advanced_install_hooks(self):
294 def edit_advanced_install_hooks(self):
316 """
295 """
317 Install Hooks for repository
296 Install Hooks for repository
@@ -24,7 +24,6 b' import formencode'
24 import formencode.htmlfill
24 import formencode.htmlfill
25
25
26 from pyramid.httpexceptions import HTTPFound
26 from pyramid.httpexceptions import HTTPFound
27 from pyramid.view import view_config
28
27
29 from rhodecode.apps._base import RepoAppView
28 from rhodecode.apps._base import RepoAppView
30 from rhodecode.lib import audit_logger
29 from rhodecode.lib import audit_logger
@@ -48,9 +47,6 b' class RepoSettingsFieldsView(RepoAppView'
48
47
49 @LoginRequired()
48 @LoginRequired()
50 @HasRepoPermissionAnyDecorator('repository.admin')
49 @HasRepoPermissionAnyDecorator('repository.admin')
51 @view_config(
52 route_name='edit_repo_fields', request_method='GET',
53 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
54 def repo_field_edit(self):
50 def repo_field_edit(self):
55 c = self.load_default_context()
51 c = self.load_default_context()
56
52
@@ -63,9 +59,6 b' class RepoSettingsFieldsView(RepoAppView'
63 @LoginRequired()
59 @LoginRequired()
64 @HasRepoPermissionAnyDecorator('repository.admin')
60 @HasRepoPermissionAnyDecorator('repository.admin')
65 @CSRFRequired()
61 @CSRFRequired()
66 @view_config(
67 route_name='edit_repo_fields_create', request_method='POST',
68 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
69 def repo_field_create(self):
62 def repo_field_create(self):
70 _ = self.request.translate
63 _ = self.request.translate
71
64
@@ -94,9 +87,6 b' class RepoSettingsFieldsView(RepoAppView'
94 @LoginRequired()
87 @LoginRequired()
95 @HasRepoPermissionAnyDecorator('repository.admin')
88 @HasRepoPermissionAnyDecorator('repository.admin')
96 @CSRFRequired()
89 @CSRFRequired()
97 @view_config(
98 route_name='edit_repo_fields_delete', request_method='POST',
99 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
100 def repo_field_delete(self):
90 def repo_field_delete(self):
101 _ = self.request.translate
91 _ = self.request.translate
102 field = RepositoryField.get_or_404(self.request.matchdict['field_id'])
92 field = RepositoryField.get_or_404(self.request.matchdict['field_id'])
@@ -21,7 +21,7 b''
21 import logging
21 import logging
22
22
23 from pyramid.httpexceptions import HTTPFound, HTTPNotFound
23 from pyramid.httpexceptions import HTTPFound, HTTPNotFound
24 from pyramid.view import view_config
24
25 import formencode
25 import formencode
26
26
27 from rhodecode.apps._base import RepoAppView
27 from rhodecode.apps._base import RepoAppView
@@ -45,9 +45,6 b' class RepoSettingsIssueTrackersView(Repo'
45
45
46 @LoginRequired()
46 @LoginRequired()
47 @HasRepoPermissionAnyDecorator('repository.admin')
47 @HasRepoPermissionAnyDecorator('repository.admin')
48 @view_config(
49 route_name='edit_repo_issuetracker', request_method='GET',
50 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
51 def repo_issuetracker(self):
48 def repo_issuetracker(self):
52 c = self.load_default_context()
49 c = self.load_default_context()
53 c.active = 'issuetracker'
50 c.active = 'issuetracker'
@@ -62,9 +59,6 b' class RepoSettingsIssueTrackersView(Repo'
62 @LoginRequired()
59 @LoginRequired()
63 @HasRepoPermissionAnyDecorator('repository.admin')
60 @HasRepoPermissionAnyDecorator('repository.admin')
64 @CSRFRequired()
61 @CSRFRequired()
65 @view_config(
66 route_name='edit_repo_issuetracker_test', request_method='POST',
67 renderer='string', xhr=True)
68 def repo_issuetracker_test(self):
62 def repo_issuetracker_test(self):
69 return h.urlify_commit_message(
63 return h.urlify_commit_message(
70 self.request.POST.get('test_text', ''),
64 self.request.POST.get('test_text', ''),
@@ -73,9 +67,6 b' class RepoSettingsIssueTrackersView(Repo'
73 @LoginRequired()
67 @LoginRequired()
74 @HasRepoPermissionAnyDecorator('repository.admin')
68 @HasRepoPermissionAnyDecorator('repository.admin')
75 @CSRFRequired()
69 @CSRFRequired()
76 @view_config(
77 route_name='edit_repo_issuetracker_delete', request_method='POST',
78 renderer='json_ext', xhr=True)
79 def repo_issuetracker_delete(self):
70 def repo_issuetracker_delete(self):
80 _ = self.request.translate
71 _ = self.request.translate
81 uid = self.request.POST.get('uid')
72 uid = self.request.POST.get('uid')
@@ -107,9 +98,6 b' class RepoSettingsIssueTrackersView(Repo'
107 @LoginRequired()
98 @LoginRequired()
108 @HasRepoPermissionAnyDecorator('repository.admin')
99 @HasRepoPermissionAnyDecorator('repository.admin')
109 @CSRFRequired()
100 @CSRFRequired()
110 @view_config(
111 route_name='edit_repo_issuetracker_update', request_method='POST',
112 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
113 def repo_issuetracker_update(self):
101 def repo_issuetracker_update(self):
114 _ = self.request.translate
102 _ = self.request.translate
115 # Save inheritance
103 # Save inheritance
@@ -21,7 +21,7 b''
21 import logging
21 import logging
22
22
23 from pyramid.httpexceptions import HTTPFound
23 from pyramid.httpexceptions import HTTPFound
24 from pyramid.view import view_config
24
25
25
26 from rhodecode.apps._base import RepoAppView
26 from rhodecode.apps._base import RepoAppView
27 from rhodecode.lib import helpers as h
27 from rhodecode.lib import helpers as h
@@ -39,9 +39,6 b' class RepoSettingsRemoteView(RepoAppView'
39
39
40 @LoginRequired()
40 @LoginRequired()
41 @HasRepoPermissionAnyDecorator('repository.admin')
41 @HasRepoPermissionAnyDecorator('repository.admin')
42 @view_config(
43 route_name='edit_repo_remote', request_method='GET',
44 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
45 def repo_remote_edit_form(self):
42 def repo_remote_edit_form(self):
46 c = self.load_default_context()
43 c = self.load_default_context()
47 c.active = 'remote'
44 c.active = 'remote'
@@ -51,9 +48,6 b' class RepoSettingsRemoteView(RepoAppView'
51 @LoginRequired()
48 @LoginRequired()
52 @HasRepoPermissionAnyDecorator('repository.admin')
49 @HasRepoPermissionAnyDecorator('repository.admin')
53 @CSRFRequired()
50 @CSRFRequired()
54 @view_config(
55 route_name='edit_repo_remote_pull', request_method='POST',
56 renderer=None)
57 def repo_remote_pull_changes(self):
51 def repo_remote_pull_changes(self):
58 _ = self.request.translate
52 _ = self.request.translate
59 self.load_default_context()
53 self.load_default_context()
@@ -25,10 +25,8 b' import formencode.htmlfill'
25 from pyramid.httpexceptions import HTTPFound, HTTPBadRequest
25 from pyramid.httpexceptions import HTTPFound, HTTPBadRequest
26 from pyramid.response import Response
26 from pyramid.response import Response
27 from pyramid.renderers import render
27 from pyramid.renderers import render
28 from pyramid.view import view_config
29
28
30 from rhodecode.apps._base import RepoAppView
29 from rhodecode.apps._base import RepoAppView
31 from rhodecode.lib import audit_logger
32 from rhodecode.lib import helpers as h
30 from rhodecode.lib import helpers as h
33 from rhodecode.lib.auth import (
31 from rhodecode.lib.auth import (
34 LoginRequired, HasRepoPermissionAnyDecorator, CSRFRequired)
32 LoginRequired, HasRepoPermissionAnyDecorator, CSRFRequired)
@@ -71,9 +69,6 b' class RepoSettingsVcsView(RepoAppView):'
71
69
72 @LoginRequired()
70 @LoginRequired()
73 @HasRepoPermissionAnyDecorator('repository.admin')
71 @HasRepoPermissionAnyDecorator('repository.admin')
74 @view_config(
75 route_name='edit_repo_vcs', request_method='GET',
76 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
77 def repo_vcs_settings(self):
72 def repo_vcs_settings(self):
78 c = self.load_default_context()
73 c = self.load_default_context()
79 model = VcsSettingsModel(repo=self.db_repo_name)
74 model = VcsSettingsModel(repo=self.db_repo_name)
@@ -100,9 +95,6 b' class RepoSettingsVcsView(RepoAppView):'
100 @LoginRequired()
95 @LoginRequired()
101 @HasRepoPermissionAnyDecorator('repository.admin')
96 @HasRepoPermissionAnyDecorator('repository.admin')
102 @CSRFRequired()
97 @CSRFRequired()
103 @view_config(
104 route_name='edit_repo_vcs_update', request_method='POST',
105 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
106 def repo_settings_vcs_update(self):
98 def repo_settings_vcs_update(self):
107 _ = self.request.translate
99 _ = self.request.translate
108 c = self.load_default_context()
100 c = self.load_default_context()
@@ -153,9 +145,6 b' class RepoSettingsVcsView(RepoAppView):'
153 @LoginRequired()
145 @LoginRequired()
154 @HasRepoPermissionAnyDecorator('repository.admin')
146 @HasRepoPermissionAnyDecorator('repository.admin')
155 @CSRFRequired()
147 @CSRFRequired()
156 @view_config(
157 route_name='edit_repo_vcs_svn_pattern_delete', request_method='POST',
158 renderer='json_ext', xhr=True)
159 def repo_settings_delete_svn_pattern(self):
148 def repo_settings_delete_svn_pattern(self):
160 self.load_default_context()
149 self.load_default_context()
161 delete_pattern_id = self.request.POST.get('delete_svn_pattern')
150 delete_pattern_id = self.request.POST.get('delete_svn_pattern')
@@ -19,7 +19,7 b''
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 import logging
21 import logging
22 from pyramid.view import view_config
22
23
23
24 from rhodecode.apps._base import RepoAppView
24 from rhodecode.apps._base import RepoAppView
25 from rhodecode.lib import audit_logger
25 from rhodecode.lib import audit_logger
@@ -31,7 +31,7 b' from rhodecode.lib.ext_json import json'
31 log = logging.getLogger(__name__)
31 log = logging.getLogger(__name__)
32
32
33
33
34 class StripView(RepoAppView):
34 class RepoStripView(RepoAppView):
35 def load_default_context(self):
35 def load_default_context(self):
36 c = self._get_local_tmpl_context()
36 c = self._get_local_tmpl_context()
37
37
@@ -40,9 +40,6 b' class StripView(RepoAppView):'
40
40
41 @LoginRequired()
41 @LoginRequired()
42 @HasRepoPermissionAnyDecorator('repository.admin')
42 @HasRepoPermissionAnyDecorator('repository.admin')
43 @view_config(
44 route_name='edit_repo_strip', request_method='GET',
45 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
46 def strip(self):
43 def strip(self):
47 c = self.load_default_context()
44 c = self.load_default_context()
48 c.active = 'strip'
45 c.active = 'strip'
@@ -53,9 +50,6 b' class StripView(RepoAppView):'
53 @LoginRequired()
50 @LoginRequired()
54 @HasRepoPermissionAnyDecorator('repository.admin')
51 @HasRepoPermissionAnyDecorator('repository.admin')
55 @CSRFRequired()
52 @CSRFRequired()
56 @view_config(
57 route_name='strip_check', request_method='POST',
58 renderer='json', xhr=True)
59 def strip_check(self):
53 def strip_check(self):
60 from rhodecode.lib.vcs.backends.base import EmptyCommit
54 from rhodecode.lib.vcs.backends.base import EmptyCommit
61 data = {}
55 data = {}
@@ -79,9 +73,6 b' class StripView(RepoAppView):'
79 @LoginRequired()
73 @LoginRequired()
80 @HasRepoPermissionAnyDecorator('repository.admin')
74 @HasRepoPermissionAnyDecorator('repository.admin')
81 @CSRFRequired()
75 @CSRFRequired()
82 @view_config(
83 route_name='strip_execute', request_method='POST',
84 renderer='json', xhr=True)
85 def strip_execute(self):
76 def strip_execute(self):
86 from rhodecode.model.scm import ScmModel
77 from rhodecode.model.scm import ScmModel
87
78
@@ -24,7 +24,7 b' import time'
24
24
25 import rhodecode
25 import rhodecode
26
26
27 from pyramid.view import view_config
27
28
28
29 from rhodecode.lib.view_utils import get_format_ref_id
29 from rhodecode.lib.view_utils import get_format_ref_id
30 from rhodecode.apps._base import RepoAppView
30 from rhodecode.apps._base import RepoAppView
@@ -101,9 +101,6 b' class RepoSummaryView(RepoAppView):'
101 @LoginRequired()
101 @LoginRequired()
102 @HasRepoPermissionAnyDecorator(
102 @HasRepoPermissionAnyDecorator(
103 'repository.read', 'repository.write', 'repository.admin')
103 'repository.read', 'repository.write', 'repository.admin')
104 @view_config(
105 route_name='repo_summary_commits', request_method='GET',
106 renderer='rhodecode:templates/summary/summary_commits.mako')
107 def summary_commits(self):
104 def summary_commits(self):
108 c = self.load_default_context()
105 c = self.load_default_context()
109 self._prepare_and_set_clone_url(c)
106 self._prepare_and_set_clone_url(c)
@@ -113,15 +110,6 b' class RepoSummaryView(RepoAppView):'
113 @LoginRequired()
110 @LoginRequired()
114 @HasRepoPermissionAnyDecorator(
111 @HasRepoPermissionAnyDecorator(
115 'repository.read', 'repository.write', 'repository.admin')
112 'repository.read', 'repository.write', 'repository.admin')
116 @view_config(
117 route_name='repo_summary', request_method='GET',
118 renderer='rhodecode:templates/summary/summary.mako')
119 @view_config(
120 route_name='repo_summary_slash', request_method='GET',
121 renderer='rhodecode:templates/summary/summary.mako')
122 @view_config(
123 route_name='repo_summary_explicit', request_method='GET',
124 renderer='rhodecode:templates/summary/summary.mako')
125 def summary(self):
113 def summary(self):
126 c = self.load_default_context()
114 c = self.load_default_context()
127
115
@@ -176,9 +164,6 b' class RepoSummaryView(RepoAppView):'
176 @LoginRequired()
164 @LoginRequired()
177 @HasRepoPermissionAnyDecorator(
165 @HasRepoPermissionAnyDecorator(
178 'repository.read', 'repository.write', 'repository.admin')
166 'repository.read', 'repository.write', 'repository.admin')
179 @view_config(
180 route_name='repo_stats', request_method='GET',
181 renderer='json_ext')
182 def repo_stats(self):
167 def repo_stats(self):
183 show_stats = bool(self.db_repo.enable_statistics)
168 show_stats = bool(self.db_repo.enable_statistics)
184 repo_id = self.db_repo.repo_id
169 repo_id = self.db_repo.repo_id
@@ -228,9 +213,6 b' class RepoSummaryView(RepoAppView):'
228 @LoginRequired()
213 @LoginRequired()
229 @HasRepoPermissionAnyDecorator(
214 @HasRepoPermissionAnyDecorator(
230 'repository.read', 'repository.write', 'repository.admin')
215 'repository.read', 'repository.write', 'repository.admin')
231 @view_config(
232 route_name='repo_refs_data', request_method='GET',
233 renderer='json_ext')
234 def repo_refs_data(self):
216 def repo_refs_data(self):
235 _ = self.request.translate
217 _ = self.request.translate
236 self.load_default_context()
218 self.load_default_context()
@@ -251,9 +233,6 b' class RepoSummaryView(RepoAppView):'
251 @LoginRequired()
233 @LoginRequired()
252 @HasRepoPermissionAnyDecorator(
234 @HasRepoPermissionAnyDecorator(
253 'repository.read', 'repository.write', 'repository.admin')
235 'repository.read', 'repository.write', 'repository.admin')
254 @view_config(
255 route_name='repo_refs_changelog_data', request_method='GET',
256 renderer='json_ext')
257 def repo_refs_changelog_data(self):
236 def repo_refs_changelog_data(self):
258 _ = self.request.translate
237 _ = self.request.translate
259 self.load_default_context()
238 self.load_default_context()
@@ -19,7 +19,6 b''
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 import logging
21 import logging
22 from pyramid.view import view_config
23
22
24 from rhodecode.apps._base import BaseReferencesView
23 from rhodecode.apps._base import BaseReferencesView
25 from rhodecode.lib.ext_json import json
24 from rhodecode.lib.ext_json import json
@@ -33,9 +32,6 b' class RepoTagsView(BaseReferencesView):'
33 @LoginRequired()
32 @LoginRequired()
34 @HasRepoPermissionAnyDecorator(
33 @HasRepoPermissionAnyDecorator(
35 'repository.read', 'repository.write', 'repository.admin')
34 'repository.read', 'repository.write', 'repository.admin')
36 @view_config(
37 route_name='tags_home', request_method='GET',
38 renderer='rhodecode:templates/tags/tags.mako')
39 def tags(self):
35 def tags(self):
40 c = self.load_default_context()
36 c = self.load_default_context()
41
37
@@ -21,23 +21,42 b' from rhodecode.apps._base import ADMIN_P'
21
21
22
22
23 def includeme(config):
23 def includeme(config):
24 from rhodecode.apps.search.views import (
25 SearchView, SearchRepoView, SearchRepoGroupView)
24
26
25 config.add_route(
27 config.add_route(
26 name='search',
28 name='search',
27 pattern=ADMIN_PREFIX + '/search')
29 pattern=ADMIN_PREFIX + '/search')
30 config.add_view(
31 SearchView,
32 attr='search',
33 route_name='search', request_method='GET',
34 renderer='rhodecode:templates/search/search.mako')
28
35
29 config.add_route(
36 config.add_route(
30 name='search_repo',
37 name='search_repo',
31 pattern='/{repo_name:.*?[^/]}/_search', repo_route=True)
38 pattern='/{repo_name:.*?[^/]}/_search', repo_route=True)
39 config.add_view(
40 SearchRepoView,
41 attr='search_repo',
42 route_name='search_repo', request_method='GET',
43 renderer='rhodecode:templates/search/search.mako')
32
44
33 config.add_route(
45 config.add_route(
34 name='search_repo_alt',
46 name='search_repo_alt',
35 pattern='/{repo_name:.*?[^/]}/search', repo_route=True)
47 pattern='/{repo_name:.*?[^/]}/search', repo_route=True)
48 config.add_view(
49 SearchRepoView,
50 attr='search_repo',
51 route_name='search_repo_alt', request_method='GET',
52 renderer='rhodecode:templates/search/search.mako')
36
53
37 config.add_route(
54 config.add_route(
38 name='search_repo_group',
55 name='search_repo_group',
39 pattern='/{repo_group_name:.*?[^/]}/_search',
56 pattern='/{repo_group_name:.*?[^/]}/_search',
40 repo_group_route=True)
57 repo_group_route=True)
41
58 config.add_view(
42 # Scan module for configuration decorators.
59 SearchRepoGroupView,
43 config.scan('.views', ignore='.tests')
60 attr='search_repo_group',
61 route_name='search_repo_group', request_method='GET',
62 renderer='rhodecode:templates/search/search.mako')
@@ -20,7 +20,7 b''
20
20
21 import logging
21 import logging
22 import urllib
22 import urllib
23 from pyramid.view import view_config
23
24 from webhelpers2.html.tools import update_params
24 from webhelpers2.html.tools import update_params
25
25
26 from rhodecode.apps._base import BaseAppView, RepoAppView, RepoGroupAppView
26 from rhodecode.apps._base import BaseAppView, RepoAppView, RepoGroupAppView
@@ -130,9 +130,6 b' class SearchView(BaseAppView):'
130 return c
130 return c
131
131
132 @LoginRequired()
132 @LoginRequired()
133 @view_config(
134 route_name='search', request_method='GET',
135 renderer='rhodecode:templates/search/search.mako')
136 def search(self):
133 def search(self):
137 c = self.load_default_context()
134 c = self.load_default_context()
138 perform_search(self.request, c)
135 perform_search(self.request, c)
@@ -148,12 +145,6 b' class SearchRepoView(RepoAppView):'
148 @LoginRequired()
145 @LoginRequired()
149 @HasRepoPermissionAnyDecorator(
146 @HasRepoPermissionAnyDecorator(
150 'repository.read', 'repository.write', 'repository.admin')
147 'repository.read', 'repository.write', 'repository.admin')
151 @view_config(
152 route_name='search_repo', request_method='GET',
153 renderer='rhodecode:templates/search/search.mako')
154 @view_config(
155 route_name='search_repo_alt', request_method='GET',
156 renderer='rhodecode:templates/search/search.mako')
157 def search_repo(self):
148 def search_repo(self):
158 c = self.load_default_context()
149 c = self.load_default_context()
159 perform_search(self.request, c, repo_name=self.db_repo_name)
150 perform_search(self.request, c, repo_name=self.db_repo_name)
@@ -169,9 +160,6 b' class SearchRepoGroupView(RepoGroupAppVi'
169 @LoginRequired()
160 @LoginRequired()
170 @HasRepoGroupPermissionAnyDecorator(
161 @HasRepoGroupPermissionAnyDecorator(
171 'group.read', 'group.write', 'group.admin')
162 'group.read', 'group.write', 'group.admin')
172 @view_config(
173 route_name='search_repo_group', request_method='GET',
174 renderer='rhodecode:templates/search/search.mako')
175 def search_repo_group(self):
163 def search_repo_group(self):
176 c = self.load_default_context()
164 c = self.load_default_context()
177 perform_search(self.request, c, repo_group_name=self.db_repo_group_name)
165 perform_search(self.request, c, repo_group_name=self.db_repo_group_name)
@@ -37,25 +37,6 b' from . import config_keys'
37 log = logging.getLogger(__name__)
37 log = logging.getLogger(__name__)
38
38
39
39
40 def includeme(config):
41 settings = config.registry.settings
42 _sanitize_settings_and_apply_defaults(settings)
43
44 if settings[config_keys.generate_config]:
45 # Add subscriber to generate the Apache mod dav svn configuration on
46 # repository group events.
47 config.add_subscriber(generate_config_subscriber, RepoGroupEvent)
48
49 # If a reload command is set add a subscriber to execute it on
50 # configuration changes.
51 reload_cmd = settings[config_keys.reload_command]
52 if reload_cmd:
53 reload_timeout = settings[config_keys.reload_timeout] or None
54 reload_subscriber = AsyncSubprocessSubscriber(
55 cmd=reload_cmd, timeout=reload_timeout)
56 config.add_subscriber(reload_subscriber, ModDavSvnConfigChange)
57
58
59 def _sanitize_settings_and_apply_defaults(settings):
40 def _sanitize_settings_and_apply_defaults(settings):
60 """
41 """
61 Set defaults, convert to python types and validate settings.
42 Set defaults, convert to python types and validate settings.
@@ -88,3 +69,22 b' def _append_path_sep(path):'
88 if isinstance(path, compat.string_types) and not path.endswith(os.path.sep):
69 if isinstance(path, compat.string_types) and not path.endswith(os.path.sep):
89 path += os.path.sep
70 path += os.path.sep
90 return path
71 return path
72
73
74 def includeme(config):
75 settings = config.registry.settings
76 _sanitize_settings_and_apply_defaults(settings)
77
78 if settings[config_keys.generate_config]:
79 # Add subscriber to generate the Apache mod dav svn configuration on
80 # repository group events.
81 config.add_subscriber(generate_config_subscriber, RepoGroupEvent)
82
83 # If a reload command is set add a subscriber to execute it on
84 # configuration changes.
85 reload_cmd = settings[config_keys.reload_command]
86 if reload_cmd:
87 reload_timeout = settings[config_keys.reload_timeout] or None
88 reload_subscriber = AsyncSubprocessSubscriber(
89 cmd=reload_cmd, timeout=reload_timeout)
90 config.add_subscriber(reload_subscriber, ModDavSvnConfigChange)
@@ -28,74 +28,134 b' def admin_routes(config):'
28 """
28 """
29 User groups /_admin prefixed routes
29 User groups /_admin prefixed routes
30 """
30 """
31 from rhodecode.apps.user_group.views import UserGroupsView
31
32
32 config.add_route(
33 config.add_route(
33 name='user_group_members_data',
34 name='user_group_members_data',
34 pattern='/user_groups/{user_group_id:\d+}/members',
35 pattern='/user_groups/{user_group_id:\d+}/members',
35 user_group_route=True)
36 user_group_route=True)
37 config.add_view(
38 UserGroupsView,
39 attr='user_group_members',
40 route_name='user_group_members_data', request_method='GET',
41 renderer='json_ext', xhr=True)
36
42
37 # user groups perms
43 # user groups perms
38 config.add_route(
44 config.add_route(
39 name='edit_user_group_perms_summary',
45 name='edit_user_group_perms_summary',
40 pattern='/user_groups/{user_group_id:\d+}/edit/permissions_summary',
46 pattern='/user_groups/{user_group_id:\d+}/edit/permissions_summary',
41 user_group_route=True)
47 user_group_route=True)
48 config.add_view(
49 UserGroupsView,
50 attr='user_group_perms_summary',
51 route_name='edit_user_group_perms_summary', request_method='GET',
52 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
53
42 config.add_route(
54 config.add_route(
43 name='edit_user_group_perms_summary_json',
55 name='edit_user_group_perms_summary_json',
44 pattern='/user_groups/{user_group_id:\d+}/edit/permissions_summary/json',
56 pattern='/user_groups/{user_group_id:\d+}/edit/permissions_summary/json',
45 user_group_route=True)
57 user_group_route=True)
58 config.add_view(
59 UserGroupsView,
60 attr='user_group_perms_summary_json',
61 route_name='edit_user_group_perms_summary_json', request_method='GET',
62 renderer='json_ext')
46
63
47 # user groups edit
64 # user groups edit
48 config.add_route(
65 config.add_route(
49 name='edit_user_group',
66 name='edit_user_group',
50 pattern='/user_groups/{user_group_id:\d+}/edit',
67 pattern='/user_groups/{user_group_id:\d+}/edit',
51 user_group_route=True)
68 user_group_route=True)
69 config.add_view(
70 UserGroupsView,
71 attr='user_group_edit',
72 route_name='edit_user_group', request_method='GET',
73 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
52
74
53 # user groups update
75 # user groups update
54 config.add_route(
76 config.add_route(
55 name='user_groups_update',
77 name='user_groups_update',
56 pattern='/user_groups/{user_group_id:\d+}/update',
78 pattern='/user_groups/{user_group_id:\d+}/update',
57 user_group_route=True)
79 user_group_route=True)
80 config.add_view(
81 UserGroupsView,
82 attr='user_group_update',
83 route_name='user_groups_update', request_method='POST',
84 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
58
85
59 config.add_route(
86 config.add_route(
60 name='edit_user_group_global_perms',
87 name='edit_user_group_global_perms',
61 pattern='/user_groups/{user_group_id:\d+}/edit/global_permissions',
88 pattern='/user_groups/{user_group_id:\d+}/edit/global_permissions',
62 user_group_route=True)
89 user_group_route=True)
90 config.add_view(
91 UserGroupsView,
92 attr='user_group_global_perms_edit',
93 route_name='edit_user_group_global_perms', request_method='GET',
94 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
63
95
64 config.add_route(
96 config.add_route(
65 name='edit_user_group_global_perms_update',
97 name='edit_user_group_global_perms_update',
66 pattern='/user_groups/{user_group_id:\d+}/edit/global_permissions/update',
98 pattern='/user_groups/{user_group_id:\d+}/edit/global_permissions/update',
67 user_group_route=True)
99 user_group_route=True)
100 config.add_view(
101 UserGroupsView,
102 attr='user_group_global_perms_update',
103 route_name='edit_user_group_global_perms_update', request_method='POST',
104 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
68
105
69 config.add_route(
106 config.add_route(
70 name='edit_user_group_perms',
107 name='edit_user_group_perms',
71 pattern='/user_groups/{user_group_id:\d+}/edit/permissions',
108 pattern='/user_groups/{user_group_id:\d+}/edit/permissions',
72 user_group_route=True)
109 user_group_route=True)
110 config.add_view(
111 UserGroupsView,
112 attr='user_group_edit_perms',
113 route_name='edit_user_group_perms', request_method='GET',
114 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
73
115
74 config.add_route(
116 config.add_route(
75 name='edit_user_group_perms_update',
117 name='edit_user_group_perms_update',
76 pattern='/user_groups/{user_group_id:\d+}/edit/permissions/update',
118 pattern='/user_groups/{user_group_id:\d+}/edit/permissions/update',
77 user_group_route=True)
119 user_group_route=True)
120 config.add_view(
121 UserGroupsView,
122 attr='user_group_update_perms',
123 route_name='edit_user_group_perms_update', request_method='POST',
124 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
78
125
79 config.add_route(
126 config.add_route(
80 name='edit_user_group_advanced',
127 name='edit_user_group_advanced',
81 pattern='/user_groups/{user_group_id:\d+}/edit/advanced',
128 pattern='/user_groups/{user_group_id:\d+}/edit/advanced',
82 user_group_route=True)
129 user_group_route=True)
130 config.add_view(
131 UserGroupsView,
132 attr='user_group_edit_advanced',
133 route_name='edit_user_group_advanced', request_method='GET',
134 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
83
135
84 config.add_route(
136 config.add_route(
85 name='edit_user_group_advanced_sync',
137 name='edit_user_group_advanced_sync',
86 pattern='/user_groups/{user_group_id:\d+}/edit/advanced/sync',
138 pattern='/user_groups/{user_group_id:\d+}/edit/advanced/sync',
87 user_group_route=True)
139 user_group_route=True)
140 config.add_view(
141 UserGroupsView,
142 attr='user_group_edit_advanced_set_synchronization',
143 route_name='edit_user_group_advanced_sync', request_method='POST',
144 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
88
145
89 # user groups delete
146 # user groups delete
90 config.add_route(
147 config.add_route(
91 name='user_groups_delete',
148 name='user_groups_delete',
92 pattern='/user_groups/{user_group_id:\d+}/delete',
149 pattern='/user_groups/{user_group_id:\d+}/delete',
93 user_group_route=True)
150 user_group_route=True)
151 config.add_view(
152 UserGroupsView,
153 attr='user_group_delete',
154 route_name='user_groups_delete', request_method='POST',
155 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
94
156
95
157
96 def includeme(config):
158 def includeme(config):
97 # main admin routes
159 # main admin routes
98 config.include(admin_routes, route_prefix=ADMIN_PREFIX)
160 config.include(admin_routes, route_prefix=ADMIN_PREFIX)
99
161
100 # Scan module for configuration decorators.
101 config.scan('.views', ignore='.tests')
@@ -24,7 +24,7 b' import peppercorn'
24 import formencode
24 import formencode
25 import formencode.htmlfill
25 import formencode.htmlfill
26 from pyramid.httpexceptions import HTTPFound
26 from pyramid.httpexceptions import HTTPFound
27 from pyramid.view import view_config
27
28 from pyramid.response import Response
28 from pyramid.response import Response
29 from pyramid.renderers import render
29 from pyramid.renderers import render
30
30
@@ -60,9 +60,6 b' class UserGroupsView(UserGroupAppView):'
60
60
61 @LoginRequired()
61 @LoginRequired()
62 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
62 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
63 @view_config(
64 route_name='user_group_members_data', request_method='GET',
65 renderer='json_ext', xhr=True)
66 def user_group_members(self):
63 def user_group_members(self):
67 """
64 """
68 Return members of given user group
65 Return members of given user group
@@ -93,9 +90,6 b' class UserGroupsView(UserGroupAppView):'
93
90
94 @LoginRequired()
91 @LoginRequired()
95 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
92 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
96 @view_config(
97 route_name='edit_user_group_perms_summary', request_method='GET',
98 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
99 def user_group_perms_summary(self):
93 def user_group_perms_summary(self):
100 c = self.load_default_context()
94 c = self.load_default_context()
101 c.user_group = self.db_user_group
95 c.user_group = self.db_user_group
@@ -106,9 +100,6 b' class UserGroupsView(UserGroupAppView):'
106
100
107 @LoginRequired()
101 @LoginRequired()
108 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
102 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
109 @view_config(
110 route_name='edit_user_group_perms_summary_json', request_method='GET',
111 renderer='json_ext')
112 def user_group_perms_summary_json(self):
103 def user_group_perms_summary_json(self):
113 self.load_default_context()
104 self.load_default_context()
114 user_group = self.db_user_group
105 user_group = self.db_user_group
@@ -131,9 +122,6 b' class UserGroupsView(UserGroupAppView):'
131 @LoginRequired()
122 @LoginRequired()
132 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
123 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
133 @CSRFRequired()
124 @CSRFRequired()
134 @view_config(
135 route_name='user_groups_update', request_method='POST',
136 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
137 def user_group_update(self):
125 def user_group_update(self):
138 _ = self.request.translate
126 _ = self.request.translate
139
127
@@ -230,9 +218,6 b' class UserGroupsView(UserGroupAppView):'
230 @LoginRequired()
218 @LoginRequired()
231 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
219 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
232 @CSRFRequired()
220 @CSRFRequired()
233 @view_config(
234 route_name='user_groups_delete', request_method='POST',
235 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
236 def user_group_delete(self):
221 def user_group_delete(self):
237 _ = self.request.translate
222 _ = self.request.translate
238 user_group = self.db_user_group
223 user_group = self.db_user_group
@@ -258,9 +243,6 b' class UserGroupsView(UserGroupAppView):'
258
243
259 @LoginRequired()
244 @LoginRequired()
260 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
245 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
261 @view_config(
262 route_name='edit_user_group', request_method='GET',
263 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
264 def user_group_edit(self):
246 def user_group_edit(self):
265 user_group = self.db_user_group
247 user_group = self.db_user_group
266
248
@@ -293,9 +275,6 b' class UserGroupsView(UserGroupAppView):'
293
275
294 @LoginRequired()
276 @LoginRequired()
295 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
277 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
296 @view_config(
297 route_name='edit_user_group_perms', request_method='GET',
298 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
299 def user_group_edit_perms(self):
278 def user_group_edit_perms(self):
300 user_group = self.db_user_group
279 user_group = self.db_user_group
301 c = self.load_default_context()
280 c = self.load_default_context()
@@ -326,9 +305,6 b' class UserGroupsView(UserGroupAppView):'
326 @LoginRequired()
305 @LoginRequired()
327 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
306 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
328 @CSRFRequired()
307 @CSRFRequired()
329 @view_config(
330 route_name='edit_user_group_perms_update', request_method='POST',
331 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
332 def user_group_update_perms(self):
308 def user_group_update_perms(self):
333 """
309 """
334 grant permission for given user group
310 grant permission for given user group
@@ -390,9 +366,6 b' class UserGroupsView(UserGroupAppView):'
390
366
391 @LoginRequired()
367 @LoginRequired()
392 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
368 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
393 @view_config(
394 route_name='edit_user_group_global_perms', request_method='GET',
395 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
396 def user_group_global_perms_edit(self):
369 def user_group_global_perms_edit(self):
397 user_group = self.db_user_group
370 user_group = self.db_user_group
398 c = self.load_default_context()
371 c = self.load_default_context()
@@ -418,9 +391,6 b' class UserGroupsView(UserGroupAppView):'
418 @LoginRequired()
391 @LoginRequired()
419 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
392 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
420 @CSRFRequired()
393 @CSRFRequired()
421 @view_config(
422 route_name='edit_user_group_global_perms_update', request_method='POST',
423 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
424 def user_group_global_perms_update(self):
394 def user_group_global_perms_update(self):
425 _ = self.request.translate
395 _ = self.request.translate
426 user_group = self.db_user_group
396 user_group = self.db_user_group
@@ -485,9 +455,6 b' class UserGroupsView(UserGroupAppView):'
485
455
486 @LoginRequired()
456 @LoginRequired()
487 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
457 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
488 @view_config(
489 route_name='edit_user_group_advanced', request_method='GET',
490 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
491 def user_group_edit_advanced(self):
458 def user_group_edit_advanced(self):
492 user_group = self.db_user_group
459 user_group = self.db_user_group
493
460
@@ -515,9 +482,6 b' class UserGroupsView(UserGroupAppView):'
515 @LoginRequired()
482 @LoginRequired()
516 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
483 @HasUserGroupPermissionAnyDecorator('usergroup.admin')
517 @CSRFRequired()
484 @CSRFRequired()
518 @view_config(
519 route_name='edit_user_group_advanced_sync', request_method='POST',
520 renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako')
521 def user_group_edit_advanced_set_synchronization(self):
485 def user_group_edit_advanced_set_synchronization(self):
522 _ = self.request.translate
486 _ = self.request.translate
523 user_group = self.db_user_group
487 user_group = self.db_user_group
@@ -20,8 +20,13 b''
20
20
21
21
22 def includeme(config):
22 def includeme(config):
23 from rhodecode.apps.user_group_profile.views import UserGroupProfileView
24
23 config.add_route(
25 config.add_route(
24 name='user_group_profile',
26 name='user_group_profile',
25 pattern='/_profile_user_group/{user_group_name}')
27 pattern='/_profile_user_group/{user_group_name}')
26 # Scan module for configuration decorators.
28 config.add_view(
27 config.scan('.views', ignore='.tests')
29 UserGroupProfileView,
30 attr='user_group_profile',
31 route_name='user_group_profile', request_method='GET',
32 renderer='rhodecode:templates/user_group/user_group.mako')
@@ -21,7 +21,7 b''
21 import logging
21 import logging
22
22
23 from pyramid.httpexceptions import HTTPNotFound
23 from pyramid.httpexceptions import HTTPNotFound
24 from pyramid.view import view_config
24
25
25
26 from rhodecode.apps._base import BaseAppView
26 from rhodecode.apps._base import BaseAppView
27 from rhodecode.lib.auth import HasUserGroupPermissionAnyDecorator, LoginRequired, NotAnonymous
27 from rhodecode.lib.auth import HasUserGroupPermissionAnyDecorator, LoginRequired, NotAnonymous
@@ -36,9 +36,6 b' class UserGroupProfileView(BaseAppView):'
36 @LoginRequired()
36 @LoginRequired()
37 @NotAnonymous()
37 @NotAnonymous()
38 @HasUserGroupPermissionAnyDecorator('usergroup.read', 'usergroup.write', 'usergroup.admin',)
38 @HasUserGroupPermissionAnyDecorator('usergroup.read', 'usergroup.write', 'usergroup.admin',)
39 @view_config(
40 route_name='user_group_profile', request_method='GET',
41 renderer='rhodecode:templates/user_group/user_group.mako')
42 def user_group_profile(self):
39 def user_group_profile(self):
43 c = self._get_local_tmpl_context()
40 c = self._get_local_tmpl_context()
44 c.active = 'profile'
41 c.active = 'profile'
@@ -20,9 +20,13 b''
20
20
21
21
22 def includeme(config):
22 def includeme(config):
23 from rhodecode.apps.user_profile.views import UserProfileView
24
23 config.add_route(
25 config.add_route(
24 name='user_profile',
26 name='user_profile',
25 pattern='/_profiles/{username}')
27 pattern='/_profiles/{username}')
26
28 config.add_view(
27 # Scan module for configuration decorators.
29 UserProfileView,
28 config.scan('.views', ignore='.tests')
30 attr='user_profile',
31 route_name='user_profile', request_method='GET',
32 renderer='rhodecode:templates/users/user.mako')
@@ -21,7 +21,6 b''
21 import logging
21 import logging
22
22
23 from pyramid.httpexceptions import HTTPNotFound
23 from pyramid.httpexceptions import HTTPNotFound
24 from pyramid.view import view_config
25
24
26 from rhodecode.apps._base import BaseAppView
25 from rhodecode.apps._base import BaseAppView
27 from rhodecode.lib.auth import LoginRequired, NotAnonymous
26 from rhodecode.lib.auth import LoginRequired, NotAnonymous
@@ -36,9 +35,6 b' class UserProfileView(BaseAppView):'
36
35
37 @LoginRequired()
36 @LoginRequired()
38 @NotAnonymous()
37 @NotAnonymous()
39 @view_config(
40 route_name='user_profile', request_method='GET',
41 renderer='rhodecode:templates/users/user.mako')
42 def user_profile(self):
38 def user_profile(self):
43 # register local template context
39 # register local template context
44 c = self._get_local_tmpl_context()
40 c = self._get_local_tmpl_context()
@@ -20,7 +20,7 b''
20
20
21 def generate_jsroutes_content(jsroutes):
21 def generate_jsroutes_content(jsroutes):
22 statements = []
22 statements = []
23 for url_name, url, fields in jsroutes:
23 for url_name, url, fields in sorted(jsroutes):
24 statements.append(
24 statements.append(
25 "pyroutes.register('%s', '%s', %s);" % (url_name, url, fields))
25 "pyroutes.register('%s', '%s', %s);" % (url_name, url, fields))
26 return u'''
26 return u'''
@@ -92,6 +92,7 b' def make_pyramid_app(global_config, **se'
92 # Allows to use format style "{ENV_NAME}" placeholders in the configuration. It
92 # Allows to use format style "{ENV_NAME}" placeholders in the configuration. It
93 # will be replaced by the value of the environment variable "NAME" in this case.
93 # will be replaced by the value of the environment variable "NAME" in this case.
94 start_time = time.time()
94 start_time = time.time()
95 log.info('Pyramid app config starting')
95
96
96 debug = asbool(global_config.get('debug'))
97 debug = asbool(global_config.get('debug'))
97 if debug:
98 if debug:
@@ -121,6 +122,7 b' def make_pyramid_app(global_config, **se'
121 pyramid_app.config = config
122 pyramid_app.config = config
122
123
123 config.configure_celery(global_config['__file__'])
124 config.configure_celery(global_config['__file__'])
125
124 # creating the app uses a connection - return it after we are done
126 # creating the app uses a connection - return it after we are done
125 meta.Session.remove()
127 meta.Session.remove()
126 total_time = time.time() - start_time
128 total_time = time.time() - start_time
@@ -256,16 +258,12 b' def includeme(config, auth_resources=Non'
256 config.include('pyramid_mako')
258 config.include('pyramid_mako')
257 config.include('rhodecode.lib.rc_beaker')
259 config.include('rhodecode.lib.rc_beaker')
258 config.include('rhodecode.lib.rc_cache')
260 config.include('rhodecode.lib.rc_cache')
259
260 config.include('rhodecode.apps._base.navigation')
261 config.include('rhodecode.apps._base.navigation')
261 config.include('rhodecode.apps._base.subscribers')
262 config.include('rhodecode.apps._base.subscribers')
262 config.include('rhodecode.tweens')
263 config.include('rhodecode.tweens')
263 config.include('rhodecode.authentication')
264 config.include('rhodecode.authentication')
264
265
265 if load_all:
266 if load_all:
266 config.include('rhodecode.integrations')
267
268 if load_all:
269 ce_auth_resources = [
267 ce_auth_resources = [
270 'rhodecode.authentication.plugins.auth_crowd',
268 'rhodecode.authentication.plugins.auth_crowd',
271 'rhodecode.authentication.plugins.auth_headers',
269 'rhodecode.authentication.plugins.auth_headers',
@@ -291,15 +289,17 b' def includeme(config, auth_resources=Non'
291
289
292 # apps
290 # apps
293 if load_all:
291 if load_all:
292 config.include('rhodecode.api')
294 config.include('rhodecode.apps._base')
293 config.include('rhodecode.apps._base')
295 config.include('rhodecode.apps.hovercards')
294 config.include('rhodecode.apps.hovercards')
296 config.include('rhodecode.apps.ops')
295 config.include('rhodecode.apps.ops')
297 config.include('rhodecode.apps.admin')
298 config.include('rhodecode.apps.channelstream')
296 config.include('rhodecode.apps.channelstream')
299 config.include('rhodecode.apps.file_store')
297 config.include('rhodecode.apps.file_store')
298 config.include('rhodecode.apps.admin')
300 config.include('rhodecode.apps.login')
299 config.include('rhodecode.apps.login')
301 config.include('rhodecode.apps.home')
300 config.include('rhodecode.apps.home')
302 config.include('rhodecode.apps.journal')
301 config.include('rhodecode.apps.journal')
302
303 config.include('rhodecode.apps.repository')
303 config.include('rhodecode.apps.repository')
304 config.include('rhodecode.apps.repo_group')
304 config.include('rhodecode.apps.repo_group')
305 config.include('rhodecode.apps.user_group')
305 config.include('rhodecode.apps.user_group')
@@ -307,11 +307,14 b' def includeme(config, auth_resources=Non'
307 config.include('rhodecode.apps.user_profile')
307 config.include('rhodecode.apps.user_profile')
308 config.include('rhodecode.apps.user_group_profile')
308 config.include('rhodecode.apps.user_group_profile')
309 config.include('rhodecode.apps.my_account')
309 config.include('rhodecode.apps.my_account')
310 config.include('rhodecode.apps.gist')
311
310 config.include('rhodecode.apps.svn_support')
312 config.include('rhodecode.apps.svn_support')
311 config.include('rhodecode.apps.ssh_support')
313 config.include('rhodecode.apps.ssh_support')
312 config.include('rhodecode.apps.gist')
313 config.include('rhodecode.apps.debug_style')
314 config.include('rhodecode.apps.debug_style')
314 config.include('rhodecode.api')
315
316 if load_all:
317 config.include('rhodecode.integrations')
315
318
316 config.add_route('rhodecode_support', 'https://rhodecode.com/help/', static=True)
319 config.add_route('rhodecode_support', 'https://rhodecode.com/help/', static=True)
317 config.add_translation_dirs('rhodecode:i18n/')
320 config.add_translation_dirs('rhodecode:i18n/')
@@ -24,6 +24,9 b' from rhodecode.apps._base import ADMIN_P'
24 from rhodecode.lib.utils2 import safe_int
24 from rhodecode.lib.utils2 import safe_int
25 from rhodecode.model.db import Repository, Integration, RepoGroup
25 from rhodecode.model.db import Repository, Integration, RepoGroup
26 from rhodecode.integrations import integration_type_registry
26 from rhodecode.integrations import integration_type_registry
27 from rhodecode.integrations.views import GlobalIntegrationsView
28 from rhodecode.integrations.views import RepoGroupIntegrationsView
29 from rhodecode.integrations.views import RepoIntegrationsView
27
30
28 log = logging.getLogger(__name__)
31 log = logging.getLogger(__name__)
29
32
@@ -83,7 +86,7 b' def includeme(config):'
83 # global integrations
86 # global integrations
84 config.add_route('global_integrations_new',
87 config.add_route('global_integrations_new',
85 ADMIN_PREFIX + '/integrations/new')
88 ADMIN_PREFIX + '/integrations/new')
86 config.add_view('rhodecode.integrations.views.GlobalIntegrationsView',
89 config.add_view(GlobalIntegrationsView,
87 attr='new_integration',
90 attr='new_integration',
88 renderer='rhodecode:templates/admin/integrations/new.mako',
91 renderer='rhodecode:templates/admin/integrations/new.mako',
89 request_method='GET',
92 request_method='GET',
@@ -94,7 +97,7 b' def includeme(config):'
94 config.add_route('global_integrations_list',
97 config.add_route('global_integrations_list',
95 ADMIN_PREFIX + '/integrations/{integration}')
98 ADMIN_PREFIX + '/integrations/{integration}')
96 for route_name in ['global_integrations_home', 'global_integrations_list']:
99 for route_name in ['global_integrations_home', 'global_integrations_list']:
97 config.add_view('rhodecode.integrations.views.GlobalIntegrationsView',
100 config.add_view(GlobalIntegrationsView,
98 attr='integration_list',
101 attr='integration_list',
99 renderer='rhodecode:templates/admin/integrations/list.mako',
102 renderer='rhodecode:templates/admin/integrations/list.mako',
100 request_method='GET',
103 request_method='GET',
@@ -108,12 +111,12 b' def includeme(config):'
108 valid_integration=True)
111 valid_integration=True)
109
112
110 for route_name in ['global_integrations_create', 'global_integrations_edit']:
113 for route_name in ['global_integrations_create', 'global_integrations_edit']:
111 config.add_view('rhodecode.integrations.views.GlobalIntegrationsView',
114 config.add_view(GlobalIntegrationsView,
112 attr='settings_get',
115 attr='settings_get',
113 renderer='rhodecode:templates/admin/integrations/form.mako',
116 renderer='rhodecode:templates/admin/integrations/form.mako',
114 request_method='GET',
117 request_method='GET',
115 route_name=route_name)
118 route_name=route_name)
116 config.add_view('rhodecode.integrations.views.GlobalIntegrationsView',
119 config.add_view(GlobalIntegrationsView,
117 attr='settings_post',
120 attr='settings_post',
118 renderer='rhodecode:templates/admin/integrations/form.mako',
121 renderer='rhodecode:templates/admin/integrations/form.mako',
119 request_method='POST',
122 request_method='POST',
@@ -124,7 +127,7 b' def includeme(config):'
124 add_route_requirements('/{repo_group_name}/_settings/integrations'),
127 add_route_requirements('/{repo_group_name}/_settings/integrations'),
125 repo_group_route=True)
128 repo_group_route=True)
126
129
127 config.add_view('rhodecode.integrations.views.RepoGroupIntegrationsView',
130 config.add_view(RepoGroupIntegrationsView,
128 attr='integration_list',
131 attr='integration_list',
129 renderer='rhodecode:templates/admin/integrations/list.mako',
132 renderer='rhodecode:templates/admin/integrations/list.mako',
130 request_method='GET',
133 request_method='GET',
@@ -133,7 +136,7 b' def includeme(config):'
133 config.add_route('repo_group_integrations_new',
136 config.add_route('repo_group_integrations_new',
134 add_route_requirements('/{repo_group_name}/_settings/integrations/new'),
137 add_route_requirements('/{repo_group_name}/_settings/integrations/new'),
135 repo_group_route=True)
138 repo_group_route=True)
136 config.add_view('rhodecode.integrations.views.RepoGroupIntegrationsView',
139 config.add_view(RepoGroupIntegrationsView,
137 attr='new_integration',
140 attr='new_integration',
138 renderer='rhodecode:templates/admin/integrations/new.mako',
141 renderer='rhodecode:templates/admin/integrations/new.mako',
139 request_method='GET',
142 request_method='GET',
@@ -143,7 +146,7 b' def includeme(config):'
143 add_route_requirements('/{repo_group_name}/_settings/integrations/{integration}'),
146 add_route_requirements('/{repo_group_name}/_settings/integrations/{integration}'),
144 repo_group_route=True,
147 repo_group_route=True,
145 valid_integration=True)
148 valid_integration=True)
146 config.add_view('rhodecode.integrations.views.RepoGroupIntegrationsView',
149 config.add_view(RepoGroupIntegrationsView,
147 attr='integration_list',
150 attr='integration_list',
148 renderer='rhodecode:templates/admin/integrations/list.mako',
151 renderer='rhodecode:templates/admin/integrations/list.mako',
149 request_method='GET',
152 request_method='GET',
@@ -153,12 +156,12 b' def includeme(config):'
153 add_route_requirements('/{repo_group_name}/_settings/integrations/{integration}/new'),
156 add_route_requirements('/{repo_group_name}/_settings/integrations/{integration}/new'),
154 repo_group_route=True,
157 repo_group_route=True,
155 valid_integration=True)
158 valid_integration=True)
156 config.add_view('rhodecode.integrations.views.RepoGroupIntegrationsView',
159 config.add_view(RepoGroupIntegrationsView,
157 attr='settings_get',
160 attr='settings_get',
158 renderer='rhodecode:templates/admin/integrations/form.mako',
161 renderer='rhodecode:templates/admin/integrations/form.mako',
159 request_method='GET',
162 request_method='GET',
160 route_name='repo_group_integrations_create')
163 route_name='repo_group_integrations_create')
161 config.add_view('rhodecode.integrations.views.RepoGroupIntegrationsView',
164 config.add_view(RepoGroupIntegrationsView,
162 attr='settings_post',
165 attr='settings_post',
163 renderer='rhodecode:templates/admin/integrations/form.mako',
166 renderer='rhodecode:templates/admin/integrations/form.mako',
164 request_method='POST',
167 request_method='POST',
@@ -169,12 +172,12 b' def includeme(config):'
169 repo_group_route=True,
172 repo_group_route=True,
170 valid_integration=True)
173 valid_integration=True)
171
174
172 config.add_view('rhodecode.integrations.views.RepoGroupIntegrationsView',
175 config.add_view(RepoGroupIntegrationsView,
173 attr='settings_get',
176 attr='settings_get',
174 renderer='rhodecode:templates/admin/integrations/form.mako',
177 renderer='rhodecode:templates/admin/integrations/form.mako',
175 request_method='GET',
178 request_method='GET',
176 route_name='repo_group_integrations_edit')
179 route_name='repo_group_integrations_edit')
177 config.add_view('rhodecode.integrations.views.RepoGroupIntegrationsView',
180 config.add_view(RepoGroupIntegrationsView,
178 attr='settings_post',
181 attr='settings_post',
179 renderer='rhodecode:templates/admin/integrations/form.mako',
182 renderer='rhodecode:templates/admin/integrations/form.mako',
180 request_method='POST',
183 request_method='POST',
@@ -184,7 +187,7 b' def includeme(config):'
184 config.add_route('repo_integrations_home',
187 config.add_route('repo_integrations_home',
185 add_route_requirements('/{repo_name}/settings/integrations'),
188 add_route_requirements('/{repo_name}/settings/integrations'),
186 repo_route=True)
189 repo_route=True)
187 config.add_view('rhodecode.integrations.views.RepoIntegrationsView',
190 config.add_view(RepoIntegrationsView,
188 attr='integration_list',
191 attr='integration_list',
189 request_method='GET',
192 request_method='GET',
190 renderer='rhodecode:templates/admin/integrations/list.mako',
193 renderer='rhodecode:templates/admin/integrations/list.mako',
@@ -193,7 +196,7 b' def includeme(config):'
193 config.add_route('repo_integrations_new',
196 config.add_route('repo_integrations_new',
194 add_route_requirements('/{repo_name}/settings/integrations/new'),
197 add_route_requirements('/{repo_name}/settings/integrations/new'),
195 repo_route=True)
198 repo_route=True)
196 config.add_view('rhodecode.integrations.views.RepoIntegrationsView',
199 config.add_view(RepoIntegrationsView,
197 attr='new_integration',
200 attr='new_integration',
198 renderer='rhodecode:templates/admin/integrations/new.mako',
201 renderer='rhodecode:templates/admin/integrations/new.mako',
199 request_method='GET',
202 request_method='GET',
@@ -203,7 +206,7 b' def includeme(config):'
203 add_route_requirements('/{repo_name}/settings/integrations/{integration}'),
206 add_route_requirements('/{repo_name}/settings/integrations/{integration}'),
204 repo_route=True,
207 repo_route=True,
205 valid_integration=True)
208 valid_integration=True)
206 config.add_view('rhodecode.integrations.views.RepoIntegrationsView',
209 config.add_view(RepoIntegrationsView,
207 attr='integration_list',
210 attr='integration_list',
208 request_method='GET',
211 request_method='GET',
209 renderer='rhodecode:templates/admin/integrations/list.mako',
212 renderer='rhodecode:templates/admin/integrations/list.mako',
@@ -213,12 +216,12 b' def includeme(config):'
213 add_route_requirements('/{repo_name}/settings/integrations/{integration}/new'),
216 add_route_requirements('/{repo_name}/settings/integrations/{integration}/new'),
214 repo_route=True,
217 repo_route=True,
215 valid_integration=True)
218 valid_integration=True)
216 config.add_view('rhodecode.integrations.views.RepoIntegrationsView',
219 config.add_view(RepoIntegrationsView,
217 attr='settings_get',
220 attr='settings_get',
218 renderer='rhodecode:templates/admin/integrations/form.mako',
221 renderer='rhodecode:templates/admin/integrations/form.mako',
219 request_method='GET',
222 request_method='GET',
220 route_name='repo_integrations_create')
223 route_name='repo_integrations_create')
221 config.add_view('rhodecode.integrations.views.RepoIntegrationsView',
224 config.add_view(RepoIntegrationsView,
222 attr='settings_post',
225 attr='settings_post',
223 renderer='rhodecode:templates/admin/integrations/form.mako',
226 renderer='rhodecode:templates/admin/integrations/form.mako',
224 request_method='POST',
227 request_method='POST',
@@ -228,12 +231,12 b' def includeme(config):'
228 add_route_requirements('/{repo_name}/settings/integrations/{integration}/{integration_id}'),
231 add_route_requirements('/{repo_name}/settings/integrations/{integration}/{integration_id}'),
229 repo_route=True,
232 repo_route=True,
230 valid_integration=True)
233 valid_integration=True)
231 config.add_view('rhodecode.integrations.views.RepoIntegrationsView',
234 config.add_view(RepoIntegrationsView,
232 attr='settings_get',
235 attr='settings_get',
233 renderer='rhodecode:templates/admin/integrations/form.mako',
236 renderer='rhodecode:templates/admin/integrations/form.mako',
234 request_method='GET',
237 request_method='GET',
235 route_name='repo_integrations_edit')
238 route_name='repo_integrations_edit')
236 config.add_view('rhodecode.integrations.views.RepoIntegrationsView',
239 config.add_view(RepoIntegrationsView,
237 attr='settings_post',
240 attr='settings_post',
238 renderer='rhodecode:templates/admin/integrations/form.mako',
241 renderer='rhodecode:templates/admin/integrations/form.mako',
239 request_method='POST',
242 request_method='POST',
@@ -4810,6 +4810,7 b' class Gist(Base, BaseModel):'
4810
4810
4811 res = cls.query().filter(cls.gist_access_id == id_).scalar()
4811 res = cls.query().filter(cls.gist_access_id == id_).scalar()
4812 if not res:
4812 if not res:
4813 log.debug('WARN: No DB entry with id %s', id_)
4813 raise HTTPNotFound()
4814 raise HTTPNotFound()
4814 return res
4815 return res
4815
4816
This diff has been collapsed as it changes many lines, (694 lines changed) Show them Hide them
@@ -12,394 +12,392 b''
12 ******************************************************************************/
12 ******************************************************************************/
13 function registerRCRoutes() {
13 function registerRCRoutes() {
14 // routes registration
14 // routes registration
15 pyroutes.register('favicon', '/favicon.ico', []);
15 pyroutes.register('admin_audit_log_entry', '/_admin/audit_logs/%(audit_log_id)s', ['audit_log_id']);
16 pyroutes.register('robots', '/robots.txt', []);
17 pyroutes.register('auth_home', '/_admin/auth*traverse', []);
18 pyroutes.register('global_integrations_new', '/_admin/integrations/new', []);
19 pyroutes.register('global_integrations_home', '/_admin/integrations', []);
20 pyroutes.register('global_integrations_list', '/_admin/integrations/%(integration)s', ['integration']);
21 pyroutes.register('global_integrations_create', '/_admin/integrations/%(integration)s/new', ['integration']);
22 pyroutes.register('global_integrations_edit', '/_admin/integrations/%(integration)s/%(integration_id)s', ['integration', 'integration_id']);
23 pyroutes.register('repo_group_integrations_home', '/%(repo_group_name)s/_settings/integrations', ['repo_group_name']);
24 pyroutes.register('repo_group_integrations_new', '/%(repo_group_name)s/_settings/integrations/new', ['repo_group_name']);
25 pyroutes.register('repo_group_integrations_list', '/%(repo_group_name)s/_settings/integrations/%(integration)s', ['repo_group_name', 'integration']);
26 pyroutes.register('repo_group_integrations_create', '/%(repo_group_name)s/_settings/integrations/%(integration)s/new', ['repo_group_name', 'integration']);
27 pyroutes.register('repo_group_integrations_edit', '/%(repo_group_name)s/_settings/integrations/%(integration)s/%(integration_id)s', ['repo_group_name', 'integration', 'integration_id']);
28 pyroutes.register('repo_integrations_home', '/%(repo_name)s/settings/integrations', ['repo_name']);
29 pyroutes.register('repo_integrations_new', '/%(repo_name)s/settings/integrations/new', ['repo_name']);
30 pyroutes.register('repo_integrations_list', '/%(repo_name)s/settings/integrations/%(integration)s', ['repo_name', 'integration']);
31 pyroutes.register('repo_integrations_create', '/%(repo_name)s/settings/integrations/%(integration)s/new', ['repo_name', 'integration']);
32 pyroutes.register('repo_integrations_edit', '/%(repo_name)s/settings/integrations/%(integration)s/%(integration_id)s', ['repo_name', 'integration', 'integration_id']);
33 pyroutes.register('hovercard_user', '/_hovercard/user/%(user_id)s', ['user_id']);
34 pyroutes.register('hovercard_username', '/_hovercard/username/%(username)s', ['username']);
35 pyroutes.register('hovercard_user_group', '/_hovercard/user_group/%(user_group_id)s', ['user_group_id']);
36 pyroutes.register('hovercard_pull_request', '/_hovercard/pull_request/%(pull_request_id)s', ['pull_request_id']);
37 pyroutes.register('hovercard_repo_commit', '/_hovercard/commit/%(repo_name)s/%(commit_id)s', ['repo_name', 'commit_id']);
38 pyroutes.register('ops_ping', '/_admin/ops/ping', []);
39 pyroutes.register('ops_error_test', '/_admin/ops/error', []);
40 pyroutes.register('ops_redirect_test', '/_admin/ops/redirect', []);
41 pyroutes.register('ops_ping_legacy', '/_admin/ping', []);
42 pyroutes.register('ops_error_test_legacy', '/_admin/error_test', []);
43 pyroutes.register('admin_home', '/_admin', []);
44 pyroutes.register('admin_audit_logs', '/_admin/audit_logs', []);
16 pyroutes.register('admin_audit_logs', '/_admin/audit_logs', []);
45 pyroutes.register('admin_audit_log_entry', '/_admin/audit_logs/%(audit_log_id)s', ['audit_log_id']);
46 pyroutes.register('pull_requests_global_0', '/_admin/pull_requests/%(pull_request_id)s', ['pull_request_id']);
47 pyroutes.register('pull_requests_global_1', '/_admin/pull-requests/%(pull_request_id)s', ['pull_request_id']);
48 pyroutes.register('pull_requests_global', '/_admin/pull-request/%(pull_request_id)s', ['pull_request_id']);
49 pyroutes.register('admin_settings_open_source', '/_admin/settings/open_source', []);
50 pyroutes.register('admin_settings_vcs_svn_generate_cfg', '/_admin/settings/vcs/svn_generate_cfg', []);
51 pyroutes.register('admin_settings_system', '/_admin/settings/system', []);
52 pyroutes.register('admin_settings_system_update', '/_admin/settings/system/updates', []);
53 pyroutes.register('admin_settings_exception_tracker', '/_admin/settings/exceptions', []);
54 pyroutes.register('admin_settings_exception_tracker_delete_all', '/_admin/settings/exceptions/delete', []);
55 pyroutes.register('admin_settings_exception_tracker_show', '/_admin/settings/exceptions/%(exception_id)s', ['exception_id']);
56 pyroutes.register('admin_settings_exception_tracker_delete', '/_admin/settings/exceptions/%(exception_id)s/delete', ['exception_id']);
57 pyroutes.register('admin_settings_sessions', '/_admin/settings/sessions', []);
58 pyroutes.register('admin_settings_sessions_cleanup', '/_admin/settings/sessions/cleanup', []);
59 pyroutes.register('admin_settings_process_management', '/_admin/settings/process_management', []);
60 pyroutes.register('admin_settings_process_management_data', '/_admin/settings/process_management/data', []);
61 pyroutes.register('admin_settings_process_management_signal', '/_admin/settings/process_management/signal', []);
62 pyroutes.register('admin_settings_process_management_master_signal', '/_admin/settings/process_management/master_signal', []);
63 pyroutes.register('admin_defaults_repositories', '/_admin/defaults/repositories', []);
17 pyroutes.register('admin_defaults_repositories', '/_admin/defaults/repositories', []);
64 pyroutes.register('admin_defaults_repositories_update', '/_admin/defaults/repositories/update', []);
18 pyroutes.register('admin_defaults_repositories_update', '/_admin/defaults/repositories/update', []);
65 pyroutes.register('admin_settings', '/_admin/settings', []);
19 pyroutes.register('admin_home', '/_admin', []);
66 pyroutes.register('admin_settings_update', '/_admin/settings/update', []);
67 pyroutes.register('admin_settings_global', '/_admin/settings/global', []);
68 pyroutes.register('admin_settings_global_update', '/_admin/settings/global/update', []);
69 pyroutes.register('admin_settings_vcs', '/_admin/settings/vcs', []);
70 pyroutes.register('admin_settings_vcs_update', '/_admin/settings/vcs/update', []);
71 pyroutes.register('admin_settings_vcs_svn_pattern_delete', '/_admin/settings/vcs/svn_pattern_delete', []);
72 pyroutes.register('admin_settings_mapping', '/_admin/settings/mapping', []);
73 pyroutes.register('admin_settings_mapping_update', '/_admin/settings/mapping/update', []);
74 pyroutes.register('admin_settings_visual', '/_admin/settings/visual', []);
75 pyroutes.register('admin_settings_visual_update', '/_admin/settings/visual/update', []);
76 pyroutes.register('admin_settings_issuetracker', '/_admin/settings/issue-tracker', []);
77 pyroutes.register('admin_settings_issuetracker_update', '/_admin/settings/issue-tracker/update', []);
78 pyroutes.register('admin_settings_issuetracker_test', '/_admin/settings/issue-tracker/test', []);
79 pyroutes.register('admin_settings_issuetracker_delete', '/_admin/settings/issue-tracker/delete', []);
80 pyroutes.register('admin_settings_email', '/_admin/settings/email', []);
81 pyroutes.register('admin_settings_email_update', '/_admin/settings/email/update', []);
82 pyroutes.register('admin_settings_hooks', '/_admin/settings/hooks', []);
83 pyroutes.register('admin_settings_hooks_update', '/_admin/settings/hooks/update', []);
84 pyroutes.register('admin_settings_hooks_delete', '/_admin/settings/hooks/delete', []);
85 pyroutes.register('admin_settings_search', '/_admin/settings/search', []);
86 pyroutes.register('admin_settings_labs', '/_admin/settings/labs', []);
87 pyroutes.register('admin_settings_labs_update', '/_admin/settings/labs/update', []);
88 pyroutes.register('admin_permissions_application', '/_admin/permissions/application', []);
20 pyroutes.register('admin_permissions_application', '/_admin/permissions/application', []);
89 pyroutes.register('admin_permissions_application_update', '/_admin/permissions/application/update', []);
21 pyroutes.register('admin_permissions_application_update', '/_admin/permissions/application/update', []);
22 pyroutes.register('admin_permissions_auth_token_access', '/_admin/permissions/auth_token_access', []);
23 pyroutes.register('admin_permissions_branch', '/_admin/permissions/branch', []);
24 pyroutes.register('admin_permissions_branch_update', '/_admin/permissions/branch/update', []);
90 pyroutes.register('admin_permissions_global', '/_admin/permissions/global', []);
25 pyroutes.register('admin_permissions_global', '/_admin/permissions/global', []);
91 pyroutes.register('admin_permissions_global_update', '/_admin/permissions/global/update', []);
26 pyroutes.register('admin_permissions_global_update', '/_admin/permissions/global/update', []);
27 pyroutes.register('admin_permissions_ips', '/_admin/permissions/ips', []);
92 pyroutes.register('admin_permissions_object', '/_admin/permissions/object', []);
28 pyroutes.register('admin_permissions_object', '/_admin/permissions/object', []);
93 pyroutes.register('admin_permissions_object_update', '/_admin/permissions/object/update', []);
29 pyroutes.register('admin_permissions_object_update', '/_admin/permissions/object/update', []);
94 pyroutes.register('admin_permissions_ips', '/_admin/permissions/ips', []);
95 pyroutes.register('admin_permissions_overview', '/_admin/permissions/overview', []);
30 pyroutes.register('admin_permissions_overview', '/_admin/permissions/overview', []);
96 pyroutes.register('admin_permissions_auth_token_access', '/_admin/permissions/auth_token_access', []);
97 pyroutes.register('admin_permissions_ssh_keys', '/_admin/permissions/ssh_keys', []);
31 pyroutes.register('admin_permissions_ssh_keys', '/_admin/permissions/ssh_keys', []);
98 pyroutes.register('admin_permissions_ssh_keys_data', '/_admin/permissions/ssh_keys/data', []);
32 pyroutes.register('admin_permissions_ssh_keys_data', '/_admin/permissions/ssh_keys/data', []);
99 pyroutes.register('admin_permissions_ssh_keys_update', '/_admin/permissions/ssh_keys/update', []);
33 pyroutes.register('admin_permissions_ssh_keys_update', '/_admin/permissions/ssh_keys/update', []);
100 pyroutes.register('users', '/_admin/users', []);
34 pyroutes.register('admin_settings', '/_admin/settings', []);
101 pyroutes.register('users_data', '/_admin/users_data', []);
35 pyroutes.register('admin_settings_automation', '/_admin/settings/automation', []);
102 pyroutes.register('users_create', '/_admin/users/create', []);
36 pyroutes.register('admin_settings_automation_update', '/_admin/settings/automation/%(entry_id)s/update', ['entry_id']);
103 pyroutes.register('users_new', '/_admin/users/new', []);
37 pyroutes.register('admin_settings_email', '/_admin/settings/email', []);
104 pyroutes.register('user_edit', '/_admin/users/%(user_id)s/edit', ['user_id']);
38 pyroutes.register('admin_settings_email_update', '/_admin/settings/email/update', []);
105 pyroutes.register('user_edit_advanced', '/_admin/users/%(user_id)s/edit/advanced', ['user_id']);
39 pyroutes.register('admin_settings_exception_tracker', '/_admin/settings/exceptions', []);
106 pyroutes.register('user_edit_global_perms', '/_admin/users/%(user_id)s/edit/global_permissions', ['user_id']);
40 pyroutes.register('admin_settings_exception_tracker_delete', '/_admin/settings/exceptions/%(exception_id)s/delete', ['exception_id']);
107 pyroutes.register('user_edit_global_perms_update', '/_admin/users/%(user_id)s/edit/global_permissions/update', ['user_id']);
41 pyroutes.register('admin_settings_exception_tracker_delete_all', '/_admin/settings/exceptions_delete_all', []);
108 pyroutes.register('user_update', '/_admin/users/%(user_id)s/update', ['user_id']);
42 pyroutes.register('admin_settings_exception_tracker_show', '/_admin/settings/exceptions/%(exception_id)s', ['exception_id']);
109 pyroutes.register('user_delete', '/_admin/users/%(user_id)s/delete', ['user_id']);
43 pyroutes.register('admin_settings_global', '/_admin/settings/global', []);
110 pyroutes.register('user_enable_force_password_reset', '/_admin/users/%(user_id)s/password_reset_enable', ['user_id']);
44 pyroutes.register('admin_settings_global_update', '/_admin/settings/global/update', []);
111 pyroutes.register('user_disable_force_password_reset', '/_admin/users/%(user_id)s/password_reset_disable', ['user_id']);
45 pyroutes.register('admin_settings_hooks', '/_admin/settings/hooks', []);
112 pyroutes.register('user_create_personal_repo_group', '/_admin/users/%(user_id)s/create_repo_group', ['user_id']);
46 pyroutes.register('admin_settings_hooks_delete', '/_admin/settings/hooks/delete', []);
113 pyroutes.register('user_notice_dismiss', '/_admin/users/%(user_id)s/notice_dismiss', ['user_id']);
47 pyroutes.register('admin_settings_hooks_update', '/_admin/settings/hooks/update', []);
48 pyroutes.register('admin_settings_issuetracker', '/_admin/settings/issue-tracker', []);
49 pyroutes.register('admin_settings_issuetracker_delete', '/_admin/settings/issue-tracker/delete', []);
50 pyroutes.register('admin_settings_issuetracker_test', '/_admin/settings/issue-tracker/test', []);
51 pyroutes.register('admin_settings_issuetracker_update', '/_admin/settings/issue-tracker/update', []);
52 pyroutes.register('admin_settings_labs', '/_admin/settings/labs', []);
53 pyroutes.register('admin_settings_labs_update', '/_admin/settings/labs/update', []);
54 pyroutes.register('admin_settings_license', '/_admin/settings/license', []);
55 pyroutes.register('admin_settings_license_unlock', '/_admin/settings/license_unlock', []);
56 pyroutes.register('admin_settings_mapping', '/_admin/settings/mapping', []);
57 pyroutes.register('admin_settings_mapping_update', '/_admin/settings/mapping/update', []);
58 pyroutes.register('admin_settings_open_source', '/_admin/settings/open_source', []);
59 pyroutes.register('admin_settings_process_management', '/_admin/settings/process_management', []);
60 pyroutes.register('admin_settings_process_management_data', '/_admin/settings/process_management/data', []);
61 pyroutes.register('admin_settings_process_management_master_signal', '/_admin/settings/process_management/master_signal', []);
62 pyroutes.register('admin_settings_process_management_signal', '/_admin/settings/process_management/signal', []);
63 pyroutes.register('admin_settings_scheduler_create', '/_admin/settings/scheduler/create', []);
64 pyroutes.register('admin_settings_scheduler_delete', '/_admin/settings/scheduler/%(schedule_id)s/delete', ['schedule_id']);
65 pyroutes.register('admin_settings_scheduler_edit', '/_admin/settings/scheduler/%(schedule_id)s', ['schedule_id']);
66 pyroutes.register('admin_settings_scheduler_execute', '/_admin/settings/scheduler/%(schedule_id)s/execute', ['schedule_id']);
67 pyroutes.register('admin_settings_scheduler_new', '/_admin/settings/scheduler/new', []);
68 pyroutes.register('admin_settings_scheduler_show_all', '/_admin/settings/scheduler', []);
69 pyroutes.register('admin_settings_scheduler_show_tasks', '/_admin/settings/scheduler/_tasks', []);
70 pyroutes.register('admin_settings_scheduler_update', '/_admin/settings/scheduler/%(schedule_id)s/update', ['schedule_id']);
71 pyroutes.register('admin_settings_search', '/_admin/settings/search', []);
72 pyroutes.register('admin_settings_sessions', '/_admin/settings/sessions', []);
73 pyroutes.register('admin_settings_sessions_cleanup', '/_admin/settings/sessions/cleanup', []);
74 pyroutes.register('admin_settings_system', '/_admin/settings/system', []);
75 pyroutes.register('admin_settings_system_update', '/_admin/settings/system/updates', []);
76 pyroutes.register('admin_settings_update', '/_admin/settings/update', []);
77 pyroutes.register('admin_settings_vcs', '/_admin/settings/vcs', []);
78 pyroutes.register('admin_settings_vcs_svn_generate_cfg', '/_admin/settings/vcs/svn_generate_cfg', []);
79 pyroutes.register('admin_settings_vcs_svn_pattern_delete', '/_admin/settings/vcs/svn_pattern_delete', []);
80 pyroutes.register('admin_settings_vcs_update', '/_admin/settings/vcs/update', []);
81 pyroutes.register('admin_settings_visual', '/_admin/settings/visual', []);
82 pyroutes.register('admin_settings_visual_update', '/_admin/settings/visual/update', []);
83 pyroutes.register('apiv2', '/_admin/api', []);
84 pyroutes.register('atom_feed_home', '/%(repo_name)s/feed-atom', ['repo_name']);
85 pyroutes.register('atom_feed_home_old', '/%(repo_name)s/feed/atom', ['repo_name']);
86 pyroutes.register('auth_home', '/_admin/auth*traverse', []);
87 pyroutes.register('bookmarks_home', '/%(repo_name)s/bookmarks', ['repo_name']);
88 pyroutes.register('branches_home', '/%(repo_name)s/branches', ['repo_name']);
89 pyroutes.register('channelstream_connect', '/_admin/channelstream/connect', []);
90 pyroutes.register('channelstream_proxy', '/_channelstream', []);
91 pyroutes.register('channelstream_subscribe', '/_admin/channelstream/subscribe', []);
92 pyroutes.register('commit_draft_comments_submit', '/%(repo_name)s/changeset/%(commit_id)s/draft_comments_submit', ['repo_name', 'commit_id']);
93 pyroutes.register('debug_style_email', '/_admin/debug_style/email/%(email_id)s', ['email_id']);
94 pyroutes.register('debug_style_email_plain_rendered', '/_admin/debug_style/email-rendered/%(email_id)s', ['email_id']);
95 pyroutes.register('debug_style_home', '/_admin/debug_style', []);
96 pyroutes.register('debug_style_template', '/_admin/debug_style/t/%(t_path)s', ['t_path']);
97 pyroutes.register('download_file', '/_file_store/download/%(fid)s', ['fid']);
98 pyroutes.register('download_file_by_token', '/_file_store/token-download/%(_auth_token)s/%(fid)s', ['_auth_token', 'fid']);
99 pyroutes.register('edit_repo', '/%(repo_name)s/settings', ['repo_name']);
100 pyroutes.register('edit_repo_advanced', '/%(repo_name)s/settings/advanced', ['repo_name']);
101 pyroutes.register('edit_repo_advanced_archive', '/%(repo_name)s/settings/advanced/archive', ['repo_name']);
102 pyroutes.register('edit_repo_advanced_delete', '/%(repo_name)s/settings/advanced/delete', ['repo_name']);
103 pyroutes.register('edit_repo_advanced_fork', '/%(repo_name)s/settings/advanced/fork', ['repo_name']);
104 pyroutes.register('edit_repo_advanced_hooks', '/%(repo_name)s/settings/advanced/hooks', ['repo_name']);
105 pyroutes.register('edit_repo_advanced_journal', '/%(repo_name)s/settings/advanced/journal', ['repo_name']);
106 pyroutes.register('edit_repo_advanced_locking', '/%(repo_name)s/settings/advanced/locking', ['repo_name']);
107 pyroutes.register('edit_repo_audit_logs', '/%(repo_name)s/settings/audit_logs', ['repo_name']);
108 pyroutes.register('edit_repo_caches', '/%(repo_name)s/settings/caches', ['repo_name']);
109 pyroutes.register('edit_repo_fields', '/%(repo_name)s/settings/fields', ['repo_name']);
110 pyroutes.register('edit_repo_fields_create', '/%(repo_name)s/settings/fields/create', ['repo_name']);
111 pyroutes.register('edit_repo_fields_delete', '/%(repo_name)s/settings/fields/%(field_id)s/delete', ['repo_name', 'field_id']);
112 pyroutes.register('edit_repo_group', '/%(repo_group_name)s/_edit', ['repo_group_name']);
113 pyroutes.register('edit_repo_group_advanced', '/%(repo_group_name)s/_settings/advanced', ['repo_group_name']);
114 pyroutes.register('edit_repo_group_advanced_delete', '/%(repo_group_name)s/_settings/advanced/delete', ['repo_group_name']);
115 pyroutes.register('edit_repo_group_perms', '/%(repo_group_name)s/_settings/permissions', ['repo_group_name']);
116 pyroutes.register('edit_repo_group_perms_update', '/%(repo_group_name)s/_settings/permissions/update', ['repo_group_name']);
117 pyroutes.register('edit_repo_issuetracker', '/%(repo_name)s/settings/issue_trackers', ['repo_name']);
118 pyroutes.register('edit_repo_issuetracker_delete', '/%(repo_name)s/settings/issue_trackers/delete', ['repo_name']);
119 pyroutes.register('edit_repo_issuetracker_test', '/%(repo_name)s/settings/issue_trackers/test', ['repo_name']);
120 pyroutes.register('edit_repo_issuetracker_update', '/%(repo_name)s/settings/issue_trackers/update', ['repo_name']);
121 pyroutes.register('edit_repo_maintenance', '/%(repo_name)s/settings/maintenance', ['repo_name']);
122 pyroutes.register('edit_repo_maintenance_execute', '/%(repo_name)s/settings/maintenance/execute', ['repo_name']);
123 pyroutes.register('edit_repo_perms', '/%(repo_name)s/settings/permissions', ['repo_name']);
124 pyroutes.register('edit_repo_perms_branch', '/%(repo_name)s/settings/branch_permissions', ['repo_name']);
125 pyroutes.register('edit_repo_perms_branch_delete', '/%(repo_name)s/settings/branch_permissions/%(rule_id)s/delete', ['repo_name', 'rule_id']);
126 pyroutes.register('edit_repo_perms_set_private', '/%(repo_name)s/settings/permissions/set_private', ['repo_name']);
127 pyroutes.register('edit_repo_remote', '/%(repo_name)s/settings/remote', ['repo_name']);
128 pyroutes.register('edit_repo_remote_pull', '/%(repo_name)s/settings/remote/pull', ['repo_name']);
129 pyroutes.register('edit_repo_remote_push', '/%(repo_name)s/settings/remote/push', ['repo_name']);
130 pyroutes.register('edit_repo_statistics', '/%(repo_name)s/settings/statistics', ['repo_name']);
131 pyroutes.register('edit_repo_statistics_reset', '/%(repo_name)s/settings/statistics/update', ['repo_name']);
132 pyroutes.register('edit_repo_strip', '/%(repo_name)s/settings/strip', ['repo_name']);
133 pyroutes.register('edit_repo_vcs', '/%(repo_name)s/settings/vcs', ['repo_name']);
134 pyroutes.register('edit_repo_vcs_svn_pattern_delete', '/%(repo_name)s/settings/vcs/svn_pattern/delete', ['repo_name']);
135 pyroutes.register('edit_repo_vcs_update', '/%(repo_name)s/settings/vcs/update', ['repo_name']);
136 pyroutes.register('edit_user_audit_logs', '/_admin/users/%(user_id)s/edit/audit', ['user_id']);
137 pyroutes.register('edit_user_audit_logs_download', '/_admin/users/%(user_id)s/edit/audit/download', ['user_id']);
138 pyroutes.register('edit_user_auth_tokens', '/_admin/users/%(user_id)s/edit/auth_tokens', ['user_id']);
139 pyroutes.register('edit_user_auth_tokens_add', '/_admin/users/%(user_id)s/edit/auth_tokens/new', ['user_id']);
140 pyroutes.register('edit_user_auth_tokens_delete', '/_admin/users/%(user_id)s/edit/auth_tokens/delete', ['user_id']);
114 pyroutes.register('edit_user_auth_tokens_view', '/_admin/users/%(user_id)s/edit/auth_tokens/view', ['user_id']);
141 pyroutes.register('edit_user_auth_tokens_view', '/_admin/users/%(user_id)s/edit/auth_tokens/view', ['user_id']);
115 pyroutes.register('edit_user_auth_tokens_delete', '/_admin/users/%(user_id)s/edit/auth_tokens/delete', ['user_id']);
142 pyroutes.register('edit_user_caches', '/_admin/users/%(user_id)s/edit/caches', ['user_id']);
116 pyroutes.register('edit_user_ssh_keys', '/_admin/users/%(user_id)s/edit/ssh_keys', ['user_id']);
143 pyroutes.register('edit_user_caches_update', '/_admin/users/%(user_id)s/edit/caches/update', ['user_id']);
117 pyroutes.register('edit_user_ssh_keys_generate_keypair', '/_admin/users/%(user_id)s/edit/ssh_keys/generate', ['user_id']);
118 pyroutes.register('edit_user_ssh_keys_add', '/_admin/users/%(user_id)s/edit/ssh_keys/new', ['user_id']);
119 pyroutes.register('edit_user_ssh_keys_delete', '/_admin/users/%(user_id)s/edit/ssh_keys/delete', ['user_id']);
120 pyroutes.register('edit_user_emails', '/_admin/users/%(user_id)s/edit/emails', ['user_id']);
144 pyroutes.register('edit_user_emails', '/_admin/users/%(user_id)s/edit/emails', ['user_id']);
121 pyroutes.register('edit_user_emails_add', '/_admin/users/%(user_id)s/edit/emails/new', ['user_id']);
145 pyroutes.register('edit_user_emails_add', '/_admin/users/%(user_id)s/edit/emails/new', ['user_id']);
122 pyroutes.register('edit_user_emails_delete', '/_admin/users/%(user_id)s/edit/emails/delete', ['user_id']);
146 pyroutes.register('edit_user_emails_delete', '/_admin/users/%(user_id)s/edit/emails/delete', ['user_id']);
147 pyroutes.register('edit_user_group', '/_admin/user_groups/%(user_group_id)s/edit', ['user_group_id']);
148 pyroutes.register('edit_user_group_advanced', '/_admin/user_groups/%(user_group_id)s/edit/advanced', ['user_group_id']);
149 pyroutes.register('edit_user_group_advanced_sync', '/_admin/user_groups/%(user_group_id)s/edit/advanced/sync', ['user_group_id']);
150 pyroutes.register('edit_user_group_global_perms', '/_admin/user_groups/%(user_group_id)s/edit/global_permissions', ['user_group_id']);
151 pyroutes.register('edit_user_group_global_perms_update', '/_admin/user_groups/%(user_group_id)s/edit/global_permissions/update', ['user_group_id']);
152 pyroutes.register('edit_user_group_perms', '/_admin/user_groups/%(user_group_id)s/edit/permissions', ['user_group_id']);
153 pyroutes.register('edit_user_group_perms_summary', '/_admin/user_groups/%(user_group_id)s/edit/permissions_summary', ['user_group_id']);
154 pyroutes.register('edit_user_group_perms_summary_json', '/_admin/user_groups/%(user_group_id)s/edit/permissions_summary/json', ['user_group_id']);
155 pyroutes.register('edit_user_group_perms_update', '/_admin/user_groups/%(user_group_id)s/edit/permissions/update', ['user_group_id']);
156 pyroutes.register('edit_user_groups_management', '/_admin/users/%(user_id)s/edit/groups_management', ['user_id']);
157 pyroutes.register('edit_user_groups_management_updates', '/_admin/users/%(user_id)s/edit/edit_user_groups_management/updates', ['user_id']);
123 pyroutes.register('edit_user_ips', '/_admin/users/%(user_id)s/edit/ips', ['user_id']);
158 pyroutes.register('edit_user_ips', '/_admin/users/%(user_id)s/edit/ips', ['user_id']);
124 pyroutes.register('edit_user_ips_add', '/_admin/users/%(user_id)s/edit/ips/new', ['user_id']);
159 pyroutes.register('edit_user_ips_add', '/_admin/users/%(user_id)s/edit/ips/new', ['user_id']);
125 pyroutes.register('edit_user_ips_delete', '/_admin/users/%(user_id)s/edit/ips/delete', ['user_id']);
160 pyroutes.register('edit_user_ips_delete', '/_admin/users/%(user_id)s/edit/ips/delete', ['user_id']);
126 pyroutes.register('edit_user_perms_summary', '/_admin/users/%(user_id)s/edit/permissions_summary', ['user_id']);
161 pyroutes.register('edit_user_perms_summary', '/_admin/users/%(user_id)s/edit/permissions_summary', ['user_id']);
127 pyroutes.register('edit_user_perms_summary_json', '/_admin/users/%(user_id)s/edit/permissions_summary/json', ['user_id']);
162 pyroutes.register('edit_user_perms_summary_json', '/_admin/users/%(user_id)s/edit/permissions_summary/json', ['user_id']);
128 pyroutes.register('edit_user_groups_management', '/_admin/users/%(user_id)s/edit/groups_management', ['user_id']);
163 pyroutes.register('edit_user_ssh_keys', '/_admin/users/%(user_id)s/edit/ssh_keys', ['user_id']);
129 pyroutes.register('edit_user_groups_management_updates', '/_admin/users/%(user_id)s/edit/edit_user_groups_management/updates', ['user_id']);
164 pyroutes.register('edit_user_ssh_keys_add', '/_admin/users/%(user_id)s/edit/ssh_keys/new', ['user_id']);
130 pyroutes.register('edit_user_audit_logs', '/_admin/users/%(user_id)s/edit/audit', ['user_id']);
165 pyroutes.register('edit_user_ssh_keys_delete', '/_admin/users/%(user_id)s/edit/ssh_keys/delete', ['user_id']);
131 pyroutes.register('edit_user_audit_logs_download', '/_admin/users/%(user_id)s/edit/audit/download', ['user_id']);
166 pyroutes.register('edit_user_ssh_keys_generate_keypair', '/_admin/users/%(user_id)s/edit/ssh_keys/generate', ['user_id']);
132 pyroutes.register('edit_user_caches', '/_admin/users/%(user_id)s/edit/caches', ['user_id']);
167 pyroutes.register('favicon', '/favicon.ico', []);
133 pyroutes.register('edit_user_caches_update', '/_admin/users/%(user_id)s/edit/caches/update', ['user_id']);
168 pyroutes.register('file_preview', '/_file_preview', []);
134 pyroutes.register('user_groups', '/_admin/user_groups', []);
169 pyroutes.register('gist_delete', '/_admin/gists/%(gist_id)s/delete', ['gist_id']);
135 pyroutes.register('user_groups_data', '/_admin/user_groups_data', []);
170 pyroutes.register('gist_edit', '/_admin/gists/%(gist_id)s/edit', ['gist_id']);
136 pyroutes.register('user_groups_new', '/_admin/user_groups/new', []);
171 pyroutes.register('gist_edit_check_revision', '/_admin/gists/%(gist_id)s/edit/check_revision', ['gist_id']);
137 pyroutes.register('user_groups_create', '/_admin/user_groups/create', []);
172 pyroutes.register('gist_show', '/_admin/gists/%(gist_id)s', ['gist_id']);
138 pyroutes.register('repos', '/_admin/repos', []);
173 pyroutes.register('gist_show_formatted', '/_admin/gists/%(gist_id)s/rev/%(revision)s/%(format)s', ['gist_id', 'revision', 'format']);
139 pyroutes.register('repos_data', '/_admin/repos_data', []);
174 pyroutes.register('gist_show_formatted_path', '/_admin/gists/%(gist_id)s/rev/%(revision)s/%(format)s/%(f_path)s', ['gist_id', 'revision', 'format', 'f_path']);
140 pyroutes.register('repo_new', '/_admin/repos/new', []);
175 pyroutes.register('gist_show_rev', '/_admin/gists/%(gist_id)s/rev/%(revision)s', ['gist_id', 'revision']);
141 pyroutes.register('repo_create', '/_admin/repos/create', []);
176 pyroutes.register('gist_update', '/_admin/gists/%(gist_id)s/update', ['gist_id']);
142 pyroutes.register('repo_groups', '/_admin/repo_groups', []);
177 pyroutes.register('gists_create', '/_admin/gists/create', []);
143 pyroutes.register('repo_groups_data', '/_admin/repo_groups_data', []);
178 pyroutes.register('gists_new', '/_admin/gists/new', []);
144 pyroutes.register('repo_group_new', '/_admin/repo_group/new', []);
179 pyroutes.register('gists_show', '/_admin/gists', []);
145 pyroutes.register('repo_group_create', '/_admin/repo_group/create', []);
180 pyroutes.register('global_integrations_create', '/_admin/integrations/%(integration)s/new', ['integration']);
146 pyroutes.register('channelstream_connect', '/_admin/channelstream/connect', []);
181 pyroutes.register('global_integrations_edit', '/_admin/integrations/%(integration)s/%(integration_id)s', ['integration', 'integration_id']);
147 pyroutes.register('channelstream_subscribe', '/_admin/channelstream/subscribe', []);
182 pyroutes.register('global_integrations_home', '/_admin/integrations', []);
148 pyroutes.register('channelstream_proxy', '/_channelstream', []);
183 pyroutes.register('global_integrations_list', '/_admin/integrations/%(integration)s', ['integration']);
149 pyroutes.register('upload_file', '/_file_store/upload', []);
184 pyroutes.register('global_integrations_new', '/_admin/integrations/new', []);
150 pyroutes.register('download_file', '/_file_store/download/%(fid)s', ['fid']);
185 pyroutes.register('goto_switcher_data', '/_goto_data', []);
151 pyroutes.register('download_file_by_token', '/_file_store/token-download/%(_auth_token)s/%(fid)s', ['_auth_token', 'fid']);
152 pyroutes.register('logout', '/_admin/logout', []);
153 pyroutes.register('reset_password', '/_admin/password_reset', []);
154 pyroutes.register('reset_password_confirmation', '/_admin/password_reset_confirmation', []);
155 pyroutes.register('home', '/', []);
186 pyroutes.register('home', '/', []);
156 pyroutes.register('main_page_repos_data', '/_home_repos', []);
187 pyroutes.register('hovercard_pull_request', '/_hovercard/pull_request/%(pull_request_id)s', ['pull_request_id']);
157 pyroutes.register('main_page_repo_groups_data', '/_home_repo_groups', []);
188 pyroutes.register('hovercard_repo_commit', '/_hovercard/commit/%(repo_name)s/%(commit_id)s', ['repo_name', 'commit_id']);
158 pyroutes.register('user_autocomplete_data', '/_users', []);
189 pyroutes.register('hovercard_user', '/_hovercard/user/%(user_id)s', ['user_id']);
159 pyroutes.register('user_group_autocomplete_data', '/_user_groups', []);
190 pyroutes.register('hovercard_user_group', '/_hovercard/user_group/%(user_group_id)s', ['user_group_id']);
160 pyroutes.register('repo_list_data', '/_repos', []);
191 pyroutes.register('hovercard_username', '/_hovercard/username/%(username)s', ['username']);
161 pyroutes.register('repo_group_list_data', '/_repo_groups', []);
162 pyroutes.register('goto_switcher_data', '/_goto_data', []);
163 pyroutes.register('markup_preview', '/_markup_preview', []);
164 pyroutes.register('file_preview', '/_file_preview', []);
165 pyroutes.register('store_user_session_value', '/_store_session_attr', []);
166 pyroutes.register('journal', '/_admin/journal', []);
192 pyroutes.register('journal', '/_admin/journal', []);
167 pyroutes.register('journal_rss', '/_admin/journal/rss', []);
168 pyroutes.register('journal_atom', '/_admin/journal/atom', []);
193 pyroutes.register('journal_atom', '/_admin/journal/atom', []);
169 pyroutes.register('journal_public', '/_admin/public_journal', []);
194 pyroutes.register('journal_public', '/_admin/public_journal', []);
170 pyroutes.register('journal_public_atom', '/_admin/public_journal/atom', []);
195 pyroutes.register('journal_public_atom', '/_admin/public_journal/atom', []);
171 pyroutes.register('journal_public_atom_old', '/_admin/public_journal_atom', []);
196 pyroutes.register('journal_public_atom_old', '/_admin/public_journal_atom', []);
172 pyroutes.register('journal_public_rss', '/_admin/public_journal/rss', []);
197 pyroutes.register('journal_public_rss', '/_admin/public_journal/rss', []);
173 pyroutes.register('journal_public_rss_old', '/_admin/public_journal_rss', []);
198 pyroutes.register('journal_public_rss_old', '/_admin/public_journal_rss', []);
174 pyroutes.register('toggle_following', '/_admin/toggle_following', []);
199 pyroutes.register('journal_rss', '/_admin/journal/rss', []);
175 pyroutes.register('repo_creating', '/%(repo_name)s/repo_creating', ['repo_name']);
200 pyroutes.register('login', '/_admin/login', []);
176 pyroutes.register('repo_creating_check', '/%(repo_name)s/repo_creating_check', ['repo_name']);
201 pyroutes.register('logout', '/_admin/logout', []);
177 pyroutes.register('repo_summary_explicit', '/%(repo_name)s/summary', ['repo_name']);
202 pyroutes.register('main_page_repo_groups_data', '/_home_repo_groups', []);
178 pyroutes.register('repo_summary_commits', '/%(repo_name)s/summary-commits', ['repo_name']);
203 pyroutes.register('main_page_repos_data', '/_home_repos', []);
179 pyroutes.register('repo_commit', '/%(repo_name)s/changeset/%(commit_id)s', ['repo_name', 'commit_id']);
204 pyroutes.register('markup_preview', '/_markup_preview', []);
180 pyroutes.register('repo_commit_children', '/%(repo_name)s/changeset_children/%(commit_id)s', ['repo_name', 'commit_id']);
205 pyroutes.register('my_account_auth_tokens', '/_admin/my_account/auth_tokens', []);
181 pyroutes.register('repo_commit_parents', '/%(repo_name)s/changeset_parents/%(commit_id)s', ['repo_name', 'commit_id']);
206 pyroutes.register('my_account_auth_tokens_add', '/_admin/my_account/auth_tokens/new', []);
182 pyroutes.register('repo_commit_raw', '/%(repo_name)s/changeset-diff/%(commit_id)s', ['repo_name', 'commit_id']);
207 pyroutes.register('my_account_auth_tokens_delete', '/_admin/my_account/auth_tokens/delete', []);
183 pyroutes.register('repo_commit_patch', '/%(repo_name)s/changeset-patch/%(commit_id)s', ['repo_name', 'commit_id']);
208 pyroutes.register('my_account_auth_tokens_view', '/_admin/my_account/auth_tokens/view', []);
184 pyroutes.register('repo_commit_download', '/%(repo_name)s/changeset-download/%(commit_id)s', ['repo_name', 'commit_id']);
209 pyroutes.register('my_account_bookmarks', '/_admin/my_account/bookmarks', []);
185 pyroutes.register('repo_commit_data', '/%(repo_name)s/changeset-data/%(commit_id)s', ['repo_name', 'commit_id']);
210 pyroutes.register('my_account_bookmarks_update', '/_admin/my_account/bookmarks/update', []);
186 pyroutes.register('repo_commit_comment_create', '/%(repo_name)s/changeset/%(commit_id)s/comment/create', ['repo_name', 'commit_id']);
211 pyroutes.register('my_account_edit', '/_admin/my_account/edit', []);
187 pyroutes.register('repo_commit_comment_preview', '/%(repo_name)s/changeset/%(commit_id)s/comment/preview', ['repo_name', 'commit_id']);
212 pyroutes.register('my_account_emails', '/_admin/my_account/emails', []);
188 pyroutes.register('repo_commit_comment_history_view', '/%(repo_name)s/changeset/%(commit_id)s/comment/%(comment_history_id)s/history_view', ['repo_name', 'commit_id', 'comment_history_id']);
213 pyroutes.register('my_account_emails_add', '/_admin/my_account/emails/new', []);
189 pyroutes.register('repo_commit_comment_attachment_upload', '/%(repo_name)s/changeset/%(commit_id)s/comment/attachment_upload', ['repo_name', 'commit_id']);
214 pyroutes.register('my_account_emails_delete', '/_admin/my_account/emails/delete', []);
190 pyroutes.register('repo_commit_comment_delete', '/%(repo_name)s/changeset/%(commit_id)s/comment/%(comment_id)s/delete', ['repo_name', 'commit_id', 'comment_id']);
215 pyroutes.register('my_account_external_identity', '/_admin/my_account/external-identity', []);
191 pyroutes.register('repo_commit_comment_edit', '/%(repo_name)s/changeset/%(commit_id)s/comment/%(comment_id)s/edit', ['repo_name', 'commit_id', 'comment_id']);
216 pyroutes.register('my_account_external_identity_delete', '/_admin/my_account/external-identity/delete', []);
192 pyroutes.register('repo_commit_raw_deprecated', '/%(repo_name)s/raw-changeset/%(commit_id)s', ['repo_name', 'commit_id']);
217 pyroutes.register('my_account_goto_bookmark', '/_admin/my_account/bookmark/%(bookmark_id)s', ['bookmark_id']);
193 pyroutes.register('repo_archivefile', '/%(repo_name)s/archive/%(fname)s', ['repo_name', 'fname']);
218 pyroutes.register('my_account_notifications', '/_admin/my_account/notifications', []);
194 pyroutes.register('repo_files_diff', '/%(repo_name)s/diff/%(f_path)s', ['repo_name', 'f_path']);
219 pyroutes.register('my_account_notifications_test_channelstream', '/_admin/my_account/test_channelstream', []);
195 pyroutes.register('repo_files_diff_2way_redirect', '/%(repo_name)s/diff-2way/%(f_path)s', ['repo_name', 'f_path']);
220 pyroutes.register('my_account_notifications_toggle_visibility', '/_admin/my_account/toggle_visibility', []);
196 pyroutes.register('repo_files', '/%(repo_name)s/files/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
221 pyroutes.register('my_account_password', '/_admin/my_account/password', []);
197 pyroutes.register('repo_files:default_path', '/%(repo_name)s/files/%(commit_id)s/', ['repo_name', 'commit_id']);
222 pyroutes.register('my_account_password_update', '/_admin/my_account/password/update', []);
198 pyroutes.register('repo_files:default_commit', '/%(repo_name)s/files', ['repo_name']);
223 pyroutes.register('my_account_perms', '/_admin/my_account/perms', []);
199 pyroutes.register('repo_files:rendered', '/%(repo_name)s/render/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
224 pyroutes.register('my_account_profile', '/_admin/my_account/profile', []);
200 pyroutes.register('repo_files:annotated', '/%(repo_name)s/annotate/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
225 pyroutes.register('my_account_pullrequests', '/_admin/my_account/pull_requests', []);
201 pyroutes.register('repo_files:annotated_previous', '/%(repo_name)s/annotate-previous/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
226 pyroutes.register('my_account_pullrequests_data', '/_admin/my_account/pull_requests/data', []);
202 pyroutes.register('repo_nodetree_full', '/%(repo_name)s/nodetree_full/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
227 pyroutes.register('my_account_repos', '/_admin/my_account/repos', []);
203 pyroutes.register('repo_nodetree_full:default_path', '/%(repo_name)s/nodetree_full/%(commit_id)s/', ['repo_name', 'commit_id']);
228 pyroutes.register('my_account_ssh_keys', '/_admin/my_account/ssh_keys', []);
204 pyroutes.register('repo_files_nodelist', '/%(repo_name)s/nodelist/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
229 pyroutes.register('my_account_ssh_keys_add', '/_admin/my_account/ssh_keys/new', []);
205 pyroutes.register('repo_file_raw', '/%(repo_name)s/raw/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
230 pyroutes.register('my_account_ssh_keys_delete', '/_admin/my_account/ssh_keys/delete', []);
206 pyroutes.register('repo_file_download', '/%(repo_name)s/download/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
231 pyroutes.register('my_account_ssh_keys_generate', '/_admin/my_account/ssh_keys/generate', []);
207 pyroutes.register('repo_file_download:legacy', '/%(repo_name)s/rawfile/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
232 pyroutes.register('my_account_update', '/_admin/my_account/update', []);
208 pyroutes.register('repo_file_history', '/%(repo_name)s/history/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
233 pyroutes.register('my_account_user_group_membership', '/_admin/my_account/user_group_membership', []);
209 pyroutes.register('repo_file_authors', '/%(repo_name)s/authors/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
234 pyroutes.register('my_account_watched', '/_admin/my_account/watched', []);
210 pyroutes.register('repo_files_check_head', '/%(repo_name)s/check_head/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
235 pyroutes.register('notifications_delete', '/_admin/notifications/%(notification_id)s/delete', ['notification_id']);
211 pyroutes.register('repo_files_remove_file', '/%(repo_name)s/remove_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
236 pyroutes.register('notifications_mark_all_read', '/_admin/notifications_mark_all_read', []);
212 pyroutes.register('repo_files_delete_file', '/%(repo_name)s/delete_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
237 pyroutes.register('notifications_show', '/_admin/notifications/%(notification_id)s', ['notification_id']);
213 pyroutes.register('repo_files_edit_file', '/%(repo_name)s/edit_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
238 pyroutes.register('notifications_show_all', '/_admin/notifications', []);
214 pyroutes.register('repo_files_update_file', '/%(repo_name)s/update_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
239 pyroutes.register('notifications_update', '/_admin/notifications/%(notification_id)s/update', ['notification_id']);
215 pyroutes.register('repo_files_add_file', '/%(repo_name)s/add_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
240 pyroutes.register('ops_error_test', '/_admin/ops/error', []);
216 pyroutes.register('repo_files_upload_file', '/%(repo_name)s/upload_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
241 pyroutes.register('ops_ping', '/_admin/ops/ping', []);
217 pyroutes.register('repo_files_create_file', '/%(repo_name)s/create_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
242 pyroutes.register('ops_redirect_test', '/_admin/ops/redirect', []);
218 pyroutes.register('repo_refs_data', '/%(repo_name)s/refs-data', ['repo_name']);
243 pyroutes.register('plugin_admin_chat', '/_admin/plugin_admin_chat/%(action)s', ['action']);
219 pyroutes.register('repo_refs_changelog_data', '/%(repo_name)s/refs-data-changelog', ['repo_name']);
244 pyroutes.register('pull_requests_global', '/_admin/pull-request/%(pull_request_id)s', ['pull_request_id']);
220 pyroutes.register('repo_stats', '/%(repo_name)s/repo_stats/%(commit_id)s', ['repo_name', 'commit_id']);
245 pyroutes.register('pull_requests_global_0', '/_admin/pull_requests/%(pull_request_id)s', ['pull_request_id']);
221 pyroutes.register('repo_commits', '/%(repo_name)s/commits', ['repo_name']);
246 pyroutes.register('pull_requests_global_1', '/_admin/pull-requests/%(pull_request_id)s', ['pull_request_id']);
222 pyroutes.register('repo_commits_file', '/%(repo_name)s/commits/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
247 pyroutes.register('pullrequest_comment_create', '/%(repo_name)s/pull-request/%(pull_request_id)s/comment', ['repo_name', 'pull_request_id']);
223 pyroutes.register('repo_commits_elements', '/%(repo_name)s/commits_elements', ['repo_name']);
248 pyroutes.register('pullrequest_comment_delete', '/%(repo_name)s/pull-request/%(pull_request_id)s/comment/%(comment_id)s/delete', ['repo_name', 'pull_request_id', 'comment_id']);
224 pyroutes.register('repo_commits_elements_file', '/%(repo_name)s/commits_elements/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
249 pyroutes.register('pullrequest_comment_edit', '/%(repo_name)s/pull-request/%(pull_request_id)s/comment/%(comment_id)s/edit', ['repo_name', 'pull_request_id', 'comment_id']);
225 pyroutes.register('repo_changelog', '/%(repo_name)s/changelog', ['repo_name']);
250 pyroutes.register('pullrequest_comments', '/%(repo_name)s/pull-request/%(pull_request_id)s/comments', ['repo_name', 'pull_request_id']);
226 pyroutes.register('repo_changelog_file', '/%(repo_name)s/changelog/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
251 pyroutes.register('pullrequest_create', '/%(repo_name)s/pull-request/create', ['repo_name']);
227 pyroutes.register('repo_compare_select', '/%(repo_name)s/compare', ['repo_name']);
252 pyroutes.register('pullrequest_delete', '/%(repo_name)s/pull-request/%(pull_request_id)s/delete', ['repo_name', 'pull_request_id']);
228 pyroutes.register('repo_compare', '/%(repo_name)s/compare/%(source_ref_type)s@%(source_ref)s...%(target_ref_type)s@%(target_ref)s', ['repo_name', 'source_ref_type', 'source_ref', 'target_ref_type', 'target_ref']);
253 pyroutes.register('pullrequest_draft_comments_submit', '/%(repo_name)s/pull-request/%(pull_request_id)s/draft_comments_submit', ['repo_name', 'pull_request_id']);
229 pyroutes.register('tags_home', '/%(repo_name)s/tags', ['repo_name']);
254 pyroutes.register('pullrequest_drafts', '/%(repo_name)s/pull-request/%(pull_request_id)s/drafts', ['repo_name', 'pull_request_id']);
230 pyroutes.register('branches_home', '/%(repo_name)s/branches', ['repo_name']);
255 pyroutes.register('pullrequest_merge', '/%(repo_name)s/pull-request/%(pull_request_id)s/merge', ['repo_name', 'pull_request_id']);
231 pyroutes.register('bookmarks_home', '/%(repo_name)s/bookmarks', ['repo_name']);
256 pyroutes.register('pullrequest_new', '/%(repo_name)s/pull-request/new', ['repo_name']);
232 pyroutes.register('repo_fork_new', '/%(repo_name)s/fork', ['repo_name']);
257 pyroutes.register('pullrequest_repo_refs', '/%(repo_name)s/pull-request/refs/%(target_repo_name)s', ['repo_name', 'target_repo_name']);
233 pyroutes.register('repo_fork_create', '/%(repo_name)s/fork/create', ['repo_name']);
258 pyroutes.register('pullrequest_repo_targets', '/%(repo_name)s/pull-request/repo-targets', ['repo_name']);
234 pyroutes.register('repo_forks_show_all', '/%(repo_name)s/forks', ['repo_name']);
235 pyroutes.register('repo_forks_data', '/%(repo_name)s/forks/data', ['repo_name']);
236 pyroutes.register('pullrequest_show', '/%(repo_name)s/pull-request/%(pull_request_id)s', ['repo_name', 'pull_request_id']);
259 pyroutes.register('pullrequest_show', '/%(repo_name)s/pull-request/%(pull_request_id)s', ['repo_name', 'pull_request_id']);
237 pyroutes.register('pullrequest_show_all', '/%(repo_name)s/pull-request', ['repo_name']);
260 pyroutes.register('pullrequest_show_all', '/%(repo_name)s/pull-request', ['repo_name']);
238 pyroutes.register('pullrequest_show_all_data', '/%(repo_name)s/pull-request-data', ['repo_name']);
261 pyroutes.register('pullrequest_show_all_data', '/%(repo_name)s/pull-request-data', ['repo_name']);
239 pyroutes.register('pullrequest_repo_refs', '/%(repo_name)s/pull-request/refs/%(target_repo_name)s', ['repo_name', 'target_repo_name']);
262 pyroutes.register('pullrequest_todos', '/%(repo_name)s/pull-request/%(pull_request_id)s/todos', ['repo_name', 'pull_request_id']);
240 pyroutes.register('pullrequest_repo_targets', '/%(repo_name)s/pull-request/repo-targets', ['repo_name']);
241 pyroutes.register('pullrequest_new', '/%(repo_name)s/pull-request/new', ['repo_name']);
242 pyroutes.register('pullrequest_create', '/%(repo_name)s/pull-request/create', ['repo_name']);
243 pyroutes.register('pullrequest_update', '/%(repo_name)s/pull-request/%(pull_request_id)s/update', ['repo_name', 'pull_request_id']);
263 pyroutes.register('pullrequest_update', '/%(repo_name)s/pull-request/%(pull_request_id)s/update', ['repo_name', 'pull_request_id']);
244 pyroutes.register('pullrequest_merge', '/%(repo_name)s/pull-request/%(pull_request_id)s/merge', ['repo_name', 'pull_request_id']);
264 pyroutes.register('register', '/_admin/register', []);
245 pyroutes.register('pullrequest_delete', '/%(repo_name)s/pull-request/%(pull_request_id)s/delete', ['repo_name', 'pull_request_id']);
265 pyroutes.register('repo_archivefile', '/%(repo_name)s/archive/%(fname)s', ['repo_name', 'fname']);
246 pyroutes.register('pullrequest_comment_create', '/%(repo_name)s/pull-request/%(pull_request_id)s/comment', ['repo_name', 'pull_request_id']);
266 pyroutes.register('repo_artifacts_data', '/%(repo_name)s/artifacts_data', ['repo_name']);
247 pyroutes.register('pullrequest_comment_edit', '/%(repo_name)s/pull-request/%(pull_request_id)s/comment/%(comment_id)s/edit', ['repo_name', 'pull_request_id', 'comment_id']);
267 pyroutes.register('repo_artifacts_delete', '/%(repo_name)s/artifacts/delete/%(uid)s', ['repo_name', 'uid']);
248 pyroutes.register('pullrequest_comment_delete', '/%(repo_name)s/pull-request/%(pull_request_id)s/comment/%(comment_id)s/delete', ['repo_name', 'pull_request_id', 'comment_id']);
268 pyroutes.register('repo_artifacts_get', '/%(repo_name)s/artifacts/download/%(uid)s', ['repo_name', 'uid']);
249 pyroutes.register('pullrequest_comments', '/%(repo_name)s/pull-request/%(pull_request_id)s/comments', ['repo_name', 'pull_request_id']);
269 pyroutes.register('repo_artifacts_info', '/%(repo_name)s/artifacts/info/%(uid)s', ['repo_name', 'uid']);
250 pyroutes.register('pullrequest_todos', '/%(repo_name)s/pull-request/%(pull_request_id)s/todos', ['repo_name', 'pull_request_id']);
270 pyroutes.register('repo_artifacts_list', '/%(repo_name)s/artifacts', ['repo_name']);
251 pyroutes.register('pullrequest_drafts', '/%(repo_name)s/pull-request/%(pull_request_id)s/drafts', ['repo_name', 'pull_request_id']);
271 pyroutes.register('repo_artifacts_new', '/%(repo_name)s/artifacts/new', ['repo_name']);
252 pyroutes.register('edit_repo', '/%(repo_name)s/settings', ['repo_name']);
272 pyroutes.register('repo_artifacts_store', '/%(repo_name)s/artifacts/store', ['repo_name']);
253 pyroutes.register('edit_repo_advanced', '/%(repo_name)s/settings/advanced', ['repo_name']);
273 pyroutes.register('repo_artifacts_update', '/%(repo_name)s/artifacts/update/%(uid)s', ['repo_name', 'uid']);
254 pyroutes.register('edit_repo_advanced_archive', '/%(repo_name)s/settings/advanced/archive', ['repo_name']);
274 pyroutes.register('repo_automation', '/%(repo_name)s/settings/automation', ['repo_name']);
255 pyroutes.register('edit_repo_advanced_delete', '/%(repo_name)s/settings/advanced/delete', ['repo_name']);
275 pyroutes.register('repo_automation_update', '/%(repo_name)s/settings/automation/%(entry_id)s/update', ['repo_name', 'entry_id']);
256 pyroutes.register('edit_repo_advanced_locking', '/%(repo_name)s/settings/advanced/locking', ['repo_name']);
276 pyroutes.register('repo_changelog', '/%(repo_name)s/changelog', ['repo_name']);
257 pyroutes.register('edit_repo_advanced_journal', '/%(repo_name)s/settings/advanced/journal', ['repo_name']);
277 pyroutes.register('repo_changelog_file', '/%(repo_name)s/changelog/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
258 pyroutes.register('edit_repo_advanced_fork', '/%(repo_name)s/settings/advanced/fork', ['repo_name']);
278 pyroutes.register('repo_commit', '/%(repo_name)s/changeset/%(commit_id)s', ['repo_name', 'commit_id']);
259 pyroutes.register('edit_repo_advanced_hooks', '/%(repo_name)s/settings/advanced/hooks', ['repo_name']);
279 pyroutes.register('repo_commit_children', '/%(repo_name)s/changeset_children/%(commit_id)s', ['repo_name', 'commit_id']);
260 pyroutes.register('edit_repo_caches', '/%(repo_name)s/settings/caches', ['repo_name']);
280 pyroutes.register('repo_commit_comment_attachment_upload', '/%(repo_name)s/changeset/%(commit_id)s/comment/attachment_upload', ['repo_name', 'commit_id']);
261 pyroutes.register('edit_repo_perms', '/%(repo_name)s/settings/permissions', ['repo_name']);
281 pyroutes.register('repo_commit_comment_create', '/%(repo_name)s/changeset/%(commit_id)s/comment/create', ['repo_name', 'commit_id']);
262 pyroutes.register('edit_repo_perms_set_private', '/%(repo_name)s/settings/permissions/set_private', ['repo_name']);
282 pyroutes.register('repo_commit_comment_delete', '/%(repo_name)s/changeset/%(commit_id)s/comment/%(comment_id)s/delete', ['repo_name', 'commit_id', 'comment_id']);
263 pyroutes.register('edit_repo_maintenance', '/%(repo_name)s/settings/maintenance', ['repo_name']);
283 pyroutes.register('repo_commit_comment_edit', '/%(repo_name)s/changeset/%(commit_id)s/comment/%(comment_id)s/edit', ['repo_name', 'commit_id', 'comment_id']);
264 pyroutes.register('edit_repo_maintenance_execute', '/%(repo_name)s/settings/maintenance/execute', ['repo_name']);
284 pyroutes.register('repo_commit_comment_history_view', '/%(repo_name)s/changeset/%(commit_id)s/comment/%(comment_history_id)s/history_view', ['repo_name', 'commit_id', 'comment_history_id']);
265 pyroutes.register('edit_repo_fields', '/%(repo_name)s/settings/fields', ['repo_name']);
285 pyroutes.register('repo_commit_comment_preview', '/%(repo_name)s/changeset/%(commit_id)s/comment/preview', ['repo_name', 'commit_id']);
266 pyroutes.register('edit_repo_fields_create', '/%(repo_name)s/settings/fields/create', ['repo_name']);
286 pyroutes.register('repo_commit_data', '/%(repo_name)s/changeset-data/%(commit_id)s', ['repo_name', 'commit_id']);
267 pyroutes.register('edit_repo_fields_delete', '/%(repo_name)s/settings/fields/%(field_id)s/delete', ['repo_name', 'field_id']);
287 pyroutes.register('repo_commit_download', '/%(repo_name)s/changeset-download/%(commit_id)s', ['repo_name', 'commit_id']);
288 pyroutes.register('repo_commit_parents', '/%(repo_name)s/changeset_parents/%(commit_id)s', ['repo_name', 'commit_id']);
289 pyroutes.register('repo_commit_patch', '/%(repo_name)s/changeset-patch/%(commit_id)s', ['repo_name', 'commit_id']);
290 pyroutes.register('repo_commit_raw', '/%(repo_name)s/changeset-diff/%(commit_id)s', ['repo_name', 'commit_id']);
291 pyroutes.register('repo_commit_raw_deprecated', '/%(repo_name)s/raw-changeset/%(commit_id)s', ['repo_name', 'commit_id']);
292 pyroutes.register('repo_commits', '/%(repo_name)s/commits', ['repo_name']);
293 pyroutes.register('repo_commits_elements', '/%(repo_name)s/commits_elements', ['repo_name']);
294 pyroutes.register('repo_commits_elements_file', '/%(repo_name)s/commits_elements/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
295 pyroutes.register('repo_commits_file', '/%(repo_name)s/commits/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
296 pyroutes.register('repo_compare', '/%(repo_name)s/compare/%(source_ref_type)s@%(source_ref)s...%(target_ref_type)s@%(target_ref)s', ['repo_name', 'source_ref_type', 'source_ref', 'target_ref_type', 'target_ref']);
297 pyroutes.register('repo_compare_select', '/%(repo_name)s/compare', ['repo_name']);
298 pyroutes.register('repo_create', '/_admin/repos/create', []);
299 pyroutes.register('repo_creating', '/%(repo_name)s/repo_creating', ['repo_name']);
300 pyroutes.register('repo_creating_check', '/%(repo_name)s/repo_creating_check', ['repo_name']);
301 pyroutes.register('repo_default_reviewers_data', '/%(repo_name)s/settings/review/default-reviewers', ['repo_name']);
268 pyroutes.register('repo_edit_toggle_locking', '/%(repo_name)s/settings/toggle_locking', ['repo_name']);
302 pyroutes.register('repo_edit_toggle_locking', '/%(repo_name)s/settings/toggle_locking', ['repo_name']);
269 pyroutes.register('edit_repo_remote', '/%(repo_name)s/settings/remote', ['repo_name']);
303 pyroutes.register('repo_file_authors', '/%(repo_name)s/authors/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
270 pyroutes.register('edit_repo_remote_pull', '/%(repo_name)s/settings/remote/pull', ['repo_name']);
304 pyroutes.register('repo_file_download', '/%(repo_name)s/download/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
271 pyroutes.register('edit_repo_statistics', '/%(repo_name)s/settings/statistics', ['repo_name']);
305 pyroutes.register('repo_file_download:legacy', '/%(repo_name)s/rawfile/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
272 pyroutes.register('edit_repo_statistics_reset', '/%(repo_name)s/settings/statistics/update', ['repo_name']);
306 pyroutes.register('repo_file_history', '/%(repo_name)s/history/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
273 pyroutes.register('edit_repo_issuetracker', '/%(repo_name)s/settings/issue_trackers', ['repo_name']);
307 pyroutes.register('repo_file_raw', '/%(repo_name)s/raw/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
274 pyroutes.register('edit_repo_issuetracker_test', '/%(repo_name)s/settings/issue_trackers/test', ['repo_name']);
308 pyroutes.register('repo_files', '/%(repo_name)s/files/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
275 pyroutes.register('edit_repo_issuetracker_delete', '/%(repo_name)s/settings/issue_trackers/delete', ['repo_name']);
309 pyroutes.register('repo_files:annotated', '/%(repo_name)s/annotate/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
276 pyroutes.register('edit_repo_issuetracker_update', '/%(repo_name)s/settings/issue_trackers/update', ['repo_name']);
310 pyroutes.register('repo_files:annotated_previous', '/%(repo_name)s/annotate-previous/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
277 pyroutes.register('edit_repo_vcs', '/%(repo_name)s/settings/vcs', ['repo_name']);
311 pyroutes.register('repo_files:default_commit', '/%(repo_name)s/files', ['repo_name']);
278 pyroutes.register('edit_repo_vcs_update', '/%(repo_name)s/settings/vcs/update', ['repo_name']);
312 pyroutes.register('repo_files:default_path', '/%(repo_name)s/files/%(commit_id)s/', ['repo_name', 'commit_id']);
279 pyroutes.register('edit_repo_vcs_svn_pattern_delete', '/%(repo_name)s/settings/vcs/svn_pattern/delete', ['repo_name']);
313 pyroutes.register('repo_files:rendered', '/%(repo_name)s/render/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
280 pyroutes.register('repo_reviewers', '/%(repo_name)s/settings/review/rules', ['repo_name']);
314 pyroutes.register('repo_files_add_file', '/%(repo_name)s/add_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
281 pyroutes.register('repo_default_reviewers_data', '/%(repo_name)s/settings/review/default-reviewers', ['repo_name']);
315 pyroutes.register('repo_files_check_head', '/%(repo_name)s/check_head/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
282 pyroutes.register('edit_repo_strip', '/%(repo_name)s/settings/strip', ['repo_name']);
316 pyroutes.register('repo_files_create_file', '/%(repo_name)s/create_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
283 pyroutes.register('strip_check', '/%(repo_name)s/settings/strip_check', ['repo_name']);
317 pyroutes.register('repo_files_delete_file', '/%(repo_name)s/delete_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
284 pyroutes.register('strip_execute', '/%(repo_name)s/settings/strip_execute', ['repo_name']);
318 pyroutes.register('repo_files_diff', '/%(repo_name)s/diff/%(f_path)s', ['repo_name', 'f_path']);
285 pyroutes.register('edit_repo_audit_logs', '/%(repo_name)s/settings/audit_logs', ['repo_name']);
319 pyroutes.register('repo_files_diff_2way_redirect', '/%(repo_name)s/diff-2way/%(f_path)s', ['repo_name', 'f_path']);
286 pyroutes.register('rss_feed_home', '/%(repo_name)s/feed-rss', ['repo_name']);
320 pyroutes.register('repo_files_edit_file', '/%(repo_name)s/edit_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
287 pyroutes.register('atom_feed_home', '/%(repo_name)s/feed-atom', ['repo_name']);
321 pyroutes.register('repo_files_nodelist', '/%(repo_name)s/nodelist/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
288 pyroutes.register('rss_feed_home_old', '/%(repo_name)s/feed/rss', ['repo_name']);
322 pyroutes.register('repo_files_remove_file', '/%(repo_name)s/remove_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
289 pyroutes.register('atom_feed_home_old', '/%(repo_name)s/feed/atom', ['repo_name']);
323 pyroutes.register('repo_files_update_file', '/%(repo_name)s/update_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
290 pyroutes.register('repo_summary', '/%(repo_name)s', ['repo_name']);
324 pyroutes.register('repo_files_upload_file', '/%(repo_name)s/upload_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
291 pyroutes.register('repo_summary_slash', '/%(repo_name)s/', ['repo_name']);
325 pyroutes.register('repo_fork_create', '/%(repo_name)s/fork/create', ['repo_name']);
292 pyroutes.register('edit_repo_group', '/%(repo_group_name)s/_edit', ['repo_group_name']);
326 pyroutes.register('repo_fork_new', '/%(repo_name)s/fork', ['repo_name']);
293 pyroutes.register('edit_repo_group_advanced', '/%(repo_group_name)s/_settings/advanced', ['repo_group_name']);
327 pyroutes.register('repo_forks_data', '/%(repo_name)s/forks/data', ['repo_name']);
294 pyroutes.register('edit_repo_group_advanced_delete', '/%(repo_group_name)s/_settings/advanced/delete', ['repo_group_name']);
328 pyroutes.register('repo_forks_show_all', '/%(repo_name)s/forks', ['repo_name']);
295 pyroutes.register('edit_repo_group_perms', '/%(repo_group_name)s/_settings/permissions', ['repo_group_name']);
329 pyroutes.register('repo_group_create', '/_admin/repo_group/create', []);
296 pyroutes.register('edit_repo_group_perms_update', '/%(repo_group_name)s/_settings/permissions/update', ['repo_group_name']);
297 pyroutes.register('repo_group_home', '/%(repo_group_name)s', ['repo_group_name']);
330 pyroutes.register('repo_group_home', '/%(repo_group_name)s', ['repo_group_name']);
298 pyroutes.register('repo_group_home_slash', '/%(repo_group_name)s/', ['repo_group_name']);
331 pyroutes.register('repo_group_home_slash', '/%(repo_group_name)s/', ['repo_group_name']);
299 pyroutes.register('user_group_members_data', '/_admin/user_groups/%(user_group_id)s/members', ['user_group_id']);
332 pyroutes.register('repo_group_integrations_create', '/%(repo_group_name)s/_settings/integrations/%(integration)s/new', ['repo_group_name', 'integration']);
300 pyroutes.register('edit_user_group_perms_summary', '/_admin/user_groups/%(user_group_id)s/edit/permissions_summary', ['user_group_id']);
333 pyroutes.register('repo_group_integrations_edit', '/%(repo_group_name)s/_settings/integrations/%(integration)s/%(integration_id)s', ['repo_group_name', 'integration', 'integration_id']);
301 pyroutes.register('edit_user_group_perms_summary_json', '/_admin/user_groups/%(user_group_id)s/edit/permissions_summary/json', ['user_group_id']);
334 pyroutes.register('repo_group_integrations_home', '/%(repo_group_name)s/_settings/integrations', ['repo_group_name']);
302 pyroutes.register('edit_user_group', '/_admin/user_groups/%(user_group_id)s/edit', ['user_group_id']);
335 pyroutes.register('repo_group_integrations_list', '/%(repo_group_name)s/_settings/integrations/%(integration)s', ['repo_group_name', 'integration']);
303 pyroutes.register('user_groups_update', '/_admin/user_groups/%(user_group_id)s/update', ['user_group_id']);
336 pyroutes.register('repo_group_integrations_new', '/%(repo_group_name)s/_settings/integrations/new', ['repo_group_name']);
304 pyroutes.register('edit_user_group_global_perms', '/_admin/user_groups/%(user_group_id)s/edit/global_permissions', ['user_group_id']);
337 pyroutes.register('repo_group_list_data', '/_repo_groups', []);
305 pyroutes.register('edit_user_group_global_perms_update', '/_admin/user_groups/%(user_group_id)s/edit/global_permissions/update', ['user_group_id']);
338 pyroutes.register('repo_group_new', '/_admin/repo_group/new', []);
306 pyroutes.register('edit_user_group_perms', '/_admin/user_groups/%(user_group_id)s/edit/permissions', ['user_group_id']);
339 pyroutes.register('repo_groups', '/_admin/repo_groups', []);
307 pyroutes.register('edit_user_group_perms_update', '/_admin/user_groups/%(user_group_id)s/edit/permissions/update', ['user_group_id']);
340 pyroutes.register('repo_groups_data', '/_admin/repo_groups_data', []);
308 pyroutes.register('edit_user_group_advanced', '/_admin/user_groups/%(user_group_id)s/edit/advanced', ['user_group_id']);
341 pyroutes.register('repo_integrations_create', '/%(repo_name)s/settings/integrations/%(integration)s/new', ['repo_name', 'integration']);
309 pyroutes.register('edit_user_group_advanced_sync', '/_admin/user_groups/%(user_group_id)s/edit/advanced/sync', ['user_group_id']);
342 pyroutes.register('repo_integrations_edit', '/%(repo_name)s/settings/integrations/%(integration)s/%(integration_id)s', ['repo_name', 'integration', 'integration_id']);
310 pyroutes.register('user_groups_delete', '/_admin/user_groups/%(user_group_id)s/delete', ['user_group_id']);
343 pyroutes.register('repo_integrations_home', '/%(repo_name)s/settings/integrations', ['repo_name']);
344 pyroutes.register('repo_integrations_list', '/%(repo_name)s/settings/integrations/%(integration)s', ['repo_name', 'integration']);
345 pyroutes.register('repo_integrations_new', '/%(repo_name)s/settings/integrations/new', ['repo_name']);
346 pyroutes.register('repo_list_data', '/_repos', []);
347 pyroutes.register('repo_new', '/_admin/repos/new', []);
348 pyroutes.register('repo_nodetree_full', '/%(repo_name)s/nodetree_full/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
349 pyroutes.register('repo_nodetree_full:default_path', '/%(repo_name)s/nodetree_full/%(commit_id)s/', ['repo_name', 'commit_id']);
350 pyroutes.register('repo_refs_changelog_data', '/%(repo_name)s/refs-data-changelog', ['repo_name']);
351 pyroutes.register('repo_refs_data', '/%(repo_name)s/refs-data', ['repo_name']);
352 pyroutes.register('repo_reviewers', '/%(repo_name)s/settings/review/rules', ['repo_name']);
353 pyroutes.register('repo_reviewers_review_rule_delete', '/%(repo_name)s/settings/review/rules/%(rule_id)s/delete', ['repo_name', 'rule_id']);
354 pyroutes.register('repo_reviewers_review_rule_edit', '/%(repo_name)s/settings/review/rules/%(rule_id)s', ['repo_name', 'rule_id']);
355 pyroutes.register('repo_reviewers_review_rule_new', '/%(repo_name)s/settings/review/rules/new', ['repo_name']);
356 pyroutes.register('repo_stats', '/%(repo_name)s/repo_stats/%(commit_id)s', ['repo_name', 'commit_id']);
357 pyroutes.register('repo_summary', '/%(repo_name)s', ['repo_name']);
358 pyroutes.register('repo_summary_commits', '/%(repo_name)s/summary-commits', ['repo_name']);
359 pyroutes.register('repo_summary_explicit', '/%(repo_name)s/summary', ['repo_name']);
360 pyroutes.register('repo_summary_slash', '/%(repo_name)s/', ['repo_name']);
361 pyroutes.register('repos', '/_admin/repos', []);
362 pyroutes.register('repos_data', '/_admin/repos_data', []);
363 pyroutes.register('reset_password', '/_admin/password_reset', []);
364 pyroutes.register('reset_password_confirmation', '/_admin/password_reset_confirmation', []);
365 pyroutes.register('robots', '/robots.txt', []);
366 pyroutes.register('rss_feed_home', '/%(repo_name)s/feed-rss', ['repo_name']);
367 pyroutes.register('rss_feed_home_old', '/%(repo_name)s/feed/rss', ['repo_name']);
311 pyroutes.register('search', '/_admin/search', []);
368 pyroutes.register('search', '/_admin/search', []);
312 pyroutes.register('search_repo', '/%(repo_name)s/_search', ['repo_name']);
369 pyroutes.register('search_repo', '/%(repo_name)s/_search', ['repo_name']);
313 pyroutes.register('search_repo_alt', '/%(repo_name)s/search', ['repo_name']);
370 pyroutes.register('search_repo_alt', '/%(repo_name)s/search', ['repo_name']);
314 pyroutes.register('search_repo_group', '/%(repo_group_name)s/_search', ['repo_group_name']);
371 pyroutes.register('search_repo_group', '/%(repo_group_name)s/_search', ['repo_group_name']);
315 pyroutes.register('user_profile', '/_profiles/%(username)s', ['username']);
372 pyroutes.register('store_user_session_value', '/_store_session_attr', []);
373 pyroutes.register('strip_check', '/%(repo_name)s/settings/strip_check', ['repo_name']);
374 pyroutes.register('strip_execute', '/%(repo_name)s/settings/strip_execute', ['repo_name']);
375 pyroutes.register('tags_home', '/%(repo_name)s/tags', ['repo_name']);
376 pyroutes.register('toggle_following', '/_admin/toggle_following', []);
377 pyroutes.register('upload_file', '/_file_store/upload', []);
378 pyroutes.register('user_autocomplete_data', '/_users', []);
379 pyroutes.register('user_create_personal_repo_group', '/_admin/users/%(user_id)s/create_repo_group', ['user_id']);
380 pyroutes.register('user_delete', '/_admin/users/%(user_id)s/delete', ['user_id']);
381 pyroutes.register('user_disable_force_password_reset', '/_admin/users/%(user_id)s/password_reset_disable', ['user_id']);
382 pyroutes.register('user_edit', '/_admin/users/%(user_id)s/edit', ['user_id']);
383 pyroutes.register('user_edit_advanced', '/_admin/users/%(user_id)s/edit/advanced', ['user_id']);
384 pyroutes.register('user_edit_global_perms', '/_admin/users/%(user_id)s/edit/global_permissions', ['user_id']);
385 pyroutes.register('user_edit_global_perms_update', '/_admin/users/%(user_id)s/edit/global_permissions/update', ['user_id']);
386 pyroutes.register('user_enable_force_password_reset', '/_admin/users/%(user_id)s/password_reset_enable', ['user_id']);
387 pyroutes.register('user_group_autocomplete_data', '/_user_groups', []);
388 pyroutes.register('user_group_members_data', '/_admin/user_groups/%(user_group_id)s/members', ['user_group_id']);
316 pyroutes.register('user_group_profile', '/_profile_user_group/%(user_group_name)s', ['user_group_name']);
389 pyroutes.register('user_group_profile', '/_profile_user_group/%(user_group_name)s', ['user_group_name']);
317 pyroutes.register('my_account_profile', '/_admin/my_account/profile', []);
390 pyroutes.register('user_groups', '/_admin/user_groups', []);
318 pyroutes.register('my_account_edit', '/_admin/my_account/edit', []);
391 pyroutes.register('user_groups_create', '/_admin/user_groups/create', []);
319 pyroutes.register('my_account_update', '/_admin/my_account/update', []);
392 pyroutes.register('user_groups_data', '/_admin/user_groups_data', []);
320 pyroutes.register('my_account_password', '/_admin/my_account/password', []);
393 pyroutes.register('user_groups_delete', '/_admin/user_groups/%(user_group_id)s/delete', ['user_group_id']);
321 pyroutes.register('my_account_password_update', '/_admin/my_account/password/update', []);
394 pyroutes.register('user_groups_new', '/_admin/user_groups/new', []);
322 pyroutes.register('my_account_auth_tokens_view', '/_admin/my_account/auth_tokens/view', []);
395 pyroutes.register('user_groups_update', '/_admin/user_groups/%(user_group_id)s/update', ['user_group_id']);
323 pyroutes.register('my_account_auth_tokens_delete', '/_admin/my_account/auth_tokens/delete', []);
396 pyroutes.register('user_notice_dismiss', '/_admin/users/%(user_id)s/notice_dismiss', ['user_id']);
324 pyroutes.register('my_account_ssh_keys', '/_admin/my_account/ssh_keys', []);
397 pyroutes.register('user_profile', '/_profiles/%(username)s', ['username']);
325 pyroutes.register('my_account_ssh_keys_generate', '/_admin/my_account/ssh_keys/generate', []);
398 pyroutes.register('user_update', '/_admin/users/%(user_id)s/update', ['user_id']);
326 pyroutes.register('my_account_ssh_keys_add', '/_admin/my_account/ssh_keys/new', []);
399 pyroutes.register('users', '/_admin/users', []);
327 pyroutes.register('my_account_ssh_keys_delete', '/_admin/my_account/ssh_keys/delete', []);
400 pyroutes.register('users_create', '/_admin/users/create', []);
328 pyroutes.register('my_account_user_group_membership', '/_admin/my_account/user_group_membership', []);
401 pyroutes.register('users_data', '/_admin/users_data', []);
329 pyroutes.register('my_account_emails', '/_admin/my_account/emails', []);
402 pyroutes.register('users_new', '/_admin/users/new', []);
330 pyroutes.register('my_account_emails_add', '/_admin/my_account/emails/new', []);
331 pyroutes.register('my_account_emails_delete', '/_admin/my_account/emails/delete', []);
332 pyroutes.register('my_account_repos', '/_admin/my_account/repos', []);
333 pyroutes.register('my_account_watched', '/_admin/my_account/watched', []);
334 pyroutes.register('my_account_bookmarks', '/_admin/my_account/bookmarks', []);
335 pyroutes.register('my_account_bookmarks_update', '/_admin/my_account/bookmarks/update', []);
336 pyroutes.register('my_account_goto_bookmark', '/_admin/my_account/bookmark/%(bookmark_id)s', ['bookmark_id']);
337 pyroutes.register('my_account_perms', '/_admin/my_account/perms', []);
338 pyroutes.register('my_account_notifications', '/_admin/my_account/notifications', []);
339 pyroutes.register('my_account_notifications_toggle_visibility', '/_admin/my_account/toggle_visibility', []);
340 pyroutes.register('my_account_pullrequests', '/_admin/my_account/pull_requests', []);
341 pyroutes.register('my_account_pullrequests_data', '/_admin/my_account/pull_requests/data', []);
342 pyroutes.register('notifications_show_all', '/_admin/notifications', []);
343 pyroutes.register('notifications_mark_all_read', '/_admin/notifications/mark_all_read', []);
344 pyroutes.register('notifications_show', '/_admin/notifications/%(notification_id)s', ['notification_id']);
345 pyroutes.register('notifications_update', '/_admin/notifications/%(notification_id)s/update', ['notification_id']);
346 pyroutes.register('notifications_delete', '/_admin/notifications/%(notification_id)s/delete', ['notification_id']);
347 pyroutes.register('my_account_notifications_test_channelstream', '/_admin/my_account/test_channelstream', []);
348 pyroutes.register('gists_show', '/_admin/gists', []);
349 pyroutes.register('gists_new', '/_admin/gists/new', []);
350 pyroutes.register('gists_create', '/_admin/gists/create', []);
351 pyroutes.register('gist_show', '/_admin/gists/%(gist_id)s', ['gist_id']);
352 pyroutes.register('gist_delete', '/_admin/gists/%(gist_id)s/delete', ['gist_id']);
353 pyroutes.register('gist_edit', '/_admin/gists/%(gist_id)s/edit', ['gist_id']);
354 pyroutes.register('gist_edit_check_revision', '/_admin/gists/%(gist_id)s/edit/check_revision', ['gist_id']);
355 pyroutes.register('gist_update', '/_admin/gists/%(gist_id)s/update', ['gist_id']);
356 pyroutes.register('gist_show_rev', '/_admin/gists/%(gist_id)s/%(revision)s', ['gist_id', 'revision']);
357 pyroutes.register('gist_show_formatted', '/_admin/gists/%(gist_id)s/%(revision)s/%(format)s', ['gist_id', 'revision', 'format']);
358 pyroutes.register('gist_show_formatted_path', '/_admin/gists/%(gist_id)s/%(revision)s/%(format)s/%(f_path)s', ['gist_id', 'revision', 'format', 'f_path']);
359 pyroutes.register('debug_style_home', '/_admin/debug_style', []);
360 pyroutes.register('debug_style_email', '/_admin/debug_style/email/%(email_id)s', ['email_id']);
361 pyroutes.register('debug_style_email_plain_rendered', '/_admin/debug_style/email-rendered/%(email_id)s', ['email_id']);
362 pyroutes.register('debug_style_template', '/_admin/debug_style/t/%(t_path)s', ['t_path']);
363 pyroutes.register('apiv2', '/_admin/api', []);
364 pyroutes.register('admin_settings_license', '/_admin/settings/license', []);
365 pyroutes.register('admin_settings_license_unlock', '/_admin/settings/license_unlock', []);
366 pyroutes.register('login', '/_admin/login', []);
367 pyroutes.register('register', '/_admin/register', []);
368 pyroutes.register('repo_reviewers_review_rule_new', '/%(repo_name)s/settings/review/rules/new', ['repo_name']);
369 pyroutes.register('repo_reviewers_review_rule_edit', '/%(repo_name)s/settings/review/rules/%(rule_id)s', ['repo_name', 'rule_id']);
370 pyroutes.register('repo_reviewers_review_rule_delete', '/%(repo_name)s/settings/review/rules/%(rule_id)s/delete', ['repo_name', 'rule_id']);
371 pyroutes.register('plugin_admin_chat', '/_admin/plugin_admin_chat/%(action)s', ['action']);
372 pyroutes.register('edit_user_auth_tokens', '/_admin/users/%(user_id)s/edit/auth_tokens', ['user_id']);
373 pyroutes.register('edit_user_auth_tokens_add', '/_admin/users/%(user_id)s/edit/auth_tokens/new', ['user_id']);
374 pyroutes.register('admin_settings_scheduler_show_tasks', '/_admin/settings/scheduler/_tasks', []);
375 pyroutes.register('admin_settings_scheduler_show_all', '/_admin/settings/scheduler', []);
376 pyroutes.register('admin_settings_scheduler_new', '/_admin/settings/scheduler/new', []);
377 pyroutes.register('admin_settings_scheduler_create', '/_admin/settings/scheduler/create', []);
378 pyroutes.register('admin_settings_scheduler_edit', '/_admin/settings/scheduler/%(schedule_id)s', ['schedule_id']);
379 pyroutes.register('admin_settings_scheduler_update', '/_admin/settings/scheduler/%(schedule_id)s/update', ['schedule_id']);
380 pyroutes.register('admin_settings_scheduler_delete', '/_admin/settings/scheduler/%(schedule_id)s/delete', ['schedule_id']);
381 pyroutes.register('admin_settings_scheduler_execute', '/_admin/settings/scheduler/%(schedule_id)s/execute', ['schedule_id']);
382 pyroutes.register('admin_settings_automation', '/_admin/settings/automation', []);
383 pyroutes.register('admin_settings_automation_update', '/_admin/settings/automation/%(entry_id)s/update', ['entry_id']);
384 pyroutes.register('admin_permissions_branch', '/_admin/permissions/branch', []);
385 pyroutes.register('admin_permissions_branch_update', '/_admin/permissions/branch/update', []);
386 pyroutes.register('my_account_auth_tokens', '/_admin/my_account/auth_tokens', []);
387 pyroutes.register('my_account_auth_tokens_add', '/_admin/my_account/auth_tokens/new', []);
388 pyroutes.register('my_account_external_identity', '/_admin/my_account/external-identity', []);
389 pyroutes.register('my_account_external_identity_delete', '/_admin/my_account/external-identity/delete', []);
390 pyroutes.register('pullrequest_draft_comments_submit', '/%(repo_name)s/pull-request/%(pull_request_id)s/draft_comments_submit', ['repo_name', 'pull_request_id']);
391 pyroutes.register('commit_draft_comments_submit', '/%(repo_name)s/changeset/%(commit_id)s/draft_comments_submit', ['repo_name', 'commit_id']);
392 pyroutes.register('repo_artifacts_list', '/%(repo_name)s/artifacts', ['repo_name']);
393 pyroutes.register('repo_artifacts_data', '/%(repo_name)s/artifacts_data', ['repo_name']);
394 pyroutes.register('repo_artifacts_new', '/%(repo_name)s/artifacts/new', ['repo_name']);
395 pyroutes.register('repo_artifacts_get', '/%(repo_name)s/artifacts/download/%(uid)s', ['repo_name', 'uid']);
396 pyroutes.register('repo_artifacts_store', '/%(repo_name)s/artifacts/store', ['repo_name']);
397 pyroutes.register('repo_artifacts_info', '/%(repo_name)s/artifacts/info/%(uid)s', ['repo_name', 'uid']);
398 pyroutes.register('repo_artifacts_delete', '/%(repo_name)s/artifacts/delete/%(uid)s', ['repo_name', 'uid']);
399 pyroutes.register('repo_artifacts_update', '/%(repo_name)s/artifacts/update/%(uid)s', ['repo_name', 'uid']);
400 pyroutes.register('repo_automation', '/%(repo_name)s/settings/automation', ['repo_name']);
401 pyroutes.register('repo_automation_update', '/%(repo_name)s/settings/automation/%(entry_id)s/update', ['repo_name', 'entry_id']);
402 pyroutes.register('edit_repo_remote_push', '/%(repo_name)s/settings/remote/push', ['repo_name']);
403 pyroutes.register('edit_repo_perms_branch', '/%(repo_name)s/settings/branch_permissions', ['repo_name']);
404 pyroutes.register('edit_repo_perms_branch_delete', '/%(repo_name)s/settings/branch_permissions/%(rule_id)s/delete', ['repo_name', 'rule_id']);
405 }
403 }
@@ -233,7 +233,7 b' def write_usage_data(event):'
233
233
234 # write every 6th hour
234 # write every 6th hour
235 if age_in_min and age_in_min < 60 * 6:
235 if age_in_min and age_in_min < 60 * 6:
236 log.debug('Usage file created %s minutes ago, skipping (threashold: %s)...',
236 log.debug('Usage file created %s minutes ago, skipping (threshold: %s minutes)...',
237 age_in_min, 60 * 6)
237 age_in_min, 60 * 6)
238 return
238 return
239
239
General Comments 0
You need to be logged in to leave comments. Login now