Show More
@@ -527,6 +527,14 b' class jsonrpc_deprecated_method(object):' | |||
|
527 | 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 | 538 | def includeme(config): |
|
531 | 539 | plugin_module = 'rhodecode.api' |
|
532 | 540 | plugin_settings = get_plugin_settings( |
@@ -549,7 +557,8 b' def includeme(config):' | |||
|
549 | 557 | config.add_route( |
|
550 | 558 | 'apiv2', plugin_settings.get('url', DEFAULT_URL), jsonrpc_call=True) |
|
551 | 559 | |
|
552 | config.scan(plugin_module, ignore='rhodecode.api.tests') | |
|
553 | 560 | # register some exception handling view |
|
554 | 561 | config.add_view(exception_view, context=JSONRPCBaseError) |
|
555 | 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 | 144 | labs_active = str2bool(settings.get('labs_settings_active', False)) |
|
145 | 145 | navigation_registry_instance = NavigationRegistry(labs_active=labs_active) |
|
146 | 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 | 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 | 45 | config.add_route( |
|
30 | 46 | name='admin_audit_logs', |
|
31 | 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 | 54 | config.add_route( |
|
34 | 55 | name='admin_audit_log_entry', |
|
35 | 56 | pattern='/audit_logs/{audit_log_id}') |
|
36 | ||
|
37 | config.add_route( | |
|
38 | name='pull_requests_global_0', # backward compat | |
|
39 | pattern='/pull_requests/{pull_request_id:\d+}') | |
|
40 | config.add_route( | |
|
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+}') | |
|
57 | config.add_view( | |
|
58 | AdminAuditLogsView, | |
|
59 | attr='admin_audit_log_entry', | |
|
60 | route_name='admin_audit_log_entry', request_method='GET', | |
|
61 | renderer='rhodecode:templates/admin/admin_audit_log_entry.mako') | |
|
46 | 62 | |
|
47 | 63 | config.add_route( |
|
48 | 64 | name='admin_settings_open_source', |
|
49 | 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 | 72 | config.add_route( |
|
51 | 73 | name='admin_settings_vcs_svn_generate_cfg', |
|
52 | 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 | 81 | config.add_route( |
|
55 | 82 | name='admin_settings_system', |
|
56 | 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 | 90 | config.add_route( |
|
58 | 91 | name='admin_settings_system_update', |
|
59 | 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 | 99 | config.add_route( |
|
62 | 100 | name='admin_settings_exception_tracker', |
|
63 | 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 | 108 | config.add_route( |
|
65 | 109 | name='admin_settings_exception_tracker_delete_all', |
|
66 |
pattern='/settings/exceptions |
|
|
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 | 117 | config.add_route( |
|
68 | 118 | name='admin_settings_exception_tracker_show', |
|
69 | 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 | 126 | config.add_route( |
|
71 | 127 | name='admin_settings_exception_tracker_delete', |
|
72 | 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 | 135 | config.add_route( |
|
75 | 136 | name='admin_settings_sessions', |
|
76 | 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 | 144 | config.add_route( |
|
78 | 145 | name='admin_settings_sessions_cleanup', |
|
79 | 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 | 152 | config.add_route( |
|
82 | 153 | name='admin_settings_process_management', |
|
83 | 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 | 161 | config.add_route( |
|
85 | 162 | name='admin_settings_process_management_data', |
|
86 | 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 | 170 | config.add_route( |
|
88 | 171 | name='admin_settings_process_management_signal', |
|
89 | 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 | 179 | config.add_route( |
|
91 | 180 | name='admin_settings_process_management_master_signal', |
|
92 | 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 | 188 | # default settings |
|
95 | 189 | config.add_route( |
|
96 | 190 | name='admin_defaults_repositories', |
|
97 | 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 | 198 | config.add_route( |
|
99 | 199 | name='admin_defaults_repositories_update', |
|
100 | 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 | 207 | # admin settings |
|
103 | 208 | |
|
104 | 209 | config.add_route( |
|
105 | 210 | name='admin_settings', |
|
106 | 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 | 218 | config.add_route( |
|
108 | 219 | name='admin_settings_update', |
|
109 | 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 | 227 | config.add_route( |
|
112 | 228 | name='admin_settings_global', |
|
113 | 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 | 236 | config.add_route( |
|
115 | 237 | name='admin_settings_global_update', |
|
116 | 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 | 245 | config.add_route( |
|
119 | 246 | name='admin_settings_vcs', |
|
120 | 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 | 254 | config.add_route( |
|
122 | 255 | name='admin_settings_vcs_update', |
|
123 | 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 | 263 | config.add_route( |
|
125 | 264 | name='admin_settings_vcs_svn_pattern_delete', |
|
126 | 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 | 272 | config.add_route( |
|
129 | 273 | name='admin_settings_mapping', |
|
130 | 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 | 281 | config.add_route( |
|
132 | 282 | name='admin_settings_mapping_update', |
|
133 | 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 | 290 | config.add_route( |
|
136 | 291 | name='admin_settings_visual', |
|
137 | 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 | 299 | config.add_route( |
|
139 | 300 | name='admin_settings_visual_update', |
|
140 | 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 | 308 | config.add_route( |
|
143 | 309 | name='admin_settings_issuetracker', |
|
144 | 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 | 317 | config.add_route( |
|
146 | 318 | name='admin_settings_issuetracker_update', |
|
147 | 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 | 326 | config.add_route( |
|
149 | 327 | name='admin_settings_issuetracker_test', |
|
150 | 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 | 335 | config.add_route( |
|
152 | 336 | name='admin_settings_issuetracker_delete', |
|
153 | 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 | 344 | config.add_route( |
|
156 | 345 | name='admin_settings_email', |
|
157 | 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 | 353 | config.add_route( |
|
159 | 354 | name='admin_settings_email_update', |
|
160 | 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 | 362 | config.add_route( |
|
163 | 363 | name='admin_settings_hooks', |
|
164 | 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 | 371 | config.add_route( |
|
166 | 372 | name='admin_settings_hooks_update', |
|
167 | 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 | 380 | config.add_route( |
|
169 | 381 | name='admin_settings_hooks_delete', |
|
170 | 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 | 389 | config.add_route( |
|
173 | 390 | name='admin_settings_search', |
|
174 | 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 | 398 | config.add_route( |
|
177 | 399 | name='admin_settings_labs', |
|
178 | 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 | 407 | config.add_route( |
|
180 | 408 | name='admin_settings_labs_update', |
|
181 | 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 | 416 | # Automation EE feature |
|
184 | 417 | config.add_route( |
|
185 | 418 | 'admin_settings_automation', |
|
186 | 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 | 426 | # global permissions |
|
189 | 427 | |
|
190 | 428 | config.add_route( |
|
191 | 429 | name='admin_permissions_application', |
|
192 | 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 | 437 | config.add_route( |
|
194 | 438 | name='admin_permissions_application_update', |
|
195 | 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 | 446 | config.add_route( |
|
198 | 447 | name='admin_permissions_global', |
|
199 | 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 | 455 | config.add_route( |
|
201 | 456 | name='admin_permissions_global_update', |
|
202 | 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 | 464 | config.add_route( |
|
205 | 465 | name='admin_permissions_object', |
|
206 | 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 | 473 | config.add_route( |
|
208 | 474 | name='admin_permissions_object_update', |
|
209 | 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 | 482 | # Branch perms EE feature |
|
212 | 483 | config.add_route( |
|
213 | 484 | name='admin_permissions_branch', |
|
214 | 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 | 492 | config.add_route( |
|
217 | 493 | name='admin_permissions_ips', |
|
218 | 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 | 501 | config.add_route( |
|
221 | 502 | name='admin_permissions_overview', |
|
222 | 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 | 510 | config.add_route( |
|
225 | 511 | name='admin_permissions_auth_token_access', |
|
226 | 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 | 519 | config.add_route( |
|
229 | 520 | name='admin_permissions_ssh_keys', |
|
230 | 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 | 528 | config.add_route( |
|
232 | 529 | name='admin_permissions_ssh_keys_data', |
|
233 | 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 | 537 | config.add_route( |
|
235 | 538 | name='admin_permissions_ssh_keys_update', |
|
236 | 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 | 546 | # users admin |
|
239 | 547 | config.add_route( |
|
240 | 548 | name='users', |
|
241 | 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 | 556 | config.add_route( |
|
244 | 557 | name='users_data', |
|
245 | 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 | 566 | config.add_route( |
|
248 | 567 | name='users_create', |
|
249 | 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 | 575 | config.add_route( |
|
252 | 576 | name='users_new', |
|
253 | 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 | 584 | # user management |
|
256 | 585 | config.add_route( |
|
257 | 586 | name='user_edit', |
|
258 | 587 | pattern='/users/{user_id:\d+}/edit', |
|
259 | 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 | 595 | config.add_route( |
|
261 | 596 | name='user_edit_advanced', |
|
262 | 597 | pattern='/users/{user_id:\d+}/edit/advanced', |
|
263 | 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 | 605 | config.add_route( |
|
265 | 606 | name='user_edit_global_perms', |
|
266 | 607 | pattern='/users/{user_id:\d+}/edit/global_permissions', |
|
267 | 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 | 615 | config.add_route( |
|
269 | 616 | name='user_edit_global_perms_update', |
|
270 | 617 | pattern='/users/{user_id:\d+}/edit/global_permissions/update', |
|
271 | 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 | 625 | config.add_route( |
|
273 | 626 | name='user_update', |
|
274 | 627 | pattern='/users/{user_id:\d+}/update', |
|
275 | 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 | 635 | config.add_route( |
|
277 | 636 | name='user_delete', |
|
278 | 637 | pattern='/users/{user_id:\d+}/delete', |
|
279 | 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 | 645 | config.add_route( |
|
281 | 646 | name='user_enable_force_password_reset', |
|
282 | 647 | pattern='/users/{user_id:\d+}/password_reset_enable', |
|
283 | 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 | 655 | config.add_route( |
|
285 | 656 | name='user_disable_force_password_reset', |
|
286 | 657 | pattern='/users/{user_id:\d+}/password_reset_disable', |
|
287 | 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 | 665 | config.add_route( |
|
289 | 666 | name='user_create_personal_repo_group', |
|
290 | 667 | pattern='/users/{user_id:\d+}/create_repo_group', |
|
291 | 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 | 675 | # user notice |
|
294 | 676 | config.add_route( |
|
295 | 677 | name='user_notice_dismiss', |
|
296 | 678 | pattern='/users/{user_id:\d+}/notice_dismiss', |
|
297 | 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 | 686 | # user auth tokens |
|
300 | 687 | config.add_route( |
|
301 | 688 | name='edit_user_auth_tokens', |
|
302 | 689 | pattern='/users/{user_id:\d+}/edit/auth_tokens', |
|
303 | 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 | 697 | config.add_route( |
|
305 | 698 | name='edit_user_auth_tokens_view', |
|
306 | 699 | pattern='/users/{user_id:\d+}/edit/auth_tokens/view', |
|
307 | 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 | 707 | config.add_route( |
|
309 | 708 | name='edit_user_auth_tokens_add', |
|
310 | 709 | pattern='/users/{user_id:\d+}/edit/auth_tokens/new', |
|
311 | 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 | 716 | config.add_route( |
|
313 | 717 | name='edit_user_auth_tokens_delete', |
|
314 | 718 | pattern='/users/{user_id:\d+}/edit/auth_tokens/delete', |
|
315 | 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 | 725 | # user ssh keys |
|
318 | 726 | config.add_route( |
|
319 | 727 | name='edit_user_ssh_keys', |
|
320 | 728 | pattern='/users/{user_id:\d+}/edit/ssh_keys', |
|
321 | 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 | 736 | config.add_route( |
|
323 | 737 | name='edit_user_ssh_keys_generate_keypair', |
|
324 | 738 | pattern='/users/{user_id:\d+}/edit/ssh_keys/generate', |
|
325 | 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 | 746 | config.add_route( |
|
327 | 747 | name='edit_user_ssh_keys_add', |
|
328 | 748 | pattern='/users/{user_id:\d+}/edit/ssh_keys/new', |
|
329 | 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 | 755 | config.add_route( |
|
331 | 756 | name='edit_user_ssh_keys_delete', |
|
332 | 757 | pattern='/users/{user_id:\d+}/edit/ssh_keys/delete', |
|
333 | 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 | 764 | # user emails |
|
336 | 765 | config.add_route( |
|
337 | 766 | name='edit_user_emails', |
|
338 | 767 | pattern='/users/{user_id:\d+}/edit/emails', |
|
339 | 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 | 775 | config.add_route( |
|
341 | 776 | name='edit_user_emails_add', |
|
342 | 777 | pattern='/users/{user_id:\d+}/edit/emails/new', |
|
343 | 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 | 784 | config.add_route( |
|
345 | 785 | name='edit_user_emails_delete', |
|
346 | 786 | pattern='/users/{user_id:\d+}/edit/emails/delete', |
|
347 | 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 | 793 | # user IPs |
|
350 | 794 | config.add_route( |
|
351 | 795 | name='edit_user_ips', |
|
352 | 796 | pattern='/users/{user_id:\d+}/edit/ips', |
|
353 | 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 | 804 | config.add_route( |
|
355 | 805 | name='edit_user_ips_add', |
|
356 | 806 | pattern='/users/{user_id:\d+}/edit/ips/new', |
|
357 | 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 | 813 | config.add_route( |
|
359 | 814 | name='edit_user_ips_delete', |
|
360 | 815 | pattern='/users/{user_id:\d+}/edit/ips/delete', |
|
361 | 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 | 822 | # user perms |
|
364 | 823 | config.add_route( |
|
365 | 824 | name='edit_user_perms_summary', |
|
366 | 825 | pattern='/users/{user_id:\d+}/edit/permissions_summary', |
|
367 | 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 | 833 | config.add_route( |
|
369 | 834 | name='edit_user_perms_summary_json', |
|
370 | 835 | pattern='/users/{user_id:\d+}/edit/permissions_summary/json', |
|
371 | 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 | 843 | # user user groups management |
|
374 | 844 | config.add_route( |
|
375 | 845 | name='edit_user_groups_management', |
|
376 | 846 | pattern='/users/{user_id:\d+}/edit/groups_management', |
|
377 | 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 | 854 | config.add_route( |
|
380 | 855 | name='edit_user_groups_management_updates', |
|
381 | 856 | pattern='/users/{user_id:\d+}/edit/edit_user_groups_management/updates', |
|
382 | 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 | 863 | # user audit logs |
|
385 | 864 | config.add_route( |
|
386 | 865 | name='edit_user_audit_logs', |
|
387 | 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 | 873 | config.add_route( |
|
390 | 874 | name='edit_user_audit_logs_download', |
|
391 | 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 | 882 | # user caches |
|
394 | 883 | config.add_route( |
|
395 | 884 | name='edit_user_caches', |
|
396 | 885 | pattern='/users/{user_id:\d+}/edit/caches', |
|
397 | 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 | 893 | config.add_route( |
|
399 | 894 | name='edit_user_caches_update', |
|
400 | 895 | pattern='/users/{user_id:\d+}/edit/caches/update', |
|
401 | 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 | 902 | # user-groups admin |
|
404 | 903 | config.add_route( |
|
405 | 904 | name='user_groups', |
|
406 | 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 | 912 | config.add_route( |
|
409 | 913 | name='user_groups_data', |
|
410 | 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 | 921 | config.add_route( |
|
413 | 922 | name='user_groups_new', |
|
414 | 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 | 930 | config.add_route( |
|
417 | 931 | name='user_groups_create', |
|
418 | 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 | 939 | # repos admin |
|
421 | 940 | config.add_route( |
|
422 | 941 | name='repos', |
|
423 | 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 | 949 | config.add_route( |
|
426 | 950 | name='repos_data', |
|
427 | 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 | 958 | config.add_route( |
|
430 | 959 | name='repo_new', |
|
431 | 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 | 967 | config.add_route( |
|
434 | 968 | name='repo_create', |
|
435 | 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 | 976 | # repo groups admin |
|
438 | 977 | config.add_route( |
|
439 | 978 | name='repo_groups', |
|
440 | 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 | 986 | config.add_route( |
|
443 | 987 | name='repo_groups_data', |
|
444 | 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 | 995 | config.add_route( |
|
447 | 996 | name='repo_group_new', |
|
448 | 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 | 1004 | config.add_route( |
|
451 | 1005 | name='repo_group_create', |
|
452 | 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 | 1014 | def includeme(config): |
|
456 | 1015 | from rhodecode.apps._base.navigation import includeme as nav_includeme |
|
1016 | from rhodecode.apps.admin.views.main_views import AdminMainView | |
|
457 | 1017 | |
|
458 | 1018 | # Create admin navigation registry and add it to the pyramid registry. |
|
459 | 1019 | nav_includeme(config) |
|
460 | 1020 | |
|
461 | 1021 | # main admin routes |
|
462 | config.add_route(name='admin_home', pattern=ADMIN_PREFIX) | |
|
463 | config.include(admin_routes, route_prefix=ADMIN_PREFIX) | |
|
1022 | config.add_route( | |
|
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. | |
|
466 | config.scan('.views', ignore='.tests') | |
|
1039 | config.add_route( | |
|
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 | 21 | import logging |
|
22 | 22 | |
|
23 | 23 | from pyramid.httpexceptions import HTTPNotFound |
|
24 | from pyramid.view import view_config | |
|
25 | 24 | |
|
26 | 25 | from rhodecode.apps._base import BaseAppView |
|
27 | 26 | from rhodecode.model.db import joinedload, UserLog |
@@ -34,15 +33,13 b' log = logging.getLogger(__name__)' | |||
|
34 | 33 | |
|
35 | 34 | |
|
36 | 35 | class AdminAuditLogsView(BaseAppView): |
|
36 | ||
|
37 | 37 | def load_default_context(self): |
|
38 | 38 | c = self._get_local_tmpl_context() |
|
39 | 39 | return c |
|
40 | 40 | |
|
41 | 41 | @LoginRequired() |
|
42 | 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 | 43 | def admin_audit_logs(self): |
|
47 | 44 | c = self.load_default_context() |
|
48 | 45 | |
@@ -76,9 +73,6 b' class AdminAuditLogsView(BaseAppView):' | |||
|
76 | 73 | |
|
77 | 74 | @LoginRequired() |
|
78 | 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 | 76 | def admin_audit_log_entry(self): |
|
83 | 77 | c = self.load_default_context() |
|
84 | 78 | audit_log_id = self.request.matchdict['audit_log_id'] |
@@ -23,7 +23,6 b' import logging' | |||
|
23 | 23 | import formencode |
|
24 | 24 | import formencode.htmlfill |
|
25 | 25 | |
|
26 | from pyramid.view import view_config | |
|
27 | 26 | from pyramid.httpexceptions import HTTPFound |
|
28 | 27 | from pyramid.renderers import render |
|
29 | 28 | from pyramid.response import Response |
@@ -41,17 +40,13 b' log = logging.getLogger(__name__)' | |||
|
41 | 40 | |
|
42 | 41 | |
|
43 | 42 | class AdminDefaultSettingsView(BaseAppView): |
|
43 | ||
|
44 | 44 | def load_default_context(self): |
|
45 | 45 | c = self._get_local_tmpl_context() |
|
46 | ||
|
47 | ||
|
48 | 46 | return c |
|
49 | 47 | |
|
50 | 48 | @LoginRequired() |
|
51 | 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 | 50 | def defaults_repository_show(self): |
|
56 | 51 | c = self.load_default_context() |
|
57 | 52 | c.backends = BACKENDS.keys() |
@@ -72,9 +67,6 b' class AdminDefaultSettingsView(BaseAppVi' | |||
|
72 | 67 | @LoginRequired() |
|
73 | 68 | @HasPermissionAllDecorator('hg.admin') |
|
74 | 69 | @CSRFRequired() |
|
75 | @view_config( | |
|
76 | route_name='admin_defaults_repositories_update', request_method='POST', | |
|
77 | renderer='rhodecode:templates/admin/defaults/defaults.mako') | |
|
78 | 70 | def defaults_repository_update(self): |
|
79 | 71 | _ = self.request.translate |
|
80 | 72 | c = self.load_default_context() |
@@ -21,7 +21,6 b' import os' | |||
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | 23 | from pyramid.httpexceptions import HTTPFound |
|
24 | from pyramid.view import view_config | |
|
25 | 24 | |
|
26 | 25 | from rhodecode.apps._base import BaseAppView |
|
27 | 26 | from rhodecode.apps._base.navigation import navigation_list |
@@ -99,9 +98,6 b' class ExceptionsTrackerView(BaseAppView)' | |||
|
99 | 98 | |
|
100 | 99 | @LoginRequired() |
|
101 | 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 | 101 | def browse_exceptions(self): |
|
106 | 102 | _ = self.request.translate |
|
107 | 103 | c = self.load_default_context() |
@@ -117,9 +113,6 b' class ExceptionsTrackerView(BaseAppView)' | |||
|
117 | 113 | |
|
118 | 114 | @LoginRequired() |
|
119 | 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 | 116 | def exception_show(self): |
|
124 | 117 | _ = self.request.translate |
|
125 | 118 | c = self.load_default_context() |
@@ -132,9 +125,6 b' class ExceptionsTrackerView(BaseAppView)' | |||
|
132 | 125 | @LoginRequired() |
|
133 | 126 | @HasPermissionAllDecorator('hg.admin') |
|
134 | 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 | 128 | def exception_delete_all(self): |
|
139 | 129 | _ = self.request.translate |
|
140 | 130 | c = self.load_default_context() |
@@ -159,9 +149,6 b' class ExceptionsTrackerView(BaseAppView)' | |||
|
159 | 149 | @LoginRequired() |
|
160 | 150 | @HasPermissionAllDecorator('hg.admin') |
|
161 | 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 | 152 | def exception_delete(self): |
|
166 | 153 | _ = self.request.translate |
|
167 | 154 | c = self.load_default_context() |
@@ -21,7 +21,6 b'' | |||
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | 23 | from pyramid.httpexceptions import HTTPFound, HTTPNotFound |
|
24 | from pyramid.view import view_config | |
|
25 | 24 | |
|
26 | 25 | from rhodecode.apps._base import BaseAppView |
|
27 | 26 | from rhodecode.lib import helpers as h |
@@ -39,9 +38,6 b' class AdminMainView(BaseAppView):' | |||
|
39 | 38 | |
|
40 | 39 | @LoginRequired() |
|
41 | 40 | @NotAnonymous() |
|
42 | @view_config( | |
|
43 | route_name='admin_home', request_method='GET', | |
|
44 | renderer='rhodecode:templates/admin/main.mako') | |
|
45 | 41 | def admin_main(self): |
|
46 | 42 | c = self.load_default_context() |
|
47 | 43 | c.active = 'admin' |
@@ -52,9 +48,6 b' class AdminMainView(BaseAppView):' | |||
|
52 | 48 | return self._get_template_context(c) |
|
53 | 49 | |
|
54 | 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 | 51 | def pull_requests(self): |
|
59 | 52 | """ |
|
60 | 53 | Global redirect for Pull Requests |
@@ -21,8 +21,6 b'' | |||
|
21 | 21 | import collections |
|
22 | 22 | import logging |
|
23 | 23 | |
|
24 | from pyramid.view import view_config | |
|
25 | ||
|
26 | 24 | from rhodecode.apps._base import BaseAppView |
|
27 | 25 | from rhodecode.apps._base.navigation import navigation_list |
|
28 | 26 | from rhodecode.lib.auth import (LoginRequired, HasPermissionAllDecorator) |
@@ -39,9 +37,6 b' class OpenSourceLicensesAdminSettingsVie' | |||
|
39 | 37 | |
|
40 | 38 | @LoginRequired() |
|
41 | 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 | 40 | def open_source_licenses(self): |
|
46 | 41 | c = self.load_default_context() |
|
47 | 42 | c.active = 'open_source' |
@@ -25,7 +25,6 b' import formencode.htmlfill' | |||
|
25 | 25 | import datetime |
|
26 | 26 | from pyramid.interfaces import IRoutesMapper |
|
27 | 27 | |
|
28 | from pyramid.view import view_config | |
|
29 | 28 | from pyramid.httpexceptions import HTTPFound |
|
30 | 29 | from pyramid.renderers import render |
|
31 | 30 | from pyramid.response import Response |
@@ -59,9 +58,6 b' class AdminPermissionsView(BaseAppView, ' | |||
|
59 | 58 | |
|
60 | 59 | @LoginRequired() |
|
61 | 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 | 61 | def permissions_application(self): |
|
66 | 62 | c = self.load_default_context() |
|
67 | 63 | c.active = 'application' |
@@ -90,9 +86,6 b' class AdminPermissionsView(BaseAppView, ' | |||
|
90 | 86 | @LoginRequired() |
|
91 | 87 | @HasPermissionAllDecorator('hg.admin') |
|
92 | 88 | @CSRFRequired() |
|
93 | @view_config( | |
|
94 | route_name='admin_permissions_application_update', request_method='POST', | |
|
95 | renderer='rhodecode:templates/admin/permissions/permissions.mako') | |
|
96 | 89 | def permissions_application_update(self): |
|
97 | 90 | _ = self.request.translate |
|
98 | 91 | c = self.load_default_context() |
@@ -149,9 +142,6 b' class AdminPermissionsView(BaseAppView, ' | |||
|
149 | 142 | |
|
150 | 143 | @LoginRequired() |
|
151 | 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 | 145 | def permissions_objects(self): |
|
156 | 146 | c = self.load_default_context() |
|
157 | 147 | c.active = 'objects' |
@@ -174,9 +164,6 b' class AdminPermissionsView(BaseAppView, ' | |||
|
174 | 164 | @LoginRequired() |
|
175 | 165 | @HasPermissionAllDecorator('hg.admin') |
|
176 | 166 | @CSRFRequired() |
|
177 | @view_config( | |
|
178 | route_name='admin_permissions_object_update', request_method='POST', | |
|
179 | renderer='rhodecode:templates/admin/permissions/permissions.mako') | |
|
180 | 167 | def permissions_objects_update(self): |
|
181 | 168 | _ = self.request.translate |
|
182 | 169 | c = self.load_default_context() |
@@ -225,9 +212,6 b' class AdminPermissionsView(BaseAppView, ' | |||
|
225 | 212 | |
|
226 | 213 | @LoginRequired() |
|
227 | 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 | 215 | def permissions_branch(self): |
|
232 | 216 | c = self.load_default_context() |
|
233 | 217 | c.active = 'branch' |
@@ -249,9 +233,6 b' class AdminPermissionsView(BaseAppView, ' | |||
|
249 | 233 | |
|
250 | 234 | @LoginRequired() |
|
251 | 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 | 236 | def permissions_global(self): |
|
256 | 237 | c = self.load_default_context() |
|
257 | 238 | c.active = 'global' |
@@ -274,9 +255,6 b' class AdminPermissionsView(BaseAppView, ' | |||
|
274 | 255 | @LoginRequired() |
|
275 | 256 | @HasPermissionAllDecorator('hg.admin') |
|
276 | 257 | @CSRFRequired() |
|
277 | @view_config( | |
|
278 | route_name='admin_permissions_global_update', request_method='POST', | |
|
279 | renderer='rhodecode:templates/admin/permissions/permissions.mako') | |
|
280 | 258 | def permissions_global_update(self): |
|
281 | 259 | _ = self.request.translate |
|
282 | 260 | c = self.load_default_context() |
@@ -327,9 +305,6 b' class AdminPermissionsView(BaseAppView, ' | |||
|
327 | 305 | |
|
328 | 306 | @LoginRequired() |
|
329 | 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 | 308 | def permissions_ips(self): |
|
334 | 309 | c = self.load_default_context() |
|
335 | 310 | c.active = 'ips' |
@@ -342,9 +317,6 b' class AdminPermissionsView(BaseAppView, ' | |||
|
342 | 317 | |
|
343 | 318 | @LoginRequired() |
|
344 | 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 | 320 | def permissions_overview(self): |
|
349 | 321 | c = self.load_default_context() |
|
350 | 322 | c.active = 'perms' |
@@ -355,9 +327,6 b' class AdminPermissionsView(BaseAppView, ' | |||
|
355 | 327 | |
|
356 | 328 | @LoginRequired() |
|
357 | 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 | 330 | def auth_token_access(self): |
|
362 | 331 | from rhodecode import CONFIG |
|
363 | 332 | |
@@ -415,9 +384,6 b' class AdminPermissionsView(BaseAppView, ' | |||
|
415 | 384 | |
|
416 | 385 | @LoginRequired() |
|
417 | 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 | 387 | def ssh_keys(self): |
|
422 | 388 | c = self.load_default_context() |
|
423 | 389 | c.active = 'ssh_keys' |
@@ -426,9 +392,6 b' class AdminPermissionsView(BaseAppView, ' | |||
|
426 | 392 | |
|
427 | 393 | @LoginRequired() |
|
428 | 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 | 395 | def ssh_keys_data(self): |
|
433 | 396 | _ = self.request.translate |
|
434 | 397 | self.load_default_context() |
@@ -498,9 +461,6 b' class AdminPermissionsView(BaseAppView, ' | |||
|
498 | 461 | @LoginRequired() |
|
499 | 462 | @HasPermissionAllDecorator('hg.admin') |
|
500 | 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 | 464 | def ssh_keys_update(self): |
|
505 | 465 | _ = self.request.translate |
|
506 | 466 | self.load_default_context() |
@@ -22,7 +22,7 b' import logging' | |||
|
22 | 22 | |
|
23 | 23 | import psutil |
|
24 | 24 | import signal |
|
25 | from pyramid.view import view_config | |
|
25 | ||
|
26 | 26 | |
|
27 | 27 | from rhodecode.apps._base import BaseAppView |
|
28 | 28 | from rhodecode.apps._base.navigation import navigation_list |
@@ -84,9 +84,6 b' class AdminProcessManagementView(BaseApp' | |||
|
84 | 84 | |
|
85 | 85 | @LoginRequired() |
|
86 | 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 | 87 | def process_management(self): |
|
91 | 88 | _ = self.request.translate |
|
92 | 89 | c = self.load_default_context() |
@@ -99,9 +96,6 b' class AdminProcessManagementView(BaseApp' | |||
|
99 | 96 | |
|
100 | 97 | @LoginRequired() |
|
101 | 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 | 99 | def process_management_data(self): |
|
106 | 100 | _ = self.request.translate |
|
107 | 101 | c = self.load_default_context() |
@@ -111,9 +105,6 b' class AdminProcessManagementView(BaseApp' | |||
|
111 | 105 | @LoginRequired() |
|
112 | 106 | @HasPermissionAllDecorator('hg.admin') |
|
113 | 107 | @CSRFRequired() |
|
114 | @view_config( | |
|
115 | route_name='admin_settings_process_management_signal', | |
|
116 | request_method='POST', renderer='json_ext') | |
|
117 | 108 | def process_management_signal(self): |
|
118 | 109 | pids = self.request.json.get('pids', []) |
|
119 | 110 | result = [] |
@@ -155,9 +146,6 b' class AdminProcessManagementView(BaseApp' | |||
|
155 | 146 | @LoginRequired() |
|
156 | 147 | @HasPermissionAllDecorator('hg.admin') |
|
157 | 148 | @CSRFRequired() |
|
158 | @view_config( | |
|
159 | route_name='admin_settings_process_management_master_signal', | |
|
160 | request_method='POST', renderer='json_ext') | |
|
161 | 149 | def process_management_master_signal(self): |
|
162 | 150 | pid_data = self.request.json.get('pid_data', {}) |
|
163 | 151 | pid = safe_int(pid_data['pid']) |
@@ -25,7 +25,7 b' import formencode' | |||
|
25 | 25 | import formencode.htmlfill |
|
26 | 26 | |
|
27 | 27 | from pyramid.httpexceptions import HTTPFound, HTTPForbidden |
|
28 | from pyramid.view import view_config | |
|
28 | ||
|
29 | 29 | from pyramid.renderers import render |
|
30 | 30 | from pyramid.response import Response |
|
31 | 31 | |
@@ -96,9 +96,6 b' class AdminRepoGroupsView(BaseAppView, D' | |||
|
96 | 96 | # `repo_group_list_data` via RepoGroupList |
|
97 | 97 | @LoginRequired() |
|
98 | 98 | @NotAnonymous() |
|
99 | @view_config( | |
|
100 | route_name='repo_groups', request_method='GET', | |
|
101 | renderer='rhodecode:templates/admin/repo_groups/repo_groups.mako') | |
|
102 | 99 | def repo_group_list(self): |
|
103 | 100 | c = self.load_default_context() |
|
104 | 101 | return self._get_template_context(c) |
@@ -106,9 +103,6 b' class AdminRepoGroupsView(BaseAppView, D' | |||
|
106 | 103 | # permission check inside |
|
107 | 104 | @LoginRequired() |
|
108 | 105 | @NotAnonymous() |
|
109 | @view_config( | |
|
110 | route_name='repo_groups_data', request_method='GET', | |
|
111 | renderer='json_ext', xhr=True) | |
|
112 | 106 | def repo_group_list_data(self): |
|
113 | 107 | self.load_default_context() |
|
114 | 108 | column_map = { |
@@ -254,9 +248,6 b' class AdminRepoGroupsView(BaseAppView, D' | |||
|
254 | 248 | @LoginRequired() |
|
255 | 249 | @NotAnonymous() |
|
256 | 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 | 251 | def repo_group_new(self): |
|
261 | 252 | c = self.load_default_context() |
|
262 | 253 | |
@@ -296,9 +287,6 b' class AdminRepoGroupsView(BaseAppView, D' | |||
|
296 | 287 | @NotAnonymous() |
|
297 | 288 | @CSRFRequired() |
|
298 | 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 | 290 | def repo_group_create(self): |
|
303 | 291 | c = self.load_default_context() |
|
304 | 292 | _ = self.request.translate |
@@ -23,7 +23,7 b' import formencode' | |||
|
23 | 23 | import formencode.htmlfill |
|
24 | 24 | |
|
25 | 25 | from pyramid.httpexceptions import HTTPFound, HTTPForbidden |
|
26 | from pyramid.view import view_config | |
|
26 | ||
|
27 | 27 | from pyramid.renderers import render |
|
28 | 28 | from pyramid.response import Response |
|
29 | 29 | |
@@ -52,7 +52,6 b' class AdminReposView(BaseAppView, DataGr' | |||
|
52 | 52 | |
|
53 | 53 | def load_default_context(self): |
|
54 | 54 | c = self._get_local_tmpl_context() |
|
55 | ||
|
56 | 55 | return c |
|
57 | 56 | |
|
58 | 57 | def _load_form_data(self, c): |
@@ -65,9 +64,6 b' class AdminReposView(BaseAppView, DataGr' | |||
|
65 | 64 | @LoginRequired() |
|
66 | 65 | @NotAnonymous() |
|
67 | 66 | # perms check inside |
|
68 | @view_config( | |
|
69 | route_name='repos', request_method='GET', | |
|
70 | renderer='rhodecode:templates/admin/repos/repos.mako') | |
|
71 | 67 | def repository_list(self): |
|
72 | 68 | c = self.load_default_context() |
|
73 | 69 | return self._get_template_context(c) |
@@ -75,9 +71,6 b' class AdminReposView(BaseAppView, DataGr' | |||
|
75 | 71 | @LoginRequired() |
|
76 | 72 | @NotAnonymous() |
|
77 | 73 | # perms check inside |
|
78 | @view_config( | |
|
79 | route_name='repos_data', request_method='GET', | |
|
80 | renderer='json_ext', xhr=True) | |
|
81 | 74 | def repository_list_data(self): |
|
82 | 75 | self.load_default_context() |
|
83 | 76 | column_map = { |
@@ -162,9 +155,6 b' class AdminReposView(BaseAppView, DataGr' | |||
|
162 | 155 | @LoginRequired() |
|
163 | 156 | @NotAnonymous() |
|
164 | 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 | 158 | def repository_new(self): |
|
169 | 159 | c = self.load_default_context() |
|
170 | 160 | |
@@ -216,9 +206,6 b' class AdminReposView(BaseAppView, DataGr' | |||
|
216 | 206 | @NotAnonymous() |
|
217 | 207 | @CSRFRequired() |
|
218 | 208 | # perms check inside |
|
219 | @view_config( | |
|
220 | route_name='repo_create', request_method='POST', | |
|
221 | renderer='rhodecode:templates/admin/repos/repos.mako') | |
|
222 | 209 | def repository_create(self): |
|
223 | 210 | c = self.load_default_context() |
|
224 | 211 |
@@ -20,7 +20,7 b'' | |||
|
20 | 20 | |
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | from pyramid.view import view_config | |
|
23 | ||
|
24 | 24 | from pyramid.httpexceptions import HTTPFound |
|
25 | 25 | |
|
26 | 26 | from rhodecode.apps._base import BaseAppView |
@@ -37,17 +37,13 b' log = logging.getLogger(__name__)' | |||
|
37 | 37 | |
|
38 | 38 | |
|
39 | 39 | class AdminSessionSettingsView(BaseAppView): |
|
40 | ||
|
40 | 41 | def load_default_context(self): |
|
41 | 42 | c = self._get_local_tmpl_context() |
|
42 | ||
|
43 | ||
|
44 | 43 | return c |
|
45 | 44 | |
|
46 | 45 | @LoginRequired() |
|
47 | 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 | 47 | def settings_sessions(self): |
|
52 | 48 | c = self.load_default_context() |
|
53 | 49 | |
@@ -71,8 +67,6 b' class AdminSessionSettingsView(BaseAppVi' | |||
|
71 | 67 | @LoginRequired() |
|
72 | 68 | @HasPermissionAllDecorator('hg.admin') |
|
73 | 69 | @CSRFRequired() |
|
74 | @view_config( | |
|
75 | route_name='admin_settings_sessions_cleanup', request_method='POST') | |
|
76 | 70 | def settings_sessions_cleanup(self): |
|
77 | 71 | _ = self.request.translate |
|
78 | 72 | expire_days = safe_int(self.request.params.get('expire_days')) |
@@ -27,7 +27,7 b' import formencode' | |||
|
27 | 27 | import formencode.htmlfill |
|
28 | 28 | |
|
29 | 29 | import rhodecode |
|
30 | from pyramid.view import view_config | |
|
30 | ||
|
31 | 31 | from pyramid.httpexceptions import HTTPFound, HTTPNotFound |
|
32 | 32 | from pyramid.renderers import render |
|
33 | 33 | from pyramid.response import Response |
@@ -68,7 +68,6 b' class AdminSettingsView(BaseAppView):' | |||
|
68 | 68 | c.labs_active = str2bool( |
|
69 | 69 | rhodecode.CONFIG.get('labs_settings_active', 'true')) |
|
70 | 70 | c.navlist = navigation_list(self.request) |
|
71 | ||
|
72 | 71 | return c |
|
73 | 72 | |
|
74 | 73 | @classmethod |
@@ -109,9 +108,6 b' class AdminSettingsView(BaseAppView):' | |||
|
109 | 108 | |
|
110 | 109 | @LoginRequired() |
|
111 | 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 | 111 | def settings_vcs(self): |
|
116 | 112 | c = self.load_default_context() |
|
117 | 113 | c.active = 'vcs' |
@@ -139,9 +135,6 b' class AdminSettingsView(BaseAppView):' | |||
|
139 | 135 | @LoginRequired() |
|
140 | 136 | @HasPermissionAllDecorator('hg.admin') |
|
141 | 137 | @CSRFRequired() |
|
142 | @view_config( | |
|
143 | route_name='admin_settings_vcs_update', request_method='POST', | |
|
144 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
|
145 | 138 | def settings_vcs_update(self): |
|
146 | 139 | _ = self.request.translate |
|
147 | 140 | c = self.load_default_context() |
@@ -207,9 +200,6 b' class AdminSettingsView(BaseAppView):' | |||
|
207 | 200 | @LoginRequired() |
|
208 | 201 | @HasPermissionAllDecorator('hg.admin') |
|
209 | 202 | @CSRFRequired() |
|
210 | @view_config( | |
|
211 | route_name='admin_settings_vcs_svn_pattern_delete', request_method='POST', | |
|
212 | renderer='json_ext', xhr=True) | |
|
213 | 203 | def settings_vcs_delete_svn_pattern(self): |
|
214 | 204 | delete_pattern_id = self.request.POST.get('delete_svn_pattern') |
|
215 | 205 | model = VcsSettingsModel() |
@@ -225,9 +215,6 b' class AdminSettingsView(BaseAppView):' | |||
|
225 | 215 | |
|
226 | 216 | @LoginRequired() |
|
227 | 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 | 218 | def settings_mapping(self): |
|
232 | 219 | c = self.load_default_context() |
|
233 | 220 | c.active = 'mapping' |
@@ -245,9 +232,6 b' class AdminSettingsView(BaseAppView):' | |||
|
245 | 232 | @LoginRequired() |
|
246 | 233 | @HasPermissionAllDecorator('hg.admin') |
|
247 | 234 | @CSRFRequired() |
|
248 | @view_config( | |
|
249 | route_name='admin_settings_mapping_update', request_method='POST', | |
|
250 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
|
251 | 235 | def settings_mapping_update(self): |
|
252 | 236 | _ = self.request.translate |
|
253 | 237 | c = self.load_default_context() |
@@ -274,12 +258,6 b' class AdminSettingsView(BaseAppView):' | |||
|
274 | 258 | |
|
275 | 259 | @LoginRequired() |
|
276 | 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 | 261 | def settings_global(self): |
|
284 | 262 | c = self.load_default_context() |
|
285 | 263 | c.active = 'global' |
@@ -299,12 +277,6 b' class AdminSettingsView(BaseAppView):' | |||
|
299 | 277 | @LoginRequired() |
|
300 | 278 | @HasPermissionAllDecorator('hg.admin') |
|
301 | 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 | 280 | def settings_global_update(self): |
|
309 | 281 | _ = self.request.translate |
|
310 | 282 | c = self.load_default_context() |
@@ -359,9 +331,6 b' class AdminSettingsView(BaseAppView):' | |||
|
359 | 331 | |
|
360 | 332 | @LoginRequired() |
|
361 | 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 | 334 | def settings_visual(self): |
|
366 | 335 | c = self.load_default_context() |
|
367 | 336 | c.active = 'visual' |
@@ -379,9 +348,6 b' class AdminSettingsView(BaseAppView):' | |||
|
379 | 348 | @LoginRequired() |
|
380 | 349 | @HasPermissionAllDecorator('hg.admin') |
|
381 | 350 | @CSRFRequired() |
|
382 | @view_config( | |
|
383 | route_name='admin_settings_visual_update', request_method='POST', | |
|
384 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
|
385 | 351 | def settings_visual_update(self): |
|
386 | 352 | _ = self.request.translate |
|
387 | 353 | c = self.load_default_context() |
@@ -441,9 +407,6 b' class AdminSettingsView(BaseAppView):' | |||
|
441 | 407 | |
|
442 | 408 | @LoginRequired() |
|
443 | 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 | 410 | def settings_issuetracker(self): |
|
448 | 411 | c = self.load_default_context() |
|
449 | 412 | c.active = 'issuetracker' |
@@ -470,9 +433,6 b' class AdminSettingsView(BaseAppView):' | |||
|
470 | 433 | @LoginRequired() |
|
471 | 434 | @HasPermissionAllDecorator('hg.admin') |
|
472 | 435 | @CSRFRequired() |
|
473 | @view_config( | |
|
474 | route_name='admin_settings_issuetracker_test', request_method='POST', | |
|
475 | renderer='string', xhr=True) | |
|
476 | 436 | def settings_issuetracker_test(self): |
|
477 | 437 | error_container = [] |
|
478 | 438 | |
@@ -490,9 +450,6 b' class AdminSettingsView(BaseAppView):' | |||
|
490 | 450 | @LoginRequired() |
|
491 | 451 | @HasPermissionAllDecorator('hg.admin') |
|
492 | 452 | @CSRFRequired() |
|
493 | @view_config( | |
|
494 | route_name='admin_settings_issuetracker_update', request_method='POST', | |
|
495 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
|
496 | 453 | def settings_issuetracker_update(self): |
|
497 | 454 | _ = self.request.translate |
|
498 | 455 | self.load_default_context() |
@@ -527,9 +484,6 b' class AdminSettingsView(BaseAppView):' | |||
|
527 | 484 | @LoginRequired() |
|
528 | 485 | @HasPermissionAllDecorator('hg.admin') |
|
529 | 486 | @CSRFRequired() |
|
530 | @view_config( | |
|
531 | route_name='admin_settings_issuetracker_delete', request_method='POST', | |
|
532 | renderer='json_ext', xhr=True) | |
|
533 | 487 | def settings_issuetracker_delete(self): |
|
534 | 488 | _ = self.request.translate |
|
535 | 489 | self.load_default_context() |
@@ -547,9 +501,6 b' class AdminSettingsView(BaseAppView):' | |||
|
547 | 501 | |
|
548 | 502 | @LoginRequired() |
|
549 | 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 | 504 | def settings_email(self): |
|
554 | 505 | c = self.load_default_context() |
|
555 | 506 | c.active = 'email' |
@@ -568,9 +519,6 b' class AdminSettingsView(BaseAppView):' | |||
|
568 | 519 | @LoginRequired() |
|
569 | 520 | @HasPermissionAllDecorator('hg.admin') |
|
570 | 521 | @CSRFRequired() |
|
571 | @view_config( | |
|
572 | route_name='admin_settings_email_update', request_method='POST', | |
|
573 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
|
574 | 522 | def settings_email_update(self): |
|
575 | 523 | _ = self.request.translate |
|
576 | 524 | c = self.load_default_context() |
@@ -600,9 +548,6 b' class AdminSettingsView(BaseAppView):' | |||
|
600 | 548 | |
|
601 | 549 | @LoginRequired() |
|
602 | 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 | 551 | def settings_hooks(self): |
|
607 | 552 | c = self.load_default_context() |
|
608 | 553 | c.active = 'hooks' |
@@ -624,12 +569,6 b' class AdminSettingsView(BaseAppView):' | |||
|
624 | 569 | @LoginRequired() |
|
625 | 570 | @HasPermissionAllDecorator('hg.admin') |
|
626 | 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 | 572 | def settings_hooks_update(self): |
|
634 | 573 | _ = self.request.translate |
|
635 | 574 | c = self.load_default_context() |
@@ -671,9 +610,6 b' class AdminSettingsView(BaseAppView):' | |||
|
671 | 610 | |
|
672 | 611 | @LoginRequired() |
|
673 | 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 | 613 | def settings_search(self): |
|
678 | 614 | c = self.load_default_context() |
|
679 | 615 | c.active = 'search' |
@@ -685,9 +621,6 b' class AdminSettingsView(BaseAppView):' | |||
|
685 | 621 | |
|
686 | 622 | @LoginRequired() |
|
687 | 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 | 624 | def settings_automation(self): |
|
692 | 625 | c = self.load_default_context() |
|
693 | 626 | c.active = 'automation' |
@@ -696,9 +629,6 b' class AdminSettingsView(BaseAppView):' | |||
|
696 | 629 | |
|
697 | 630 | @LoginRequired() |
|
698 | 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 | 632 | def settings_labs(self): |
|
703 | 633 | c = self.load_default_context() |
|
704 | 634 | if not c.labs_active: |
@@ -720,9 +650,6 b' class AdminSettingsView(BaseAppView):' | |||
|
720 | 650 | @LoginRequired() |
|
721 | 651 | @HasPermissionAllDecorator('hg.admin') |
|
722 | 652 | @CSRFRequired() |
|
723 | @view_config( | |
|
724 | route_name='admin_settings_labs_update', request_method='POST', | |
|
725 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
|
726 | 653 | def settings_labs_update(self): |
|
727 | 654 | _ = self.request.translate |
|
728 | 655 | c = self.load_default_context() |
@@ -20,7 +20,7 b'' | |||
|
20 | 20 | |
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | from pyramid.view import view_config | |
|
23 | ||
|
24 | 24 | |
|
25 | 25 | from rhodecode.apps._base import BaseAppView |
|
26 | 26 | from rhodecode.apps.svn_support.utils import generate_mod_dav_svn_config |
@@ -30,14 +30,11 b' from rhodecode.lib.auth import (' | |||
|
30 | 30 | log = logging.getLogger(__name__) |
|
31 | 31 | |
|
32 | 32 | |
|
33 |
class SvnConfig |
|
|
33 | class AdminSvnConfigView(BaseAppView): | |
|
34 | 34 | |
|
35 | 35 | @LoginRequired() |
|
36 | 36 | @HasPermissionAllDecorator('hg.admin') |
|
37 | 37 | @CSRFRequired() |
|
38 | @view_config( | |
|
39 | route_name='admin_settings_vcs_svn_generate_cfg', | |
|
40 | request_method='POST', renderer='json') | |
|
41 | 38 | def vcs_svn_generate_config(self): |
|
42 | 39 | _ = self.request.translate |
|
43 | 40 | try: |
@@ -21,7 +21,7 b'' | |||
|
21 | 21 | import logging |
|
22 | 22 | import urllib2 |
|
23 | 23 | |
|
24 | from pyramid.view import view_config | |
|
24 | ||
|
25 | 25 | |
|
26 | 26 | import rhodecode |
|
27 | 27 | from rhodecode.apps._base import BaseAppView |
@@ -42,9 +42,6 b' class AdminSystemInfoSettingsView(BaseAp' | |||
|
42 | 42 | |
|
43 | 43 | @LoginRequired() |
|
44 | 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 | 45 | def settings_system_info(self): |
|
49 | 46 | _ = self.request.translate |
|
50 | 47 | c = self.load_default_context() |
@@ -169,9 +166,6 b' class AdminSystemInfoSettingsView(BaseAp' | |||
|
169 | 166 | |
|
170 | 167 | @LoginRequired() |
|
171 | 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 | 169 | def settings_system_info_check_update(self): |
|
176 | 170 | _ = self.request.translate |
|
177 | 171 | c = self.load_default_context() |
@@ -24,7 +24,7 b' import formencode' | |||
|
24 | 24 | import formencode.htmlfill |
|
25 | 25 | |
|
26 | 26 | from pyramid.httpexceptions import HTTPFound |
|
27 | from pyramid.view import view_config | |
|
27 | ||
|
28 | 28 | from pyramid.response import Response |
|
29 | 29 | from pyramid.renderers import render |
|
30 | 30 | |
@@ -51,19 +51,14 b' class AdminUserGroupsView(BaseAppView, D' | |||
|
51 | 51 | |
|
52 | 52 | def load_default_context(self): |
|
53 | 53 | c = self._get_local_tmpl_context() |
|
54 | ||
|
55 | 54 | PermissionModel().set_global_permission_choices( |
|
56 | 55 | c, gettext_translator=self.request.translate) |
|
57 | ||
|
58 | 56 | return c |
|
59 | 57 | |
|
60 | 58 | # permission check in data loading of |
|
61 | 59 | # `user_groups_list_data` via UserGroupList |
|
62 | 60 | @LoginRequired() |
|
63 | 61 | @NotAnonymous() |
|
64 | @view_config( | |
|
65 | route_name='user_groups', request_method='GET', | |
|
66 | renderer='rhodecode:templates/admin/user_groups/user_groups.mako') | |
|
67 | 62 | def user_groups_list(self): |
|
68 | 63 | c = self.load_default_context() |
|
69 | 64 | return self._get_template_context(c) |
@@ -71,9 +66,6 b' class AdminUserGroupsView(BaseAppView, D' | |||
|
71 | 66 | # permission check inside |
|
72 | 67 | @LoginRequired() |
|
73 | 68 | @NotAnonymous() |
|
74 | @view_config( | |
|
75 | route_name='user_groups_data', request_method='GET', | |
|
76 | renderer='json_ext', xhr=True) | |
|
77 | 69 | def user_groups_list_data(self): |
|
78 | 70 | self.load_default_context() |
|
79 | 71 | column_map = { |
@@ -197,9 +189,6 b' class AdminUserGroupsView(BaseAppView, D' | |||
|
197 | 189 | |
|
198 | 190 | @LoginRequired() |
|
199 | 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 | 192 | def user_groups_new(self): |
|
204 | 193 | c = self.load_default_context() |
|
205 | 194 | return self._get_template_context(c) |
@@ -207,9 +196,6 b' class AdminUserGroupsView(BaseAppView, D' | |||
|
207 | 196 | @LoginRequired() |
|
208 | 197 | @HasPermissionAnyDecorator('hg.admin', 'hg.usergroup.create.true') |
|
209 | 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 | 199 | def user_groups_create(self): |
|
214 | 200 | _ = self.request.translate |
|
215 | 201 | c = self.load_default_context() |
@@ -24,7 +24,6 b' import formencode' | |||
|
24 | 24 | import formencode.htmlfill |
|
25 | 25 | |
|
26 | 26 | from pyramid.httpexceptions import HTTPFound |
|
27 | from pyramid.view import view_config | |
|
28 | 27 | from pyramid.renderers import render |
|
29 | 28 | from pyramid.response import Response |
|
30 | 29 | |
@@ -72,19 +71,12 b' class AdminUsersView(BaseAppView, DataGr' | |||
|
72 | 71 | |
|
73 | 72 | @LoginRequired() |
|
74 | 73 | @HasPermissionAllDecorator('hg.admin') |
|
75 | @view_config( | |
|
76 | route_name='users', request_method='GET', | |
|
77 | renderer='rhodecode:templates/admin/users/users.mako') | |
|
78 | 74 | def users_list(self): |
|
79 | 75 | c = self.load_default_context() |
|
80 | 76 | return self._get_template_context(c) |
|
81 | 77 | |
|
82 | 78 | @LoginRequired() |
|
83 | 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 | 80 | def users_list_data(self): |
|
89 | 81 | self.load_default_context() |
|
90 | 82 | column_map = { |
@@ -183,9 +175,6 b' class AdminUsersView(BaseAppView, DataGr' | |||
|
183 | 175 | |
|
184 | 176 | @LoginRequired() |
|
185 | 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 | 178 | def users_new(self): |
|
190 | 179 | _ = self.request.translate |
|
191 | 180 | c = self.load_default_context() |
@@ -196,9 +185,6 b' class AdminUsersView(BaseAppView, DataGr' | |||
|
196 | 185 | @LoginRequired() |
|
197 | 186 | @HasPermissionAllDecorator('hg.admin') |
|
198 | 187 | @CSRFRequired() |
|
199 | @view_config( | |
|
200 | route_name='users_create', request_method='POST', | |
|
201 | renderer='rhodecode:templates/admin/users/user_add.mako') | |
|
202 | 188 | def users_create(self): |
|
203 | 189 | _ = self.request.translate |
|
204 | 190 | c = self.load_default_context() |
@@ -309,9 +295,6 b' class UsersView(UserAppView):' | |||
|
309 | 295 | @LoginRequired() |
|
310 | 296 | @HasPermissionAllDecorator('hg.admin') |
|
311 | 297 | @CSRFRequired() |
|
312 | @view_config( | |
|
313 | route_name='user_update', request_method='POST', | |
|
314 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
|
315 | 298 | def user_update(self): |
|
316 | 299 | _ = self.request.translate |
|
317 | 300 | c = self.load_default_context() |
@@ -371,9 +354,6 b' class UsersView(UserAppView):' | |||
|
371 | 354 | @LoginRequired() |
|
372 | 355 | @HasPermissionAllDecorator('hg.admin') |
|
373 | 356 | @CSRFRequired() |
|
374 | @view_config( | |
|
375 | route_name='user_delete', request_method='POST', | |
|
376 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
|
377 | 357 | def user_delete(self): |
|
378 | 358 | _ = self.request.translate |
|
379 | 359 | c = self.load_default_context() |
@@ -496,9 +476,6 b' class UsersView(UserAppView):' | |||
|
496 | 476 | |
|
497 | 477 | @LoginRequired() |
|
498 | 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 | 479 | def user_edit(self): |
|
503 | 480 | _ = self.request.translate |
|
504 | 481 | c = self.load_default_context() |
@@ -525,9 +502,6 b' class UsersView(UserAppView):' | |||
|
525 | 502 | |
|
526 | 503 | @LoginRequired() |
|
527 | 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 | 505 | def user_edit_advanced(self): |
|
532 | 506 | _ = self.request.translate |
|
533 | 507 | c = self.load_default_context() |
@@ -584,9 +558,6 b' class UsersView(UserAppView):' | |||
|
584 | 558 | |
|
585 | 559 | @LoginRequired() |
|
586 | 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 | 561 | def user_edit_global_perms(self): |
|
591 | 562 | _ = self.request.translate |
|
592 | 563 | c = self.load_default_context() |
@@ -614,9 +585,6 b' class UsersView(UserAppView):' | |||
|
614 | 585 | @LoginRequired() |
|
615 | 586 | @HasPermissionAllDecorator('hg.admin') |
|
616 | 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 | 588 | def user_edit_global_perms_update(self): |
|
621 | 589 | _ = self.request.translate |
|
622 | 590 | c = self.load_default_context() |
@@ -682,9 +650,6 b' class UsersView(UserAppView):' | |||
|
682 | 650 | @LoginRequired() |
|
683 | 651 | @HasPermissionAllDecorator('hg.admin') |
|
684 | 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 | 653 | def user_enable_force_password_reset(self): |
|
689 | 654 | _ = self.request.translate |
|
690 | 655 | c = self.load_default_context() |
@@ -711,9 +676,6 b' class UsersView(UserAppView):' | |||
|
711 | 676 | @LoginRequired() |
|
712 | 677 | @HasPermissionAllDecorator('hg.admin') |
|
713 | 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 | 679 | def user_disable_force_password_reset(self): |
|
718 | 680 | _ = self.request.translate |
|
719 | 681 | c = self.load_default_context() |
@@ -741,9 +703,6 b' class UsersView(UserAppView):' | |||
|
741 | 703 | @LoginRequired() |
|
742 | 704 | @HasPermissionAllDecorator('hg.admin') |
|
743 | 705 | @CSRFRequired() |
|
744 | @view_config( | |
|
745 | route_name='user_notice_dismiss', request_method='POST', | |
|
746 | renderer='json_ext', xhr=True) | |
|
747 | 706 | def user_notice_dismiss(self): |
|
748 | 707 | _ = self.request.translate |
|
749 | 708 | c = self.load_default_context() |
@@ -767,9 +726,6 b' class UsersView(UserAppView):' | |||
|
767 | 726 | @LoginRequired() |
|
768 | 727 | @HasPermissionAllDecorator('hg.admin') |
|
769 | 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 | 729 | def user_create_personal_repo_group(self): |
|
774 | 730 | """ |
|
775 | 731 | Create personal repository group for this user |
@@ -821,9 +777,6 b' class UsersView(UserAppView):' | |||
|
821 | 777 | |
|
822 | 778 | @LoginRequired() |
|
823 | 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 | 780 | def auth_tokens(self): |
|
828 | 781 | _ = self.request.translate |
|
829 | 782 | c = self.load_default_context() |
@@ -843,9 +796,6 b' class UsersView(UserAppView):' | |||
|
843 | 796 | |
|
844 | 797 | @LoginRequired() |
|
845 | 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 | 799 | def auth_tokens_view(self): |
|
850 | 800 | _ = self.request.translate |
|
851 | 801 | c = self.load_default_context() |
@@ -867,8 +817,6 b' class UsersView(UserAppView):' | |||
|
867 | 817 | @LoginRequired() |
|
868 | 818 | @HasPermissionAllDecorator('hg.admin') |
|
869 | 819 | @CSRFRequired() |
|
870 | @view_config( | |
|
871 | route_name='edit_user_auth_tokens_add', request_method='POST') | |
|
872 | 820 | def auth_tokens_add(self): |
|
873 | 821 | _ = self.request.translate |
|
874 | 822 | c = self.load_default_context() |
@@ -899,8 +847,6 b' class UsersView(UserAppView):' | |||
|
899 | 847 | @LoginRequired() |
|
900 | 848 | @HasPermissionAllDecorator('hg.admin') |
|
901 | 849 | @CSRFRequired() |
|
902 | @view_config( | |
|
903 | route_name='edit_user_auth_tokens_delete', request_method='POST') | |
|
904 | 850 | def auth_tokens_delete(self): |
|
905 | 851 | _ = self.request.translate |
|
906 | 852 | c = self.load_default_context() |
@@ -928,9 +874,6 b' class UsersView(UserAppView):' | |||
|
928 | 874 | |
|
929 | 875 | @LoginRequired() |
|
930 | 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 | 877 | def ssh_keys(self): |
|
935 | 878 | _ = self.request.translate |
|
936 | 879 | c = self.load_default_context() |
@@ -943,9 +886,6 b' class UsersView(UserAppView):' | |||
|
943 | 886 | |
|
944 | 887 | @LoginRequired() |
|
945 | 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 | 889 | def ssh_keys_generate_keypair(self): |
|
950 | 890 | _ = self.request.translate |
|
951 | 891 | c = self.load_default_context() |
@@ -964,8 +904,6 b' class UsersView(UserAppView):' | |||
|
964 | 904 | @LoginRequired() |
|
965 | 905 | @HasPermissionAllDecorator('hg.admin') |
|
966 | 906 | @CSRFRequired() |
|
967 | @view_config( | |
|
968 | route_name='edit_user_ssh_keys_add', request_method='POST') | |
|
969 | 907 | def ssh_keys_add(self): |
|
970 | 908 | _ = self.request.translate |
|
971 | 909 | c = self.load_default_context() |
@@ -1017,8 +955,6 b' class UsersView(UserAppView):' | |||
|
1017 | 955 | @LoginRequired() |
|
1018 | 956 | @HasPermissionAllDecorator('hg.admin') |
|
1019 | 957 | @CSRFRequired() |
|
1020 | @view_config( | |
|
1021 | route_name='edit_user_ssh_keys_delete', request_method='POST') | |
|
1022 | 958 | def ssh_keys_delete(self): |
|
1023 | 959 | _ = self.request.translate |
|
1024 | 960 | c = self.load_default_context() |
@@ -1048,9 +984,6 b' class UsersView(UserAppView):' | |||
|
1048 | 984 | |
|
1049 | 985 | @LoginRequired() |
|
1050 | 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 | 987 | def emails(self): |
|
1055 | 988 | _ = self.request.translate |
|
1056 | 989 | c = self.load_default_context() |
@@ -1065,8 +998,6 b' class UsersView(UserAppView):' | |||
|
1065 | 998 | @LoginRequired() |
|
1066 | 999 | @HasPermissionAllDecorator('hg.admin') |
|
1067 | 1000 | @CSRFRequired() |
|
1068 | @view_config( | |
|
1069 | route_name='edit_user_emails_add', request_method='POST') | |
|
1070 | 1001 | def emails_add(self): |
|
1071 | 1002 | _ = self.request.translate |
|
1072 | 1003 | c = self.load_default_context() |
@@ -1105,8 +1036,6 b' class UsersView(UserAppView):' | |||
|
1105 | 1036 | @LoginRequired() |
|
1106 | 1037 | @HasPermissionAllDecorator('hg.admin') |
|
1107 | 1038 | @CSRFRequired() |
|
1108 | @view_config( | |
|
1109 | route_name='edit_user_emails_delete', request_method='POST') | |
|
1110 | 1039 | def emails_delete(self): |
|
1111 | 1040 | _ = self.request.translate |
|
1112 | 1041 | c = self.load_default_context() |
@@ -1131,9 +1060,6 b' class UsersView(UserAppView):' | |||
|
1131 | 1060 | |
|
1132 | 1061 | @LoginRequired() |
|
1133 | 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 | 1063 | def ips(self): |
|
1138 | 1064 | _ = self.request.translate |
|
1139 | 1065 | c = self.load_default_context() |
@@ -1152,8 +1078,6 b' class UsersView(UserAppView):' | |||
|
1152 | 1078 | @LoginRequired() |
|
1153 | 1079 | @HasPermissionAllDecorator('hg.admin') |
|
1154 | 1080 | @CSRFRequired() |
|
1155 | @view_config( | |
|
1156 | route_name='edit_user_ips_add', request_method='POST') | |
|
1157 | 1081 | # NOTE(marcink): this view is allowed for default users, as we can |
|
1158 | 1082 | # edit their IP white list |
|
1159 | 1083 | def ips_add(self): |
@@ -1207,8 +1131,6 b' class UsersView(UserAppView):' | |||
|
1207 | 1131 | @LoginRequired() |
|
1208 | 1132 | @HasPermissionAllDecorator('hg.admin') |
|
1209 | 1133 | @CSRFRequired() |
|
1210 | @view_config( | |
|
1211 | route_name='edit_user_ips_delete', request_method='POST') | |
|
1212 | 1134 | # NOTE(marcink): this view is allowed for default users, as we can |
|
1213 | 1135 | # edit their IP white list |
|
1214 | 1136 | def ips_delete(self): |
@@ -1236,9 +1158,6 b' class UsersView(UserAppView):' | |||
|
1236 | 1158 | |
|
1237 | 1159 | @LoginRequired() |
|
1238 | 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 | 1161 | def groups_management(self): |
|
1243 | 1162 | c = self.load_default_context() |
|
1244 | 1163 | c.user = self.db_user |
@@ -1254,8 +1173,6 b' class UsersView(UserAppView):' | |||
|
1254 | 1173 | @LoginRequired() |
|
1255 | 1174 | @HasPermissionAllDecorator('hg.admin') |
|
1256 | 1175 | @CSRFRequired() |
|
1257 | @view_config( | |
|
1258 | route_name='edit_user_groups_management_updates', request_method='POST') | |
|
1259 | 1176 | def groups_management_updates(self): |
|
1260 | 1177 | _ = self.request.translate |
|
1261 | 1178 | c = self.load_default_context() |
@@ -1299,9 +1216,6 b' class UsersView(UserAppView):' | |||
|
1299 | 1216 | |
|
1300 | 1217 | @LoginRequired() |
|
1301 | 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 | 1219 | def user_audit_logs(self): |
|
1306 | 1220 | _ = self.request.translate |
|
1307 | 1221 | c = self.load_default_context() |
@@ -1329,9 +1243,6 b' class UsersView(UserAppView):' | |||
|
1329 | 1243 | |
|
1330 | 1244 | @LoginRequired() |
|
1331 | 1245 | @HasPermissionAllDecorator('hg.admin') |
|
1332 | @view_config( | |
|
1333 | route_name='edit_user_audit_logs_download', request_method='GET', | |
|
1334 | renderer='string') | |
|
1335 | 1246 | def user_audit_logs_download(self): |
|
1336 | 1247 | _ = self.request.translate |
|
1337 | 1248 | c = self.load_default_context() |
@@ -1352,9 +1263,6 b' class UsersView(UserAppView):' | |||
|
1352 | 1263 | |
|
1353 | 1264 | @LoginRequired() |
|
1354 | 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 | 1266 | def user_perms_summary(self): |
|
1359 | 1267 | _ = self.request.translate |
|
1360 | 1268 | c = self.load_default_context() |
@@ -1367,9 +1275,6 b' class UsersView(UserAppView):' | |||
|
1367 | 1275 | |
|
1368 | 1276 | @LoginRequired() |
|
1369 | 1277 | @HasPermissionAllDecorator('hg.admin') |
|
1370 | @view_config( | |
|
1371 | route_name='edit_user_perms_summary_json', request_method='GET', | |
|
1372 | renderer='json_ext') | |
|
1373 | 1278 | def user_perms_summary_json(self): |
|
1374 | 1279 | self.load_default_context() |
|
1375 | 1280 | perm_user = self.db_user.AuthUser(ip_addr=self.request.remote_addr) |
@@ -1378,9 +1283,6 b' class UsersView(UserAppView):' | |||
|
1378 | 1283 | |
|
1379 | 1284 | @LoginRequired() |
|
1380 | 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 | 1286 | def user_caches(self): |
|
1385 | 1287 | _ = self.request.translate |
|
1386 | 1288 | c = self.load_default_context() |
@@ -1399,8 +1301,6 b' class UsersView(UserAppView):' | |||
|
1399 | 1301 | @LoginRequired() |
|
1400 | 1302 | @HasPermissionAllDecorator('hg.admin') |
|
1401 | 1303 | @CSRFRequired() |
|
1402 | @view_config( | |
|
1403 | route_name='edit_user_caches_update', request_method='POST') | |
|
1404 | 1304 | def user_caches_update(self): |
|
1405 | 1305 | _ = self.request.translate |
|
1406 | 1306 | c = self.load_default_context() |
@@ -67,6 +67,8 b' def maybe_create_history_store(event):' | |||
|
67 | 67 | |
|
68 | 68 | |
|
69 | 69 | def includeme(config): |
|
70 | from rhodecode.apps.channelstream.views import ChannelstreamView | |
|
71 | ||
|
70 | 72 | settings = config.registry.settings |
|
71 | 73 | PLUGIN_DEFINITION['config']['enabled'] = asbool( |
|
72 | 74 | settings.get('channelstream.enabled')) |
@@ -85,12 +87,20 b' def includeme(config):' | |||
|
85 | 87 | config.add_route( |
|
86 | 88 | name='channelstream_connect', |
|
87 | 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 | 95 | config.add_route( |
|
89 | 96 | name='channelstream_subscribe', |
|
90 | 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 | 103 | config.add_route( |
|
92 | 104 | name='channelstream_proxy', |
|
93 | 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 | 21 | import logging |
|
22 | 22 | import uuid |
|
23 | 23 | |
|
24 | from pyramid.view import view_config | |
|
24 | ||
|
25 | 25 | from pyramid.httpexceptions import HTTPBadRequest, HTTPForbidden, HTTPBadGateway |
|
26 | 26 | |
|
27 | 27 | from rhodecode.apps._base import BaseAppView |
@@ -54,8 +54,7 b' class ChannelstreamView(BaseAppView):' | |||
|
54 | 54 | return c |
|
55 | 55 | |
|
56 | 56 | @NotAnonymous() |
|
57 | @view_config(route_name='channelstream_connect', renderer='json_ext') | |
|
58 | def connect(self): | |
|
57 | def channelstream_connect(self): | |
|
59 | 58 | """ handle authorization of users trying to connect """ |
|
60 | 59 | |
|
61 | 60 | self.load_default_context() |
@@ -132,8 +131,7 b' class ChannelstreamView(BaseAppView):' | |||
|
132 | 131 | return connect_result |
|
133 | 132 | |
|
134 | 133 | @NotAnonymous() |
|
135 | @view_config(route_name='channelstream_subscribe', renderer='json_ext') | |
|
136 | def subscribe(self): | |
|
134 | def channelstream_subscribe(self): | |
|
137 | 135 | """ can be used to subscribe specific connection to other channels """ |
|
138 | 136 | self.load_default_context() |
|
139 | 137 | try: |
@@ -35,6 +35,8 b' class DebugStylePredicate(object):' | |||
|
35 | 35 | |
|
36 | 36 | |
|
37 | 37 | def includeme(config): |
|
38 | from rhodecode.apps.debug_style.views import DebugStyleView | |
|
39 | ||
|
38 | 40 | config.add_route_predicate( |
|
39 | 41 | 'debug_style', DebugStylePredicate) |
|
40 | 42 | |
@@ -42,18 +44,38 b' def includeme(config):' | |||
|
42 | 44 | name='debug_style_home', |
|
43 | 45 | pattern=ADMIN_PREFIX + '/debug_style', |
|
44 | 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 | 53 | config.add_route( |
|
46 | 54 | name='debug_style_email', |
|
47 | 55 | pattern=ADMIN_PREFIX + '/debug_style/email/{email_id}', |
|
48 | 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 | 63 | config.add_route( |
|
50 | 64 | name='debug_style_email_plain_rendered', |
|
51 | 65 | pattern=ADMIN_PREFIX + '/debug_style/email-rendered/{email_id}', |
|
52 | 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 | 73 | config.add_route( |
|
54 | 74 | name='debug_style_template', |
|
55 | 75 | pattern=ADMIN_PREFIX + '/debug_style/t/{t_path}', |
|
56 | 76 | debug_style=True) |
|
57 | ||
|
58 | # Scan module for configuration decorators. | |
|
59 | config.scan('.views', ignore='.tests') | |
|
77 | config.add_view( | |
|
78 | DebugStyleView, | |
|
79 | attr='template', | |
|
80 | route_name='debug_style_template', request_method='GET', | |
|
81 | renderer=None) |
@@ -22,7 +22,6 b' import os' | |||
|
22 | 22 | import logging |
|
23 | 23 | import datetime |
|
24 | 24 | |
|
25 | from pyramid.view import view_config | |
|
26 | 25 | from pyramid.renderers import render_to_response |
|
27 | 26 | from rhodecode.apps._base import BaseAppView |
|
28 | 27 | from rhodecode.lib.celerylib import run_task, tasks |
@@ -37,12 +36,8 b' class DebugStyleView(BaseAppView):' | |||
|
37 | 36 | |
|
38 | 37 | def load_default_context(self): |
|
39 | 38 | c = self._get_local_tmpl_context() |
|
40 | ||
|
41 | 39 | return c |
|
42 | 40 | |
|
43 | @view_config( | |
|
44 | route_name='debug_style_home', request_method='GET', | |
|
45 | renderer=None) | |
|
46 | 41 | def index(self): |
|
47 | 42 | c = self.load_default_context() |
|
48 | 43 | c.active = 'index' |
@@ -51,12 +46,6 b' class DebugStyleView(BaseAppView):' | |||
|
51 | 46 | 'debug_style/index.html', self._get_template_context(c), |
|
52 | 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 | 49 | def render_email(self): |
|
61 | 50 | c = self.load_default_context() |
|
62 | 51 | email_id = self.request.matchdict['email_id'] |
@@ -457,9 +446,6 b' users: description edit fixes' | |||
|
457 | 446 | template, self._get_template_context(c), |
|
458 | 447 | request=self.request) |
|
459 | 448 | |
|
460 | @view_config( | |
|
461 | route_name='debug_style_template', request_method='GET', | |
|
462 | renderer=None) | |
|
463 | 449 | def template(self): |
|
464 | 450 | t_path = self.request.matchdict['t_path'] |
|
465 | 451 | c = self.load_default_context() |
@@ -483,4 +469,3 b' users: description edit fixes' | |||
|
483 | 469 | return render_to_response( |
|
484 | 470 | 'debug_style/' + t_path, self._get_template_context(c), |
|
485 | 471 | request=self.request) |
|
486 |
@@ -35,18 +35,31 b' def _sanitize_settings_and_apply_default' | |||
|
35 | 35 | |
|
36 | 36 | |
|
37 | 37 | def includeme(config): |
|
38 | from rhodecode.apps.file_store.views import FileStoreView | |
|
39 | ||
|
38 | 40 | settings = config.registry.settings |
|
39 | 41 | _sanitize_settings_and_apply_defaults(settings) |
|
40 | 42 | |
|
41 | 43 | config.add_route( |
|
42 | 44 | name='upload_file', |
|
43 | 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 | 51 | config.add_route( |
|
45 | 52 | name='download_file', |
|
46 | 53 | pattern='/_file_store/download/{fid:.*}') |
|
54 | config.add_view( | |
|
55 | FileStoreView, | |
|
56 | attr='download_file', | |
|
57 | route_name='download_file') | |
|
58 | ||
|
47 | 59 | config.add_route( |
|
48 | 60 | name='download_file_by_token', |
|
49 | 61 | pattern='/_file_store/token-download/{_auth_token}/{fid:.*}') |
|
50 | ||
|
51 | # Scan module for configuration decorators. | |
|
52 | config.scan('.views', ignore='.tests') | |
|
62 | config.add_view( | |
|
63 | FileStoreView, | |
|
64 | attr='download_file_by_token', | |
|
65 | route_name='download_file_by_token') |
@@ -19,7 +19,7 b'' | |||
|
19 | 19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
20 | 20 | import logging |
|
21 | 21 | |
|
22 | from pyramid.view import view_config | |
|
22 | ||
|
23 | 23 | from pyramid.response import FileResponse |
|
24 | 24 | from pyramid.httpexceptions import HTTPFound, HTTPNotFound |
|
25 | 25 | |
@@ -128,7 +128,6 b' class FileStoreView(BaseAppView):' | |||
|
128 | 128 | @LoginRequired() |
|
129 | 129 | @NotAnonymous() |
|
130 | 130 | @CSRFRequired() |
|
131 | @view_config(route_name='upload_file', request_method='POST', renderer='json_ext') | |
|
132 | 131 | def upload_file(self): |
|
133 | 132 | self.load_default_context() |
|
134 | 133 | file_obj = self.request.POST.get(self.upload_key) |
@@ -182,7 +181,6 b' class FileStoreView(BaseAppView):' | |||
|
182 | 181 | 'access_path': h.route_path('download_file', fid=store_uid)} |
|
183 | 182 | |
|
184 | 183 | # ACL is checked by scopes, if no scope the file is accessible to all |
|
185 | @view_config(route_name='download_file') | |
|
186 | 184 | def download_file(self): |
|
187 | 185 | self.load_default_context() |
|
188 | 186 | file_uid = self.request.matchdict['fid'] |
@@ -192,7 +190,6 b' class FileStoreView(BaseAppView):' | |||
|
192 | 190 | # in addition to @LoginRequired ACL is checked by scopes |
|
193 | 191 | @LoginRequired(auth_token_access=[UserApiKeys.ROLE_ARTIFACT_DOWNLOAD]) |
|
194 | 192 | @NotAnonymous() |
|
195 | @view_config(route_name='download_file_by_token') | |
|
196 | 193 | def download_file_by_token(self): |
|
197 | 194 | """ |
|
198 | 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 | 23 | def admin_routes(config): |
|
24 | from rhodecode.apps.gist.views import GistView | |
|
25 | ||
|
24 | 26 | config.add_route( |
|
25 | 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 | 34 | config.add_route( |
|
27 | 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 | 42 | config.add_route( |
|
29 | 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 | 50 | config.add_route( |
|
32 | 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 | 86 | config.add_route( |
|
35 | 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 | 93 | config.add_route( |
|
38 | 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 | 109 | config.add_route( |
|
41 | 110 | name='gist_edit_check_revision', |
|
42 | 111 | pattern='/gists/{gist_id}/edit/check_revision') |
|
43 | ||
|
44 | config.add_route( | |
|
45 | name='gist_update', pattern='/gists/{gist_id}/update') | |
|
46 | ||
|
47 | config.add_route( | |
|
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:.*}') | |
|
112 | config.add_view( | |
|
113 | GistView, | |
|
114 | attr='gist_edit_check_revision', | |
|
115 | route_name='gist_edit_check_revision', request_method='GET', | |
|
116 | renderer='json_ext') | |
|
57 | 117 | |
|
58 | 118 | |
|
59 | 119 | def includeme(config): |
|
60 | 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 | 43 | 'gist_edit': ADMIN_PREFIX + '/gists/{gist_id}/edit', |
|
44 | 44 | 'gist_edit_check_revision': ADMIN_PREFIX + '/gists/{gist_id}/edit/check_revision', |
|
45 | 45 | 'gist_update': ADMIN_PREFIX + '/gists/{gist_id}/update', |
|
46 | 'gist_show_rev': ADMIN_PREFIX + '/gists/{gist_id}/{revision}', | |
|
47 | 'gist_show_formatted': ADMIN_PREFIX + '/gists/{gist_id}/{revision}/{format}', | |
|
48 | 'gist_show_formatted_path': ADMIN_PREFIX + '/gists/{gist_id}/{revision}/{format}/{f_path}', | |
|
46 | 'gist_show_rev': ADMIN_PREFIX + '/gists/{gist_id}/rev/{revision}', | |
|
47 | 'gist_show_formatted': ADMIN_PREFIX + '/gists/{gist_id}/rev/{revision}/{format}', | |
|
48 | 'gist_show_formatted_path': ADMIN_PREFIX + '/gists/{gist_id}/rev/{revision}/{format}/{f_path}', | |
|
49 | 49 | |
|
50 | 50 | }[name].format(**kwargs) |
|
51 | 51 |
@@ -26,7 +26,6 b' import formencode.htmlfill' | |||
|
26 | 26 | import peppercorn |
|
27 | 27 | |
|
28 | 28 | from pyramid.httpexceptions import HTTPNotFound, HTTPFound, HTTPBadRequest |
|
29 | from pyramid.view import view_config | |
|
30 | 29 | from pyramid.renderers import render |
|
31 | 30 | from pyramid.response import Response |
|
32 | 31 | |
@@ -70,9 +69,6 b' class GistView(BaseAppView):' | |||
|
70 | 69 | return c |
|
71 | 70 | |
|
72 | 71 | @LoginRequired() |
|
73 | @view_config( | |
|
74 | route_name='gists_show', request_method='GET', | |
|
75 | renderer='rhodecode:templates/admin/gists/gist_index.mako') | |
|
76 | 72 | def gist_show_all(self): |
|
77 | 73 | c = self.load_default_context() |
|
78 | 74 | |
@@ -134,9 +130,6 b' class GistView(BaseAppView):' | |||
|
134 | 130 | |
|
135 | 131 | @LoginRequired() |
|
136 | 132 | @NotAnonymous() |
|
137 | @view_config( | |
|
138 | route_name='gists_new', request_method='GET', | |
|
139 | renderer='rhodecode:templates/admin/gists/gist_new.mako') | |
|
140 | 133 | def gist_new(self): |
|
141 | 134 | c = self.load_default_context() |
|
142 | 135 | return self._get_template_context(c) |
@@ -144,9 +137,6 b' class GistView(BaseAppView):' | |||
|
144 | 137 | @LoginRequired() |
|
145 | 138 | @NotAnonymous() |
|
146 | 139 | @CSRFRequired() |
|
147 | @view_config( | |
|
148 | route_name='gists_create', request_method='POST', | |
|
149 | renderer='rhodecode:templates/admin/gists/gist_new.mako') | |
|
150 | 140 | def gist_create(self): |
|
151 | 141 | _ = self.request.translate |
|
152 | 142 | c = self.load_default_context() |
@@ -222,8 +212,6 b' class GistView(BaseAppView):' | |||
|
222 | 212 | @LoginRequired() |
|
223 | 213 | @NotAnonymous() |
|
224 | 214 | @CSRFRequired() |
|
225 | @view_config( | |
|
226 | route_name='gist_delete', request_method='POST') | |
|
227 | 215 | def gist_delete(self): |
|
228 | 216 | _ = self.request.translate |
|
229 | 217 | gist_id = self.request.matchdict['gist_id'] |
@@ -263,18 +251,6 b' class GistView(BaseAppView):' | |||
|
263 | 251 | return gist |
|
264 | 252 | |
|
265 | 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 | 254 | def gist_show(self): |
|
279 | 255 | gist_id = self.request.matchdict['gist_id'] |
|
280 | 256 | |
@@ -307,9 +283,6 b' class GistView(BaseAppView):' | |||
|
307 | 283 | |
|
308 | 284 | @LoginRequired() |
|
309 | 285 | @NotAnonymous() |
|
310 | @view_config( | |
|
311 | route_name='gist_edit', request_method='GET', | |
|
312 | renderer='rhodecode:templates/admin/gists/gist_edit.mako') | |
|
313 | 286 | def gist_edit(self): |
|
314 | 287 | _ = self.request.translate |
|
315 | 288 | gist_id = self.request.matchdict['gist_id'] |
@@ -341,9 +314,6 b' class GistView(BaseAppView):' | |||
|
341 | 314 | @LoginRequired() |
|
342 | 315 | @NotAnonymous() |
|
343 | 316 | @CSRFRequired() |
|
344 | @view_config( | |
|
345 | route_name='gist_update', request_method='POST', | |
|
346 | renderer='rhodecode:templates/admin/gists/gist_edit.mako') | |
|
347 | 317 | def gist_update(self): |
|
348 | 318 | _ = self.request.translate |
|
349 | 319 | gist_id = self.request.matchdict['gist_id'] |
@@ -397,9 +367,6 b' class GistView(BaseAppView):' | |||
|
397 | 367 | |
|
398 | 368 | @LoginRequired() |
|
399 | 369 | @NotAnonymous() |
|
400 | @view_config( | |
|
401 | route_name='gist_edit_check_revision', request_method='GET', | |
|
402 | renderer='json_ext') | |
|
403 | 370 | def gist_edit_check_revision(self): |
|
404 | 371 | _ = self.request.translate |
|
405 | 372 | gist_id = self.request.matchdict['gist_id'] |
@@ -38,56 +38,110 b' class VCSCallPredicate(object):' | |||
|
38 | 38 | |
|
39 | 39 | |
|
40 | 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 | 46 | config.add_route( |
|
43 | 47 | name='home', |
|
44 | 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 | 55 | config.add_route( |
|
47 | 56 | name='main_page_repos_data', |
|
48 | 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 | 64 | config.add_route( |
|
51 | 65 | name='main_page_repo_groups_data', |
|
52 | 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 | 73 | config.add_route( |
|
55 | 74 | name='user_autocomplete_data', |
|
56 | 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 | 82 | config.add_route( |
|
59 | 83 | name='user_group_autocomplete_data', |
|
60 | 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 | 91 | config.add_route( |
|
63 | 92 | name='repo_list_data', |
|
64 | 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 | 100 | config.add_route( |
|
67 | 101 | name='repo_group_list_data', |
|
68 | 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 | 109 | config.add_route( |
|
71 | 110 | name='goto_switcher_data', |
|
72 | 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 | 118 | config.add_route( |
|
75 | 119 | name='markup_preview', |
|
76 | 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 | 127 | config.add_route( |
|
79 | 128 | name='file_preview', |
|
80 | 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 | 136 | config.add_route( |
|
83 | 137 | name='store_user_session_value', |
|
84 | 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 | 145 | # register our static links via redirection mechanism |
|
87 | 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 | 23 | import collections |
|
24 | 24 | |
|
25 | 25 | from pyramid.httpexceptions import HTTPNotFound |
|
26 | from pyramid.view import view_config | |
|
27 | 26 | |
|
28 | 27 | from rhodecode.apps._base import BaseAppView, DataGridAppView |
|
29 | 28 | from rhodecode.lib import helpers as h |
@@ -50,13 +49,9 b' class HomeView(BaseAppView, DataGridAppV' | |||
|
50 | 49 | def load_default_context(self): |
|
51 | 50 | c = self._get_local_tmpl_context() |
|
52 | 51 | c.user = c.auth_user.get_instance() |
|
53 | ||
|
54 | 52 | return c |
|
55 | 53 | |
|
56 | 54 | @LoginRequired() |
|
57 | @view_config( | |
|
58 | route_name='user_autocomplete_data', request_method='GET', | |
|
59 | renderer='json_ext', xhr=True) | |
|
60 | 55 | def user_autocomplete_data(self): |
|
61 | 56 | self.load_default_context() |
|
62 | 57 | query = self.request.GET.get('query') |
@@ -88,9 +83,6 b' class HomeView(BaseAppView, DataGridAppV' | |||
|
88 | 83 | |
|
89 | 84 | @LoginRequired() |
|
90 | 85 | @NotAnonymous() |
|
91 | @view_config( | |
|
92 | route_name='user_group_autocomplete_data', request_method='GET', | |
|
93 | renderer='json_ext', xhr=True) | |
|
94 | 86 | def user_group_autocomplete_data(self): |
|
95 | 87 | self.load_default_context() |
|
96 | 88 | query = self.request.GET.get('query') |
@@ -434,9 +426,6 b' class HomeView(BaseAppView, DataGridAppV' | |||
|
434 | 426 | return files, True |
|
435 | 427 | |
|
436 | 428 | @LoginRequired() |
|
437 | @view_config( | |
|
438 | route_name='repo_list_data', request_method='GET', | |
|
439 | renderer='json_ext', xhr=True) | |
|
440 | 429 | def repo_list_data(self): |
|
441 | 430 | _ = self.request.translate |
|
442 | 431 | self.load_default_context() |
@@ -461,9 +450,6 b' class HomeView(BaseAppView, DataGridAppV' | |||
|
461 | 450 | return data |
|
462 | 451 | |
|
463 | 452 | @LoginRequired() |
|
464 | @view_config( | |
|
465 | route_name='repo_group_list_data', request_method='GET', | |
|
466 | renderer='json_ext', xhr=True) | |
|
467 | 453 | def repo_group_list_data(self): |
|
468 | 454 | _ = self.request.translate |
|
469 | 455 | self.load_default_context() |
@@ -619,9 +605,6 b' class HomeView(BaseAppView, DataGridAppV' | |||
|
619 | 605 | return queries |
|
620 | 606 | |
|
621 | 607 | @LoginRequired() |
|
622 | @view_config( | |
|
623 | route_name='goto_switcher_data', request_method='GET', | |
|
624 | renderer='json_ext', xhr=True) | |
|
625 | 608 | def goto_switcher_data(self): |
|
626 | 609 | c = self.load_default_context() |
|
627 | 610 | |
@@ -750,9 +733,6 b' class HomeView(BaseAppView, DataGridAppV' | |||
|
750 | 733 | return {'suggestions': res} |
|
751 | 734 | |
|
752 | 735 | @LoginRequired() |
|
753 | @view_config( | |
|
754 | route_name='home', request_method='GET', | |
|
755 | renderer='rhodecode:templates/index.mako') | |
|
756 | 736 | def main_page(self): |
|
757 | 737 | c = self.load_default_context() |
|
758 | 738 | c.repo_group = None |
@@ -789,9 +769,6 b' class HomeView(BaseAppView, DataGridAppV' | |||
|
789 | 769 | self._rhodecode_user, repo_group_id) |
|
790 | 770 | |
|
791 | 771 | @LoginRequired() |
|
792 | @view_config( | |
|
793 | route_name='main_page_repo_groups_data', | |
|
794 | request_method='GET', renderer='json_ext', xhr=True) | |
|
795 | 772 | def main_page_repo_groups_data(self): |
|
796 | 773 | self.load_default_context() |
|
797 | 774 | repo_group_id = safe_int(self.request.GET.get('repo_group_id')) |
@@ -806,9 +783,6 b' class HomeView(BaseAppView, DataGridAppV' | |||
|
806 | 783 | return self._main_page_repo_groups_data(repo_group_id) |
|
807 | 784 | |
|
808 | 785 | @LoginRequired() |
|
809 | @view_config( | |
|
810 | route_name='main_page_repos_data', | |
|
811 | request_method='GET', renderer='json_ext', xhr=True) | |
|
812 | 786 | def main_page_repos_data(self): |
|
813 | 787 | self.load_default_context() |
|
814 | 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 | 799 | @LoginRequired() |
|
826 | 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 | 801 | def repo_group_main_page(self): |
|
834 | 802 | c = self.load_default_context() |
|
835 | 803 | c.repo_group = self.request.db_repo_group |
@@ -837,9 +805,6 b' class HomeView(BaseAppView, DataGridAppV' | |||
|
837 | 805 | |
|
838 | 806 | @LoginRequired() |
|
839 | 807 | @CSRFRequired() |
|
840 | @view_config( | |
|
841 | route_name='markup_preview', request_method='POST', | |
|
842 | renderer='string', xhr=True) | |
|
843 | 808 | def markup_preview(self): |
|
844 | 809 | # Technically a CSRF token is not needed as no state changes with this |
|
845 | 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 | 821 | @LoginRequired() |
|
857 | 822 | @CSRFRequired() |
|
858 | @view_config( | |
|
859 | route_name='file_preview', request_method='POST', | |
|
860 | renderer='string', xhr=True) | |
|
861 | 823 | def file_preview(self): |
|
862 | 824 | # Technically a CSRF token is not needed as no state changes with this |
|
863 | 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 | 846 | @LoginRequired() |
|
885 | 847 | @CSRFRequired() |
|
886 | @view_config( | |
|
887 | route_name='store_user_session_value', request_method='POST', | |
|
888 | renderer='string', xhr=True) | |
|
889 | 848 | def store_user_session_attr(self): |
|
890 | 849 | key = self.request.POST.get('key') |
|
891 | 850 | val = self.request.POST.get('val') |
@@ -20,26 +20,48 b'' | |||
|
20 | 20 | |
|
21 | 21 | |
|
22 | 22 | def includeme(config): |
|
23 | ||
|
23 | from rhodecode.apps.hovercards.views import HoverCardsView, HoverCardsRepoView | |
|
24 | 24 | config.add_route( |
|
25 | 25 | name='hovercard_user', |
|
26 | 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 | 33 | config.add_route( |
|
29 | 34 | name='hovercard_username', |
|
30 | 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 | 42 | config.add_route( |
|
33 | 43 | name='hovercard_user_group', |
|
34 | 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 | 51 | config.add_route( |
|
37 | 52 | name='hovercard_pull_request', |
|
38 | 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 | 60 | config.add_route( |
|
41 | 61 | name='hovercard_repo_commit', |
|
42 | 62 | pattern='/_hovercard/commit/{repo_name:.*?[^/]}/{commit_id}', repo_route=True) |
|
43 | ||
|
44 | # Scan module for configuration decorators. | |
|
45 | config.scan('.views', ignore='.tests') | |
|
63 | config.add_view( | |
|
64 | HoverCardsRepoView, | |
|
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 | 23 | import collections |
|
24 | 24 | |
|
25 | 25 | from pyramid.httpexceptions import HTTPNotFound |
|
26 | from pyramid.view import view_config | |
|
26 | ||
|
27 | 27 | |
|
28 | 28 | from rhodecode.apps._base import BaseAppView, RepoAppView |
|
29 | 29 | from rhodecode.lib import helpers as h |
@@ -54,9 +54,6 b' class HoverCardsView(BaseAppView):' | |||
|
54 | 54 | return c |
|
55 | 55 | |
|
56 | 56 | @LoginRequired() |
|
57 | @view_config( | |
|
58 | route_name='hovercard_user', request_method='GET', xhr=True, | |
|
59 | renderer='rhodecode:templates/hovercards/hovercard_user.mako') | |
|
60 | 57 | def hovercard_user(self): |
|
61 | 58 | c = self.load_default_context() |
|
62 | 59 | user_id = self.request.matchdict['user_id'] |
@@ -64,9 +61,6 b' class HoverCardsView(BaseAppView):' | |||
|
64 | 61 | return self._get_template_context(c) |
|
65 | 62 | |
|
66 | 63 | @LoginRequired() |
|
67 | @view_config( | |
|
68 | route_name='hovercard_username', request_method='GET', xhr=True, | |
|
69 | renderer='rhodecode:templates/hovercards/hovercard_user.mako') | |
|
70 | 64 | def hovercard_username(self): |
|
71 | 65 | c = self.load_default_context() |
|
72 | 66 | username = self.request.matchdict['username'] |
@@ -77,9 +71,6 b' class HoverCardsView(BaseAppView):' | |||
|
77 | 71 | return self._get_template_context(c) |
|
78 | 72 | |
|
79 | 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 | 74 | def hovercard_user_group(self): |
|
84 | 75 | c = self.load_default_context() |
|
85 | 76 | user_group_id = self.request.matchdict['user_group_id'] |
@@ -87,9 +78,6 b' class HoverCardsView(BaseAppView):' | |||
|
87 | 78 | return self._get_template_context(c) |
|
88 | 79 | |
|
89 | 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 | 81 | def hovercard_pull_request(self): |
|
94 | 82 | c = self.load_default_context() |
|
95 | 83 | c.pull_request = PullRequest.get_or_404( |
@@ -107,9 +95,6 b' class HoverCardsRepoView(RepoAppView):' | |||
|
107 | 95 | |
|
108 | 96 | @LoginRequired() |
|
109 | 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 | 98 | def hovercard_repo_commit(self): |
|
114 | 99 | c = self.load_default_context() |
|
115 | 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 | 25 | def admin_routes(config): |
|
26 | from rhodecode.apps.journal.views import JournalView | |
|
26 | 27 | |
|
27 | 28 | config.add_route( |
|
28 | 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 | 36 | config.add_route( |
|
30 | 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 | 44 | config.add_route( |
|
32 | 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 | 52 | config.add_route( |
|
35 | 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 | 60 | config.add_route( |
|
37 | 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 | 68 | config.add_route( |
|
39 | 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 | 76 | config.add_route( |
|
42 | 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 | 84 | config.add_route( |
|
44 | 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 | 92 | config.add_route( |
|
47 | 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 | 101 | def includeme(config): |
|
51 | 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 | 18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
19 | 19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
20 | 20 | |
|
21 | ||
|
22 | 21 | import logging |
|
23 | 22 | import itertools |
|
24 | 23 | |
|
25 | ||
|
26 | ||
|
27 | from pyramid.view import view_config | |
|
28 | 24 | from pyramid.httpexceptions import HTTPBadRequest |
|
29 | 25 | from pyramid.response import Response |
|
30 | 26 | from pyramid.renderers import render |
@@ -218,9 +214,6 b' class JournalView(BaseAppView):' | |||
|
218 | 214 | |
|
219 | 215 | @LoginRequired() |
|
220 | 216 | @NotAnonymous() |
|
221 | @view_config( | |
|
222 | route_name='journal', request_method='GET', | |
|
223 | renderer=None) | |
|
224 | 217 | def journal(self): |
|
225 | 218 | c = self.load_default_context() |
|
226 | 219 | |
@@ -258,9 +251,6 b' class JournalView(BaseAppView):' | |||
|
258 | 251 | |
|
259 | 252 | @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED]) |
|
260 | 253 | @NotAnonymous() |
|
261 | @view_config( | |
|
262 | route_name='journal_atom', request_method='GET', | |
|
263 | renderer=None) | |
|
264 | 254 | def journal_atom(self): |
|
265 | 255 | """ |
|
266 | 256 | Produce an atom-1.0 feed via feedgenerator module |
@@ -274,9 +264,6 b' class JournalView(BaseAppView):' | |||
|
274 | 264 | |
|
275 | 265 | @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED]) |
|
276 | 266 | @NotAnonymous() |
|
277 | @view_config( | |
|
278 | route_name='journal_rss', request_method='GET', | |
|
279 | renderer=None) | |
|
280 | 267 | def journal_rss(self): |
|
281 | 268 | """ |
|
282 | 269 | Produce an rss feed via feedgenerator module |
@@ -289,39 +276,6 b' class JournalView(BaseAppView):' | |||
|
289 | 276 | return self._rss_feed(following_repos, c.search_term, public=False) |
|
290 | 277 | |
|
291 | 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 | 279 | def journal_public(self): |
|
326 | 280 | c = self.load_default_context() |
|
327 | 281 | # Return a rendered template |
@@ -357,9 +311,6 b' class JournalView(BaseAppView):' | |||
|
357 | 311 | return Response(html) |
|
358 | 312 | |
|
359 | 313 | @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED]) |
|
360 | @view_config( | |
|
361 | route_name='journal_public_atom', request_method='GET', | |
|
362 | renderer=None) | |
|
363 | 314 | def journal_public_atom(self): |
|
364 | 315 | """ |
|
365 | 316 | Produce an atom-1.0 feed via feedgenerator module |
@@ -373,9 +324,6 b' class JournalView(BaseAppView):' | |||
|
373 | 324 | return self._atom_feed(following_repos, c.search_term) |
|
374 | 325 | |
|
375 | 326 | @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED]) |
|
376 | @view_config( | |
|
377 | route_name='journal_public_rss', request_method='GET', | |
|
378 | renderer=None) | |
|
379 | 327 | def journal_public_rss(self): |
|
380 | 328 | """ |
|
381 | 329 | Produce an rss2 feed via feedgenerator module |
@@ -387,3 +335,30 b' class JournalView(BaseAppView):' | |||
|
387 | 335 | .all() |
|
388 | 336 | |
|
389 | 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 | 25 | def includeme(config): |
|
26 | ||
|
26 | from rhodecode.apps.login.views import LoginView | |
|
27 | ||
|
27 | 28 | config.add_route( |
|
28 | 29 | name='login', |
|
29 | 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 | 42 | config.add_route( |
|
31 | 43 | name='logout', |
|
32 | 44 | pattern=ADMIN_PREFIX + '/logout') |
|
45 | config.add_view( | |
|
46 | LoginView, | |
|
47 | attr='logout', | |
|
48 | route_name='logout', request_method='POST') | |
|
49 | ||
|
33 | 50 | config.add_route( |
|
34 | 51 | name='register', |
|
35 | 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 | 64 | config.add_route( |
|
37 | 65 | name='reset_password', |
|
38 | 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 | 73 | config.add_route( |
|
40 | 74 | name='reset_password_confirmation', |
|
41 | 75 | pattern=ADMIN_PREFIX + '/password_reset_confirmation') |
|
42 | ||
|
43 | # Scan module for configuration decorators. | |
|
44 | config.scan('.views', ignore='.tests') | |
|
76 | config.add_view( | |
|
77 | LoginView, | |
|
78 | attr='password_reset_confirmation', | |
|
79 | route_name='reset_password_confirmation', request_method='GET') |
@@ -28,7 +28,7 b' import urlparse' | |||
|
28 | 28 | import requests |
|
29 | 29 | |
|
30 | 30 | from pyramid.httpexceptions import HTTPFound |
|
31 | from pyramid.view import view_config | |
|
31 | ||
|
32 | 32 | |
|
33 | 33 | from rhodecode.apps._base import BaseAppView |
|
34 | 34 | from rhodecode.authentication.base import authenticate, HTTP_TYPE |
@@ -114,7 +114,6 b' class LoginView(BaseAppView):' | |||
|
114 | 114 | def load_default_context(self): |
|
115 | 115 | c = self._get_local_tmpl_context() |
|
116 | 116 | c.came_from = get_came_from(self.request) |
|
117 | ||
|
118 | 117 | return c |
|
119 | 118 | |
|
120 | 119 | def _get_captcha_data(self): |
@@ -148,9 +147,6 b' class LoginView(BaseAppView):' | |||
|
148 | 147 | |
|
149 | 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 | 150 | def login(self): |
|
155 | 151 | c = self.load_default_context() |
|
156 | 152 | auth_user = self._rhodecode_user |
@@ -175,9 +171,6 b' class LoginView(BaseAppView):' | |||
|
175 | 171 | |
|
176 | 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 | 174 | def login_post(self): |
|
182 | 175 | c = self.load_default_context() |
|
183 | 176 | |
@@ -229,7 +222,6 b' class LoginView(BaseAppView):' | |||
|
229 | 222 | return self._get_template_context(c) |
|
230 | 223 | |
|
231 | 224 | @CSRFRequired() |
|
232 | @view_config(route_name='logout', request_method='POST') | |
|
233 | 225 | def logout(self): |
|
234 | 226 | auth_user = self._rhodecode_user |
|
235 | 227 | log.info('Deleting session for user: `%s`', auth_user) |
@@ -243,9 +235,6 b' class LoginView(BaseAppView):' | |||
|
243 | 235 | |
|
244 | 236 | @HasPermissionAnyDecorator( |
|
245 | 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 | 238 | def register(self, defaults=None, errors=None): |
|
250 | 239 | c = self.load_default_context() |
|
251 | 240 | defaults = defaults or {} |
@@ -270,9 +259,6 b' class LoginView(BaseAppView):' | |||
|
270 | 259 | |
|
271 | 260 | @HasPermissionAnyDecorator( |
|
272 | 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 | 262 | def register_post(self): |
|
277 | 263 | from rhodecode.authentication.plugins import auth_rhodecode |
|
278 | 264 | |
@@ -353,9 +339,6 b' class LoginView(BaseAppView):' | |||
|
353 | 339 | h.flash(e, category='error') |
|
354 | 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 | 342 | def password_reset(self): |
|
360 | 343 | c = self.load_default_context() |
|
361 | 344 | captcha = self._get_captcha_data() |
@@ -454,8 +437,6 b' class LoginView(BaseAppView):' | |||
|
454 | 437 | |
|
455 | 438 | return self._get_template_context(c, **template_context) |
|
456 | 439 | |
|
457 | @view_config(route_name='reset_password_confirmation', | |
|
458 | request_method='GET') | |
|
459 | 440 | def password_reset_confirmation(self): |
|
460 | 441 | self.load_default_context() |
|
461 | 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 | 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 | 30 | config.add_route( |
|
28 | 31 | name='my_account_profile', |
|
29 | 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 | 39 | # my account edit details |
|
32 | 40 | config.add_route( |
|
33 | 41 | name='my_account_edit', |
|
34 | 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 | 50 | config.add_route( |
|
36 | 51 | name='my_account_update', |
|
37 | 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 | 60 | # my account password |
|
40 | 61 | config.add_route( |
|
41 | 62 | name='my_account_password', |
|
42 | 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 | 70 | config.add_route( |
|
45 | 71 | name='my_account_password_update', |
|
46 | 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 | 79 | # my account tokens |
|
49 | 80 | config.add_route( |
|
50 | 81 | name='my_account_auth_tokens', |
|
51 | 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 | 89 | config.add_route( |
|
53 | 90 | name='my_account_auth_tokens_view', |
|
54 | 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 | 98 | config.add_route( |
|
56 | 99 | name='my_account_auth_tokens_add', |
|
57 | 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 | 106 | config.add_route( |
|
59 | 107 | name='my_account_auth_tokens_delete', |
|
60 | 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 | 114 | # my account ssh keys |
|
63 | 115 | config.add_route( |
|
64 | 116 | name='my_account_ssh_keys', |
|
65 | 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 | 124 | config.add_route( |
|
67 | 125 | name='my_account_ssh_keys_generate', |
|
68 | 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 | 133 | config.add_route( |
|
70 | 134 | name='my_account_ssh_keys_add', |
|
71 | 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 | 141 | config.add_route( |
|
73 | 142 | name='my_account_ssh_keys_delete', |
|
74 | 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 | 149 | # my account user group membership |
|
77 | 150 | config.add_route( |
|
78 | 151 | name='my_account_user_group_membership', |
|
79 | 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 | 160 | # my account emails |
|
82 | 161 | config.add_route( |
|
83 | 162 | name='my_account_emails', |
|
84 | 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 | 170 | config.add_route( |
|
86 | 171 | name='my_account_emails_add', |
|
87 | 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 | 179 | config.add_route( |
|
89 | 180 | name='my_account_emails_delete', |
|
90 | 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 | 187 | config.add_route( |
|
93 | 188 | name='my_account_repos', |
|
94 | 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 | 196 | config.add_route( |
|
97 | 197 | name='my_account_watched', |
|
98 | 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 | 205 | config.add_route( |
|
101 | 206 | name='my_account_bookmarks', |
|
102 | 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 | 214 | config.add_route( |
|
105 | 215 | name='my_account_bookmarks_update', |
|
106 | 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 | 222 | config.add_route( |
|
109 | 223 | name='my_account_goto_bookmark', |
|
110 | 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 | 231 | config.add_route( |
|
113 | 232 | name='my_account_perms', |
|
114 | 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 | 240 | config.add_route( |
|
117 | 241 | name='my_account_notifications', |
|
118 | 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 | 249 | config.add_route( |
|
121 | 250 | name='my_account_notifications_toggle_visibility', |
|
122 | 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 | 258 | # my account pull requests |
|
125 | 259 | config.add_route( |
|
126 | 260 | name='my_account_pullrequests', |
|
127 | 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 | 269 | config.add_route( |
|
129 | 270 | name='my_account_pullrequests_data', |
|
130 | 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 | 288 | # notifications |
|
133 | 289 | config.add_route( |
|
134 | 290 | name='notifications_show_all', |
|
135 | 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 | 298 | # notifications |
|
138 | 299 | config.add_route( |
|
139 | 300 | name='notifications_mark_all_read', |
|
140 |
pattern=ADMIN_PREFIX + '/notifications |
|
|
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 | 308 | config.add_route( |
|
143 | 309 | name='notifications_show', |
|
144 | 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 | 317 | config.add_route( |
|
147 | 318 | name='notifications_update', |
|
148 | 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 | 326 | config.add_route( |
|
151 | 327 | name='notifications_delete', |
|
152 | 328 | pattern=ADMIN_PREFIX + '/notifications/{notification_id}/delete') |
|
153 | ||
|
154 | # channelstream test | |
|
155 | config.add_route( | |
|
156 | name='my_account_notifications_test_channelstream', | |
|
157 | pattern=ADMIN_PREFIX + '/my_account/test_channelstream') | |
|
158 | ||
|
159 | # Scan module for configuration decorators. | |
|
160 | config.scan('.views', ignore='.tests') | |
|
329 | config.add_view( | |
|
330 | MyAccountNotificationsView, | |
|
331 | attr='notification_delete', | |
|
332 | route_name='notifications_delete', request_method='POST', | |
|
333 | renderer='json_ext') |
@@ -40,7 +40,7 b' def route_path(name, params=None, **kwar' | |||
|
40 | 40 | |
|
41 | 41 | base_url = { |
|
42 | 42 | 'notifications_show_all': ADMIN_PREFIX + '/notifications', |
|
43 |
'notifications_mark_all_read': ADMIN_PREFIX + '/notifications |
|
|
43 | 'notifications_mark_all_read': ADMIN_PREFIX + '/notifications_mark_all_read', | |
|
44 | 44 | 'notifications_show': ADMIN_PREFIX + '/notifications/{notification_id}', |
|
45 | 45 | 'notifications_update': ADMIN_PREFIX + '/notifications/{notification_id}/update', |
|
46 | 46 | 'notifications_delete': ADMIN_PREFIX + '/notifications/{notification_id}/delete', |
@@ -60,6 +60,15 b' class TestNotificationsController(TestCo' | |||
|
60 | 60 | Session().delete(inst) |
|
61 | 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 | 72 | def test_show_all(self, user_util): |
|
64 | 73 | user = user_util.create_user(password='qweqwe') |
|
65 | 74 | user_id = user.user_id |
@@ -26,7 +26,6 b' import formencode' | |||
|
26 | 26 | import formencode.htmlfill |
|
27 | 27 | import peppercorn |
|
28 | 28 | from pyramid.httpexceptions import HTTPFound, HTTPNotFound |
|
29 | from pyramid.view import view_config | |
|
30 | 29 | |
|
31 | 30 | from rhodecode.apps._base import BaseAppView, DataGridAppView |
|
32 | 31 | from rhodecode import forms |
@@ -65,14 +64,10 b' class MyAccountView(BaseAppView, DataGri' | |||
|
65 | 64 | c = self._get_local_tmpl_context() |
|
66 | 65 | c.user = c.auth_user.get_instance() |
|
67 | 66 | c.allow_scoped_tokens = self.ALLOW_SCOPED_TOKENS |
|
68 | ||
|
69 | 67 | return c |
|
70 | 68 | |
|
71 | 69 | @LoginRequired() |
|
72 | 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 | 71 | def my_account_profile(self): |
|
77 | 72 | c = self.load_default_context() |
|
78 | 73 | c.active = 'profile' |
@@ -81,9 +76,75 b' class MyAccountView(BaseAppView, DataGri' | |||
|
81 | 76 | |
|
82 | 77 | @LoginRequired() |
|
83 | 78 | @NotAnonymous() |
|
84 | @view_config( | |
|
85 | route_name='my_account_password', request_method='GET', | |
|
86 | renderer='rhodecode:templates/admin/my_account/my_account.mako') | |
|
79 | def my_account_edit(self): | |
|
80 | c = self.load_default_context() | |
|
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 | 148 | def my_account_password(self): |
|
88 | 149 | c = self.load_default_context() |
|
89 | 150 | c.active = 'password' |
@@ -103,9 +164,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
103 | 164 | @LoginRequired() |
|
104 | 165 | @NotAnonymous() |
|
105 | 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 | 167 | def my_account_password_update(self): |
|
110 | 168 | _ = self.request.translate |
|
111 | 169 | c = self.load_default_context() |
@@ -146,9 +204,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
146 | 204 | |
|
147 | 205 | @LoginRequired() |
|
148 | 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 | 207 | def my_account_auth_tokens(self): |
|
153 | 208 | _ = self.request.translate |
|
154 | 209 | |
@@ -167,9 +222,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
167 | 222 | @LoginRequired() |
|
168 | 223 | @NotAnonymous() |
|
169 | 224 | @CSRFRequired() |
|
170 | @view_config( | |
|
171 | route_name='my_account_auth_tokens_view', request_method='POST', xhr=True, | |
|
172 | renderer='json_ext') | |
|
173 | 225 | def my_account_auth_tokens_view(self): |
|
174 | 226 | _ = self.request.translate |
|
175 | 227 | c = self.load_default_context() |
@@ -192,8 +244,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
192 | 244 | @LoginRequired() |
|
193 | 245 | @NotAnonymous() |
|
194 | 246 | @CSRFRequired() |
|
195 | @view_config( | |
|
196 | route_name='my_account_auth_tokens_add', request_method='POST',) | |
|
197 | 247 | def my_account_auth_tokens_add(self): |
|
198 | 248 | _ = self.request.translate |
|
199 | 249 | c = self.load_default_context() |
@@ -220,8 +270,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
220 | 270 | @LoginRequired() |
|
221 | 271 | @NotAnonymous() |
|
222 | 272 | @CSRFRequired() |
|
223 | @view_config( | |
|
224 | route_name='my_account_auth_tokens_delete', request_method='POST') | |
|
225 | 273 | def my_account_auth_tokens_delete(self): |
|
226 | 274 | _ = self.request.translate |
|
227 | 275 | c = self.load_default_context() |
@@ -244,9 +292,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
244 | 292 | |
|
245 | 293 | @LoginRequired() |
|
246 | 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 | 295 | def my_account_emails(self): |
|
251 | 296 | _ = self.request.translate |
|
252 | 297 | |
@@ -269,9 +314,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
269 | 314 | @LoginRequired() |
|
270 | 315 | @NotAnonymous() |
|
271 | 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 | 317 | def my_account_emails_add(self): |
|
276 | 318 | _ = self.request.translate |
|
277 | 319 | c = self.load_default_context() |
@@ -312,8 +354,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
312 | 354 | @LoginRequired() |
|
313 | 355 | @NotAnonymous() |
|
314 | 356 | @CSRFRequired() |
|
315 | @view_config( | |
|
316 | route_name='my_account_emails_delete', request_method='POST') | |
|
317 | 357 | def my_account_emails_delete(self): |
|
318 | 358 | _ = self.request.translate |
|
319 | 359 | c = self.load_default_context() |
@@ -334,9 +374,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
334 | 374 | @LoginRequired() |
|
335 | 375 | @NotAnonymous() |
|
336 | 376 | @CSRFRequired() |
|
337 | @view_config( | |
|
338 | route_name='my_account_notifications_test_channelstream', | |
|
339 | request_method='POST', renderer='json_ext') | |
|
340 | 377 | def my_account_notifications_test_channelstream(self): |
|
341 | 378 | message = 'Test message sent via Channelstream by user: {}, on {}'.format( |
|
342 | 379 | self._rhodecode_user.username, datetime.datetime.now()) |
@@ -424,9 +461,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
424 | 461 | |
|
425 | 462 | @LoginRequired() |
|
426 | 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 | 464 | def my_account_repos(self): |
|
431 | 465 | c = self.load_default_context() |
|
432 | 466 | c.active = 'repos' |
@@ -437,9 +471,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
437 | 471 | |
|
438 | 472 | @LoginRequired() |
|
439 | 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 | 474 | def my_account_watched(self): |
|
444 | 475 | c = self.load_default_context() |
|
445 | 476 | c.active = 'watched' |
@@ -450,9 +481,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
450 | 481 | |
|
451 | 482 | @LoginRequired() |
|
452 | 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 | 484 | def my_account_bookmarks(self): |
|
457 | 485 | c = self.load_default_context() |
|
458 | 486 | c.active = 'bookmarks' |
@@ -519,8 +547,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
519 | 547 | @LoginRequired() |
|
520 | 548 | @NotAnonymous() |
|
521 | 549 | @CSRFRequired() |
|
522 | @view_config( | |
|
523 | route_name='my_account_bookmarks_update', request_method='POST') | |
|
524 | 550 | def my_account_bookmarks_update(self): |
|
525 | 551 | _ = self.request.translate |
|
526 | 552 | c = self.load_default_context() |
@@ -559,9 +585,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
559 | 585 | |
|
560 | 586 | @LoginRequired() |
|
561 | 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 | 588 | def my_account_goto_bookmark(self): |
|
566 | 589 | |
|
567 | 590 | bookmark_id = self.request.matchdict['bookmark_id'] |
@@ -606,9 +629,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
606 | 629 | |
|
607 | 630 | @LoginRequired() |
|
608 | 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 | 632 | def my_account_perms(self): |
|
613 | 633 | c = self.load_default_context() |
|
614 | 634 | c.active = 'perms' |
@@ -618,9 +638,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
618 | 638 | |
|
619 | 639 | @LoginRequired() |
|
620 | 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 | 641 | def my_notifications(self): |
|
625 | 642 | c = self.load_default_context() |
|
626 | 643 | c.active = 'notifications' |
@@ -630,9 +647,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
630 | 647 | @LoginRequired() |
|
631 | 648 | @NotAnonymous() |
|
632 | 649 | @CSRFRequired() |
|
633 | @view_config( | |
|
634 | route_name='my_account_notifications_toggle_visibility', | |
|
635 | request_method='POST', renderer='json_ext') | |
|
636 | 650 | def my_notifications_toggle_visibility(self): |
|
637 | 651 | user = self._rhodecode_db_user |
|
638 | 652 | new_status = not user.user_data.get('notification_status', True) |
@@ -640,83 +654,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
640 | 654 | Session().commit() |
|
641 | 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 | 657 | def _get_pull_requests_list(self, statuses): |
|
721 | 658 | draw, start, limit = self._extract_chunk(self.request) |
|
722 | 659 | search_q, order_by, order_dir = self._extract_ordering(self.request) |
@@ -781,10 +718,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
781 | 718 | |
|
782 | 719 | @LoginRequired() |
|
783 | 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 | 721 | def my_account_pullrequests(self): |
|
789 | 722 | c = self.load_default_context() |
|
790 | 723 | c.active = 'pullrequests' |
@@ -796,9 +729,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
796 | 729 | |
|
797 | 730 | @LoginRequired() |
|
798 | 731 | @NotAnonymous() |
|
799 | @view_config( | |
|
800 | route_name='my_account_pullrequests_data', | |
|
801 | request_method='GET', renderer='json_ext') | |
|
802 | 732 | def my_account_pullrequests_data(self): |
|
803 | 733 | self.load_default_context() |
|
804 | 734 | req_get = self.request.GET |
@@ -813,10 +743,6 b' class MyAccountView(BaseAppView, DataGri' | |||
|
813 | 743 | |
|
814 | 744 | @LoginRequired() |
|
815 | 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 | 746 | def my_account_user_group_membership(self): |
|
821 | 747 | c = self.load_default_context() |
|
822 | 748 | c.active = 'user_group_membership' |
@@ -22,7 +22,6 b' import logging' | |||
|
22 | 22 | |
|
23 | 23 | from pyramid.httpexceptions import ( |
|
24 | 24 | HTTPFound, HTTPNotFound, HTTPInternalServerError) |
|
25 | from pyramid.view import view_config | |
|
26 | 25 | |
|
27 | 26 | from rhodecode.apps._base import BaseAppView |
|
28 | 27 | from rhodecode.lib.auth import LoginRequired, NotAnonymous, CSRFRequired |
@@ -57,9 +56,6 b' class MyAccountNotificationsView(BaseApp' | |||
|
57 | 56 | |
|
58 | 57 | @LoginRequired() |
|
59 | 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 | 59 | def notifications_show_all(self): |
|
64 | 60 | c = self.load_default_context() |
|
65 | 61 | |
@@ -105,22 +101,6 b' class MyAccountNotificationsView(BaseApp' | |||
|
105 | 101 | |
|
106 | 102 | @LoginRequired() |
|
107 | 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 | 104 | def notifications_show(self): |
|
125 | 105 | c = self.load_default_context() |
|
126 | 106 | notification_id = self.request.matchdict['notification_id'] |
@@ -150,9 +130,16 b' class MyAccountNotificationsView(BaseApp' | |||
|
150 | 130 | @LoginRequired() |
|
151 | 131 | @NotAnonymous() |
|
152 | 132 | @CSRFRequired() |
|
153 | @view_config( | |
|
154 | route_name='notifications_update', request_method='POST', | |
|
155 | renderer='json_ext') | |
|
133 | def notifications_mark_all_read(self): | |
|
134 | NotificationModel().mark_all_read_for_user( | |
|
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 | 143 | def notification_update(self): |
|
157 | 144 | notification_id = self.request.matchdict['notification_id'] |
|
158 | 145 | notification = Notification.get_or_404(notification_id) |
@@ -177,9 +164,6 b' class MyAccountNotificationsView(BaseApp' | |||
|
177 | 164 | @LoginRequired() |
|
178 | 165 | @NotAnonymous() |
|
179 | 166 | @CSRFRequired() |
|
180 | @view_config( | |
|
181 | route_name='notifications_delete', request_method='POST', | |
|
182 | renderer='json_ext') | |
|
183 | 167 | def notification_delete(self): |
|
184 | 168 | notification_id = self.request.matchdict['notification_id'] |
|
185 | 169 | notification = Notification.get_or_404(notification_id) |
@@ -21,7 +21,6 b'' | |||
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | 23 | from pyramid.httpexceptions import HTTPFound |
|
24 | from pyramid.view import view_config | |
|
25 | 24 | |
|
26 | 25 | from rhodecode.apps._base import BaseAppView, DataGridAppView |
|
27 | 26 | from rhodecode.apps.ssh_support import SshKeyFileChangeEvent |
@@ -41,17 +40,12 b' class MyAccountSshKeysView(BaseAppView, ' | |||
|
41 | 40 | def load_default_context(self): |
|
42 | 41 | c = self._get_local_tmpl_context() |
|
43 | 42 | c.user = c.auth_user.get_instance() |
|
44 | ||
|
45 | 43 | c.ssh_enabled = self.request.registry.settings.get( |
|
46 | 44 | 'ssh.generate_authorized_keyfile') |
|
47 | ||
|
48 | 45 | return c |
|
49 | 46 | |
|
50 | 47 | @LoginRequired() |
|
51 | 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 | 49 | def my_account_ssh_keys(self): |
|
56 | 50 | _ = self.request.translate |
|
57 | 51 | |
@@ -63,9 +57,6 b' class MyAccountSshKeysView(BaseAppView, ' | |||
|
63 | 57 | |
|
64 | 58 | @LoginRequired() |
|
65 | 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 | 60 | def ssh_keys_generate_keypair(self): |
|
70 | 61 | _ = self.request.translate |
|
71 | 62 | c = self.load_default_context() |
@@ -84,8 +75,6 b' class MyAccountSshKeysView(BaseAppView, ' | |||
|
84 | 75 | @LoginRequired() |
|
85 | 76 | @NotAnonymous() |
|
86 | 77 | @CSRFRequired() |
|
87 | @view_config( | |
|
88 | route_name='my_account_ssh_keys_add', request_method='POST',) | |
|
89 | 78 | def my_account_ssh_keys_add(self): |
|
90 | 79 | _ = self.request.translate |
|
91 | 80 | c = self.load_default_context() |
@@ -132,8 +121,6 b' class MyAccountSshKeysView(BaseAppView, ' | |||
|
132 | 121 | @LoginRequired() |
|
133 | 122 | @NotAnonymous() |
|
134 | 123 | @CSRFRequired() |
|
135 | @view_config( | |
|
136 | route_name='my_account_ssh_keys_delete', request_method='POST') | |
|
137 | 124 | def my_account_ssh_keys_delete(self): |
|
138 | 125 | _ = self.request.translate |
|
139 | 126 | c = self.load_default_context() |
@@ -22,25 +22,35 b' from rhodecode.apps._base import ADMIN_P' | |||
|
22 | 22 | |
|
23 | 23 | |
|
24 | 24 | def admin_routes(config): |
|
25 | from rhodecode.apps.ops.views import OpsView | |
|
26 | ||
|
25 | 27 | config.add_route( |
|
26 | 28 | name='ops_ping', |
|
27 | 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 | 36 | config.add_route( |
|
29 | 37 | name='ops_error_test', |
|
30 | 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 | 45 | config.add_route( |
|
32 | 46 | name='ops_redirect_test', |
|
33 | 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 | 55 | def includeme(config): |
|
37 | ||
|
38 | 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 | 21 | import time |
|
22 | 22 | import logging |
|
23 | 23 | |
|
24 | from pyramid.view import view_config | |
|
24 | ||
|
25 | 25 | from pyramid.httpexceptions import HTTPFound |
|
26 | 26 | |
|
27 | 27 | from rhodecode.apps._base import BaseAppView |
@@ -38,12 +38,6 b' class OpsView(BaseAppView):' | |||
|
38 | 38 | |
|
39 | 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 | 41 | def ops_ping(self): |
|
48 | 42 | data = { |
|
49 | 43 | 'instance': self.request.registry.settings.get('instance_id'), |
@@ -59,12 +53,6 b' class OpsView(BaseAppView):' | |||
|
59 | 53 | }) |
|
60 | 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 | 56 | def ops_error_test(self): |
|
69 | 57 | """ |
|
70 | 58 | Test exception handling and emails on errors |
@@ -78,9 +66,6 b' class OpsView(BaseAppView):' | |||
|
78 | 66 | 'Client:{}. Generation time: {}.'.format(self.request.user, time.time())) |
|
79 | 67 | raise TestException(msg) |
|
80 | 68 | |
|
81 | @view_config( | |
|
82 | route_name='ops_redirect_test', request_method='GET', | |
|
83 | renderer='json_ext') | |
|
84 | 69 | def ops_redirect_test(self): |
|
85 | 70 | """ |
|
86 | 71 | Test redirect handling |
@@ -18,6 +18,10 b'' | |||
|
18 | 18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
19 | 19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
20 | 20 | 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 | 27 | def includeme(config): |
@@ -27,35 +31,72 b' def includeme(config):' | |||
|
27 | 31 | name='edit_repo_group', |
|
28 | 32 | pattern='/{repo_group_name:.*?[^/]}/_edit', |
|
29 | 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 | 45 | # Settings advanced |
|
33 | 46 | config.add_route( |
|
34 | 47 | name='edit_repo_group_advanced', |
|
35 | 48 | pattern='/{repo_group_name:.*?[^/]}/_settings/advanced', |
|
36 | 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 | 56 | config.add_route( |
|
39 | 57 | name='edit_repo_group_advanced_delete', |
|
40 | 58 | pattern='/{repo_group_name:.*?[^/]}/_settings/advanced/delete', |
|
41 | 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 | 66 | # settings permissions |
|
44 | 67 | config.add_route( |
|
45 | 68 | name='edit_repo_group_perms', |
|
46 | 69 | pattern='/{repo_group_name:.*?[^/]}/_settings/permissions', |
|
47 | 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 | 77 | config.add_route( |
|
50 | 78 | name='edit_repo_group_perms_update', |
|
51 | 79 | pattern='/{repo_group_name:.*?[^/]}/_settings/permissions/update', |
|
52 | 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 | 87 | # Summary, NOTE(marcink): needs to be at the end for catch-all |
|
55 | 88 | add_route_with_slash( |
|
56 | 89 | config, |
|
57 | 90 | name='repo_group_home', |
|
58 | 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 | 21 | import logging |
|
22 | 22 | |
|
23 | from pyramid.view import view_config | |
|
23 | ||
|
24 | 24 | from pyramid.httpexceptions import HTTPFound |
|
25 | 25 | |
|
26 | 26 | from rhodecode.apps._base import RepoGroupAppView |
@@ -34,17 +34,13 b' from rhodecode.model.meta import Session' | |||
|
34 | 34 | log = logging.getLogger(__name__) |
|
35 | 35 | |
|
36 | 36 | |
|
37 | class RepoGroupSettingsView(RepoGroupAppView): | |
|
37 | class RepoGroupAdvancedSettingsView(RepoGroupAppView): | |
|
38 | 38 | def load_default_context(self): |
|
39 | 39 | c = self._get_local_tmpl_context() |
|
40 | ||
|
41 | 40 | return c |
|
42 | 41 | |
|
43 | 42 | @LoginRequired() |
|
44 | 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 | 44 | def edit_repo_group_advanced(self): |
|
49 | 45 | _ = self.request.translate |
|
50 | 46 | c = self.load_default_context() |
@@ -61,9 +57,6 b' class RepoGroupSettingsView(RepoGroupApp' | |||
|
61 | 57 | @LoginRequired() |
|
62 | 58 | @HasRepoGroupPermissionAnyDecorator('group.admin') |
|
63 | 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 | 60 | def edit_repo_group_delete(self): |
|
68 | 61 | _ = self.request.translate |
|
69 | 62 | _ungettext = self.request.plularize |
@@ -20,7 +20,7 b'' | |||
|
20 | 20 | |
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | from pyramid.view import view_config | |
|
23 | ||
|
24 | 24 | from pyramid.httpexceptions import HTTPFound |
|
25 | 25 | |
|
26 | 26 | from rhodecode.apps._base import RepoGroupAppView |
@@ -45,9 +45,6 b' class RepoGroupPermissionsView(RepoGroup' | |||
|
45 | 45 | |
|
46 | 46 | @LoginRequired() |
|
47 | 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 | 48 | def edit_repo_group_permissions(self): |
|
52 | 49 | c = self.load_default_context() |
|
53 | 50 | c.active = 'permissions' |
@@ -57,9 +54,6 b' class RepoGroupPermissionsView(RepoGroup' | |||
|
57 | 54 | @LoginRequired() |
|
58 | 55 | @HasRepoGroupPermissionAnyDecorator('group.admin') |
|
59 | 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 | 57 | def edit_repo_groups_permissions_update(self): |
|
64 | 58 | _ = self.request.translate |
|
65 | 59 | c = self.load_default_context() |
@@ -21,7 +21,7 b'' | |||
|
21 | 21 | import logging |
|
22 | 22 | import deform |
|
23 | 23 | |
|
24 | from pyramid.view import view_config | |
|
24 | ||
|
25 | 25 | from pyramid.httpexceptions import HTTPFound |
|
26 | 26 | |
|
27 | 27 | from rhodecode import events |
@@ -109,9 +109,6 b' class RepoGroupSettingsView(RepoGroupApp' | |||
|
109 | 109 | |
|
110 | 110 | @LoginRequired() |
|
111 | 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 | 112 | def edit_settings(self): |
|
116 | 113 | c = self.load_default_context() |
|
117 | 114 | c.active = 'settings' |
@@ -126,9 +123,6 b' class RepoGroupSettingsView(RepoGroupApp' | |||
|
126 | 123 | @LoginRequired() |
|
127 | 124 | @HasRepoGroupPermissionAnyDecorator('group.admin') |
|
128 | 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 | 126 | def edit_settings_update(self): |
|
133 | 127 | _ = self.request.translate |
|
134 | 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 | 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 | 52 | # repo creating checks, special cases that aren't repo routes |
|
26 | 53 | config.add_route( |
|
27 | 54 | name='repo_creating', |
|
28 | 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 | 62 | config.add_route( |
|
31 | 63 | name='repo_creating_check', |
|
32 | 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 | 71 | # Summary |
|
35 | 72 | # NOTE(marcink): one additional route is defined in very bottom, catch |
@@ -37,191 +74,467 b' def includeme(config):' | |||
|
37 | 74 | config.add_route( |
|
38 | 75 | name='repo_summary_explicit', |
|
39 | 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 | 83 | config.add_route( |
|
41 | 84 | name='repo_summary_commits', |
|
42 | 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 | 92 | # Commits |
|
45 | 93 | config.add_route( |
|
46 | 94 | name='repo_commit', |
|
47 | 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 | 102 | config.add_route( |
|
50 | 103 | name='repo_commit_children', |
|
51 | 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 | 111 | config.add_route( |
|
54 | 112 | name='repo_commit_parents', |
|
55 | 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 | 120 | config.add_route( |
|
58 | 121 | name='repo_commit_raw', |
|
59 | 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 | 129 | config.add_route( |
|
62 | 130 | name='repo_commit_patch', |
|
63 | 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 | 138 | config.add_route( |
|
66 | 139 | name='repo_commit_download', |
|
67 | 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 | 147 | config.add_route( |
|
70 | 148 | name='repo_commit_data', |
|
71 | 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 | 156 | config.add_route( |
|
74 | 157 | name='repo_commit_comment_create', |
|
75 | 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 | 165 | config.add_route( |
|
78 | 166 | name='repo_commit_comment_preview', |
|
79 | 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 | 174 | config.add_route( |
|
82 | 175 | name='repo_commit_comment_history_view', |
|
83 | 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 | 183 | config.add_route( |
|
86 | 184 | name='repo_commit_comment_attachment_upload', |
|
87 | 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 | 192 | config.add_route( |
|
90 | 193 | name='repo_commit_comment_delete', |
|
91 | 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 | 201 | config.add_route( |
|
94 | 202 | name='repo_commit_comment_edit', |
|
95 | 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 | 210 | # still working url for backward compat. |
|
98 | 211 | config.add_route( |
|
99 | 212 | name='repo_commit_raw_deprecated', |
|
100 | 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 | 220 | # Files |
|
103 | 221 | config.add_route( |
|
104 | 222 | name='repo_archivefile', |
|
105 | 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 | 230 | config.add_route( |
|
108 | 231 | name='repo_files_diff', |
|
109 | 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 | 239 | config.add_route( # legacy route to make old links work |
|
111 | 240 | name='repo_files_diff_2way_redirect', |
|
112 | 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 | 248 | config.add_route( |
|
115 | 249 | name='repo_files', |
|
116 | 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 | 257 | config.add_route( |
|
118 | 258 | name='repo_files:default_path', |
|
119 | 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 | 266 | config.add_route( |
|
121 | 267 | name='repo_files:default_commit', |
|
122 | 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 | 275 | config.add_route( |
|
125 | 276 | name='repo_files:rendered', |
|
126 | 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 | 284 | config.add_route( |
|
129 | 285 | name='repo_files:annotated', |
|
130 | 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 | 293 | config.add_route( |
|
132 | 294 | name='repo_files:annotated_previous', |
|
133 | 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 | 302 | config.add_route( |
|
136 | 303 | name='repo_nodetree_full', |
|
137 | 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 | 311 | config.add_route( |
|
139 | 312 | name='repo_nodetree_full:default_path', |
|
140 | 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 | 320 | config.add_route( |
|
143 | 321 | name='repo_files_nodelist', |
|
144 | 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 | 329 | config.add_route( |
|
147 | 330 | name='repo_file_raw', |
|
148 | 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 | 338 | config.add_route( |
|
151 | 339 | name='repo_file_download', |
|
152 | 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 | 347 | config.add_route( # backward compat to keep old links working |
|
154 | 348 | name='repo_file_download:legacy', |
|
155 | 349 | pattern='/{repo_name:.*?[^/]}/rawfile/{commit_id}/{f_path:.*}', |
|
156 | 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 | 357 | config.add_route( |
|
159 | 358 | name='repo_file_history', |
|
160 | 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 | 366 | config.add_route( |
|
163 | 367 | name='repo_file_authors', |
|
164 | 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 | 375 | config.add_route( |
|
167 | 376 | name='repo_files_check_head', |
|
168 | 377 | pattern='/{repo_name:.*?[^/]}/check_head/{commit_id}/{f_path:.*}', |
|
169 | 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 | 385 | config.add_route( |
|
171 | 386 | name='repo_files_remove_file', |
|
172 | 387 | pattern='/{repo_name:.*?[^/]}/remove_file/{commit_id}/{f_path:.*}', |
|
173 | 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 | 395 | config.add_route( |
|
175 | 396 | name='repo_files_delete_file', |
|
176 | 397 | pattern='/{repo_name:.*?[^/]}/delete_file/{commit_id}/{f_path:.*}', |
|
177 | 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 | 405 | config.add_route( |
|
179 | 406 | name='repo_files_edit_file', |
|
180 | 407 | pattern='/{repo_name:.*?[^/]}/edit_file/{commit_id}/{f_path:.*}', |
|
181 | 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 | 415 | config.add_route( |
|
183 | 416 | name='repo_files_update_file', |
|
184 | 417 | pattern='/{repo_name:.*?[^/]}/update_file/{commit_id}/{f_path:.*}', |
|
185 | 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 | 425 | config.add_route( |
|
187 | 426 | name='repo_files_add_file', |
|
188 | 427 | pattern='/{repo_name:.*?[^/]}/add_file/{commit_id}/{f_path:.*}', |
|
189 | 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 | 435 | config.add_route( |
|
191 | 436 | name='repo_files_upload_file', |
|
192 | 437 | pattern='/{repo_name:.*?[^/]}/upload_file/{commit_id}/{f_path:.*}', |
|
193 | 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 | 450 | config.add_route( |
|
195 | 451 | name='repo_files_create_file', |
|
196 | 452 | pattern='/{repo_name:.*?[^/]}/create_file/{commit_id}/{f_path:.*}', |
|
197 | 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 | 460 | # Refs data |
|
200 | 461 | config.add_route( |
|
201 | 462 | name='repo_refs_data', |
|
202 | 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 | 470 | config.add_route( |
|
205 | 471 | name='repo_refs_changelog_data', |
|
206 | 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 | 479 | config.add_route( |
|
209 | 480 | name='repo_stats', |
|
210 | 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 | 488 | # Commits |
|
213 | 489 | config.add_route( |
|
214 | 490 | name='repo_commits', |
|
215 | 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 | 524 | config.add_route( |
|
217 | 525 | name='repo_commits_file', |
|
218 | 526 | pattern='/{repo_name:.*?[^/]}/commits/{commit_id}/{f_path:.*}', repo_route=True) |
|
219 |
config.add_ |
|
|
220 | name='repo_commits_elements', | |
|
221 | pattern='/{repo_name:.*?[^/]}/commits_elements', repo_route=True) | |
|
222 | config.add_route( | |
|
223 | name='repo_commits_elements_file', | |
|
224 | pattern='/{repo_name:.*?[^/]}/commits_elements/{commit_id}/{f_path:.*}', repo_route=True) | |
|
527 | config.add_view( | |
|
528 | RepoChangelogView, | |
|
529 | attr='repo_changelog', | |
|
530 | route_name='repo_commits_file', request_method='GET', | |
|
531 | renderer='rhodecode:templates/commits/changelog.mako') | |
|
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 | 539 | # Changelog (old deprecated name for commits page) |
|
227 | 540 | config.add_route( |
@@ -235,25 +548,50 b' def includeme(config):' | |||
|
235 | 548 | config.add_route( |
|
236 | 549 | name='repo_compare_select', |
|
237 | 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 | 557 | config.add_route( |
|
240 | 558 | name='repo_compare', |
|
241 | 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 | 566 | # Tags |
|
244 | 567 | config.add_route( |
|
245 | 568 | name='tags_home', |
|
246 | 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 | 576 | # Branches |
|
249 | 577 | config.add_route( |
|
250 | 578 | name='branches_home', |
|
251 | 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 | 586 | # Bookmarks |
|
254 | 587 | config.add_route( |
|
255 | 588 | name='bookmarks_home', |
|
256 | 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 | 596 | # Forks |
|
259 | 597 | config.add_route( |
@@ -261,195 +599,426 b' def includeme(config):' | |||
|
261 | 599 | pattern='/{repo_name:.*?[^/]}/fork', repo_route=True, |
|
262 | 600 | repo_forbid_when_archived=True, |
|
263 | 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 | 608 | config.add_route( |
|
266 | 609 | name='repo_fork_create', |
|
267 | 610 | pattern='/{repo_name:.*?[^/]}/fork/create', repo_route=True, |
|
268 | 611 | repo_forbid_when_archived=True, |
|
269 | 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 | 619 | config.add_route( |
|
272 | 620 | name='repo_forks_show_all', |
|
273 | 621 | pattern='/{repo_name:.*?[^/]}/forks', repo_route=True, |
|
274 | 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 | 629 | config.add_route( |
|
276 | 630 | name='repo_forks_data', |
|
277 | 631 | pattern='/{repo_name:.*?[^/]}/forks/data', repo_route=True, |
|
278 | 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 | 639 | # Pull Requests |
|
281 | 640 | config.add_route( |
|
282 | 641 | name='pullrequest_show', |
|
283 | 642 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}', |
|
284 | 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 | 650 | config.add_route( |
|
287 | 651 | name='pullrequest_show_all', |
|
288 | 652 | pattern='/{repo_name:.*?[^/]}/pull-request', |
|
289 | 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 | 660 | config.add_route( |
|
292 | 661 | name='pullrequest_show_all_data', |
|
293 | 662 | pattern='/{repo_name:.*?[^/]}/pull-request-data', |
|
294 | 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 | 670 | config.add_route( |
|
297 | 671 | name='pullrequest_repo_refs', |
|
298 | 672 | pattern='/{repo_name:.*?[^/]}/pull-request/refs/{target_repo_name:.*?[^/]}', |
|
299 | 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 | 680 | config.add_route( |
|
302 | 681 | name='pullrequest_repo_targets', |
|
303 | 682 | pattern='/{repo_name:.*?[^/]}/pull-request/repo-targets', |
|
304 | 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 | 690 | config.add_route( |
|
307 | 691 | name='pullrequest_new', |
|
308 | 692 | pattern='/{repo_name:.*?[^/]}/pull-request/new', |
|
309 | 693 | repo_route=True, repo_accepted_types=['hg', 'git'], |
|
310 | 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 | 701 | config.add_route( |
|
313 | 702 | name='pullrequest_create', |
|
314 | 703 | pattern='/{repo_name:.*?[^/]}/pull-request/create', |
|
315 | 704 | repo_route=True, repo_accepted_types=['hg', 'git'], |
|
316 | 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 | 712 | config.add_route( |
|
319 | 713 | name='pullrequest_update', |
|
320 | 714 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update', |
|
321 | 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 | 722 | config.add_route( |
|
324 | 723 | name='pullrequest_merge', |
|
325 | 724 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge', |
|
326 | 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 | 732 | config.add_route( |
|
329 | 733 | name='pullrequest_delete', |
|
330 | 734 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete', |
|
331 | 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 | 742 | config.add_route( |
|
334 | 743 | name='pullrequest_comment_create', |
|
335 | 744 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment', |
|
336 | 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 | 752 | config.add_route( |
|
339 | 753 | name='pullrequest_comment_edit', |
|
340 | 754 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/edit', |
|
341 | 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 | 762 | config.add_route( |
|
344 | 763 | name='pullrequest_comment_delete', |
|
345 | 764 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete', |
|
346 | 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 | 772 | config.add_route( |
|
349 | 773 | name='pullrequest_comments', |
|
350 | 774 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comments', |
|
351 | 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 | 782 | config.add_route( |
|
354 | 783 | name='pullrequest_todos', |
|
355 | 784 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/todos', |
|
356 | 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 | 792 | config.add_route( |
|
359 | 793 | name='pullrequest_drafts', |
|
360 | 794 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/drafts', |
|
361 | 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 | 802 | # Artifacts, (EE feature) |
|
364 | 803 | config.add_route( |
|
365 | 804 | name='repo_artifacts_list', |
|
366 | 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 | 812 | # Settings |
|
369 | 813 | config.add_route( |
|
370 | 814 | name='edit_repo', |
|
371 | 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 | 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 | 828 | # Settings advanced |
|
375 | 829 | config.add_route( |
|
376 | 830 | name='edit_repo_advanced', |
|
377 | 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 | 838 | config.add_route( |
|
379 | 839 | name='edit_repo_advanced_archive', |
|
380 | 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 | 847 | config.add_route( |
|
382 | 848 | name='edit_repo_advanced_delete', |
|
383 | 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 | 856 | config.add_route( |
|
385 | 857 | name='edit_repo_advanced_locking', |
|
386 | 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 | 865 | config.add_route( |
|
388 | 866 | name='edit_repo_advanced_journal', |
|
389 | 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 | 874 | config.add_route( |
|
391 | 875 | name='edit_repo_advanced_fork', |
|
392 | 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 | 883 | config.add_route( |
|
395 | 884 | name='edit_repo_advanced_hooks', |
|
396 | 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 | 892 | # Caches |
|
399 | 893 | config.add_route( |
|
400 | 894 | name='edit_repo_caches', |
|
401 | 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 | 906 | # Permissions |
|
404 | 907 | config.add_route( |
|
405 | 908 | name='edit_repo_perms', |
|
406 | 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 | 921 | config.add_route( |
|
409 | 922 | name='edit_repo_perms_set_private', |
|
410 | 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 | 930 | # Permissions Branch (EE feature) |
|
413 | 931 | config.add_route( |
|
414 | 932 | name='edit_repo_perms_branch', |
|
415 | 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 | 940 | config.add_route( |
|
417 | 941 | name='edit_repo_perms_branch_delete', |
|
418 | 942 | pattern='/{repo_name:.*?[^/]}/settings/branch_permissions/{rule_id}/delete', |
|
419 | 943 | repo_route=True) |
|
944 | ## Only implemented in EE | |
|
420 | 945 | |
|
421 | 946 | # Maintenance |
|
422 | 947 | config.add_route( |
|
423 | 948 | name='edit_repo_maintenance', |
|
424 | 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 | 956 | config.add_route( |
|
427 | 957 | name='edit_repo_maintenance_execute', |
|
428 | 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 | 965 | # Fields |
|
431 | 966 | config.add_route( |
|
432 | 967 | name='edit_repo_fields', |
|
433 | 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 | 975 | config.add_route( |
|
435 | 976 | name='edit_repo_fields_create', |
|
436 | 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 | 984 | config.add_route( |
|
438 | 985 | name='edit_repo_fields_delete', |
|
439 | 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 | 993 | # Locking |
|
442 | 994 | config.add_route( |
|
443 | 995 | name='repo_edit_toggle_locking', |
|
444 | 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 | 1003 | # Remote |
|
447 | 1004 | config.add_route( |
|
448 | 1005 | name='edit_repo_remote', |
|
449 | 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 | 1013 | config.add_route( |
|
451 | 1014 | name='edit_repo_remote_pull', |
|
452 | 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 | 1022 | config.add_route( |
|
454 | 1023 | name='edit_repo_remote_push', |
|
455 | 1024 | pattern='/{repo_name:.*?[^/]}/settings/remote/push', repo_route=True) |
@@ -458,91 +1027,201 b' def includeme(config):' | |||
|
458 | 1027 | config.add_route( |
|
459 | 1028 | name='edit_repo_statistics', |
|
460 | 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 | 1036 | config.add_route( |
|
462 | 1037 | name='edit_repo_statistics_reset', |
|
463 | 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 | 1045 | # Issue trackers |
|
466 | 1046 | config.add_route( |
|
467 | 1047 | name='edit_repo_issuetracker', |
|
468 | 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 | 1055 | config.add_route( |
|
470 | 1056 | name='edit_repo_issuetracker_test', |
|
471 | 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 | 1064 | config.add_route( |
|
473 | 1065 | name='edit_repo_issuetracker_delete', |
|
474 | 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 | 1073 | config.add_route( |
|
476 | 1074 | name='edit_repo_issuetracker_update', |
|
477 | 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 | 1082 | # VCS Settings |
|
480 | 1083 | config.add_route( |
|
481 | 1084 | name='edit_repo_vcs', |
|
482 | 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 | 1092 | config.add_route( |
|
484 | 1093 | name='edit_repo_vcs_update', |
|
485 | 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 | 1101 | # svn pattern |
|
488 | 1102 | config.add_route( |
|
489 | 1103 | name='edit_repo_vcs_svn_pattern_delete', |
|
490 | 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 | 1111 | # Repo Review Rules (EE feature) |
|
493 | 1112 | config.add_route( |
|
494 | 1113 | name='repo_reviewers', |
|
495 | 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 | 1121 | config.add_route( |
|
498 | 1122 | name='repo_default_reviewers_data', |
|
499 | 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 | 1130 | # Repo Automation (EE feature) |
|
502 | 1131 | config.add_route( |
|
503 | 1132 | name='repo_automation', |
|
504 | 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 | 1140 | # Strip |
|
507 | 1141 | config.add_route( |
|
508 | 1142 | name='edit_repo_strip', |
|
509 | 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 | 1150 | config.add_route( |
|
512 | 1151 | name='strip_check', |
|
513 | 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 | 1159 | config.add_route( |
|
516 | 1160 | name='strip_execute', |
|
517 | 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 | 1168 | # Audit logs |
|
520 | 1169 | config.add_route( |
|
521 | 1170 | name='edit_repo_audit_logs', |
|
522 | 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 | 1178 | # ATOM/RSS Feed, shouldn't contain slashes for outlook compatibility |
|
525 | 1179 | config.add_route( |
|
526 | 1180 | name='rss_feed_home', |
|
527 | 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 | 1195 | config.add_route( |
|
530 | 1196 | name='atom_feed_home', |
|
531 | 1197 | pattern='/{repo_name:.*?[^/]}/feed-atom', repo_route=True) |
|
532 | ||
|
533 | config.add_route( | |
|
534 | name='rss_feed_home_old', | |
|
535 | pattern='/{repo_name:.*?[^/]}/feed/rss', repo_route=True) | |
|
1198 | config.add_view( | |
|
1199 | RepoFeedView, | |
|
1200 | attr='atom', | |
|
1201 | route_name='atom_feed_home', request_method='GET', renderer=None) | |
|
536 | 1202 | |
|
537 | 1203 | config.add_route( |
|
538 | 1204 | name='atom_feed_home_old', |
|
539 | 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 | 1211 | # NOTE(marcink): needs to be at the end for catch-all |
|
542 | 1212 | add_route_with_slash( |
|
543 | 1213 | config, |
|
544 | 1214 | name='repo_summary', |
|
545 | 1215 | pattern='/{repo_name:.*?[^/]}', repo_route=True) |
|
546 | ||
|
547 | # Scan module for configuration decorators. | |
|
548 | config.scan('.views', ignore='.tests') | |
|
1216 | config.add_view( | |
|
1217 | RepoSummaryView, | |
|
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 | 21 | import logging |
|
22 | 22 | |
|
23 | from pyramid.view import view_config | |
|
23 | ||
|
24 | 24 | |
|
25 | 25 | from rhodecode.apps._base import RepoAppView |
|
26 | 26 | from rhodecode.lib.auth import ( |
@@ -39,9 +39,6 b' class RepoArtifactsView(RepoAppView):' | |||
|
39 | 39 | @LoginRequired() |
|
40 | 40 | @HasRepoPermissionAnyDecorator( |
|
41 | 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 | 42 | def repo_artifacts(self): |
|
46 | 43 | c = self.load_default_context() |
|
47 | 44 | c.active = 'artifacts' |
@@ -19,7 +19,7 b'' | |||
|
19 | 19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
20 | 20 | |
|
21 | 21 | import logging |
|
22 | from pyramid.view import view_config | |
|
22 | ||
|
23 | 23 | |
|
24 | 24 | from rhodecode.apps._base import RepoAppView |
|
25 | 25 | from rhodecode.lib.helpers import SqlPage |
@@ -38,9 +38,6 b' class AuditLogsView(RepoAppView):' | |||
|
38 | 38 | |
|
39 | 39 | @LoginRequired() |
|
40 | 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 | 41 | def repo_audit_logs(self): |
|
45 | 42 | _ = self.request.translate |
|
46 | 43 | c = self.load_default_context() |
@@ -20,7 +20,7 b'' | |||
|
20 | 20 | |
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | from pyramid.view import view_config | |
|
23 | ||
|
24 | 24 | |
|
25 | 25 | from rhodecode.apps._base import RepoAppView |
|
26 | 26 | from rhodecode.apps.repository.utils import get_default_reviewers_data |
@@ -36,9 +36,6 b' class RepoAutomationView(RepoAppView):' | |||
|
36 | 36 | |
|
37 | 37 | @LoginRequired() |
|
38 | 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 | 39 | def repo_automation(self): |
|
43 | 40 | c = self.load_default_context() |
|
44 | 41 | c.active = 'automation' |
@@ -20,7 +20,7 b'' | |||
|
20 | 20 | import logging |
|
21 | 21 | |
|
22 | 22 | from pyramid.httpexceptions import HTTPNotFound |
|
23 | from pyramid.view import view_config | |
|
23 | ||
|
24 | 24 | |
|
25 | 25 | from rhodecode.apps._base import BaseReferencesView |
|
26 | 26 | from rhodecode.lib.ext_json import json |
@@ -36,9 +36,6 b' class RepoBookmarksView(BaseReferencesVi' | |||
|
36 | 36 | @LoginRequired() |
|
37 | 37 | @HasRepoPermissionAnyDecorator( |
|
38 | 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 | 39 | def bookmarks(self): |
|
43 | 40 | c = self.load_default_context() |
|
44 | 41 |
@@ -20,7 +20,7 b'' | |||
|
20 | 20 | |
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | from pyramid.view import view_config | |
|
23 | ||
|
24 | 24 | |
|
25 | 25 | from rhodecode.apps._base import RepoAppView |
|
26 | 26 | from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator |
@@ -36,9 +36,6 b' class RepoSettingsBranchPermissionsView(' | |||
|
36 | 36 | |
|
37 | 37 | @LoginRequired() |
|
38 | 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 | 39 | def branch_permissions(self): |
|
43 | 40 | c = self.load_default_context() |
|
44 | 41 | c.active = 'permissions_branch' |
@@ -19,7 +19,7 b'' | |||
|
19 | 19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
20 | 20 | |
|
21 | 21 | import logging |
|
22 | from pyramid.view import view_config | |
|
22 | ||
|
23 | 23 | |
|
24 | 24 | from rhodecode.apps._base import BaseReferencesView |
|
25 | 25 | from rhodecode.lib.ext_json import json |
@@ -34,9 +34,6 b' class RepoBranchesView(BaseReferencesVie' | |||
|
34 | 34 | @LoginRequired() |
|
35 | 35 | @HasRepoPermissionAnyDecorator( |
|
36 | 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 | 37 | def branches(self): |
|
41 | 38 | c = self.load_default_context() |
|
42 | 39 |
@@ -22,7 +22,7 b' import os' | |||
|
22 | 22 | import logging |
|
23 | 23 | |
|
24 | 24 | from pyramid.httpexceptions import HTTPFound |
|
25 | from pyramid.view import view_config | |
|
25 | ||
|
26 | 26 | |
|
27 | 27 | from rhodecode.apps._base import RepoAppView |
|
28 | 28 | from rhodecode.lib.auth import ( |
@@ -42,9 +42,6 b' class RepoCachesView(RepoAppView):' | |||
|
42 | 42 | |
|
43 | 43 | @LoginRequired() |
|
44 | 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 | 45 | def repo_caches(self): |
|
49 | 46 | c = self.load_default_context() |
|
50 | 47 | c.active = 'caches' |
@@ -65,8 +62,6 b' class RepoCachesView(RepoAppView):' | |||
|
65 | 62 | @LoginRequired() |
|
66 | 63 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
67 | 64 | @CSRFRequired() |
|
68 | @view_config( | |
|
69 | route_name='edit_repo_caches', request_method='POST') | |
|
70 | 65 | def repo_caches_purge(self): |
|
71 | 66 | _ = self.request.translate |
|
72 | 67 | c = self.load_default_context() |
@@ -22,7 +22,7 b'' | |||
|
22 | 22 | import logging |
|
23 | 23 | |
|
24 | 24 | from pyramid.httpexceptions import HTTPNotFound, HTTPFound |
|
25 | from pyramid.view import view_config | |
|
25 | ||
|
26 | 26 | from pyramid.renderers import render |
|
27 | 27 | from pyramid.response import Response |
|
28 | 28 | |
@@ -176,19 +176,6 b' class RepoChangelogView(RepoAppView):' | |||
|
176 | 176 | @LoginRequired() |
|
177 | 177 | @HasRepoPermissionAnyDecorator( |
|
178 | 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 | 179 | def repo_changelog(self): |
|
193 | 180 | c = self.load_default_context() |
|
194 | 181 | |
@@ -291,14 +278,6 b' class RepoChangelogView(RepoAppView):' | |||
|
291 | 278 | @LoginRequired() |
|
292 | 279 | @HasRepoPermissionAnyDecorator( |
|
293 | 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 | 281 | def repo_commits_elements(self): |
|
303 | 282 | c = self.load_default_context() |
|
304 | 283 | commit_id = self.request.matchdict.get('commit_id') |
@@ -20,10 +20,8 b'' | |||
|
20 | 20 | |
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | from pyramid.view import view_config | |
|
24 | 23 | from pyramid.httpexceptions import HTTPFound, HTTPNotFound |
|
25 | 24 | |
|
26 | from rhodecode import events | |
|
27 | 25 | from rhodecode.apps._base import BaseAppView |
|
28 | 26 | from rhodecode.lib import helpers as h |
|
29 | 27 | from rhodecode.lib.auth import (NotAnonymous, HasRepoPermissionAny) |
@@ -37,13 +35,9 b' log = logging.getLogger(__name__)' | |||
|
37 | 35 | class RepoChecksView(BaseAppView): |
|
38 | 36 | def load_default_context(self): |
|
39 | 37 | c = self._get_local_tmpl_context() |
|
40 | ||
|
41 | 38 | return c |
|
42 | 39 | |
|
43 | 40 | @NotAnonymous() |
|
44 | @view_config( | |
|
45 | route_name='repo_creating', request_method='GET', | |
|
46 | renderer='rhodecode:templates/admin/repos/repo_creating.mako') | |
|
47 | 41 | def repo_creating(self): |
|
48 | 42 | c = self.load_default_context() |
|
49 | 43 | repo_name = self.request.matchdict['repo_name'] |
@@ -71,9 +65,6 b' class RepoChecksView(BaseAppView):' | |||
|
71 | 65 | return self._get_template_context(c) |
|
72 | 66 | |
|
73 | 67 | @NotAnonymous() |
|
74 | @view_config( | |
|
75 | route_name='repo_creating_check', request_method='GET', | |
|
76 | renderer='json_ext') | |
|
77 | 68 | def repo_creating_check(self): |
|
78 | 69 | _ = self.request.translate |
|
79 | 70 | task_id = self.request.GET.get('task_id') |
@@ -23,7 +23,6 b' import collections' | |||
|
23 | 23 | |
|
24 | 24 | from pyramid.httpexceptions import ( |
|
25 | 25 | HTTPNotFound, HTTPBadRequest, HTTPFound, HTTPForbidden, HTTPConflict) |
|
26 | from pyramid.view import view_config | |
|
27 | 26 | from pyramid.renderers import render |
|
28 | 27 | from pyramid.response import Response |
|
29 | 28 | |
@@ -340,9 +339,6 b' class RepoCommitsView(RepoAppView):' | |||
|
340 | 339 | @LoginRequired() |
|
341 | 340 | @HasRepoPermissionAnyDecorator( |
|
342 | 341 | 'repository.read', 'repository.write', 'repository.admin') |
|
343 | @view_config( | |
|
344 | route_name='repo_commit', request_method='GET', | |
|
345 | renderer=None) | |
|
346 | 342 | def repo_commit_show(self): |
|
347 | 343 | commit_id = self.request.matchdict['commit_id'] |
|
348 | 344 | return self._commit(commit_id, method='show') |
@@ -350,12 +346,6 b' class RepoCommitsView(RepoAppView):' | |||
|
350 | 346 | @LoginRequired() |
|
351 | 347 | @HasRepoPermissionAnyDecorator( |
|
352 | 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 | 349 | def repo_commit_raw(self): |
|
360 | 350 | commit_id = self.request.matchdict['commit_id'] |
|
361 | 351 | return self._commit(commit_id, method='raw') |
@@ -363,9 +353,6 b' class RepoCommitsView(RepoAppView):' | |||
|
363 | 353 | @LoginRequired() |
|
364 | 354 | @HasRepoPermissionAnyDecorator( |
|
365 | 355 | 'repository.read', 'repository.write', 'repository.admin') |
|
366 | @view_config( | |
|
367 | route_name='repo_commit_patch', request_method='GET', | |
|
368 | renderer=None) | |
|
369 | 356 | def repo_commit_patch(self): |
|
370 | 357 | commit_id = self.request.matchdict['commit_id'] |
|
371 | 358 | return self._commit(commit_id, method='patch') |
@@ -373,9 +360,6 b' class RepoCommitsView(RepoAppView):' | |||
|
373 | 360 | @LoginRequired() |
|
374 | 361 | @HasRepoPermissionAnyDecorator( |
|
375 | 362 | 'repository.read', 'repository.write', 'repository.admin') |
|
376 | @view_config( | |
|
377 | route_name='repo_commit_download', request_method='GET', | |
|
378 | renderer=None) | |
|
379 | 363 | def repo_commit_download(self): |
|
380 | 364 | commit_id = self.request.matchdict['commit_id'] |
|
381 | 365 | return self._commit(commit_id, method='download') |
@@ -500,9 +484,6 b' class RepoCommitsView(RepoAppView):' | |||
|
500 | 484 | @HasRepoPermissionAnyDecorator( |
|
501 | 485 | 'repository.read', 'repository.write', 'repository.admin') |
|
502 | 486 | @CSRFRequired() |
|
503 | @view_config( | |
|
504 | route_name='repo_commit_comment_create', request_method='POST', | |
|
505 | renderer='json_ext') | |
|
506 | 487 | def repo_commit_comment_create(self): |
|
507 | 488 | _ = self.request.translate |
|
508 | 489 | commit_id = self.request.matchdict['commit_id'] |
@@ -538,9 +519,6 b' class RepoCommitsView(RepoAppView):' | |||
|
538 | 519 | @HasRepoPermissionAnyDecorator( |
|
539 | 520 | 'repository.read', 'repository.write', 'repository.admin') |
|
540 | 521 | @CSRFRequired() |
|
541 | @view_config( | |
|
542 | route_name='repo_commit_comment_preview', request_method='POST', | |
|
543 | renderer='string', xhr=True) | |
|
544 | 522 | def repo_commit_comment_preview(self): |
|
545 | 523 | # Technically a CSRF token is not needed as no state changes with this |
|
546 | 524 | # call. However, as this is a POST is better to have it, so automated |
@@ -559,9 +537,6 b' class RepoCommitsView(RepoAppView):' | |||
|
559 | 537 | @HasRepoPermissionAnyDecorator( |
|
560 | 538 | 'repository.read', 'repository.write', 'repository.admin') |
|
561 | 539 | @CSRFRequired() |
|
562 | @view_config( | |
|
563 | route_name='repo_commit_comment_history_view', request_method='POST', | |
|
564 | renderer='string', xhr=True) | |
|
565 | 540 | def repo_commit_comment_history_view(self): |
|
566 | 541 | c = self.load_default_context() |
|
567 | 542 | |
@@ -587,9 +562,6 b' class RepoCommitsView(RepoAppView):' | |||
|
587 | 562 | @HasRepoPermissionAnyDecorator( |
|
588 | 563 | 'repository.read', 'repository.write', 'repository.admin') |
|
589 | 564 | @CSRFRequired() |
|
590 | @view_config( | |
|
591 | route_name='repo_commit_comment_attachment_upload', request_method='POST', | |
|
592 | renderer='json_ext', xhr=True) | |
|
593 | 565 | def repo_commit_comment_attachment_upload(self): |
|
594 | 566 | c = self.load_default_context() |
|
595 | 567 | upload_key = 'attachment' |
@@ -682,9 +654,6 b' class RepoCommitsView(RepoAppView):' | |||
|
682 | 654 | @HasRepoPermissionAnyDecorator( |
|
683 | 655 | 'repository.read', 'repository.write', 'repository.admin') |
|
684 | 656 | @CSRFRequired() |
|
685 | @view_config( | |
|
686 | route_name='repo_commit_comment_delete', request_method='POST', | |
|
687 | renderer='json_ext') | |
|
688 | 657 | def repo_commit_comment_delete(self): |
|
689 | 658 | commit_id = self.request.matchdict['commit_id'] |
|
690 | 659 | comment_id = self.request.matchdict['comment_id'] |
@@ -719,9 +688,6 b' class RepoCommitsView(RepoAppView):' | |||
|
719 | 688 | @HasRepoPermissionAnyDecorator( |
|
720 | 689 | 'repository.read', 'repository.write', 'repository.admin') |
|
721 | 690 | @CSRFRequired() |
|
722 | @view_config( | |
|
723 | route_name='repo_commit_comment_edit', request_method='POST', | |
|
724 | renderer='json_ext') | |
|
725 | 691 | def repo_commit_comment_edit(self): |
|
726 | 692 | self.load_default_context() |
|
727 | 693 | |
@@ -802,9 +768,6 b' class RepoCommitsView(RepoAppView):' | |||
|
802 | 768 | @LoginRequired() |
|
803 | 769 | @HasRepoPermissionAnyDecorator( |
|
804 | 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 | 771 | def repo_commit_data(self): |
|
809 | 772 | commit_id = self.request.matchdict['commit_id'] |
|
810 | 773 | self.load_default_context() |
@@ -817,9 +780,6 b' class RepoCommitsView(RepoAppView):' | |||
|
817 | 780 | @LoginRequired() |
|
818 | 781 | @HasRepoPermissionAnyDecorator( |
|
819 | 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 | 783 | def repo_commit_children(self): |
|
824 | 784 | commit_id = self.request.matchdict['commit_id'] |
|
825 | 785 | self.load_default_context() |
@@ -836,9 +796,6 b' class RepoCommitsView(RepoAppView):' | |||
|
836 | 796 | @LoginRequired() |
|
837 | 797 | @HasRepoPermissionAnyDecorator( |
|
838 | 798 | 'repository.read', 'repository.write', 'repository.admin') |
|
839 | @view_config( | |
|
840 | route_name='repo_commit_parents', request_method='GET', | |
|
841 | renderer='json_ext') | |
|
842 | 799 | def repo_commit_parents(self): |
|
843 | 800 | commit_id = self.request.matchdict['commit_id'] |
|
844 | 801 | self.load_default_context() |
@@ -22,7 +22,7 b'' | |||
|
22 | 22 | import logging |
|
23 | 23 | |
|
24 | 24 | from pyramid.httpexceptions import HTTPBadRequest, HTTPNotFound, HTTPFound |
|
25 | from pyramid.view import view_config | |
|
25 | ||
|
26 | 26 | from pyramid.renderers import render |
|
27 | 27 | from pyramid.response import Response |
|
28 | 28 | |
@@ -79,9 +79,6 b' class RepoCompareView(RepoAppView):' | |||
|
79 | 79 | @LoginRequired() |
|
80 | 80 | @HasRepoPermissionAnyDecorator( |
|
81 | 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 | 82 | def compare_select(self): |
|
86 | 83 | _ = self.request.translate |
|
87 | 84 | c = self.load_default_context() |
@@ -111,9 +108,6 b' class RepoCompareView(RepoAppView):' | |||
|
111 | 108 | @LoginRequired() |
|
112 | 109 | @HasRepoPermissionAnyDecorator( |
|
113 | 110 | 'repository.read', 'repository.write', 'repository.admin') |
|
114 | @view_config( | |
|
115 | route_name='repo_compare', request_method='GET', | |
|
116 | renderer=None) | |
|
117 | 111 | def compare(self): |
|
118 | 112 | _ = self.request.translate |
|
119 | 113 | c = self.load_default_context() |
@@ -20,10 +20,8 b'' | |||
|
20 | 20 | import pytz |
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | from pyramid.view import view_config | |
|
24 | 23 | from pyramid.response import Response |
|
25 | 24 | |
|
26 | ||
|
27 | 25 | from rhodecode.apps._base import RepoAppView |
|
28 | 26 | from rhodecode.lib.feedgenerator import Rss201rev2Feed, Atom1Feed |
|
29 | 27 | from rhodecode.lib import audit_logger |
@@ -118,8 +116,6 b' class RepoFeedView(RepoAppView):' | |||
|
118 | 116 | @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED]) |
|
119 | 117 | @HasRepoPermissionAnyDecorator( |
|
120 | 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 | 119 | def atom(self): |
|
124 | 120 | """ |
|
125 | 121 | Produce an atom-1.0 feed via feedgenerator module |
@@ -166,8 +162,6 b' class RepoFeedView(RepoAppView):' | |||
|
166 | 162 | @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED]) |
|
167 | 163 | @HasRepoPermissionAnyDecorator( |
|
168 | 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 | 165 | def rss(self): |
|
172 | 166 | """ |
|
173 | 167 | Produce an rss2 feed via feedgenerator module |
@@ -28,7 +28,7 b' import urllib' | |||
|
28 | 28 | import pathlib2 |
|
29 | 29 | |
|
30 | 30 | from pyramid.httpexceptions import HTTPNotFound, HTTPBadRequest, HTTPFound |
|
31 | from pyramid.view import view_config | |
|
31 | ||
|
32 | 32 | from pyramid.renderers import render |
|
33 | 33 | from pyramid.response import Response |
|
34 | 34 | |
@@ -343,9 +343,6 b' class RepoFilesView(RepoAppView):' | |||
|
343 | 343 | @LoginRequired() |
|
344 | 344 | @HasRepoPermissionAnyDecorator( |
|
345 | 345 | 'repository.read', 'repository.write', 'repository.admin') |
|
346 | @view_config( | |
|
347 | route_name='repo_archivefile', request_method='GET', | |
|
348 | renderer=None) | |
|
349 | 346 | def repo_archivefile(self): |
|
350 | 347 | # archive cache config |
|
351 | 348 | from rhodecode import CONFIG |
@@ -496,9 +493,6 b' class RepoFilesView(RepoAppView):' | |||
|
496 | 493 | @LoginRequired() |
|
497 | 494 | @HasRepoPermissionAnyDecorator( |
|
498 | 495 | 'repository.read', 'repository.write', 'repository.admin') |
|
499 | @view_config( | |
|
500 | route_name='repo_files_diff', request_method='GET', | |
|
501 | renderer=None) | |
|
502 | 496 | def repo_files_diff(self): |
|
503 | 497 | c = self.load_default_context() |
|
504 | 498 | f_path = self._get_f_path(self.request.matchdict) |
@@ -581,9 +575,6 b' class RepoFilesView(RepoAppView):' | |||
|
581 | 575 | @LoginRequired() |
|
582 | 576 | @HasRepoPermissionAnyDecorator( |
|
583 | 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 | 578 | def repo_files_diff_2way_redirect(self): |
|
588 | 579 | """ |
|
589 | 580 | Kept only to make OLD links work |
@@ -610,10 +601,11 b' class RepoFilesView(RepoAppView):' | |||
|
610 | 601 | raise HTTPFound(compare_url) |
|
611 | 602 | |
|
612 | 603 | @LoginRequired() |
|
613 | @view_config( | |
|
614 | route_name='repo_files:default_commit', request_method='GET', | |
|
615 | renderer=None) | |
|
616 | def repo_files_default(self): | |
|
604 | def repo_files_default_commit_redirect(self): | |
|
605 | """ | |
|
606 | Special page that redirects to the landing page of files based on the default | |
|
607 | commit for repository | |
|
608 | """ | |
|
617 | 609 | c = self.load_default_context() |
|
618 | 610 | ref_name = c.rhodecode_db_repo.landing_ref_name |
|
619 | 611 | landing_url = h.repo_files_by_ref_url( |
@@ -630,18 +622,6 b' class RepoFilesView(RepoAppView):' | |||
|
630 | 622 | @LoginRequired() |
|
631 | 623 | @HasRepoPermissionAnyDecorator( |
|
632 | 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 | 625 | def repo_files(self): |
|
646 | 626 | c = self.load_default_context() |
|
647 | 627 | |
@@ -759,9 +739,6 b' class RepoFilesView(RepoAppView):' | |||
|
759 | 739 | |
|
760 | 740 | @HasRepoPermissionAnyDecorator( |
|
761 | 741 | 'repository.read', 'repository.write', 'repository.admin') |
|
762 | @view_config( | |
|
763 | route_name='repo_files:annotated_previous', request_method='GET', | |
|
764 | renderer=None) | |
|
765 | 742 | def repo_files_annotated_previous(self): |
|
766 | 743 | self.load_default_context() |
|
767 | 744 | |
@@ -790,12 +767,6 b' class RepoFilesView(RepoAppView):' | |||
|
790 | 767 | @LoginRequired() |
|
791 | 768 | @HasRepoPermissionAnyDecorator( |
|
792 | 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 | 770 | def repo_nodetree_full(self): |
|
800 | 771 | """ |
|
801 | 772 | Returns rendered html of file tree that contains commit date, |
@@ -835,9 +806,6 b' class RepoFilesView(RepoAppView):' | |||
|
835 | 806 | @LoginRequired() |
|
836 | 807 | @HasRepoPermissionAnyDecorator( |
|
837 | 808 | 'repository.read', 'repository.write', 'repository.admin') |
|
838 | @view_config( | |
|
839 | route_name='repo_file_raw', request_method='GET', | |
|
840 | renderer=None) | |
|
841 | 809 | def repo_file_raw(self): |
|
842 | 810 | """ |
|
843 | 811 | Action for show as raw, some mimetypes are "rendered", |
@@ -902,12 +870,6 b' class RepoFilesView(RepoAppView):' | |||
|
902 | 870 | @LoginRequired() |
|
903 | 871 | @HasRepoPermissionAnyDecorator( |
|
904 | 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 | 873 | def repo_file_download(self): |
|
912 | 874 | c = self.load_default_context() |
|
913 | 875 | |
@@ -972,9 +934,6 b' class RepoFilesView(RepoAppView):' | |||
|
972 | 934 | @LoginRequired() |
|
973 | 935 | @HasRepoPermissionAnyDecorator( |
|
974 | 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 | 937 | def repo_nodelist(self): |
|
979 | 938 | self.load_default_context() |
|
980 | 939 | |
@@ -1059,9 +1018,6 b' class RepoFilesView(RepoAppView):' | |||
|
1059 | 1018 | @LoginRequired() |
|
1060 | 1019 | @HasRepoPermissionAnyDecorator( |
|
1061 | 1020 | 'repository.read', 'repository.write', 'repository.admin') |
|
1062 | @view_config( | |
|
1063 | route_name='repo_file_history', request_method='GET', | |
|
1064 | renderer='json_ext') | |
|
1065 | 1021 | def repo_file_history(self): |
|
1066 | 1022 | self.load_default_context() |
|
1067 | 1023 | |
@@ -1105,9 +1061,6 b' class RepoFilesView(RepoAppView):' | |||
|
1105 | 1061 | @LoginRequired() |
|
1106 | 1062 | @HasRepoPermissionAnyDecorator( |
|
1107 | 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 | 1064 | def repo_file_authors(self): |
|
1112 | 1065 | c = self.load_default_context() |
|
1113 | 1066 | |
@@ -1149,9 +1102,6 b' class RepoFilesView(RepoAppView):' | |||
|
1149 | 1102 | |
|
1150 | 1103 | @LoginRequired() |
|
1151 | 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 | 1105 | def repo_files_check_head(self): |
|
1156 | 1106 | self.load_default_context() |
|
1157 | 1107 | |
@@ -1186,9 +1136,6 b' class RepoFilesView(RepoAppView):' | |||
|
1186 | 1136 | |
|
1187 | 1137 | @LoginRequired() |
|
1188 | 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 | 1139 | def repo_files_remove_file(self): |
|
1193 | 1140 | _ = self.request.translate |
|
1194 | 1141 | c = self.load_default_context() |
@@ -1214,9 +1161,6 b' class RepoFilesView(RepoAppView):' | |||
|
1214 | 1161 | @LoginRequired() |
|
1215 | 1162 | @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin') |
|
1216 | 1163 | @CSRFRequired() |
|
1217 | @view_config( | |
|
1218 | route_name='repo_files_delete_file', request_method='POST', | |
|
1219 | renderer=None) | |
|
1220 | 1164 | def repo_files_delete_file(self): |
|
1221 | 1165 | _ = self.request.translate |
|
1222 | 1166 | |
@@ -1266,9 +1210,6 b' class RepoFilesView(RepoAppView):' | |||
|
1266 | 1210 | |
|
1267 | 1211 | @LoginRequired() |
|
1268 | 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 | 1213 | def repo_files_edit_file(self): |
|
1273 | 1214 | _ = self.request.translate |
|
1274 | 1215 | c = self.load_default_context() |
@@ -1300,9 +1241,6 b' class RepoFilesView(RepoAppView):' | |||
|
1300 | 1241 | @LoginRequired() |
|
1301 | 1242 | @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin') |
|
1302 | 1243 | @CSRFRequired() |
|
1303 | @view_config( | |
|
1304 | route_name='repo_files_update_file', request_method='POST', | |
|
1305 | renderer=None) | |
|
1306 | 1244 | def repo_files_update_file(self): |
|
1307 | 1245 | _ = self.request.translate |
|
1308 | 1246 | c = self.load_default_context() |
@@ -1384,12 +1322,6 b' class RepoFilesView(RepoAppView):' | |||
|
1384 | 1322 | |
|
1385 | 1323 | @LoginRequired() |
|
1386 | 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 | 1325 | def repo_files_add_file(self): |
|
1394 | 1326 | _ = self.request.translate |
|
1395 | 1327 | c = self.load_default_context() |
@@ -1421,9 +1353,6 b' class RepoFilesView(RepoAppView):' | |||
|
1421 | 1353 | @LoginRequired() |
|
1422 | 1354 | @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin') |
|
1423 | 1355 | @CSRFRequired() |
|
1424 | @view_config( | |
|
1425 | route_name='repo_files_create_file', request_method='POST', | |
|
1426 | renderer=None) | |
|
1427 | 1356 | def repo_files_create_file(self): |
|
1428 | 1357 | _ = self.request.translate |
|
1429 | 1358 | c = self.load_default_context() |
@@ -1518,9 +1447,6 b' class RepoFilesView(RepoAppView):' | |||
|
1518 | 1447 | @LoginRequired() |
|
1519 | 1448 | @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin') |
|
1520 | 1449 | @CSRFRequired() |
|
1521 | @view_config( | |
|
1522 | route_name='repo_files_upload_file', request_method='POST', | |
|
1523 | renderer='json_ext') | |
|
1524 | 1450 | def repo_files_upload_file(self): |
|
1525 | 1451 | _ = self.request.translate |
|
1526 | 1452 | c = self.load_default_context() |
@@ -24,7 +24,7 b' import formencode' | |||
|
24 | 24 | import formencode.htmlfill |
|
25 | 25 | |
|
26 | 26 | from pyramid.httpexceptions import HTTPFound |
|
27 | from pyramid.view import view_config | |
|
27 | ||
|
28 | 28 | from pyramid.renderers import render |
|
29 | 29 | from pyramid.response import Response |
|
30 | 30 | |
@@ -64,9 +64,6 b' class RepoForksView(RepoAppView, DataGri' | |||
|
64 | 64 | @LoginRequired() |
|
65 | 65 | @HasRepoPermissionAnyDecorator( |
|
66 | 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 | 67 | def repo_forks_show_all(self): |
|
71 | 68 | c = self.load_default_context() |
|
72 | 69 | return self._get_template_context(c) |
@@ -74,9 +71,6 b' class RepoForksView(RepoAppView, DataGri' | |||
|
74 | 71 | @LoginRequired() |
|
75 | 72 | @HasRepoPermissionAnyDecorator( |
|
76 | 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 | 74 | def repo_forks_data(self): |
|
81 | 75 | _ = self.request.translate |
|
82 | 76 | self.load_default_context() |
@@ -174,9 +168,6 b' class RepoForksView(RepoAppView, DataGri' | |||
|
174 | 168 | @HasPermissionAnyDecorator('hg.admin', 'hg.fork.repository') |
|
175 | 169 | @HasRepoPermissionAnyDecorator( |
|
176 | 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 | 171 | def repo_fork_new(self): |
|
181 | 172 | c = self.load_default_context() |
|
182 | 173 | |
@@ -204,9 +195,6 b' class RepoForksView(RepoAppView, DataGri' | |||
|
204 | 195 | @HasRepoPermissionAnyDecorator( |
|
205 | 196 | 'repository.read', 'repository.write', 'repository.admin') |
|
206 | 197 | @CSRFRequired() |
|
207 | @view_config( | |
|
208 | route_name='repo_fork_create', request_method='POST', | |
|
209 | renderer='rhodecode:templates/forks/fork.mako') | |
|
210 | 198 | def repo_fork_create(self): |
|
211 | 199 | _ = self.request.translate |
|
212 | 200 | c = self.load_default_context() |
@@ -20,7 +20,7 b'' | |||
|
20 | 20 | |
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | from pyramid.view import view_config | |
|
23 | ||
|
24 | 24 | |
|
25 | 25 | from rhodecode.apps._base import RepoAppView |
|
26 | 26 | from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator |
@@ -36,9 +36,6 b' class RepoMaintenanceView(RepoAppView):' | |||
|
36 | 36 | |
|
37 | 37 | @LoginRequired() |
|
38 | 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 | 39 | def repo_maintenance(self): |
|
43 | 40 | c = self.load_default_context() |
|
44 | 41 | c.active = 'maintenance' |
@@ -48,9 +45,6 b' class RepoMaintenanceView(RepoAppView):' | |||
|
48 | 45 | |
|
49 | 46 | @LoginRequired() |
|
50 | 47 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
51 | @view_config( | |
|
52 | route_name='edit_repo_maintenance_execute', request_method='GET', | |
|
53 | renderer='json', xhr=True) | |
|
54 | 48 | def repo_maintenance_execute(self): |
|
55 | 49 | c = self.load_default_context() |
|
56 | 50 | c.active = 'maintenance' |
@@ -21,7 +21,6 b'' | |||
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | 23 | from pyramid.httpexceptions import HTTPFound |
|
24 | from pyramid.view import view_config | |
|
25 | 24 | |
|
26 | 25 | from rhodecode.apps._base import RepoAppView |
|
27 | 26 | from rhodecode.lib import helpers as h |
@@ -46,9 +45,6 b' class RepoSettingsPermissionsView(RepoAp' | |||
|
46 | 45 | |
|
47 | 46 | @LoginRequired() |
|
48 | 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 | 48 | def edit_permissions(self): |
|
53 | 49 | _ = self.request.translate |
|
54 | 50 | c = self.load_default_context() |
@@ -62,9 +58,6 b' class RepoSettingsPermissionsView(RepoAp' | |||
|
62 | 58 | @LoginRequired() |
|
63 | 59 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
64 | 60 | @CSRFRequired() |
|
65 | @view_config( | |
|
66 | route_name='edit_repo_perms', request_method='POST', | |
|
67 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
|
68 | 61 | def edit_permissions_update(self): |
|
69 | 62 | _ = self.request.translate |
|
70 | 63 | c = self.load_default_context() |
@@ -104,9 +97,6 b' class RepoSettingsPermissionsView(RepoAp' | |||
|
104 | 97 | @LoginRequired() |
|
105 | 98 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
106 | 99 | @CSRFRequired() |
|
107 | @view_config( | |
|
108 | route_name='edit_repo_perms_set_private', request_method='POST', | |
|
109 | renderer='json_ext') | |
|
110 | 100 | def edit_permissions_set_private_repo(self): |
|
111 | 101 | _ = self.request.translate |
|
112 | 102 | self.load_default_context() |
@@ -26,7 +26,7 b' import formencode.htmlfill' | |||
|
26 | 26 | import peppercorn |
|
27 | 27 | from pyramid.httpexceptions import ( |
|
28 | 28 | HTTPFound, HTTPNotFound, HTTPForbidden, HTTPBadRequest, HTTPConflict) |
|
29 | from pyramid.view import view_config | |
|
29 | ||
|
30 | 30 | from pyramid.renderers import render |
|
31 | 31 | |
|
32 | 32 | from rhodecode.apps._base import RepoAppView, DataGridAppView |
@@ -147,9 +147,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
147 | 147 | @LoginRequired() |
|
148 | 148 | @HasRepoPermissionAnyDecorator( |
|
149 | 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 | 150 | def pull_request_list(self): |
|
154 | 151 | c = self.load_default_context() |
|
155 | 152 | |
@@ -177,9 +174,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
177 | 174 | @LoginRequired() |
|
178 | 175 | @HasRepoPermissionAnyDecorator( |
|
179 | 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 | 177 | def pull_request_list_data(self): |
|
184 | 178 | self.load_default_context() |
|
185 | 179 | |
@@ -311,9 +305,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
311 | 305 | @LoginRequired() |
|
312 | 306 | @HasRepoPermissionAnyDecorator( |
|
313 | 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 | 308 | def pull_request_show(self): |
|
318 | 309 | _ = self.request.translate |
|
319 | 310 | c = self.load_default_context() |
@@ -842,9 +833,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
842 | 833 | @NotAnonymous() |
|
843 | 834 | @HasRepoPermissionAnyDecorator( |
|
844 | 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 | 836 | def pull_request_new(self): |
|
849 | 837 | _ = self.request.translate |
|
850 | 838 | c = self.load_default_context() |
@@ -902,9 +890,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
902 | 890 | @NotAnonymous() |
|
903 | 891 | @HasRepoPermissionAnyDecorator( |
|
904 | 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 | 893 | def pull_request_repo_refs(self): |
|
909 | 894 | self.load_default_context() |
|
910 | 895 | target_repo_name = self.request.matchdict['target_repo_name'] |
@@ -925,9 +910,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
925 | 910 | @NotAnonymous() |
|
926 | 911 | @HasRepoPermissionAnyDecorator( |
|
927 | 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 | 913 | def pullrequest_repo_targets(self): |
|
932 | 914 | _ = self.request.translate |
|
933 | 915 | filter_query = self.request.GET.get('query') |
@@ -998,9 +980,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
998 | 980 | @NotAnonymous() |
|
999 | 981 | @HasRepoPermissionAnyDecorator( |
|
1000 | 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 | 983 | def pullrequest_comments(self): |
|
1005 | 984 | self.load_default_context() |
|
1006 | 985 | |
@@ -1038,9 +1017,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
1038 | 1017 | @NotAnonymous() |
|
1039 | 1018 | @HasRepoPermissionAnyDecorator( |
|
1040 | 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 | 1020 | def pullrequest_todos(self): |
|
1045 | 1021 | self.load_default_context() |
|
1046 | 1022 | |
@@ -1080,9 +1056,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
1080 | 1056 | @NotAnonymous() |
|
1081 | 1057 | @HasRepoPermissionAnyDecorator( |
|
1082 | 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 | 1059 | def pullrequest_drafts(self): |
|
1087 | 1060 | self.load_default_context() |
|
1088 | 1061 | |
@@ -1123,9 +1096,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
1123 | 1096 | @HasRepoPermissionAnyDecorator( |
|
1124 | 1097 | 'repository.read', 'repository.write', 'repository.admin') |
|
1125 | 1098 | @CSRFRequired() |
|
1126 | @view_config( | |
|
1127 | route_name='pullrequest_create', request_method='POST', | |
|
1128 | renderer=None) | |
|
1129 | 1099 | def pull_request_create(self): |
|
1130 | 1100 | _ = self.request.translate |
|
1131 | 1101 | self.assure_not_empty_repo() |
@@ -1281,9 +1251,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
1281 | 1251 | @HasRepoPermissionAnyDecorator( |
|
1282 | 1252 | 'repository.read', 'repository.write', 'repository.admin') |
|
1283 | 1253 | @CSRFRequired() |
|
1284 | @view_config( | |
|
1285 | route_name='pullrequest_update', request_method='POST', | |
|
1286 | renderer='json_ext') | |
|
1287 | 1254 | def pull_request_update(self): |
|
1288 | 1255 | pull_request = PullRequest.get_or_404( |
|
1289 | 1256 | self.request.matchdict['pull_request_id']) |
@@ -1465,9 +1432,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
1465 | 1432 | @HasRepoPermissionAnyDecorator( |
|
1466 | 1433 | 'repository.read', 'repository.write', 'repository.admin') |
|
1467 | 1434 | @CSRFRequired() |
|
1468 | @view_config( | |
|
1469 | route_name='pullrequest_merge', request_method='POST', | |
|
1470 | renderer='json_ext') | |
|
1471 | 1435 | def pull_request_merge(self): |
|
1472 | 1436 | """ |
|
1473 | 1437 | Merge will perform a server-side merge of the specified |
@@ -1541,9 +1505,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
1541 | 1505 | @HasRepoPermissionAnyDecorator( |
|
1542 | 1506 | 'repository.read', 'repository.write', 'repository.admin') |
|
1543 | 1507 | @CSRFRequired() |
|
1544 | @view_config( | |
|
1545 | route_name='pullrequest_delete', request_method='POST', | |
|
1546 | renderer='json_ext') | |
|
1547 | 1508 | def pull_request_delete(self): |
|
1548 | 1509 | _ = self.request.translate |
|
1549 | 1510 | |
@@ -1719,9 +1680,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
1719 | 1680 | @HasRepoPermissionAnyDecorator( |
|
1720 | 1681 | 'repository.read', 'repository.write', 'repository.admin') |
|
1721 | 1682 | @CSRFRequired() |
|
1722 | @view_config( | |
|
1723 | route_name='pullrequest_comment_create', request_method='POST', | |
|
1724 | renderer='json_ext') | |
|
1725 | 1683 | def pull_request_comment_create(self): |
|
1726 | 1684 | _ = self.request.translate |
|
1727 | 1685 | |
@@ -1756,9 +1714,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
1756 | 1714 | @HasRepoPermissionAnyDecorator( |
|
1757 | 1715 | 'repository.read', 'repository.write', 'repository.admin') |
|
1758 | 1716 | @CSRFRequired() |
|
1759 | @view_config( | |
|
1760 | route_name='pullrequest_comment_delete', request_method='POST', | |
|
1761 | renderer='json_ext') | |
|
1762 | 1717 | def pull_request_comment_delete(self): |
|
1763 | 1718 | pull_request = PullRequest.get_or_404( |
|
1764 | 1719 | self.request.matchdict['pull_request_id']) |
@@ -1810,9 +1765,6 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
1810 | 1765 | @HasRepoPermissionAnyDecorator( |
|
1811 | 1766 | 'repository.read', 'repository.write', 'repository.admin') |
|
1812 | 1767 | @CSRFRequired() |
|
1813 | @view_config( | |
|
1814 | route_name='pullrequest_comment_edit', request_method='POST', | |
|
1815 | renderer='json_ext') | |
|
1816 | 1768 | def pull_request_comment_edit(self): |
|
1817 | 1769 | self.load_default_context() |
|
1818 | 1770 |
@@ -20,7 +20,7 b'' | |||
|
20 | 20 | |
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | from pyramid.view import view_config | |
|
23 | ||
|
24 | 24 | |
|
25 | 25 | from rhodecode.apps._base import RepoAppView |
|
26 | 26 | from rhodecode.apps.repository.utils import get_default_reviewers_data |
@@ -38,9 +38,6 b' class RepoReviewRulesView(RepoAppView):' | |||
|
38 | 38 | |
|
39 | 39 | @LoginRequired() |
|
40 | 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 | 41 | def repo_review_rules(self): |
|
45 | 42 | c = self.load_default_context() |
|
46 | 43 | c.active = 'reviewers' |
@@ -50,9 +47,6 b' class RepoReviewRulesView(RepoAppView):' | |||
|
50 | 47 | @LoginRequired() |
|
51 | 48 | @HasRepoPermissionAnyDecorator( |
|
52 | 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 | 50 | def repo_default_reviewers_data(self): |
|
57 | 51 | self.load_default_context() |
|
58 | 52 |
@@ -22,7 +22,6 b' import logging' | |||
|
22 | 22 | |
|
23 | 23 | import deform |
|
24 | 24 | from pyramid.httpexceptions import HTTPFound |
|
25 | from pyramid.view import view_config | |
|
26 | 25 | |
|
27 | 26 | from rhodecode import events |
|
28 | 27 | from rhodecode.apps._base import RepoAppView |
@@ -90,9 +89,6 b' class RepoSettingsView(RepoAppView):' | |||
|
90 | 89 | |
|
91 | 90 | @LoginRequired() |
|
92 | 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 | 92 | def edit_settings(self): |
|
97 | 93 | c = self.load_default_context() |
|
98 | 94 | c.active = 'settings' |
@@ -108,9 +104,6 b' class RepoSettingsView(RepoAppView):' | |||
|
108 | 104 | @LoginRequired() |
|
109 | 105 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
110 | 106 | @CSRFRequired() |
|
111 | @view_config( | |
|
112 | route_name='edit_repo', request_method='POST', | |
|
113 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
|
114 | 107 | def edit_settings_update(self): |
|
115 | 108 | _ = self.request.translate |
|
116 | 109 | c = self.load_default_context() |
@@ -192,9 +185,6 b' class RepoSettingsView(RepoAppView):' | |||
|
192 | 185 | |
|
193 | 186 | @LoginRequired() |
|
194 | 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 | 188 | def toggle_locking(self): |
|
199 | 189 | """ |
|
200 | 190 | Toggle locking of repository by simple GET call to url |
@@ -224,9 +214,6 b' class RepoSettingsView(RepoAppView):' | |||
|
224 | 214 | |
|
225 | 215 | @LoginRequired() |
|
226 | 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 | 217 | def edit_statistics_form(self): |
|
231 | 218 | c = self.load_default_context() |
|
232 | 219 | |
@@ -250,9 +237,6 b' class RepoSettingsView(RepoAppView):' | |||
|
250 | 237 | @LoginRequired() |
|
251 | 238 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
252 | 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 | 240 | def repo_statistics_reset(self): |
|
257 | 241 | _ = self.request.translate |
|
258 | 242 |
@@ -20,7 +20,7 b'' | |||
|
20 | 20 | |
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | from pyramid.view import view_config | |
|
23 | ||
|
24 | 24 | from pyramid.httpexceptions import HTTPFound |
|
25 | 25 | from packaging.version import Version |
|
26 | 26 | |
@@ -42,7 +42,7 b' from rhodecode.model.scm import ScmModel' | |||
|
42 | 42 | log = logging.getLogger(__name__) |
|
43 | 43 | |
|
44 | 44 | |
|
45 | class RepoSettingsView(RepoAppView): | |
|
45 | class RepoSettingsAdvancedView(RepoAppView): | |
|
46 | 46 | |
|
47 | 47 | def load_default_context(self): |
|
48 | 48 | c = self._get_local_tmpl_context() |
@@ -57,9 +57,6 b' class RepoSettingsView(RepoAppView):' | |||
|
57 | 57 | |
|
58 | 58 | @LoginRequired() |
|
59 | 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 | 60 | def edit_advanced(self): |
|
64 | 61 | _ = self.request.translate |
|
65 | 62 | c = self.load_default_context() |
@@ -89,9 +86,6 b' class RepoSettingsView(RepoAppView):' | |||
|
89 | 86 | @LoginRequired() |
|
90 | 87 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
91 | 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 | 89 | def edit_advanced_archive(self): |
|
96 | 90 | """ |
|
97 | 91 | Archives the repository. It will become read-only, and not visible in search |
@@ -132,9 +126,6 b' class RepoSettingsView(RepoAppView):' | |||
|
132 | 126 | @LoginRequired() |
|
133 | 127 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
134 | 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 | 129 | def edit_advanced_delete(self): |
|
139 | 130 | """ |
|
140 | 131 | Deletes the repository, or shows warnings if deletion is not possible |
@@ -209,9 +200,6 b' class RepoSettingsView(RepoAppView):' | |||
|
209 | 200 | @LoginRequired() |
|
210 | 201 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
211 | 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 | 203 | def edit_advanced_journal(self): |
|
216 | 204 | """ |
|
217 | 205 | Set's this repository to be visible in public journal, |
@@ -236,9 +224,6 b' class RepoSettingsView(RepoAppView):' | |||
|
236 | 224 | @LoginRequired() |
|
237 | 225 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
238 | 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 | 227 | def edit_advanced_fork(self): |
|
243 | 228 | """ |
|
244 | 229 | Mark given repository as a fork of another |
@@ -281,10 +266,7 b' class RepoSettingsView(RepoAppView):' | |||
|
281 | 266 | @LoginRequired() |
|
282 | 267 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
283 | 268 | @CSRFRequired() |
|
284 | @view_config( | |
|
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): | |
|
269 | def edit_advanced_toggle_locking(self): | |
|
288 | 270 | """ |
|
289 | 271 | Toggle locking of repository |
|
290 | 272 | """ |
@@ -309,9 +291,6 b' class RepoSettingsView(RepoAppView):' | |||
|
309 | 291 | |
|
310 | 292 | @LoginRequired() |
|
311 | 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 | 294 | def edit_advanced_install_hooks(self): |
|
316 | 295 | """ |
|
317 | 296 | Install Hooks for repository |
@@ -24,7 +24,6 b' import formencode' | |||
|
24 | 24 | import formencode.htmlfill |
|
25 | 25 | |
|
26 | 26 | from pyramid.httpexceptions import HTTPFound |
|
27 | from pyramid.view import view_config | |
|
28 | 27 | |
|
29 | 28 | from rhodecode.apps._base import RepoAppView |
|
30 | 29 | from rhodecode.lib import audit_logger |
@@ -48,9 +47,6 b' class RepoSettingsFieldsView(RepoAppView' | |||
|
48 | 47 | |
|
49 | 48 | @LoginRequired() |
|
50 | 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 | 50 | def repo_field_edit(self): |
|
55 | 51 | c = self.load_default_context() |
|
56 | 52 | |
@@ -63,9 +59,6 b' class RepoSettingsFieldsView(RepoAppView' | |||
|
63 | 59 | @LoginRequired() |
|
64 | 60 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
65 | 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 | 62 | def repo_field_create(self): |
|
70 | 63 | _ = self.request.translate |
|
71 | 64 | |
@@ -94,9 +87,6 b' class RepoSettingsFieldsView(RepoAppView' | |||
|
94 | 87 | @LoginRequired() |
|
95 | 88 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
96 | 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 | 90 | def repo_field_delete(self): |
|
101 | 91 | _ = self.request.translate |
|
102 | 92 | field = RepositoryField.get_or_404(self.request.matchdict['field_id']) |
@@ -21,7 +21,7 b'' | |||
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | 23 | from pyramid.httpexceptions import HTTPFound, HTTPNotFound |
|
24 | from pyramid.view import view_config | |
|
24 | ||
|
25 | 25 | import formencode |
|
26 | 26 | |
|
27 | 27 | from rhodecode.apps._base import RepoAppView |
@@ -45,9 +45,6 b' class RepoSettingsIssueTrackersView(Repo' | |||
|
45 | 45 | |
|
46 | 46 | @LoginRequired() |
|
47 | 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 | 48 | def repo_issuetracker(self): |
|
52 | 49 | c = self.load_default_context() |
|
53 | 50 | c.active = 'issuetracker' |
@@ -62,9 +59,6 b' class RepoSettingsIssueTrackersView(Repo' | |||
|
62 | 59 | @LoginRequired() |
|
63 | 60 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
64 | 61 | @CSRFRequired() |
|
65 | @view_config( | |
|
66 | route_name='edit_repo_issuetracker_test', request_method='POST', | |
|
67 | renderer='string', xhr=True) | |
|
68 | 62 | def repo_issuetracker_test(self): |
|
69 | 63 | return h.urlify_commit_message( |
|
70 | 64 | self.request.POST.get('test_text', ''), |
@@ -73,9 +67,6 b' class RepoSettingsIssueTrackersView(Repo' | |||
|
73 | 67 | @LoginRequired() |
|
74 | 68 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
75 | 69 | @CSRFRequired() |
|
76 | @view_config( | |
|
77 | route_name='edit_repo_issuetracker_delete', request_method='POST', | |
|
78 | renderer='json_ext', xhr=True) | |
|
79 | 70 | def repo_issuetracker_delete(self): |
|
80 | 71 | _ = self.request.translate |
|
81 | 72 | uid = self.request.POST.get('uid') |
@@ -107,9 +98,6 b' class RepoSettingsIssueTrackersView(Repo' | |||
|
107 | 98 | @LoginRequired() |
|
108 | 99 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
109 | 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 | 101 | def repo_issuetracker_update(self): |
|
114 | 102 | _ = self.request.translate |
|
115 | 103 | # Save inheritance |
@@ -21,7 +21,7 b'' | |||
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | 23 | from pyramid.httpexceptions import HTTPFound |
|
24 | from pyramid.view import view_config | |
|
24 | ||
|
25 | 25 | |
|
26 | 26 | from rhodecode.apps._base import RepoAppView |
|
27 | 27 | from rhodecode.lib import helpers as h |
@@ -39,9 +39,6 b' class RepoSettingsRemoteView(RepoAppView' | |||
|
39 | 39 | |
|
40 | 40 | @LoginRequired() |
|
41 | 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 | 42 | def repo_remote_edit_form(self): |
|
46 | 43 | c = self.load_default_context() |
|
47 | 44 | c.active = 'remote' |
@@ -51,9 +48,6 b' class RepoSettingsRemoteView(RepoAppView' | |||
|
51 | 48 | @LoginRequired() |
|
52 | 49 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
53 | 50 | @CSRFRequired() |
|
54 | @view_config( | |
|
55 | route_name='edit_repo_remote_pull', request_method='POST', | |
|
56 | renderer=None) | |
|
57 | 51 | def repo_remote_pull_changes(self): |
|
58 | 52 | _ = self.request.translate |
|
59 | 53 | self.load_default_context() |
@@ -25,10 +25,8 b' import formencode.htmlfill' | |||
|
25 | 25 | from pyramid.httpexceptions import HTTPFound, HTTPBadRequest |
|
26 | 26 | from pyramid.response import Response |
|
27 | 27 | from pyramid.renderers import render |
|
28 | from pyramid.view import view_config | |
|
29 | 28 | |
|
30 | 29 | from rhodecode.apps._base import RepoAppView |
|
31 | from rhodecode.lib import audit_logger | |
|
32 | 30 | from rhodecode.lib import helpers as h |
|
33 | 31 | from rhodecode.lib.auth import ( |
|
34 | 32 | LoginRequired, HasRepoPermissionAnyDecorator, CSRFRequired) |
@@ -71,9 +69,6 b' class RepoSettingsVcsView(RepoAppView):' | |||
|
71 | 69 | |
|
72 | 70 | @LoginRequired() |
|
73 | 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 | 72 | def repo_vcs_settings(self): |
|
78 | 73 | c = self.load_default_context() |
|
79 | 74 | model = VcsSettingsModel(repo=self.db_repo_name) |
@@ -100,9 +95,6 b' class RepoSettingsVcsView(RepoAppView):' | |||
|
100 | 95 | @LoginRequired() |
|
101 | 96 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
102 | 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 | 98 | def repo_settings_vcs_update(self): |
|
107 | 99 | _ = self.request.translate |
|
108 | 100 | c = self.load_default_context() |
@@ -153,9 +145,6 b' class RepoSettingsVcsView(RepoAppView):' | |||
|
153 | 145 | @LoginRequired() |
|
154 | 146 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
155 | 147 | @CSRFRequired() |
|
156 | @view_config( | |
|
157 | route_name='edit_repo_vcs_svn_pattern_delete', request_method='POST', | |
|
158 | renderer='json_ext', xhr=True) | |
|
159 | 148 | def repo_settings_delete_svn_pattern(self): |
|
160 | 149 | self.load_default_context() |
|
161 | 150 | delete_pattern_id = self.request.POST.get('delete_svn_pattern') |
@@ -19,7 +19,7 b'' | |||
|
19 | 19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
20 | 20 | |
|
21 | 21 | import logging |
|
22 | from pyramid.view import view_config | |
|
22 | ||
|
23 | 23 | |
|
24 | 24 | from rhodecode.apps._base import RepoAppView |
|
25 | 25 | from rhodecode.lib import audit_logger |
@@ -31,7 +31,7 b' from rhodecode.lib.ext_json import json' | |||
|
31 | 31 | log = logging.getLogger(__name__) |
|
32 | 32 | |
|
33 | 33 | |
|
34 | class StripView(RepoAppView): | |
|
34 | class RepoStripView(RepoAppView): | |
|
35 | 35 | def load_default_context(self): |
|
36 | 36 | c = self._get_local_tmpl_context() |
|
37 | 37 | |
@@ -40,9 +40,6 b' class StripView(RepoAppView):' | |||
|
40 | 40 | |
|
41 | 41 | @LoginRequired() |
|
42 | 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 | 43 | def strip(self): |
|
47 | 44 | c = self.load_default_context() |
|
48 | 45 | c.active = 'strip' |
@@ -53,9 +50,6 b' class StripView(RepoAppView):' | |||
|
53 | 50 | @LoginRequired() |
|
54 | 51 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
55 | 52 | @CSRFRequired() |
|
56 | @view_config( | |
|
57 | route_name='strip_check', request_method='POST', | |
|
58 | renderer='json', xhr=True) | |
|
59 | 53 | def strip_check(self): |
|
60 | 54 | from rhodecode.lib.vcs.backends.base import EmptyCommit |
|
61 | 55 | data = {} |
@@ -79,9 +73,6 b' class StripView(RepoAppView):' | |||
|
79 | 73 | @LoginRequired() |
|
80 | 74 | @HasRepoPermissionAnyDecorator('repository.admin') |
|
81 | 75 | @CSRFRequired() |
|
82 | @view_config( | |
|
83 | route_name='strip_execute', request_method='POST', | |
|
84 | renderer='json', xhr=True) | |
|
85 | 76 | def strip_execute(self): |
|
86 | 77 | from rhodecode.model.scm import ScmModel |
|
87 | 78 |
@@ -24,7 +24,7 b' import time' | |||
|
24 | 24 | |
|
25 | 25 | import rhodecode |
|
26 | 26 | |
|
27 | from pyramid.view import view_config | |
|
27 | ||
|
28 | 28 | |
|
29 | 29 | from rhodecode.lib.view_utils import get_format_ref_id |
|
30 | 30 | from rhodecode.apps._base import RepoAppView |
@@ -101,9 +101,6 b' class RepoSummaryView(RepoAppView):' | |||
|
101 | 101 | @LoginRequired() |
|
102 | 102 | @HasRepoPermissionAnyDecorator( |
|
103 | 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 | 104 | def summary_commits(self): |
|
108 | 105 | c = self.load_default_context() |
|
109 | 106 | self._prepare_and_set_clone_url(c) |
@@ -113,15 +110,6 b' class RepoSummaryView(RepoAppView):' | |||
|
113 | 110 | @LoginRequired() |
|
114 | 111 | @HasRepoPermissionAnyDecorator( |
|
115 | 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 | 113 | def summary(self): |
|
126 | 114 | c = self.load_default_context() |
|
127 | 115 | |
@@ -176,9 +164,6 b' class RepoSummaryView(RepoAppView):' | |||
|
176 | 164 | @LoginRequired() |
|
177 | 165 | @HasRepoPermissionAnyDecorator( |
|
178 | 166 | 'repository.read', 'repository.write', 'repository.admin') |
|
179 | @view_config( | |
|
180 | route_name='repo_stats', request_method='GET', | |
|
181 | renderer='json_ext') | |
|
182 | 167 | def repo_stats(self): |
|
183 | 168 | show_stats = bool(self.db_repo.enable_statistics) |
|
184 | 169 | repo_id = self.db_repo.repo_id |
@@ -228,9 +213,6 b' class RepoSummaryView(RepoAppView):' | |||
|
228 | 213 | @LoginRequired() |
|
229 | 214 | @HasRepoPermissionAnyDecorator( |
|
230 | 215 | 'repository.read', 'repository.write', 'repository.admin') |
|
231 | @view_config( | |
|
232 | route_name='repo_refs_data', request_method='GET', | |
|
233 | renderer='json_ext') | |
|
234 | 216 | def repo_refs_data(self): |
|
235 | 217 | _ = self.request.translate |
|
236 | 218 | self.load_default_context() |
@@ -251,9 +233,6 b' class RepoSummaryView(RepoAppView):' | |||
|
251 | 233 | @LoginRequired() |
|
252 | 234 | @HasRepoPermissionAnyDecorator( |
|
253 | 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 | 236 | def repo_refs_changelog_data(self): |
|
258 | 237 | _ = self.request.translate |
|
259 | 238 | self.load_default_context() |
@@ -19,7 +19,6 b'' | |||
|
19 | 19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
20 | 20 | |
|
21 | 21 | import logging |
|
22 | from pyramid.view import view_config | |
|
23 | 22 | |
|
24 | 23 | from rhodecode.apps._base import BaseReferencesView |
|
25 | 24 | from rhodecode.lib.ext_json import json |
@@ -33,9 +32,6 b' class RepoTagsView(BaseReferencesView):' | |||
|
33 | 32 | @LoginRequired() |
|
34 | 33 | @HasRepoPermissionAnyDecorator( |
|
35 | 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 | 35 | def tags(self): |
|
40 | 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 | 23 | def includeme(config): |
|
24 | from rhodecode.apps.search.views import ( | |
|
25 | SearchView, SearchRepoView, SearchRepoGroupView) | |
|
24 | 26 | |
|
25 | 27 | config.add_route( |
|
26 | 28 | name='search', |
|
27 | 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 | 36 | config.add_route( |
|
30 | 37 | name='search_repo', |
|
31 | 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 | 45 | config.add_route( |
|
34 | 46 | name='search_repo_alt', |
|
35 | 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 | 54 | config.add_route( |
|
38 | 55 | name='search_repo_group', |
|
39 | 56 | pattern='/{repo_group_name:.*?[^/]}/_search', |
|
40 | 57 | repo_group_route=True) |
|
41 | ||
|
42 | # Scan module for configuration decorators. | |
|
43 | config.scan('.views', ignore='.tests') | |
|
58 | config.add_view( | |
|
59 | SearchRepoGroupView, | |
|
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 | 21 | import logging |
|
22 | 22 | import urllib |
|
23 | from pyramid.view import view_config | |
|
23 | ||
|
24 | 24 | from webhelpers2.html.tools import update_params |
|
25 | 25 | |
|
26 | 26 | from rhodecode.apps._base import BaseAppView, RepoAppView, RepoGroupAppView |
@@ -130,9 +130,6 b' class SearchView(BaseAppView):' | |||
|
130 | 130 | return c |
|
131 | 131 | |
|
132 | 132 | @LoginRequired() |
|
133 | @view_config( | |
|
134 | route_name='search', request_method='GET', | |
|
135 | renderer='rhodecode:templates/search/search.mako') | |
|
136 | 133 | def search(self): |
|
137 | 134 | c = self.load_default_context() |
|
138 | 135 | perform_search(self.request, c) |
@@ -148,12 +145,6 b' class SearchRepoView(RepoAppView):' | |||
|
148 | 145 | @LoginRequired() |
|
149 | 146 | @HasRepoPermissionAnyDecorator( |
|
150 | 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 | 148 | def search_repo(self): |
|
158 | 149 | c = self.load_default_context() |
|
159 | 150 | perform_search(self.request, c, repo_name=self.db_repo_name) |
@@ -169,9 +160,6 b' class SearchRepoGroupView(RepoGroupAppVi' | |||
|
169 | 160 | @LoginRequired() |
|
170 | 161 | @HasRepoGroupPermissionAnyDecorator( |
|
171 | 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 | 163 | def search_repo_group(self): |
|
176 | 164 | c = self.load_default_context() |
|
177 | 165 | perform_search(self.request, c, repo_group_name=self.db_repo_group_name) |
@@ -37,25 +37,6 b' from . import config_keys' | |||
|
37 | 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 | 40 | def _sanitize_settings_and_apply_defaults(settings): |
|
60 | 41 | """ |
|
61 | 42 | Set defaults, convert to python types and validate settings. |
@@ -88,3 +69,22 b' def _append_path_sep(path):' | |||
|
88 | 69 | if isinstance(path, compat.string_types) and not path.endswith(os.path.sep): |
|
89 | 70 | path += os.path.sep |
|
90 | 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 | 29 | User groups /_admin prefixed routes |
|
30 | 30 | """ |
|
31 | from rhodecode.apps.user_group.views import UserGroupsView | |
|
31 | 32 | |
|
32 | 33 | config.add_route( |
|
33 | 34 | name='user_group_members_data', |
|
34 | 35 | pattern='/user_groups/{user_group_id:\d+}/members', |
|
35 | 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 | 43 | # user groups perms |
|
38 | 44 | config.add_route( |
|
39 | 45 | name='edit_user_group_perms_summary', |
|
40 | 46 | pattern='/user_groups/{user_group_id:\d+}/edit/permissions_summary', |
|
41 | 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 | 54 | config.add_route( |
|
43 | 55 | name='edit_user_group_perms_summary_json', |
|
44 | 56 | pattern='/user_groups/{user_group_id:\d+}/edit/permissions_summary/json', |
|
45 | 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 | 64 | # user groups edit |
|
48 | 65 | config.add_route( |
|
49 | 66 | name='edit_user_group', |
|
50 | 67 | pattern='/user_groups/{user_group_id:\d+}/edit', |
|
51 | 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 | 75 | # user groups update |
|
54 | 76 | config.add_route( |
|
55 | 77 | name='user_groups_update', |
|
56 | 78 | pattern='/user_groups/{user_group_id:\d+}/update', |
|
57 | 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 | 86 | config.add_route( |
|
60 | 87 | name='edit_user_group_global_perms', |
|
61 | 88 | pattern='/user_groups/{user_group_id:\d+}/edit/global_permissions', |
|
62 | 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 | 96 | config.add_route( |
|
65 | 97 | name='edit_user_group_global_perms_update', |
|
66 | 98 | pattern='/user_groups/{user_group_id:\d+}/edit/global_permissions/update', |
|
67 | 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 | 106 | config.add_route( |
|
70 | 107 | name='edit_user_group_perms', |
|
71 | 108 | pattern='/user_groups/{user_group_id:\d+}/edit/permissions', |
|
72 | 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 | 116 | config.add_route( |
|
75 | 117 | name='edit_user_group_perms_update', |
|
76 | 118 | pattern='/user_groups/{user_group_id:\d+}/edit/permissions/update', |
|
77 | 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 | 126 | config.add_route( |
|
80 | 127 | name='edit_user_group_advanced', |
|
81 | 128 | pattern='/user_groups/{user_group_id:\d+}/edit/advanced', |
|
82 | 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 | 136 | config.add_route( |
|
85 | 137 | name='edit_user_group_advanced_sync', |
|
86 | 138 | pattern='/user_groups/{user_group_id:\d+}/edit/advanced/sync', |
|
87 | 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 | 146 | # user groups delete |
|
90 | 147 | config.add_route( |
|
91 | 148 | name='user_groups_delete', |
|
92 | 149 | pattern='/user_groups/{user_group_id:\d+}/delete', |
|
93 | 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 | 158 | def includeme(config): |
|
97 | 159 | # main admin routes |
|
98 | 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 | 24 | import formencode |
|
25 | 25 | import formencode.htmlfill |
|
26 | 26 | from pyramid.httpexceptions import HTTPFound |
|
27 | from pyramid.view import view_config | |
|
27 | ||
|
28 | 28 | from pyramid.response import Response |
|
29 | 29 | from pyramid.renderers import render |
|
30 | 30 | |
@@ -60,9 +60,6 b' class UserGroupsView(UserGroupAppView):' | |||
|
60 | 60 | |
|
61 | 61 | @LoginRequired() |
|
62 | 62 | @HasUserGroupPermissionAnyDecorator('usergroup.admin') |
|
63 | @view_config( | |
|
64 | route_name='user_group_members_data', request_method='GET', | |
|
65 | renderer='json_ext', xhr=True) | |
|
66 | 63 | def user_group_members(self): |
|
67 | 64 | """ |
|
68 | 65 | Return members of given user group |
@@ -93,9 +90,6 b' class UserGroupsView(UserGroupAppView):' | |||
|
93 | 90 | |
|
94 | 91 | @LoginRequired() |
|
95 | 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 | 93 | def user_group_perms_summary(self): |
|
100 | 94 | c = self.load_default_context() |
|
101 | 95 | c.user_group = self.db_user_group |
@@ -106,9 +100,6 b' class UserGroupsView(UserGroupAppView):' | |||
|
106 | 100 | |
|
107 | 101 | @LoginRequired() |
|
108 | 102 | @HasUserGroupPermissionAnyDecorator('usergroup.admin') |
|
109 | @view_config( | |
|
110 | route_name='edit_user_group_perms_summary_json', request_method='GET', | |
|
111 | renderer='json_ext') | |
|
112 | 103 | def user_group_perms_summary_json(self): |
|
113 | 104 | self.load_default_context() |
|
114 | 105 | user_group = self.db_user_group |
@@ -131,9 +122,6 b' class UserGroupsView(UserGroupAppView):' | |||
|
131 | 122 | @LoginRequired() |
|
132 | 123 | @HasUserGroupPermissionAnyDecorator('usergroup.admin') |
|
133 | 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 | 125 | def user_group_update(self): |
|
138 | 126 | _ = self.request.translate |
|
139 | 127 | |
@@ -230,9 +218,6 b' class UserGroupsView(UserGroupAppView):' | |||
|
230 | 218 | @LoginRequired() |
|
231 | 219 | @HasUserGroupPermissionAnyDecorator('usergroup.admin') |
|
232 | 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 | 221 | def user_group_delete(self): |
|
237 | 222 | _ = self.request.translate |
|
238 | 223 | user_group = self.db_user_group |
@@ -258,9 +243,6 b' class UserGroupsView(UserGroupAppView):' | |||
|
258 | 243 | |
|
259 | 244 | @LoginRequired() |
|
260 | 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 | 246 | def user_group_edit(self): |
|
265 | 247 | user_group = self.db_user_group |
|
266 | 248 | |
@@ -293,9 +275,6 b' class UserGroupsView(UserGroupAppView):' | |||
|
293 | 275 | |
|
294 | 276 | @LoginRequired() |
|
295 | 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 | 278 | def user_group_edit_perms(self): |
|
300 | 279 | user_group = self.db_user_group |
|
301 | 280 | c = self.load_default_context() |
@@ -326,9 +305,6 b' class UserGroupsView(UserGroupAppView):' | |||
|
326 | 305 | @LoginRequired() |
|
327 | 306 | @HasUserGroupPermissionAnyDecorator('usergroup.admin') |
|
328 | 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 | 308 | def user_group_update_perms(self): |
|
333 | 309 | """ |
|
334 | 310 | grant permission for given user group |
@@ -390,9 +366,6 b' class UserGroupsView(UserGroupAppView):' | |||
|
390 | 366 | |
|
391 | 367 | @LoginRequired() |
|
392 | 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 | 369 | def user_group_global_perms_edit(self): |
|
397 | 370 | user_group = self.db_user_group |
|
398 | 371 | c = self.load_default_context() |
@@ -418,9 +391,6 b' class UserGroupsView(UserGroupAppView):' | |||
|
418 | 391 | @LoginRequired() |
|
419 | 392 | @HasUserGroupPermissionAnyDecorator('usergroup.admin') |
|
420 | 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 | 394 | def user_group_global_perms_update(self): |
|
425 | 395 | _ = self.request.translate |
|
426 | 396 | user_group = self.db_user_group |
@@ -485,9 +455,6 b' class UserGroupsView(UserGroupAppView):' | |||
|
485 | 455 | |
|
486 | 456 | @LoginRequired() |
|
487 | 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 | 458 | def user_group_edit_advanced(self): |
|
492 | 459 | user_group = self.db_user_group |
|
493 | 460 | |
@@ -515,9 +482,6 b' class UserGroupsView(UserGroupAppView):' | |||
|
515 | 482 | @LoginRequired() |
|
516 | 483 | @HasUserGroupPermissionAnyDecorator('usergroup.admin') |
|
517 | 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 | 485 | def user_group_edit_advanced_set_synchronization(self): |
|
522 | 486 | _ = self.request.translate |
|
523 | 487 | user_group = self.db_user_group |
@@ -20,8 +20,13 b'' | |||
|
20 | 20 | |
|
21 | 21 | |
|
22 | 22 | def includeme(config): |
|
23 | from rhodecode.apps.user_group_profile.views import UserGroupProfileView | |
|
24 | ||
|
23 | 25 | config.add_route( |
|
24 | 26 | name='user_group_profile', |
|
25 | 27 | pattern='/_profile_user_group/{user_group_name}') |
|
26 | # Scan module for configuration decorators. | |
|
27 | config.scan('.views', ignore='.tests') | |
|
28 | config.add_view( | |
|
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 | 21 | import logging |
|
22 | 22 | |
|
23 | 23 | from pyramid.httpexceptions import HTTPNotFound |
|
24 | from pyramid.view import view_config | |
|
24 | ||
|
25 | 25 | |
|
26 | 26 | from rhodecode.apps._base import BaseAppView |
|
27 | 27 | from rhodecode.lib.auth import HasUserGroupPermissionAnyDecorator, LoginRequired, NotAnonymous |
@@ -36,9 +36,6 b' class UserGroupProfileView(BaseAppView):' | |||
|
36 | 36 | @LoginRequired() |
|
37 | 37 | @NotAnonymous() |
|
38 | 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 | 39 | def user_group_profile(self): |
|
43 | 40 | c = self._get_local_tmpl_context() |
|
44 | 41 | c.active = 'profile' |
@@ -20,9 +20,13 b'' | |||
|
20 | 20 | |
|
21 | 21 | |
|
22 | 22 | def includeme(config): |
|
23 | from rhodecode.apps.user_profile.views import UserProfileView | |
|
24 | ||
|
23 | 25 | config.add_route( |
|
24 | 26 | name='user_profile', |
|
25 | 27 | pattern='/_profiles/{username}') |
|
26 | ||
|
27 | # Scan module for configuration decorators. | |
|
28 | config.scan('.views', ignore='.tests') | |
|
28 | config.add_view( | |
|
29 | UserProfileView, | |
|
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 | 21 | import logging |
|
22 | 22 | |
|
23 | 23 | from pyramid.httpexceptions import HTTPNotFound |
|
24 | from pyramid.view import view_config | |
|
25 | 24 | |
|
26 | 25 | from rhodecode.apps._base import BaseAppView |
|
27 | 26 | from rhodecode.lib.auth import LoginRequired, NotAnonymous |
@@ -36,9 +35,6 b' class UserProfileView(BaseAppView):' | |||
|
36 | 35 | |
|
37 | 36 | @LoginRequired() |
|
38 | 37 | @NotAnonymous() |
|
39 | @view_config( | |
|
40 | route_name='user_profile', request_method='GET', | |
|
41 | renderer='rhodecode:templates/users/user.mako') | |
|
42 | 38 | def user_profile(self): |
|
43 | 39 | # register local template context |
|
44 | 40 | c = self._get_local_tmpl_context() |
@@ -20,7 +20,7 b'' | |||
|
20 | 20 | |
|
21 | 21 | def generate_jsroutes_content(jsroutes): |
|
22 | 22 | statements = [] |
|
23 | for url_name, url, fields in jsroutes: | |
|
23 | for url_name, url, fields in sorted(jsroutes): | |
|
24 | 24 | statements.append( |
|
25 | 25 | "pyroutes.register('%s', '%s', %s);" % (url_name, url, fields)) |
|
26 | 26 | return u''' |
@@ -92,6 +92,7 b' def make_pyramid_app(global_config, **se' | |||
|
92 | 92 | # Allows to use format style "{ENV_NAME}" placeholders in the configuration. It |
|
93 | 93 | # will be replaced by the value of the environment variable "NAME" in this case. |
|
94 | 94 | start_time = time.time() |
|
95 | log.info('Pyramid app config starting') | |
|
95 | 96 | |
|
96 | 97 | debug = asbool(global_config.get('debug')) |
|
97 | 98 | if debug: |
@@ -121,6 +122,7 b' def make_pyramid_app(global_config, **se' | |||
|
121 | 122 | pyramid_app.config = config |
|
122 | 123 | |
|
123 | 124 | config.configure_celery(global_config['__file__']) |
|
125 | ||
|
124 | 126 | # creating the app uses a connection - return it after we are done |
|
125 | 127 | meta.Session.remove() |
|
126 | 128 | total_time = time.time() - start_time |
@@ -256,16 +258,12 b' def includeme(config, auth_resources=Non' | |||
|
256 | 258 | config.include('pyramid_mako') |
|
257 | 259 | config.include('rhodecode.lib.rc_beaker') |
|
258 | 260 | config.include('rhodecode.lib.rc_cache') |
|
259 | ||
|
260 | 261 | config.include('rhodecode.apps._base.navigation') |
|
261 | 262 | config.include('rhodecode.apps._base.subscribers') |
|
262 | 263 | config.include('rhodecode.tweens') |
|
263 | 264 | config.include('rhodecode.authentication') |
|
264 | 265 | |
|
265 | 266 | if load_all: |
|
266 | config.include('rhodecode.integrations') | |
|
267 | ||
|
268 | if load_all: | |
|
269 | 267 | ce_auth_resources = [ |
|
270 | 268 | 'rhodecode.authentication.plugins.auth_crowd', |
|
271 | 269 | 'rhodecode.authentication.plugins.auth_headers', |
@@ -291,15 +289,17 b' def includeme(config, auth_resources=Non' | |||
|
291 | 289 | |
|
292 | 290 | # apps |
|
293 | 291 | if load_all: |
|
292 | config.include('rhodecode.api') | |
|
294 | 293 | config.include('rhodecode.apps._base') |
|
295 | 294 | config.include('rhodecode.apps.hovercards') |
|
296 | 295 | config.include('rhodecode.apps.ops') |
|
297 | config.include('rhodecode.apps.admin') | |
|
298 | 296 | config.include('rhodecode.apps.channelstream') |
|
299 | 297 | config.include('rhodecode.apps.file_store') |
|
298 | config.include('rhodecode.apps.admin') | |
|
300 | 299 | config.include('rhodecode.apps.login') |
|
301 | 300 | config.include('rhodecode.apps.home') |
|
302 | 301 | config.include('rhodecode.apps.journal') |
|
302 | ||
|
303 | 303 | config.include('rhodecode.apps.repository') |
|
304 | 304 | config.include('rhodecode.apps.repo_group') |
|
305 | 305 | config.include('rhodecode.apps.user_group') |
@@ -307,11 +307,14 b' def includeme(config, auth_resources=Non' | |||
|
307 | 307 | config.include('rhodecode.apps.user_profile') |
|
308 | 308 | config.include('rhodecode.apps.user_group_profile') |
|
309 | 309 | config.include('rhodecode.apps.my_account') |
|
310 | config.include('rhodecode.apps.gist') | |
|
311 | ||
|
310 | 312 | config.include('rhodecode.apps.svn_support') |
|
311 | 313 | config.include('rhodecode.apps.ssh_support') |
|
312 | config.include('rhodecode.apps.gist') | |
|
313 | 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 | 319 | config.add_route('rhodecode_support', 'https://rhodecode.com/help/', static=True) |
|
317 | 320 | config.add_translation_dirs('rhodecode:i18n/') |
@@ -24,6 +24,9 b' from rhodecode.apps._base import ADMIN_P' | |||
|
24 | 24 | from rhodecode.lib.utils2 import safe_int |
|
25 | 25 | from rhodecode.model.db import Repository, Integration, RepoGroup |
|
26 | 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 | 31 | log = logging.getLogger(__name__) |
|
29 | 32 | |
@@ -83,7 +86,7 b' def includeme(config):' | |||
|
83 | 86 | # global integrations |
|
84 | 87 | config.add_route('global_integrations_new', |
|
85 | 88 | ADMIN_PREFIX + '/integrations/new') |
|
86 |
config.add_view( |
|
|
89 | config.add_view(GlobalIntegrationsView, | |
|
87 | 90 | attr='new_integration', |
|
88 | 91 | renderer='rhodecode:templates/admin/integrations/new.mako', |
|
89 | 92 | request_method='GET', |
@@ -94,7 +97,7 b' def includeme(config):' | |||
|
94 | 97 | config.add_route('global_integrations_list', |
|
95 | 98 | ADMIN_PREFIX + '/integrations/{integration}') |
|
96 | 99 | for route_name in ['global_integrations_home', 'global_integrations_list']: |
|
97 |
config.add_view( |
|
|
100 | config.add_view(GlobalIntegrationsView, | |
|
98 | 101 | attr='integration_list', |
|
99 | 102 | renderer='rhodecode:templates/admin/integrations/list.mako', |
|
100 | 103 | request_method='GET', |
@@ -108,12 +111,12 b' def includeme(config):' | |||
|
108 | 111 | valid_integration=True) |
|
109 | 112 | |
|
110 | 113 | for route_name in ['global_integrations_create', 'global_integrations_edit']: |
|
111 |
config.add_view( |
|
|
114 | config.add_view(GlobalIntegrationsView, | |
|
112 | 115 | attr='settings_get', |
|
113 | 116 | renderer='rhodecode:templates/admin/integrations/form.mako', |
|
114 | 117 | request_method='GET', |
|
115 | 118 | route_name=route_name) |
|
116 |
config.add_view( |
|
|
119 | config.add_view(GlobalIntegrationsView, | |
|
117 | 120 | attr='settings_post', |
|
118 | 121 | renderer='rhodecode:templates/admin/integrations/form.mako', |
|
119 | 122 | request_method='POST', |
@@ -124,7 +127,7 b' def includeme(config):' | |||
|
124 | 127 | add_route_requirements('/{repo_group_name}/_settings/integrations'), |
|
125 | 128 | repo_group_route=True) |
|
126 | 129 | |
|
127 |
config.add_view( |
|
|
130 | config.add_view(RepoGroupIntegrationsView, | |
|
128 | 131 | attr='integration_list', |
|
129 | 132 | renderer='rhodecode:templates/admin/integrations/list.mako', |
|
130 | 133 | request_method='GET', |
@@ -133,7 +136,7 b' def includeme(config):' | |||
|
133 | 136 | config.add_route('repo_group_integrations_new', |
|
134 | 137 | add_route_requirements('/{repo_group_name}/_settings/integrations/new'), |
|
135 | 138 | repo_group_route=True) |
|
136 |
config.add_view( |
|
|
139 | config.add_view(RepoGroupIntegrationsView, | |
|
137 | 140 | attr='new_integration', |
|
138 | 141 | renderer='rhodecode:templates/admin/integrations/new.mako', |
|
139 | 142 | request_method='GET', |
@@ -143,7 +146,7 b' def includeme(config):' | |||
|
143 | 146 | add_route_requirements('/{repo_group_name}/_settings/integrations/{integration}'), |
|
144 | 147 | repo_group_route=True, |
|
145 | 148 | valid_integration=True) |
|
146 |
config.add_view( |
|
|
149 | config.add_view(RepoGroupIntegrationsView, | |
|
147 | 150 | attr='integration_list', |
|
148 | 151 | renderer='rhodecode:templates/admin/integrations/list.mako', |
|
149 | 152 | request_method='GET', |
@@ -153,12 +156,12 b' def includeme(config):' | |||
|
153 | 156 | add_route_requirements('/{repo_group_name}/_settings/integrations/{integration}/new'), |
|
154 | 157 | repo_group_route=True, |
|
155 | 158 | valid_integration=True) |
|
156 |
config.add_view( |
|
|
159 | config.add_view(RepoGroupIntegrationsView, | |
|
157 | 160 | attr='settings_get', |
|
158 | 161 | renderer='rhodecode:templates/admin/integrations/form.mako', |
|
159 | 162 | request_method='GET', |
|
160 | 163 | route_name='repo_group_integrations_create') |
|
161 |
config.add_view( |
|
|
164 | config.add_view(RepoGroupIntegrationsView, | |
|
162 | 165 | attr='settings_post', |
|
163 | 166 | renderer='rhodecode:templates/admin/integrations/form.mako', |
|
164 | 167 | request_method='POST', |
@@ -169,12 +172,12 b' def includeme(config):' | |||
|
169 | 172 | repo_group_route=True, |
|
170 | 173 | valid_integration=True) |
|
171 | 174 | |
|
172 |
config.add_view( |
|
|
175 | config.add_view(RepoGroupIntegrationsView, | |
|
173 | 176 | attr='settings_get', |
|
174 | 177 | renderer='rhodecode:templates/admin/integrations/form.mako', |
|
175 | 178 | request_method='GET', |
|
176 | 179 | route_name='repo_group_integrations_edit') |
|
177 |
config.add_view( |
|
|
180 | config.add_view(RepoGroupIntegrationsView, | |
|
178 | 181 | attr='settings_post', |
|
179 | 182 | renderer='rhodecode:templates/admin/integrations/form.mako', |
|
180 | 183 | request_method='POST', |
@@ -184,7 +187,7 b' def includeme(config):' | |||
|
184 | 187 | config.add_route('repo_integrations_home', |
|
185 | 188 | add_route_requirements('/{repo_name}/settings/integrations'), |
|
186 | 189 | repo_route=True) |
|
187 |
config.add_view( |
|
|
190 | config.add_view(RepoIntegrationsView, | |
|
188 | 191 | attr='integration_list', |
|
189 | 192 | request_method='GET', |
|
190 | 193 | renderer='rhodecode:templates/admin/integrations/list.mako', |
@@ -193,7 +196,7 b' def includeme(config):' | |||
|
193 | 196 | config.add_route('repo_integrations_new', |
|
194 | 197 | add_route_requirements('/{repo_name}/settings/integrations/new'), |
|
195 | 198 | repo_route=True) |
|
196 |
config.add_view( |
|
|
199 | config.add_view(RepoIntegrationsView, | |
|
197 | 200 | attr='new_integration', |
|
198 | 201 | renderer='rhodecode:templates/admin/integrations/new.mako', |
|
199 | 202 | request_method='GET', |
@@ -203,7 +206,7 b' def includeme(config):' | |||
|
203 | 206 | add_route_requirements('/{repo_name}/settings/integrations/{integration}'), |
|
204 | 207 | repo_route=True, |
|
205 | 208 | valid_integration=True) |
|
206 |
config.add_view( |
|
|
209 | config.add_view(RepoIntegrationsView, | |
|
207 | 210 | attr='integration_list', |
|
208 | 211 | request_method='GET', |
|
209 | 212 | renderer='rhodecode:templates/admin/integrations/list.mako', |
@@ -213,12 +216,12 b' def includeme(config):' | |||
|
213 | 216 | add_route_requirements('/{repo_name}/settings/integrations/{integration}/new'), |
|
214 | 217 | repo_route=True, |
|
215 | 218 | valid_integration=True) |
|
216 |
config.add_view( |
|
|
219 | config.add_view(RepoIntegrationsView, | |
|
217 | 220 | attr='settings_get', |
|
218 | 221 | renderer='rhodecode:templates/admin/integrations/form.mako', |
|
219 | 222 | request_method='GET', |
|
220 | 223 | route_name='repo_integrations_create') |
|
221 |
config.add_view( |
|
|
224 | config.add_view(RepoIntegrationsView, | |
|
222 | 225 | attr='settings_post', |
|
223 | 226 | renderer='rhodecode:templates/admin/integrations/form.mako', |
|
224 | 227 | request_method='POST', |
@@ -228,12 +231,12 b' def includeme(config):' | |||
|
228 | 231 | add_route_requirements('/{repo_name}/settings/integrations/{integration}/{integration_id}'), |
|
229 | 232 | repo_route=True, |
|
230 | 233 | valid_integration=True) |
|
231 |
config.add_view( |
|
|
234 | config.add_view(RepoIntegrationsView, | |
|
232 | 235 | attr='settings_get', |
|
233 | 236 | renderer='rhodecode:templates/admin/integrations/form.mako', |
|
234 | 237 | request_method='GET', |
|
235 | 238 | route_name='repo_integrations_edit') |
|
236 |
config.add_view( |
|
|
239 | config.add_view(RepoIntegrationsView, | |
|
237 | 240 | attr='settings_post', |
|
238 | 241 | renderer='rhodecode:templates/admin/integrations/form.mako', |
|
239 | 242 | request_method='POST', |
@@ -4810,6 +4810,7 b' class Gist(Base, BaseModel):' | |||
|
4810 | 4810 | |
|
4811 | 4811 | res = cls.query().filter(cls.gist_access_id == id_).scalar() |
|
4812 | 4812 | if not res: |
|
4813 | log.debug('WARN: No DB entry with id %s', id_) | |
|
4813 | 4814 | raise HTTPNotFound() |
|
4814 | 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 | 13 | function registerRCRoutes() { |
|
14 | 14 | // routes registration |
|
15 | pyroutes.register('favicon', '/favicon.ico', []); | |
|
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', []); | |
|
15 | pyroutes.register('admin_audit_log_entry', '/_admin/audit_logs/%(audit_log_id)s', ['audit_log_id']); | |
|
44 | 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 | 17 | pyroutes.register('admin_defaults_repositories', '/_admin/defaults/repositories', []); |
|
64 | 18 | pyroutes.register('admin_defaults_repositories_update', '/_admin/defaults/repositories/update', []); |
|
65 |
pyroutes.register('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', []); | |
|
19 | pyroutes.register('admin_home', '/_admin', []); | |
|
88 | 20 | pyroutes.register('admin_permissions_application', '/_admin/permissions/application', []); |
|
89 | 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 | 25 | pyroutes.register('admin_permissions_global', '/_admin/permissions/global', []); |
|
91 | 26 | pyroutes.register('admin_permissions_global_update', '/_admin/permissions/global/update', []); |
|
27 | pyroutes.register('admin_permissions_ips', '/_admin/permissions/ips', []); | |
|
92 | 28 | pyroutes.register('admin_permissions_object', '/_admin/permissions/object', []); |
|
93 | 29 | pyroutes.register('admin_permissions_object_update', '/_admin/permissions/object/update', []); |
|
94 | pyroutes.register('admin_permissions_ips', '/_admin/permissions/ips', []); | |
|
95 | 30 | pyroutes.register('admin_permissions_overview', '/_admin/permissions/overview', []); |
|
96 | pyroutes.register('admin_permissions_auth_token_access', '/_admin/permissions/auth_token_access', []); | |
|
97 | 31 | pyroutes.register('admin_permissions_ssh_keys', '/_admin/permissions/ssh_keys', []); |
|
98 | 32 | pyroutes.register('admin_permissions_ssh_keys_data', '/_admin/permissions/ssh_keys/data', []); |
|
99 | 33 | pyroutes.register('admin_permissions_ssh_keys_update', '/_admin/permissions/ssh_keys/update', []); |
|
100 |
pyroutes.register(' |
|
|
101 |
pyroutes.register(' |
|
|
102 |
pyroutes.register(' |
|
|
103 |
pyroutes.register(' |
|
|
104 |
pyroutes.register(' |
|
|
105 | pyroutes.register('user_edit_advanced', '/_admin/users/%(user_id)s/edit/advanced', ['user_id']); | |
|
106 | pyroutes.register('user_edit_global_perms', '/_admin/users/%(user_id)s/edit/global_permissions', ['user_id']); | |
|
107 | pyroutes.register('user_edit_global_perms_update', '/_admin/users/%(user_id)s/edit/global_permissions/update', ['user_id']); | |
|
108 | pyroutes.register('user_update', '/_admin/users/%(user_id)s/update', ['user_id']); | |
|
109 |
pyroutes.register(' |
|
|
110 | pyroutes.register('user_enable_force_password_reset', '/_admin/users/%(user_id)s/password_reset_enable', ['user_id']); | |
|
111 | pyroutes.register('user_disable_force_password_reset', '/_admin/users/%(user_id)s/password_reset_disable', ['user_id']); | |
|
112 | pyroutes.register('user_create_personal_repo_group', '/_admin/users/%(user_id)s/create_repo_group', ['user_id']); | |
|
113 | pyroutes.register('user_notice_dismiss', '/_admin/users/%(user_id)s/notice_dismiss', ['user_id']); | |
|
34 | pyroutes.register('admin_settings', '/_admin/settings', []); | |
|
35 | pyroutes.register('admin_settings_automation', '/_admin/settings/automation', []); | |
|
36 | pyroutes.register('admin_settings_automation_update', '/_admin/settings/automation/%(entry_id)s/update', ['entry_id']); | |
|
37 | pyroutes.register('admin_settings_email', '/_admin/settings/email', []); | |
|
38 | pyroutes.register('admin_settings_email_update', '/_admin/settings/email/update', []); | |
|
39 | pyroutes.register('admin_settings_exception_tracker', '/_admin/settings/exceptions', []); | |
|
40 | pyroutes.register('admin_settings_exception_tracker_delete', '/_admin/settings/exceptions/%(exception_id)s/delete', ['exception_id']); | |
|
41 | pyroutes.register('admin_settings_exception_tracker_delete_all', '/_admin/settings/exceptions_delete_all', []); | |
|
42 | pyroutes.register('admin_settings_exception_tracker_show', '/_admin/settings/exceptions/%(exception_id)s', ['exception_id']); | |
|
43 | pyroutes.register('admin_settings_global', '/_admin/settings/global', []); | |
|
44 | pyroutes.register('admin_settings_global_update', '/_admin/settings/global/update', []); | |
|
45 | pyroutes.register('admin_settings_hooks', '/_admin/settings/hooks', []); | |
|
46 | pyroutes.register('admin_settings_hooks_delete', '/_admin/settings/hooks/delete', []); | |
|
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 | 141 | pyroutes.register('edit_user_auth_tokens_view', '/_admin/users/%(user_id)s/edit/auth_tokens/view', ['user_id']); |
|
115 |
pyroutes.register('edit_user_ |
|
|
116 |
pyroutes.register('edit_user_ |
|
|
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']); | |
|
142 | pyroutes.register('edit_user_caches', '/_admin/users/%(user_id)s/edit/caches', ['user_id']); | |
|
143 | pyroutes.register('edit_user_caches_update', '/_admin/users/%(user_id)s/edit/caches/update', ['user_id']); | |
|
120 | 144 | pyroutes.register('edit_user_emails', '/_admin/users/%(user_id)s/edit/emails', ['user_id']); |
|
121 | 145 | pyroutes.register('edit_user_emails_add', '/_admin/users/%(user_id)s/edit/emails/new', ['user_id']); |
|
122 | 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 | 158 | pyroutes.register('edit_user_ips', '/_admin/users/%(user_id)s/edit/ips', ['user_id']); |
|
124 | 159 | pyroutes.register('edit_user_ips_add', '/_admin/users/%(user_id)s/edit/ips/new', ['user_id']); |
|
125 | 160 | pyroutes.register('edit_user_ips_delete', '/_admin/users/%(user_id)s/edit/ips/delete', ['user_id']); |
|
126 | 161 | pyroutes.register('edit_user_perms_summary', '/_admin/users/%(user_id)s/edit/permissions_summary', ['user_id']); |
|
127 | 162 | pyroutes.register('edit_user_perms_summary_json', '/_admin/users/%(user_id)s/edit/permissions_summary/json', ['user_id']); |
|
128 |
pyroutes.register('edit_user_ |
|
|
129 |
pyroutes.register('edit_user_ |
|
|
130 |
pyroutes.register('edit_user_ |
|
|
131 |
pyroutes.register('edit_user_ |
|
|
132 | pyroutes.register('edit_user_caches', '/_admin/users/%(user_id)s/edit/caches', ['user_id']); | |
|
133 | pyroutes.register('edit_user_caches_update', '/_admin/users/%(user_id)s/edit/caches/update', ['user_id']); | |
|
134 |
pyroutes.register(' |
|
|
135 |
pyroutes.register(' |
|
|
136 | pyroutes.register('user_groups_new', '/_admin/user_groups/new', []); | |
|
137 |
pyroutes.register(' |
|
|
138 | pyroutes.register('repos', '/_admin/repos', []); | |
|
139 | pyroutes.register('repos_data', '/_admin/repos_data', []); | |
|
140 | pyroutes.register('repo_new', '/_admin/repos/new', []); | |
|
141 |
pyroutes.register(' |
|
|
142 |
pyroutes.register(' |
|
|
143 |
pyroutes.register(' |
|
|
144 |
pyroutes.register(' |
|
|
145 |
pyroutes.register(' |
|
|
146 | pyroutes.register('channelstream_connect', '/_admin/channelstream/connect', []); | |
|
147 | pyroutes.register('channelstream_subscribe', '/_admin/channelstream/subscribe', []); | |
|
148 | pyroutes.register('channelstream_proxy', '/_channelstream', []); | |
|
149 |
pyroutes.register(' |
|
|
150 | pyroutes.register('download_file', '/_file_store/download/%(fid)s', ['fid']); | |
|
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', []); | |
|
163 | pyroutes.register('edit_user_ssh_keys', '/_admin/users/%(user_id)s/edit/ssh_keys', ['user_id']); | |
|
164 | pyroutes.register('edit_user_ssh_keys_add', '/_admin/users/%(user_id)s/edit/ssh_keys/new', ['user_id']); | |
|
165 | pyroutes.register('edit_user_ssh_keys_delete', '/_admin/users/%(user_id)s/edit/ssh_keys/delete', ['user_id']); | |
|
166 | pyroutes.register('edit_user_ssh_keys_generate_keypair', '/_admin/users/%(user_id)s/edit/ssh_keys/generate', ['user_id']); | |
|
167 | pyroutes.register('favicon', '/favicon.ico', []); | |
|
168 | pyroutes.register('file_preview', '/_file_preview', []); | |
|
169 | pyroutes.register('gist_delete', '/_admin/gists/%(gist_id)s/delete', ['gist_id']); | |
|
170 | pyroutes.register('gist_edit', '/_admin/gists/%(gist_id)s/edit', ['gist_id']); | |
|
171 | pyroutes.register('gist_edit_check_revision', '/_admin/gists/%(gist_id)s/edit/check_revision', ['gist_id']); | |
|
172 | pyroutes.register('gist_show', '/_admin/gists/%(gist_id)s', ['gist_id']); | |
|
173 | pyroutes.register('gist_show_formatted', '/_admin/gists/%(gist_id)s/rev/%(revision)s/%(format)s', ['gist_id', 'revision', 'format']); | |
|
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']); | |
|
175 | pyroutes.register('gist_show_rev', '/_admin/gists/%(gist_id)s/rev/%(revision)s', ['gist_id', 'revision']); | |
|
176 | pyroutes.register('gist_update', '/_admin/gists/%(gist_id)s/update', ['gist_id']); | |
|
177 | pyroutes.register('gists_create', '/_admin/gists/create', []); | |
|
178 | pyroutes.register('gists_new', '/_admin/gists/new', []); | |
|
179 | pyroutes.register('gists_show', '/_admin/gists', []); | |
|
180 | pyroutes.register('global_integrations_create', '/_admin/integrations/%(integration)s/new', ['integration']); | |
|
181 | pyroutes.register('global_integrations_edit', '/_admin/integrations/%(integration)s/%(integration_id)s', ['integration', 'integration_id']); | |
|
182 | pyroutes.register('global_integrations_home', '/_admin/integrations', []); | |
|
183 | pyroutes.register('global_integrations_list', '/_admin/integrations/%(integration)s', ['integration']); | |
|
184 | pyroutes.register('global_integrations_new', '/_admin/integrations/new', []); | |
|
185 | pyroutes.register('goto_switcher_data', '/_goto_data', []); | |
|
155 | 186 | pyroutes.register('home', '/', []); |
|
156 | pyroutes.register('main_page_repos_data', '/_home_repos', []); | |
|
157 | pyroutes.register('main_page_repo_groups_data', '/_home_repo_groups', []); | |
|
158 |
pyroutes.register(' |
|
|
159 | pyroutes.register('user_group_autocomplete_data', '/_user_groups', []); | |
|
160 | pyroutes.register('repo_list_data', '/_repos', []); | |
|
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', []); | |
|
187 | pyroutes.register('hovercard_pull_request', '/_hovercard/pull_request/%(pull_request_id)s', ['pull_request_id']); | |
|
188 | pyroutes.register('hovercard_repo_commit', '/_hovercard/commit/%(repo_name)s/%(commit_id)s', ['repo_name', 'commit_id']); | |
|
189 | pyroutes.register('hovercard_user', '/_hovercard/user/%(user_id)s', ['user_id']); | |
|
190 | pyroutes.register('hovercard_user_group', '/_hovercard/user_group/%(user_group_id)s', ['user_group_id']); | |
|
191 | pyroutes.register('hovercard_username', '/_hovercard/username/%(username)s', ['username']); | |
|
166 | 192 | pyroutes.register('journal', '/_admin/journal', []); |
|
167 | pyroutes.register('journal_rss', '/_admin/journal/rss', []); | |
|
168 | 193 | pyroutes.register('journal_atom', '/_admin/journal/atom', []); |
|
169 | 194 | pyroutes.register('journal_public', '/_admin/public_journal', []); |
|
170 | 195 | pyroutes.register('journal_public_atom', '/_admin/public_journal/atom', []); |
|
171 | 196 | pyroutes.register('journal_public_atom_old', '/_admin/public_journal_atom', []); |
|
172 | 197 | pyroutes.register('journal_public_rss', '/_admin/public_journal/rss', []); |
|
173 | 198 | pyroutes.register('journal_public_rss_old', '/_admin/public_journal_rss', []); |
|
174 |
pyroutes.register(' |
|
|
175 |
pyroutes.register(' |
|
|
176 | pyroutes.register('repo_creating_check', '/%(repo_name)s/repo_creating_check', ['repo_name']); | |
|
177 | pyroutes.register('repo_summary_explicit', '/%(repo_name)s/summary', ['repo_name']); | |
|
178 | pyroutes.register('repo_summary_commits', '/%(repo_name)s/summary-commits', ['repo_name']); | |
|
179 | pyroutes.register('repo_commit', '/%(repo_name)s/changeset/%(commit_id)s', ['repo_name', 'commit_id']); | |
|
180 | pyroutes.register('repo_commit_children', '/%(repo_name)s/changeset_children/%(commit_id)s', ['repo_name', 'commit_id']); | |
|
181 | pyroutes.register('repo_commit_parents', '/%(repo_name)s/changeset_parents/%(commit_id)s', ['repo_name', 'commit_id']); | |
|
182 | pyroutes.register('repo_commit_raw', '/%(repo_name)s/changeset-diff/%(commit_id)s', ['repo_name', 'commit_id']); | |
|
183 | pyroutes.register('repo_commit_patch', '/%(repo_name)s/changeset-patch/%(commit_id)s', ['repo_name', 'commit_id']); | |
|
184 | pyroutes.register('repo_commit_download', '/%(repo_name)s/changeset-download/%(commit_id)s', ['repo_name', 'commit_id']); | |
|
185 | pyroutes.register('repo_commit_data', '/%(repo_name)s/changeset-data/%(commit_id)s', ['repo_name', 'commit_id']); | |
|
186 | pyroutes.register('repo_commit_comment_create', '/%(repo_name)s/changeset/%(commit_id)s/comment/create', ['repo_name', 'commit_id']); | |
|
187 | pyroutes.register('repo_commit_comment_preview', '/%(repo_name)s/changeset/%(commit_id)s/comment/preview', ['repo_name', 'commit_id']); | |
|
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']); | |
|
189 | pyroutes.register('repo_commit_comment_attachment_upload', '/%(repo_name)s/changeset/%(commit_id)s/comment/attachment_upload', ['repo_name', 'commit_id']); | |
|
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']); | |
|
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']); | |
|
192 | pyroutes.register('repo_commit_raw_deprecated', '/%(repo_name)s/raw-changeset/%(commit_id)s', ['repo_name', 'commit_id']); | |
|
193 | pyroutes.register('repo_archivefile', '/%(repo_name)s/archive/%(fname)s', ['repo_name', 'fname']); | |
|
194 | pyroutes.register('repo_files_diff', '/%(repo_name)s/diff/%(f_path)s', ['repo_name', 'f_path']); | |
|
195 | pyroutes.register('repo_files_diff_2way_redirect', '/%(repo_name)s/diff-2way/%(f_path)s', ['repo_name', 'f_path']); | |
|
196 | pyroutes.register('repo_files', '/%(repo_name)s/files/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
197 | pyroutes.register('repo_files:default_path', '/%(repo_name)s/files/%(commit_id)s/', ['repo_name', 'commit_id']); | |
|
198 | pyroutes.register('repo_files:default_commit', '/%(repo_name)s/files', ['repo_name']); | |
|
199 | pyroutes.register('repo_files:rendered', '/%(repo_name)s/render/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
200 | pyroutes.register('repo_files:annotated', '/%(repo_name)s/annotate/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
201 | pyroutes.register('repo_files:annotated_previous', '/%(repo_name)s/annotate-previous/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
202 | pyroutes.register('repo_nodetree_full', '/%(repo_name)s/nodetree_full/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
203 | pyroutes.register('repo_nodetree_full:default_path', '/%(repo_name)s/nodetree_full/%(commit_id)s/', ['repo_name', 'commit_id']); | |
|
204 | pyroutes.register('repo_files_nodelist', '/%(repo_name)s/nodelist/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
205 | pyroutes.register('repo_file_raw', '/%(repo_name)s/raw/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
206 | pyroutes.register('repo_file_download', '/%(repo_name)s/download/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
207 | pyroutes.register('repo_file_download:legacy', '/%(repo_name)s/rawfile/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
208 | pyroutes.register('repo_file_history', '/%(repo_name)s/history/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
209 | pyroutes.register('repo_file_authors', '/%(repo_name)s/authors/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
210 | pyroutes.register('repo_files_check_head', '/%(repo_name)s/check_head/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
211 | pyroutes.register('repo_files_remove_file', '/%(repo_name)s/remove_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
212 | pyroutes.register('repo_files_delete_file', '/%(repo_name)s/delete_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
213 | pyroutes.register('repo_files_edit_file', '/%(repo_name)s/edit_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
214 | pyroutes.register('repo_files_update_file', '/%(repo_name)s/update_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
215 | pyroutes.register('repo_files_add_file', '/%(repo_name)s/add_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
216 | pyroutes.register('repo_files_upload_file', '/%(repo_name)s/upload_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
217 | pyroutes.register('repo_files_create_file', '/%(repo_name)s/create_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
218 | pyroutes.register('repo_refs_data', '/%(repo_name)s/refs-data', ['repo_name']); | |
|
219 | pyroutes.register('repo_refs_changelog_data', '/%(repo_name)s/refs-data-changelog', ['repo_name']); | |
|
220 | pyroutes.register('repo_stats', '/%(repo_name)s/repo_stats/%(commit_id)s', ['repo_name', 'commit_id']); | |
|
221 | pyroutes.register('repo_commits', '/%(repo_name)s/commits', ['repo_name']); | |
|
222 |
pyroutes.register(' |
|
|
223 | pyroutes.register('repo_commits_elements', '/%(repo_name)s/commits_elements', ['repo_name']); | |
|
224 |
pyroutes.register(' |
|
|
225 |
pyroutes.register(' |
|
|
226 |
pyroutes.register(' |
|
|
227 |
pyroutes.register(' |
|
|
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']); | |
|
229 |
pyroutes.register(' |
|
|
230 |
pyroutes.register(' |
|
|
231 |
pyroutes.register(' |
|
|
232 |
pyroutes.register(' |
|
|
233 |
pyroutes.register(' |
|
|
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']); | |
|
199 | pyroutes.register('journal_rss', '/_admin/journal/rss', []); | |
|
200 | pyroutes.register('login', '/_admin/login', []); | |
|
201 | pyroutes.register('logout', '/_admin/logout', []); | |
|
202 | pyroutes.register('main_page_repo_groups_data', '/_home_repo_groups', []); | |
|
203 | pyroutes.register('main_page_repos_data', '/_home_repos', []); | |
|
204 | pyroutes.register('markup_preview', '/_markup_preview', []); | |
|
205 | pyroutes.register('my_account_auth_tokens', '/_admin/my_account/auth_tokens', []); | |
|
206 | pyroutes.register('my_account_auth_tokens_add', '/_admin/my_account/auth_tokens/new', []); | |
|
207 | pyroutes.register('my_account_auth_tokens_delete', '/_admin/my_account/auth_tokens/delete', []); | |
|
208 | pyroutes.register('my_account_auth_tokens_view', '/_admin/my_account/auth_tokens/view', []); | |
|
209 | pyroutes.register('my_account_bookmarks', '/_admin/my_account/bookmarks', []); | |
|
210 | pyroutes.register('my_account_bookmarks_update', '/_admin/my_account/bookmarks/update', []); | |
|
211 | pyroutes.register('my_account_edit', '/_admin/my_account/edit', []); | |
|
212 | pyroutes.register('my_account_emails', '/_admin/my_account/emails', []); | |
|
213 | pyroutes.register('my_account_emails_add', '/_admin/my_account/emails/new', []); | |
|
214 | pyroutes.register('my_account_emails_delete', '/_admin/my_account/emails/delete', []); | |
|
215 | pyroutes.register('my_account_external_identity', '/_admin/my_account/external-identity', []); | |
|
216 | pyroutes.register('my_account_external_identity_delete', '/_admin/my_account/external-identity/delete', []); | |
|
217 | pyroutes.register('my_account_goto_bookmark', '/_admin/my_account/bookmark/%(bookmark_id)s', ['bookmark_id']); | |
|
218 | pyroutes.register('my_account_notifications', '/_admin/my_account/notifications', []); | |
|
219 | pyroutes.register('my_account_notifications_test_channelstream', '/_admin/my_account/test_channelstream', []); | |
|
220 | pyroutes.register('my_account_notifications_toggle_visibility', '/_admin/my_account/toggle_visibility', []); | |
|
221 | pyroutes.register('my_account_password', '/_admin/my_account/password', []); | |
|
222 | pyroutes.register('my_account_password_update', '/_admin/my_account/password/update', []); | |
|
223 | pyroutes.register('my_account_perms', '/_admin/my_account/perms', []); | |
|
224 | pyroutes.register('my_account_profile', '/_admin/my_account/profile', []); | |
|
225 | pyroutes.register('my_account_pullrequests', '/_admin/my_account/pull_requests', []); | |
|
226 | pyroutes.register('my_account_pullrequests_data', '/_admin/my_account/pull_requests/data', []); | |
|
227 | pyroutes.register('my_account_repos', '/_admin/my_account/repos', []); | |
|
228 | pyroutes.register('my_account_ssh_keys', '/_admin/my_account/ssh_keys', []); | |
|
229 | pyroutes.register('my_account_ssh_keys_add', '/_admin/my_account/ssh_keys/new', []); | |
|
230 | pyroutes.register('my_account_ssh_keys_delete', '/_admin/my_account/ssh_keys/delete', []); | |
|
231 | pyroutes.register('my_account_ssh_keys_generate', '/_admin/my_account/ssh_keys/generate', []); | |
|
232 | pyroutes.register('my_account_update', '/_admin/my_account/update', []); | |
|
233 | pyroutes.register('my_account_user_group_membership', '/_admin/my_account/user_group_membership', []); | |
|
234 | pyroutes.register('my_account_watched', '/_admin/my_account/watched', []); | |
|
235 | pyroutes.register('notifications_delete', '/_admin/notifications/%(notification_id)s/delete', ['notification_id']); | |
|
236 | pyroutes.register('notifications_mark_all_read', '/_admin/notifications_mark_all_read', []); | |
|
237 | pyroutes.register('notifications_show', '/_admin/notifications/%(notification_id)s', ['notification_id']); | |
|
238 | pyroutes.register('notifications_show_all', '/_admin/notifications', []); | |
|
239 | pyroutes.register('notifications_update', '/_admin/notifications/%(notification_id)s/update', ['notification_id']); | |
|
240 | pyroutes.register('ops_error_test', '/_admin/ops/error', []); | |
|
241 | pyroutes.register('ops_ping', '/_admin/ops/ping', []); | |
|
242 | pyroutes.register('ops_redirect_test', '/_admin/ops/redirect', []); | |
|
243 | pyroutes.register('plugin_admin_chat', '/_admin/plugin_admin_chat/%(action)s', ['action']); | |
|
244 | pyroutes.register('pull_requests_global', '/_admin/pull-request/%(pull_request_id)s', ['pull_request_id']); | |
|
245 | pyroutes.register('pull_requests_global_0', '/_admin/pull_requests/%(pull_request_id)s', ['pull_request_id']); | |
|
246 | pyroutes.register('pull_requests_global_1', '/_admin/pull-requests/%(pull_request_id)s', ['pull_request_id']); | |
|
247 | pyroutes.register('pullrequest_comment_create', '/%(repo_name)s/pull-request/%(pull_request_id)s/comment', ['repo_name', 'pull_request_id']); | |
|
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']); | |
|
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']); | |
|
250 | pyroutes.register('pullrequest_comments', '/%(repo_name)s/pull-request/%(pull_request_id)s/comments', ['repo_name', 'pull_request_id']); | |
|
251 | pyroutes.register('pullrequest_create', '/%(repo_name)s/pull-request/create', ['repo_name']); | |
|
252 | pyroutes.register('pullrequest_delete', '/%(repo_name)s/pull-request/%(pull_request_id)s/delete', ['repo_name', 'pull_request_id']); | |
|
253 | pyroutes.register('pullrequest_draft_comments_submit', '/%(repo_name)s/pull-request/%(pull_request_id)s/draft_comments_submit', ['repo_name', 'pull_request_id']); | |
|
254 | pyroutes.register('pullrequest_drafts', '/%(repo_name)s/pull-request/%(pull_request_id)s/drafts', ['repo_name', 'pull_request_id']); | |
|
255 | pyroutes.register('pullrequest_merge', '/%(repo_name)s/pull-request/%(pull_request_id)s/merge', ['repo_name', 'pull_request_id']); | |
|
256 | pyroutes.register('pullrequest_new', '/%(repo_name)s/pull-request/new', ['repo_name']); | |
|
257 | pyroutes.register('pullrequest_repo_refs', '/%(repo_name)s/pull-request/refs/%(target_repo_name)s', ['repo_name', 'target_repo_name']); | |
|
258 | pyroutes.register('pullrequest_repo_targets', '/%(repo_name)s/pull-request/repo-targets', ['repo_name']); | |
|
236 | 259 | pyroutes.register('pullrequest_show', '/%(repo_name)s/pull-request/%(pull_request_id)s', ['repo_name', 'pull_request_id']); |
|
237 | 260 | pyroutes.register('pullrequest_show_all', '/%(repo_name)s/pull-request', ['repo_name']); |
|
238 | 261 | pyroutes.register('pullrequest_show_all_data', '/%(repo_name)s/pull-request-data', ['repo_name']); |
|
239 |
pyroutes.register('pullrequest_ |
|
|
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']); | |
|
262 | pyroutes.register('pullrequest_todos', '/%(repo_name)s/pull-request/%(pull_request_id)s/todos', ['repo_name', 'pull_request_id']); | |
|
243 | 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']); | |
|
245 |
pyroutes.register(' |
|
|
246 | pyroutes.register('pullrequest_comment_create', '/%(repo_name)s/pull-request/%(pull_request_id)s/comment', ['repo_name', 'pull_request_id']); | |
|
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']); | |
|
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']); | |
|
249 |
pyroutes.register(' |
|
|
250 |
pyroutes.register(' |
|
|
251 |
pyroutes.register(' |
|
|
252 |
pyroutes.register(' |
|
|
253 |
pyroutes.register(' |
|
|
254 |
pyroutes.register(' |
|
|
255 |
pyroutes.register(' |
|
|
256 |
pyroutes.register(' |
|
|
257 |
pyroutes.register(' |
|
|
258 |
pyroutes.register(' |
|
|
259 |
pyroutes.register(' |
|
|
260 |
pyroutes.register(' |
|
|
261 |
pyroutes.register(' |
|
|
262 | pyroutes.register('edit_repo_perms_set_private', '/%(repo_name)s/settings/permissions/set_private', ['repo_name']); | |
|
263 |
pyroutes.register(' |
|
|
264 | pyroutes.register('edit_repo_maintenance_execute', '/%(repo_name)s/settings/maintenance/execute', ['repo_name']); | |
|
265 |
pyroutes.register(' |
|
|
266 |
pyroutes.register(' |
|
|
267 |
pyroutes.register(' |
|
|
264 | pyroutes.register('register', '/_admin/register', []); | |
|
265 | pyroutes.register('repo_archivefile', '/%(repo_name)s/archive/%(fname)s', ['repo_name', 'fname']); | |
|
266 | pyroutes.register('repo_artifacts_data', '/%(repo_name)s/artifacts_data', ['repo_name']); | |
|
267 | pyroutes.register('repo_artifacts_delete', '/%(repo_name)s/artifacts/delete/%(uid)s', ['repo_name', 'uid']); | |
|
268 | pyroutes.register('repo_artifacts_get', '/%(repo_name)s/artifacts/download/%(uid)s', ['repo_name', 'uid']); | |
|
269 | pyroutes.register('repo_artifacts_info', '/%(repo_name)s/artifacts/info/%(uid)s', ['repo_name', 'uid']); | |
|
270 | pyroutes.register('repo_artifacts_list', '/%(repo_name)s/artifacts', ['repo_name']); | |
|
271 | pyroutes.register('repo_artifacts_new', '/%(repo_name)s/artifacts/new', ['repo_name']); | |
|
272 | pyroutes.register('repo_artifacts_store', '/%(repo_name)s/artifacts/store', ['repo_name']); | |
|
273 | pyroutes.register('repo_artifacts_update', '/%(repo_name)s/artifacts/update/%(uid)s', ['repo_name', 'uid']); | |
|
274 | pyroutes.register('repo_automation', '/%(repo_name)s/settings/automation', ['repo_name']); | |
|
275 | pyroutes.register('repo_automation_update', '/%(repo_name)s/settings/automation/%(entry_id)s/update', ['repo_name', 'entry_id']); | |
|
276 | pyroutes.register('repo_changelog', '/%(repo_name)s/changelog', ['repo_name']); | |
|
277 | pyroutes.register('repo_changelog_file', '/%(repo_name)s/changelog/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
278 | pyroutes.register('repo_commit', '/%(repo_name)s/changeset/%(commit_id)s', ['repo_name', 'commit_id']); | |
|
279 | pyroutes.register('repo_commit_children', '/%(repo_name)s/changeset_children/%(commit_id)s', ['repo_name', 'commit_id']); | |
|
280 | pyroutes.register('repo_commit_comment_attachment_upload', '/%(repo_name)s/changeset/%(commit_id)s/comment/attachment_upload', ['repo_name', 'commit_id']); | |
|
281 | pyroutes.register('repo_commit_comment_create', '/%(repo_name)s/changeset/%(commit_id)s/comment/create', ['repo_name', 'commit_id']); | |
|
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']); | |
|
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']); | |
|
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']); | |
|
285 | pyroutes.register('repo_commit_comment_preview', '/%(repo_name)s/changeset/%(commit_id)s/comment/preview', ['repo_name', 'commit_id']); | |
|
286 | pyroutes.register('repo_commit_data', '/%(repo_name)s/changeset-data/%(commit_id)s', ['repo_name', 'commit_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 | 302 | pyroutes.register('repo_edit_toggle_locking', '/%(repo_name)s/settings/toggle_locking', ['repo_name']); |
|
269 |
pyroutes.register(' |
|
|
270 |
pyroutes.register(' |
|
|
271 |
pyroutes.register(' |
|
|
272 |
pyroutes.register(' |
|
|
273 |
pyroutes.register(' |
|
|
274 |
pyroutes.register(' |
|
|
275 | pyroutes.register('edit_repo_issuetracker_delete', '/%(repo_name)s/settings/issue_trackers/delete', ['repo_name']); | |
|
276 | pyroutes.register('edit_repo_issuetracker_update', '/%(repo_name)s/settings/issue_trackers/update', ['repo_name']); | |
|
277 |
pyroutes.register(' |
|
|
278 |
pyroutes.register(' |
|
|
279 |
pyroutes.register(' |
|
|
280 |
pyroutes.register('repo_ |
|
|
281 |
pyroutes.register('repo_ |
|
|
282 |
pyroutes.register(' |
|
|
283 |
pyroutes.register(' |
|
|
284 |
pyroutes.register(' |
|
|
285 |
pyroutes.register(' |
|
|
286 |
pyroutes.register('r |
|
|
287 |
pyroutes.register(' |
|
|
288 |
pyroutes.register('r |
|
|
289 |
pyroutes.register(' |
|
|
290 |
pyroutes.register('repo_ |
|
|
291 |
pyroutes.register('repo_ |
|
|
292 |
pyroutes.register(' |
|
|
293 |
pyroutes.register(' |
|
|
294 |
pyroutes.register(' |
|
|
295 |
pyroutes.register(' |
|
|
296 | pyroutes.register('edit_repo_group_perms_update', '/%(repo_group_name)s/_settings/permissions/update', ['repo_group_name']); | |
|
303 | pyroutes.register('repo_file_authors', '/%(repo_name)s/authors/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
304 | pyroutes.register('repo_file_download', '/%(repo_name)s/download/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
305 | pyroutes.register('repo_file_download:legacy', '/%(repo_name)s/rawfile/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
306 | pyroutes.register('repo_file_history', '/%(repo_name)s/history/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
307 | pyroutes.register('repo_file_raw', '/%(repo_name)s/raw/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
308 | pyroutes.register('repo_files', '/%(repo_name)s/files/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
309 | pyroutes.register('repo_files:annotated', '/%(repo_name)s/annotate/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
310 | pyroutes.register('repo_files:annotated_previous', '/%(repo_name)s/annotate-previous/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
311 | pyroutes.register('repo_files:default_commit', '/%(repo_name)s/files', ['repo_name']); | |
|
312 | pyroutes.register('repo_files:default_path', '/%(repo_name)s/files/%(commit_id)s/', ['repo_name', 'commit_id']); | |
|
313 | pyroutes.register('repo_files:rendered', '/%(repo_name)s/render/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
314 | pyroutes.register('repo_files_add_file', '/%(repo_name)s/add_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
315 | pyroutes.register('repo_files_check_head', '/%(repo_name)s/check_head/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
316 | pyroutes.register('repo_files_create_file', '/%(repo_name)s/create_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
317 | pyroutes.register('repo_files_delete_file', '/%(repo_name)s/delete_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
318 | pyroutes.register('repo_files_diff', '/%(repo_name)s/diff/%(f_path)s', ['repo_name', 'f_path']); | |
|
319 | pyroutes.register('repo_files_diff_2way_redirect', '/%(repo_name)s/diff-2way/%(f_path)s', ['repo_name', 'f_path']); | |
|
320 | pyroutes.register('repo_files_edit_file', '/%(repo_name)s/edit_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
321 | pyroutes.register('repo_files_nodelist', '/%(repo_name)s/nodelist/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
322 | pyroutes.register('repo_files_remove_file', '/%(repo_name)s/remove_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
323 | pyroutes.register('repo_files_update_file', '/%(repo_name)s/update_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
324 | pyroutes.register('repo_files_upload_file', '/%(repo_name)s/upload_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); | |
|
325 | pyroutes.register('repo_fork_create', '/%(repo_name)s/fork/create', ['repo_name']); | |
|
326 | pyroutes.register('repo_fork_new', '/%(repo_name)s/fork', ['repo_name']); | |
|
327 | pyroutes.register('repo_forks_data', '/%(repo_name)s/forks/data', ['repo_name']); | |
|
328 | pyroutes.register('repo_forks_show_all', '/%(repo_name)s/forks', ['repo_name']); | |
|
329 | pyroutes.register('repo_group_create', '/_admin/repo_group/create', []); | |
|
297 | 330 | pyroutes.register('repo_group_home', '/%(repo_group_name)s', ['repo_group_name']); |
|
298 | 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']); | |
|
300 | pyroutes.register('edit_user_group_perms_summary', '/_admin/user_groups/%(user_group_id)s/edit/permissions_summary', ['user_group_id']); | |
|
301 | pyroutes.register('edit_user_group_perms_summary_json', '/_admin/user_groups/%(user_group_id)s/edit/permissions_summary/json', ['user_group_id']); | |
|
302 | pyroutes.register('edit_user_group', '/_admin/user_groups/%(user_group_id)s/edit', ['user_group_id']); | |
|
303 | pyroutes.register('user_groups_update', '/_admin/user_groups/%(user_group_id)s/update', ['user_group_id']); | |
|
304 | pyroutes.register('edit_user_group_global_perms', '/_admin/user_groups/%(user_group_id)s/edit/global_permissions', ['user_group_id']); | |
|
305 | pyroutes.register('edit_user_group_global_perms_update', '/_admin/user_groups/%(user_group_id)s/edit/global_permissions/update', ['user_group_id']); | |
|
306 |
pyroutes.register(' |
|
|
307 |
pyroutes.register(' |
|
|
308 | pyroutes.register('edit_user_group_advanced', '/_admin/user_groups/%(user_group_id)s/edit/advanced', ['user_group_id']); | |
|
309 | pyroutes.register('edit_user_group_advanced_sync', '/_admin/user_groups/%(user_group_id)s/edit/advanced/sync', ['user_group_id']); | |
|
310 | pyroutes.register('user_groups_delete', '/_admin/user_groups/%(user_group_id)s/delete', ['user_group_id']); | |
|
332 | pyroutes.register('repo_group_integrations_create', '/%(repo_group_name)s/_settings/integrations/%(integration)s/new', ['repo_group_name', 'integration']); | |
|
333 | pyroutes.register('repo_group_integrations_edit', '/%(repo_group_name)s/_settings/integrations/%(integration)s/%(integration_id)s', ['repo_group_name', 'integration', 'integration_id']); | |
|
334 | pyroutes.register('repo_group_integrations_home', '/%(repo_group_name)s/_settings/integrations', ['repo_group_name']); | |
|
335 | pyroutes.register('repo_group_integrations_list', '/%(repo_group_name)s/_settings/integrations/%(integration)s', ['repo_group_name', 'integration']); | |
|
336 | pyroutes.register('repo_group_integrations_new', '/%(repo_group_name)s/_settings/integrations/new', ['repo_group_name']); | |
|
337 | pyroutes.register('repo_group_list_data', '/_repo_groups', []); | |
|
338 | pyroutes.register('repo_group_new', '/_admin/repo_group/new', []); | |
|
339 | pyroutes.register('repo_groups', '/_admin/repo_groups', []); | |
|
340 | pyroutes.register('repo_groups_data', '/_admin/repo_groups_data', []); | |
|
341 | pyroutes.register('repo_integrations_create', '/%(repo_name)s/settings/integrations/%(integration)s/new', ['repo_name', 'integration']); | |
|
342 | pyroutes.register('repo_integrations_edit', '/%(repo_name)s/settings/integrations/%(integration)s/%(integration_id)s', ['repo_name', 'integration', 'integration_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 | 368 | pyroutes.register('search', '/_admin/search', []); |
|
312 | 369 | pyroutes.register('search_repo', '/%(repo_name)s/_search', ['repo_name']); |
|
313 | 370 | pyroutes.register('search_repo_alt', '/%(repo_name)s/search', ['repo_name']); |
|
314 | 371 | pyroutes.register('search_repo_group', '/%(repo_group_name)s/_search', ['repo_group_name']); |
|
315 |
pyroutes.register(' |
|
|
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 | 389 | pyroutes.register('user_group_profile', '/_profile_user_group/%(user_group_name)s', ['user_group_name']); |
|
317 |
pyroutes.register(' |
|
|
318 |
pyroutes.register(' |
|
|
319 |
pyroutes.register(' |
|
|
320 | pyroutes.register('my_account_password', '/_admin/my_account/password', []); | |
|
321 |
pyroutes.register(' |
|
|
322 | pyroutes.register('my_account_auth_tokens_view', '/_admin/my_account/auth_tokens/view', []); | |
|
323 | pyroutes.register('my_account_auth_tokens_delete', '/_admin/my_account/auth_tokens/delete', []); | |
|
324 | pyroutes.register('my_account_ssh_keys', '/_admin/my_account/ssh_keys', []); | |
|
325 |
pyroutes.register(' |
|
|
326 |
pyroutes.register(' |
|
|
327 |
pyroutes.register(' |
|
|
328 |
pyroutes.register(' |
|
|
329 |
pyroutes.register(' |
|
|
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']); | |
|
390 | pyroutes.register('user_groups', '/_admin/user_groups', []); | |
|
391 | pyroutes.register('user_groups_create', '/_admin/user_groups/create', []); | |
|
392 | pyroutes.register('user_groups_data', '/_admin/user_groups_data', []); | |
|
393 | pyroutes.register('user_groups_delete', '/_admin/user_groups/%(user_group_id)s/delete', ['user_group_id']); | |
|
394 | pyroutes.register('user_groups_new', '/_admin/user_groups/new', []); | |
|
395 | pyroutes.register('user_groups_update', '/_admin/user_groups/%(user_group_id)s/update', ['user_group_id']); | |
|
396 | pyroutes.register('user_notice_dismiss', '/_admin/users/%(user_id)s/notice_dismiss', ['user_id']); | |
|
397 | pyroutes.register('user_profile', '/_profiles/%(username)s', ['username']); | |
|
398 | pyroutes.register('user_update', '/_admin/users/%(user_id)s/update', ['user_id']); | |
|
399 | pyroutes.register('users', '/_admin/users', []); | |
|
400 | pyroutes.register('users_create', '/_admin/users/create', []); | |
|
401 | pyroutes.register('users_data', '/_admin/users_data', []); | |
|
402 | pyroutes.register('users_new', '/_admin/users/new', []); | |
|
405 | 403 | } |
@@ -233,7 +233,7 b' def write_usage_data(event):' | |||
|
233 | 233 | |
|
234 | 234 | # write every 6th hour |
|
235 | 235 | if age_in_min and age_in_min < 60 * 6: |
|
236 |
log.debug('Usage file created %s minutes ago, skipping (thre |
|
|
236 | log.debug('Usage file created %s minutes ago, skipping (threshold: %s minutes)...', | |
|
237 | 237 | age_in_min, 60 * 6) |
|
238 | 238 | return |
|
239 | 239 |
General Comments 0
You need to be logged in to leave comments.
Login now