diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -70,3 +70,6 @@ 3e635489bb7961df93b01e42454ad1a8730ae968 7e2eb896a02ca7cd2cd9f0f853ef3dac3f0039e3 v4.20.1 8bb5fece08ab65986225b184e46f53d2a71729cb v4.21.0 90734aac31ee4563bbe665a43ff73190cc762275 v4.22.0 +a9655707f7cf4146affc51c12fe5ed8e02898a57 v4.23.0 +56310d93b33b97535908ef9c7b0985b89bb7fad2 v4.23.1 +7637c38528fa38c1eabc1fde6a869c20995a0da7 v4.23.2 diff --git a/docs/admin/system_admin/nginx/nginx-proxy-conf.rst b/docs/admin/system_admin/nginx/nginx-proxy-conf.rst --- a/docs/admin/system_admin/nginx/nginx-proxy-conf.rst +++ b/docs/admin/system_admin/nginx/nginx-proxy-conf.rst @@ -36,6 +36,8 @@ timeout during large pushes. proxy_set_header X-Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $proto; + proxy_set_header X-Url-Scheme $scheme; proxy_set_header Proxy-host $proxy_host; proxy_connect_timeout 7200; diff --git a/docs/release-notes/release-notes-4.23.1.rst b/docs/release-notes/release-notes-4.23.1.rst new file mode 100644 --- /dev/null +++ b/docs/release-notes/release-notes-4.23.1.rst @@ -0,0 +1,43 @@ +|RCE| 4.23.1 |RNS| +------------------ + +Release Date +^^^^^^^^^^^^ + +- 2020-11-25 + + +New Features +^^^^^^^^^^^^ + + + +General +^^^^^^^ + + + +Security +^^^^^^^^ + + + +Performance +^^^^^^^^^^^ + +- + + +Fixes +^^^^^ + +- Comments: fixed inline comments TODO resolution +- Comments: fixed some styling for TODO resolution. +- Comments: fixed general comments live push. +- Comments: fixed reply-to links from emails. +- Reviewers: fixed some UI issues on larger screen when editing reviewers. + +Upgrade notes +^^^^^^^^^^^^^ + +- Un-scheduled release addressing problems in 4.23.X releases. diff --git a/docs/release-notes/release-notes-4.23.2.rst b/docs/release-notes/release-notes-4.23.2.rst new file mode 100644 --- /dev/null +++ b/docs/release-notes/release-notes-4.23.2.rst @@ -0,0 +1,48 @@ +|RCE| 4.23.2 |RNS| +------------------ + +Release Date +^^^^^^^^^^^^ + +- 2020-12-06 + + +New Features +^^^^^^^^^^^^ + + + +General +^^^^^^^ + +- Repo extra keys: fixed some texts to improve UI. + + +Security +^^^^^^^^ + + + +Performance +^^^^^^^^^^^ + +- Core: speed up cache loading on application startup. + + +Fixes +^^^^^ + +- Diffs: added scroll down/scroll up helper. Fixes #5643 +- Diffs: fixed diff rendering when a common ancestor was a different commit than the source of changes. +- Commits / changelog: small fixes from found problems. +- Comments: side-bar comments hover also shows an ID of comment now. +- Comments: make dismiss less prominent, and text only to not mix icons/text together. +- Comments: UX improvements for comment buttons. +- Reviewers: small ui fixes for display of review rules, and added new reviewer entries. +- Pull-requests: fixed source/target in PR creation, affecting how we load default reviewers based on branches. + + +Upgrade notes +^^^^^^^^^^^^^ + +- Un-scheduled release addressing problems in 4.23.X releases. diff --git a/docs/release-notes/release-notes.rst b/docs/release-notes/release-notes.rst --- a/docs/release-notes/release-notes.rst +++ b/docs/release-notes/release-notes.rst @@ -9,6 +9,8 @@ Release Notes .. toctree:: :maxdepth: 1 + release-notes-4.23.2.rst + release-notes-4.23.1.rst release-notes-4.23.0.rst release-notes-4.22.0.rst release-notes-4.21.0.rst diff --git a/pkgs/python-packages.nix b/pkgs/python-packages.nix --- a/pkgs/python-packages.nix +++ b/pkgs/python-packages.nix @@ -1883,7 +1883,7 @@ self: super: { }; }; "rhodecode-enterprise-ce" = super.buildPythonPackage { - name = "rhodecode-enterprise-ce-4.23.0"; + name = "rhodecode-enterprise-ce-4.23.2"; buildInputs = [ self."pytest" self."py" diff --git a/rhodecode/api/__init__.py b/rhodecode/api/__init__.py --- a/rhodecode/api/__init__.py +++ b/rhodecode/api/__init__.py @@ -527,6 +527,14 @@ class jsonrpc_deprecated_method(object): return result +def add_api_methods(config): + from rhodecode.api.views import ( + deprecated_api, gist_api, pull_request_api, repo_api, repo_group_api, + server_api, search_api, testing_api, user_api, user_group_api) + + config.scan('rhodecode.api.views') + + def includeme(config): plugin_module = 'rhodecode.api' plugin_settings = get_plugin_settings( @@ -549,7 +557,8 @@ def includeme(config): config.add_route( 'apiv2', plugin_settings.get('url', DEFAULT_URL), jsonrpc_call=True) - config.scan(plugin_module, ignore='rhodecode.api.tests') # register some exception handling view config.add_view(exception_view, context=JSONRPCBaseError) config.add_notfound_view(exception_view, jsonrpc_method_not_found=True) + + add_api_methods(config) diff --git a/rhodecode/apps/_base/navigation.py b/rhodecode/apps/_base/navigation.py --- a/rhodecode/apps/_base/navigation.py +++ b/rhodecode/apps/_base/navigation.py @@ -144,3 +144,5 @@ def includeme(config): labs_active = str2bool(settings.get('labs_settings_active', False)) navigation_registry_instance = NavigationRegistry(labs_active=labs_active) config.registry.registerUtility(navigation_registry_instance) + log.debug('Created new nabigation instance, %s', navigation_registry_instance) + diff --git a/rhodecode/apps/admin/__init__.py b/rhodecode/apps/admin/__init__.py --- a/rhodecode/apps/admin/__init__.py +++ b/rhodecode/apps/admin/__init__.py @@ -26,441 +26,1030 @@ def admin_routes(config): """ Admin prefixed routes """ + from rhodecode.apps.admin.views.audit_logs import AdminAuditLogsView + from rhodecode.apps.admin.views.defaults import AdminDefaultSettingsView + from rhodecode.apps.admin.views.exception_tracker import ExceptionsTrackerView + from rhodecode.apps.admin.views.main_views import AdminMainView + from rhodecode.apps.admin.views.open_source_licenses import OpenSourceLicensesAdminSettingsView + from rhodecode.apps.admin.views.permissions import AdminPermissionsView + from rhodecode.apps.admin.views.process_management import AdminProcessManagementView + from rhodecode.apps.admin.views.repo_groups import AdminRepoGroupsView + from rhodecode.apps.admin.views.repositories import AdminReposView + from rhodecode.apps.admin.views.sessions import AdminSessionSettingsView + from rhodecode.apps.admin.views.settings import AdminSettingsView + from rhodecode.apps.admin.views.svn_config import AdminSvnConfigView + from rhodecode.apps.admin.views.system_info import AdminSystemInfoSettingsView + from rhodecode.apps.admin.views.user_groups import AdminUserGroupsView + from rhodecode.apps.admin.views.users import AdminUsersView, UsersView + config.add_route( name='admin_audit_logs', pattern='/audit_logs') + config.add_view( + AdminAuditLogsView, + attr='admin_audit_logs', + route_name='admin_audit_logs', request_method='GET', + renderer='rhodecode:templates/admin/admin_audit_logs.mako') config.add_route( name='admin_audit_log_entry', pattern='/audit_logs/{audit_log_id}') - - config.add_route( - name='pull_requests_global_0', # backward compat - pattern='/pull_requests/{pull_request_id:\d+}') - config.add_route( - name='pull_requests_global_1', # backward compat - pattern='/pull-requests/{pull_request_id:\d+}') - config.add_route( - name='pull_requests_global', - pattern='/pull-request/{pull_request_id:\d+}') + config.add_view( + AdminAuditLogsView, + attr='admin_audit_log_entry', + route_name='admin_audit_log_entry', request_method='GET', + renderer='rhodecode:templates/admin/admin_audit_log_entry.mako') config.add_route( name='admin_settings_open_source', pattern='/settings/open_source') + config.add_view( + OpenSourceLicensesAdminSettingsView, + attr='open_source_licenses', + route_name='admin_settings_open_source', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_vcs_svn_generate_cfg', pattern='/settings/vcs/svn_generate_cfg') + config.add_view( + AdminSvnConfigView, + attr='vcs_svn_generate_config', + route_name='admin_settings_vcs_svn_generate_cfg', + request_method='POST', renderer='json') config.add_route( name='admin_settings_system', pattern='/settings/system') + config.add_view( + AdminSystemInfoSettingsView, + attr='settings_system_info', + route_name='admin_settings_system', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_system_update', pattern='/settings/system/updates') + config.add_view( + AdminSystemInfoSettingsView, + attr='settings_system_info_check_update', + route_name='admin_settings_system_update', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings_system_update.mako') config.add_route( name='admin_settings_exception_tracker', pattern='/settings/exceptions') + config.add_view( + ExceptionsTrackerView, + attr='browse_exceptions', + route_name='admin_settings_exception_tracker', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_exception_tracker_delete_all', - pattern='/settings/exceptions/delete') + pattern='/settings/exceptions_delete_all') + config.add_view( + ExceptionsTrackerView, + attr='exception_delete_all', + route_name='admin_settings_exception_tracker_delete_all', request_method='POST', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_exception_tracker_show', pattern='/settings/exceptions/{exception_id}') + config.add_view( + ExceptionsTrackerView, + attr='exception_show', + route_name='admin_settings_exception_tracker_show', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_exception_tracker_delete', pattern='/settings/exceptions/{exception_id}/delete') + config.add_view( + ExceptionsTrackerView, + attr='exception_delete', + route_name='admin_settings_exception_tracker_delete', request_method='POST', + renderer='rhodecode:templates/admin/settings/settings.mako') config.add_route( name='admin_settings_sessions', pattern='/settings/sessions') + config.add_view( + AdminSessionSettingsView, + attr='settings_sessions', + route_name='admin_settings_sessions', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_sessions_cleanup', pattern='/settings/sessions/cleanup') + config.add_view( + AdminSessionSettingsView, + attr='settings_sessions_cleanup', + route_name='admin_settings_sessions_cleanup', request_method='POST') config.add_route( name='admin_settings_process_management', pattern='/settings/process_management') + config.add_view( + AdminProcessManagementView, + attr='process_management', + route_name='admin_settings_process_management', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_process_management_data', pattern='/settings/process_management/data') + config.add_view( + AdminProcessManagementView, + attr='process_management_data', + route_name='admin_settings_process_management_data', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings_process_management_data.mako') + config.add_route( name='admin_settings_process_management_signal', pattern='/settings/process_management/signal') + config.add_view( + AdminProcessManagementView, + attr='process_management_signal', + route_name='admin_settings_process_management_signal', + request_method='POST', renderer='json_ext') + config.add_route( name='admin_settings_process_management_master_signal', pattern='/settings/process_management/master_signal') + config.add_view( + AdminProcessManagementView, + attr='process_management_master_signal', + route_name='admin_settings_process_management_master_signal', + request_method='POST', renderer='json_ext') # default settings config.add_route( name='admin_defaults_repositories', pattern='/defaults/repositories') + config.add_view( + AdminDefaultSettingsView, + attr='defaults_repository_show', + route_name='admin_defaults_repositories', request_method='GET', + renderer='rhodecode:templates/admin/defaults/defaults.mako') + config.add_route( name='admin_defaults_repositories_update', pattern='/defaults/repositories/update') + config.add_view( + AdminDefaultSettingsView, + attr='defaults_repository_update', + route_name='admin_defaults_repositories_update', request_method='POST', + renderer='rhodecode:templates/admin/defaults/defaults.mako') # admin settings config.add_route( name='admin_settings', pattern='/settings') + config.add_view( + AdminSettingsView, + attr='settings_global', + route_name='admin_settings', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_update', pattern='/settings/update') + config.add_view( + AdminSettingsView, + attr='settings_global_update', + route_name='admin_settings_update', request_method='POST', + renderer='rhodecode:templates/admin/settings/settings.mako') config.add_route( name='admin_settings_global', pattern='/settings/global') + config.add_view( + AdminSettingsView, + attr='settings_global', + route_name='admin_settings_global', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_global_update', pattern='/settings/global/update') + config.add_view( + AdminSettingsView, + attr='settings_global_update', + route_name='admin_settings_global_update', request_method='POST', + renderer='rhodecode:templates/admin/settings/settings.mako') config.add_route( name='admin_settings_vcs', pattern='/settings/vcs') + config.add_view( + AdminSettingsView, + attr='settings_vcs', + route_name='admin_settings_vcs', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_vcs_update', pattern='/settings/vcs/update') + config.add_view( + AdminSettingsView, + attr='settings_vcs_update', + route_name='admin_settings_vcs_update', request_method='POST', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_vcs_svn_pattern_delete', pattern='/settings/vcs/svn_pattern_delete') + config.add_view( + AdminSettingsView, + attr='settings_vcs_delete_svn_pattern', + route_name='admin_settings_vcs_svn_pattern_delete', request_method='POST', + renderer='json_ext', xhr=True) config.add_route( name='admin_settings_mapping', pattern='/settings/mapping') + config.add_view( + AdminSettingsView, + attr='settings_mapping', + route_name='admin_settings_mapping', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_mapping_update', pattern='/settings/mapping/update') + config.add_view( + AdminSettingsView, + attr='settings_mapping_update', + route_name='admin_settings_mapping_update', request_method='POST', + renderer='rhodecode:templates/admin/settings/settings.mako') config.add_route( name='admin_settings_visual', pattern='/settings/visual') + config.add_view( + AdminSettingsView, + attr='settings_visual', + route_name='admin_settings_visual', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_visual_update', pattern='/settings/visual/update') + config.add_view( + AdminSettingsView, + attr='settings_visual_update', + route_name='admin_settings_visual_update', request_method='POST', + renderer='rhodecode:templates/admin/settings/settings.mako') config.add_route( name='admin_settings_issuetracker', pattern='/settings/issue-tracker') + config.add_view( + AdminSettingsView, + attr='settings_issuetracker', + route_name='admin_settings_issuetracker', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_issuetracker_update', pattern='/settings/issue-tracker/update') + config.add_view( + AdminSettingsView, + attr='settings_issuetracker_update', + route_name='admin_settings_issuetracker_update', request_method='POST', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_issuetracker_test', pattern='/settings/issue-tracker/test') + config.add_view( + AdminSettingsView, + attr='settings_issuetracker_test', + route_name='admin_settings_issuetracker_test', request_method='POST', + renderer='string', xhr=True) + config.add_route( name='admin_settings_issuetracker_delete', pattern='/settings/issue-tracker/delete') + config.add_view( + AdminSettingsView, + attr='settings_issuetracker_delete', + route_name='admin_settings_issuetracker_delete', request_method='POST', + renderer='json_ext', xhr=True) config.add_route( name='admin_settings_email', pattern='/settings/email') + config.add_view( + AdminSettingsView, + attr='settings_email', + route_name='admin_settings_email', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_email_update', pattern='/settings/email/update') + config.add_view( + AdminSettingsView, + attr='settings_email_update', + route_name='admin_settings_email_update', request_method='POST', + renderer='rhodecode:templates/admin/settings/settings.mako') config.add_route( name='admin_settings_hooks', pattern='/settings/hooks') + config.add_view( + AdminSettingsView, + attr='settings_hooks', + route_name='admin_settings_hooks', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_hooks_update', pattern='/settings/hooks/update') + config.add_view( + AdminSettingsView, + attr='settings_hooks_update', + route_name='admin_settings_hooks_update', request_method='POST', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_hooks_delete', pattern='/settings/hooks/delete') + config.add_view( + AdminSettingsView, + attr='settings_hooks_update', + route_name='admin_settings_hooks_delete', request_method='POST', + renderer='rhodecode:templates/admin/settings/settings.mako') config.add_route( name='admin_settings_search', pattern='/settings/search') + config.add_view( + AdminSettingsView, + attr='settings_search', + route_name='admin_settings_search', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') config.add_route( name='admin_settings_labs', pattern='/settings/labs') + config.add_view( + AdminSettingsView, + attr='settings_labs', + route_name='admin_settings_labs', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') + config.add_route( name='admin_settings_labs_update', pattern='/settings/labs/update') + config.add_view( + AdminSettingsView, + attr='settings_labs_update', + route_name='admin_settings_labs_update', request_method='POST', + renderer='rhodecode:templates/admin/settings/settings.mako') # Automation EE feature config.add_route( 'admin_settings_automation', pattern=ADMIN_PREFIX + '/settings/automation') + config.add_view( + AdminSettingsView, + attr='settings_automation', + route_name='admin_settings_automation', request_method='GET', + renderer='rhodecode:templates/admin/settings/settings.mako') # global permissions config.add_route( name='admin_permissions_application', pattern='/permissions/application') + config.add_view( + AdminPermissionsView, + attr='permissions_application', + route_name='admin_permissions_application', request_method='GET', + renderer='rhodecode:templates/admin/permissions/permissions.mako') + config.add_route( name='admin_permissions_application_update', pattern='/permissions/application/update') + config.add_view( + AdminPermissionsView, + attr='permissions_application_update', + route_name='admin_permissions_application_update', request_method='POST', + renderer='rhodecode:templates/admin/permissions/permissions.mako') config.add_route( name='admin_permissions_global', pattern='/permissions/global') + config.add_view( + AdminPermissionsView, + attr='permissions_global', + route_name='admin_permissions_global', request_method='GET', + renderer='rhodecode:templates/admin/permissions/permissions.mako') + config.add_route( name='admin_permissions_global_update', pattern='/permissions/global/update') + config.add_view( + AdminPermissionsView, + attr='permissions_global_update', + route_name='admin_permissions_global_update', request_method='POST', + renderer='rhodecode:templates/admin/permissions/permissions.mako') config.add_route( name='admin_permissions_object', pattern='/permissions/object') + config.add_view( + AdminPermissionsView, + attr='permissions_objects', + route_name='admin_permissions_object', request_method='GET', + renderer='rhodecode:templates/admin/permissions/permissions.mako') + config.add_route( name='admin_permissions_object_update', pattern='/permissions/object/update') + config.add_view( + AdminPermissionsView, + attr='permissions_objects_update', + route_name='admin_permissions_object_update', request_method='POST', + renderer='rhodecode:templates/admin/permissions/permissions.mako') # Branch perms EE feature config.add_route( name='admin_permissions_branch', pattern='/permissions/branch') + config.add_view( + AdminPermissionsView, + attr='permissions_branch', + route_name='admin_permissions_branch', request_method='GET', + renderer='rhodecode:templates/admin/permissions/permissions.mako') config.add_route( name='admin_permissions_ips', pattern='/permissions/ips') + config.add_view( + AdminPermissionsView, + attr='permissions_ips', + route_name='admin_permissions_ips', request_method='GET', + renderer='rhodecode:templates/admin/permissions/permissions.mako') config.add_route( name='admin_permissions_overview', pattern='/permissions/overview') + config.add_view( + AdminPermissionsView, + attr='permissions_overview', + route_name='admin_permissions_overview', request_method='GET', + renderer='rhodecode:templates/admin/permissions/permissions.mako') config.add_route( name='admin_permissions_auth_token_access', pattern='/permissions/auth_token_access') + config.add_view( + AdminPermissionsView, + attr='auth_token_access', + route_name='admin_permissions_auth_token_access', request_method='GET', + renderer='rhodecode:templates/admin/permissions/permissions.mako') config.add_route( name='admin_permissions_ssh_keys', pattern='/permissions/ssh_keys') + config.add_view( + AdminPermissionsView, + attr='ssh_keys', + route_name='admin_permissions_ssh_keys', request_method='GET', + renderer='rhodecode:templates/admin/permissions/permissions.mako') + config.add_route( name='admin_permissions_ssh_keys_data', pattern='/permissions/ssh_keys/data') + config.add_view( + AdminPermissionsView, + attr='ssh_keys_data', + route_name='admin_permissions_ssh_keys_data', request_method='GET', + renderer='json_ext', xhr=True) + config.add_route( name='admin_permissions_ssh_keys_update', pattern='/permissions/ssh_keys/update') + config.add_view( + AdminPermissionsView, + attr='ssh_keys_update', + route_name='admin_permissions_ssh_keys_update', request_method='POST', + renderer='rhodecode:templates/admin/permissions/permissions.mako') # users admin config.add_route( name='users', pattern='/users') + config.add_view( + AdminUsersView, + attr='users_list', + route_name='users', request_method='GET', + renderer='rhodecode:templates/admin/users/users.mako') config.add_route( name='users_data', pattern='/users_data') + config.add_view( + AdminUsersView, + attr='users_list_data', + # renderer defined below + route_name='users_data', request_method='GET', + renderer='json_ext', xhr=True) config.add_route( name='users_create', pattern='/users/create') + config.add_view( + AdminUsersView, + attr='users_create', + route_name='users_create', request_method='POST', + renderer='rhodecode:templates/admin/users/user_add.mako') config.add_route( name='users_new', pattern='/users/new') + config.add_view( + AdminUsersView, + attr='users_new', + route_name='users_new', request_method='GET', + renderer='rhodecode:templates/admin/users/user_add.mako') # user management config.add_route( name='user_edit', pattern='/users/{user_id:\d+}/edit', user_route=True) + config.add_view( + UsersView, + attr='user_edit', + route_name='user_edit', request_method='GET', + renderer='rhodecode:templates/admin/users/user_edit.mako') + config.add_route( name='user_edit_advanced', pattern='/users/{user_id:\d+}/edit/advanced', user_route=True) + config.add_view( + UsersView, + attr='user_edit_advanced', + route_name='user_edit_advanced', request_method='GET', + renderer='rhodecode:templates/admin/users/user_edit.mako') + config.add_route( name='user_edit_global_perms', pattern='/users/{user_id:\d+}/edit/global_permissions', user_route=True) + config.add_view( + UsersView, + attr='user_edit_global_perms', + route_name='user_edit_global_perms', request_method='GET', + renderer='rhodecode:templates/admin/users/user_edit.mako') + config.add_route( name='user_edit_global_perms_update', pattern='/users/{user_id:\d+}/edit/global_permissions/update', user_route=True) + config.add_view( + UsersView, + attr='user_edit_global_perms_update', + route_name='user_edit_global_perms_update', request_method='POST', + renderer='rhodecode:templates/admin/users/user_edit.mako') + config.add_route( name='user_update', pattern='/users/{user_id:\d+}/update', user_route=True) + config.add_view( + UsersView, + attr='user_update', + route_name='user_update', request_method='POST', + renderer='rhodecode:templates/admin/users/user_edit.mako') + config.add_route( name='user_delete', pattern='/users/{user_id:\d+}/delete', user_route=True) + config.add_view( + UsersView, + attr='user_delete', + route_name='user_delete', request_method='POST', + renderer='rhodecode:templates/admin/users/user_edit.mako') + config.add_route( name='user_enable_force_password_reset', pattern='/users/{user_id:\d+}/password_reset_enable', user_route=True) + config.add_view( + UsersView, + attr='user_enable_force_password_reset', + route_name='user_enable_force_password_reset', request_method='POST', + renderer='rhodecode:templates/admin/users/user_edit.mako') + config.add_route( name='user_disable_force_password_reset', pattern='/users/{user_id:\d+}/password_reset_disable', user_route=True) + config.add_view( + UsersView, + attr='user_disable_force_password_reset', + route_name='user_disable_force_password_reset', request_method='POST', + renderer='rhodecode:templates/admin/users/user_edit.mako') + config.add_route( name='user_create_personal_repo_group', pattern='/users/{user_id:\d+}/create_repo_group', user_route=True) + config.add_view( + UsersView, + attr='user_create_personal_repo_group', + route_name='user_create_personal_repo_group', request_method='POST', + renderer='rhodecode:templates/admin/users/user_edit.mako') # user notice config.add_route( name='user_notice_dismiss', pattern='/users/{user_id:\d+}/notice_dismiss', user_route=True) + config.add_view( + UsersView, + attr='user_notice_dismiss', + route_name='user_notice_dismiss', request_method='POST', + renderer='json_ext', xhr=True) # user auth tokens config.add_route( name='edit_user_auth_tokens', pattern='/users/{user_id:\d+}/edit/auth_tokens', user_route=True) + config.add_view( + UsersView, + attr='auth_tokens', + route_name='edit_user_auth_tokens', request_method='GET', + renderer='rhodecode:templates/admin/users/user_edit.mako') + config.add_route( name='edit_user_auth_tokens_view', pattern='/users/{user_id:\d+}/edit/auth_tokens/view', user_route=True) + config.add_view( + UsersView, + attr='auth_tokens_view', + route_name='edit_user_auth_tokens_view', request_method='POST', + renderer='json_ext', xhr=True) + config.add_route( name='edit_user_auth_tokens_add', pattern='/users/{user_id:\d+}/edit/auth_tokens/new', user_route=True) + config.add_view( + UsersView, + attr='auth_tokens_add', + route_name='edit_user_auth_tokens_add', request_method='POST') + config.add_route( name='edit_user_auth_tokens_delete', pattern='/users/{user_id:\d+}/edit/auth_tokens/delete', user_route=True) + config.add_view( + UsersView, + attr='auth_tokens_delete', + route_name='edit_user_auth_tokens_delete', request_method='POST') # user ssh keys config.add_route( name='edit_user_ssh_keys', pattern='/users/{user_id:\d+}/edit/ssh_keys', user_route=True) + config.add_view( + UsersView, + attr='ssh_keys', + route_name='edit_user_ssh_keys', request_method='GET', + renderer='rhodecode:templates/admin/users/user_edit.mako') + config.add_route( name='edit_user_ssh_keys_generate_keypair', pattern='/users/{user_id:\d+}/edit/ssh_keys/generate', user_route=True) + config.add_view( + UsersView, + attr='ssh_keys_generate_keypair', + route_name='edit_user_ssh_keys_generate_keypair', request_method='GET', + renderer='rhodecode:templates/admin/users/user_edit.mako') + config.add_route( name='edit_user_ssh_keys_add', pattern='/users/{user_id:\d+}/edit/ssh_keys/new', user_route=True) + config.add_view( + UsersView, + attr='ssh_keys_add', + route_name='edit_user_ssh_keys_add', request_method='POST') + config.add_route( name='edit_user_ssh_keys_delete', pattern='/users/{user_id:\d+}/edit/ssh_keys/delete', user_route=True) + config.add_view( + UsersView, + attr='ssh_keys_delete', + route_name='edit_user_ssh_keys_delete', request_method='POST') # user emails config.add_route( name='edit_user_emails', pattern='/users/{user_id:\d+}/edit/emails', user_route=True) + config.add_view( + UsersView, + attr='emails', + route_name='edit_user_emails', request_method='GET', + renderer='rhodecode:templates/admin/users/user_edit.mako') + config.add_route( name='edit_user_emails_add', pattern='/users/{user_id:\d+}/edit/emails/new', user_route=True) + config.add_view( + UsersView, + attr='emails_add', + route_name='edit_user_emails_add', request_method='POST') + config.add_route( name='edit_user_emails_delete', pattern='/users/{user_id:\d+}/edit/emails/delete', user_route=True) + config.add_view( + UsersView, + attr='emails_delete', + route_name='edit_user_emails_delete', request_method='POST') # user IPs config.add_route( name='edit_user_ips', pattern='/users/{user_id:\d+}/edit/ips', user_route=True) + config.add_view( + UsersView, + attr='ips', + route_name='edit_user_ips', request_method='GET', + renderer='rhodecode:templates/admin/users/user_edit.mako') + config.add_route( name='edit_user_ips_add', pattern='/users/{user_id:\d+}/edit/ips/new', user_route_with_default=True) # enabled for default user too + config.add_view( + UsersView, + attr='ips_add', + route_name='edit_user_ips_add', request_method='POST') + config.add_route( name='edit_user_ips_delete', pattern='/users/{user_id:\d+}/edit/ips/delete', user_route_with_default=True) # enabled for default user too + config.add_view( + UsersView, + attr='ips_delete', + route_name='edit_user_ips_delete', request_method='POST') # user perms config.add_route( name='edit_user_perms_summary', pattern='/users/{user_id:\d+}/edit/permissions_summary', user_route=True) + config.add_view( + UsersView, + attr='user_perms_summary', + route_name='edit_user_perms_summary', request_method='GET', + renderer='rhodecode:templates/admin/users/user_edit.mako') + config.add_route( name='edit_user_perms_summary_json', pattern='/users/{user_id:\d+}/edit/permissions_summary/json', user_route=True) + config.add_view( + UsersView, + attr='user_perms_summary_json', + route_name='edit_user_perms_summary_json', request_method='GET', + renderer='json_ext') # user user groups management config.add_route( name='edit_user_groups_management', pattern='/users/{user_id:\d+}/edit/groups_management', user_route=True) + config.add_view( + UsersView, + attr='groups_management', + route_name='edit_user_groups_management', request_method='GET', + renderer='rhodecode:templates/admin/users/user_edit.mako') config.add_route( name='edit_user_groups_management_updates', pattern='/users/{user_id:\d+}/edit/edit_user_groups_management/updates', user_route=True) + config.add_view( + UsersView, + attr='groups_management_updates', + route_name='edit_user_groups_management_updates', request_method='POST') # user audit logs config.add_route( name='edit_user_audit_logs', pattern='/users/{user_id:\d+}/edit/audit', user_route=True) + config.add_view( + UsersView, + attr='user_audit_logs', + route_name='edit_user_audit_logs', request_method='GET', + renderer='rhodecode:templates/admin/users/user_edit.mako') config.add_route( name='edit_user_audit_logs_download', pattern='/users/{user_id:\d+}/edit/audit/download', user_route=True) + config.add_view( + UsersView, + attr='user_audit_logs_download', + route_name='edit_user_audit_logs_download', request_method='GET', + renderer='string') # user caches config.add_route( name='edit_user_caches', pattern='/users/{user_id:\d+}/edit/caches', user_route=True) + config.add_view( + UsersView, + attr='user_caches', + route_name='edit_user_caches', request_method='GET', + renderer='rhodecode:templates/admin/users/user_edit.mako') + config.add_route( name='edit_user_caches_update', pattern='/users/{user_id:\d+}/edit/caches/update', user_route=True) + config.add_view( + UsersView, + attr='user_caches_update', + route_name='edit_user_caches_update', request_method='POST') # user-groups admin config.add_route( name='user_groups', pattern='/user_groups') + config.add_view( + AdminUserGroupsView, + attr='user_groups_list', + route_name='user_groups', request_method='GET', + renderer='rhodecode:templates/admin/user_groups/user_groups.mako') config.add_route( name='user_groups_data', pattern='/user_groups_data') + config.add_view( + AdminUserGroupsView, + attr='user_groups_list_data', + route_name='user_groups_data', request_method='GET', + renderer='json_ext', xhr=True) config.add_route( name='user_groups_new', pattern='/user_groups/new') + config.add_view( + AdminUserGroupsView, + attr='user_groups_new', + route_name='user_groups_new', request_method='GET', + renderer='rhodecode:templates/admin/user_groups/user_group_add.mako') config.add_route( name='user_groups_create', pattern='/user_groups/create') + config.add_view( + AdminUserGroupsView, + attr='user_groups_create', + route_name='user_groups_create', request_method='POST', + renderer='rhodecode:templates/admin/user_groups/user_group_add.mako') # repos admin config.add_route( name='repos', pattern='/repos') + config.add_view( + AdminReposView, + attr='repository_list', + route_name='repos', request_method='GET', + renderer='rhodecode:templates/admin/repos/repos.mako') config.add_route( name='repos_data', pattern='/repos_data') + config.add_view( + AdminReposView, + attr='repository_list_data', + route_name='repos_data', request_method='GET', + renderer='json_ext', xhr=True) config.add_route( name='repo_new', pattern='/repos/new') + config.add_view( + AdminReposView, + attr='repository_new', + route_name='repo_new', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_add.mako') config.add_route( name='repo_create', pattern='/repos/create') + config.add_view( + AdminReposView, + attr='repository_create', + route_name='repo_create', request_method='POST', + renderer='rhodecode:templates/admin/repos/repos.mako') # repo groups admin config.add_route( name='repo_groups', pattern='/repo_groups') + config.add_view( + AdminRepoGroupsView, + attr='repo_group_list', + route_name='repo_groups', request_method='GET', + renderer='rhodecode:templates/admin/repo_groups/repo_groups.mako') config.add_route( name='repo_groups_data', pattern='/repo_groups_data') + config.add_view( + AdminRepoGroupsView, + attr='repo_group_list_data', + route_name='repo_groups_data', request_method='GET', + renderer='json_ext', xhr=True) config.add_route( name='repo_group_new', pattern='/repo_group/new') + config.add_view( + AdminRepoGroupsView, + attr='repo_group_new', + route_name='repo_group_new', request_method='GET', + renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako') config.add_route( name='repo_group_create', pattern='/repo_group/create') + config.add_view( + AdminRepoGroupsView, + attr='repo_group_create', + route_name='repo_group_create', request_method='POST', + renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako') def includeme(config): from rhodecode.apps._base.navigation import includeme as nav_includeme + from rhodecode.apps.admin.views.main_views import AdminMainView # Create admin navigation registry and add it to the pyramid registry. nav_includeme(config) # main admin routes - config.add_route(name='admin_home', pattern=ADMIN_PREFIX) - config.include(admin_routes, route_prefix=ADMIN_PREFIX) + config.add_route( + name='admin_home', pattern=ADMIN_PREFIX) + config.add_view( + AdminMainView, + attr='admin_main', + route_name='admin_home', request_method='GET', + renderer='rhodecode:templates/admin/main.mako') + + # pr global redirect + config.add_route( + name='pull_requests_global_0', # backward compat + pattern=ADMIN_PREFIX + '/pull_requests/{pull_request_id:\d+}') + config.add_view( + AdminMainView, + attr='pull_requests', + route_name='pull_requests_global_0', request_method='GET') - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') + config.add_route( + name='pull_requests_global_1', # backward compat + pattern=ADMIN_PREFIX + '/pull-requests/{pull_request_id:\d+}') + config.add_view( + AdminMainView, + attr='pull_requests', + route_name='pull_requests_global_1', request_method='GET') + + config.add_route( + name='pull_requests_global', + pattern=ADMIN_PREFIX + '/pull-request/{pull_request_id:\d+}') + config.add_view( + AdminMainView, + attr='pull_requests', + route_name='pull_requests_global', request_method='GET') + + config.include(admin_routes, route_prefix=ADMIN_PREFIX) diff --git a/rhodecode/apps/admin/views/audit_logs.py b/rhodecode/apps/admin/views/audit_logs.py --- a/rhodecode/apps/admin/views/audit_logs.py +++ b/rhodecode/apps/admin/views/audit_logs.py @@ -21,7 +21,6 @@ import logging from pyramid.httpexceptions import HTTPNotFound -from pyramid.view import view_config from rhodecode.apps._base import BaseAppView from rhodecode.model.db import joinedload, UserLog @@ -34,15 +33,13 @@ log = logging.getLogger(__name__) class AdminAuditLogsView(BaseAppView): + def load_default_context(self): c = self._get_local_tmpl_context() return c @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_audit_logs', request_method='GET', - renderer='rhodecode:templates/admin/admin_audit_logs.mako') def admin_audit_logs(self): c = self.load_default_context() @@ -76,9 +73,6 @@ class AdminAuditLogsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_audit_log_entry', request_method='GET', - renderer='rhodecode:templates/admin/admin_audit_log_entry.mako') def admin_audit_log_entry(self): c = self.load_default_context() audit_log_id = self.request.matchdict['audit_log_id'] diff --git a/rhodecode/apps/admin/views/defaults.py b/rhodecode/apps/admin/views/defaults.py --- a/rhodecode/apps/admin/views/defaults.py +++ b/rhodecode/apps/admin/views/defaults.py @@ -23,7 +23,6 @@ import logging import formencode import formencode.htmlfill -from pyramid.view import view_config from pyramid.httpexceptions import HTTPFound from pyramid.renderers import render from pyramid.response import Response @@ -41,17 +40,13 @@ log = logging.getLogger(__name__) class AdminDefaultSettingsView(BaseAppView): + def load_default_context(self): c = self._get_local_tmpl_context() - - return c @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_defaults_repositories', request_method='GET', - renderer='rhodecode:templates/admin/defaults/defaults.mako') def defaults_repository_show(self): c = self.load_default_context() c.backends = BACKENDS.keys() @@ -72,9 +67,6 @@ class AdminDefaultSettingsView(BaseAppVi @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_defaults_repositories_update', request_method='POST', - renderer='rhodecode:templates/admin/defaults/defaults.mako') def defaults_repository_update(self): _ = self.request.translate c = self.load_default_context() diff --git a/rhodecode/apps/admin/views/exception_tracker.py b/rhodecode/apps/admin/views/exception_tracker.py --- a/rhodecode/apps/admin/views/exception_tracker.py +++ b/rhodecode/apps/admin/views/exception_tracker.py @@ -21,7 +21,6 @@ import os import logging from pyramid.httpexceptions import HTTPFound -from pyramid.view import view_config from rhodecode.apps._base import BaseAppView from rhodecode.apps._base.navigation import navigation_list @@ -99,9 +98,6 @@ class ExceptionsTrackerView(BaseAppView) @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_exception_tracker', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def browse_exceptions(self): _ = self.request.translate c = self.load_default_context() @@ -117,9 +113,6 @@ class ExceptionsTrackerView(BaseAppView) @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_exception_tracker_show', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def exception_show(self): _ = self.request.translate c = self.load_default_context() @@ -132,9 +125,6 @@ class ExceptionsTrackerView(BaseAppView) @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_exception_tracker_delete_all', request_method='POST', - renderer='rhodecode:templates/admin/settings/settings.mako') def exception_delete_all(self): _ = self.request.translate c = self.load_default_context() @@ -159,9 +149,6 @@ class ExceptionsTrackerView(BaseAppView) @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_exception_tracker_delete', request_method='POST', - renderer='rhodecode:templates/admin/settings/settings.mako') def exception_delete(self): _ = self.request.translate c = self.load_default_context() diff --git a/rhodecode/apps/admin/views/main_views.py b/rhodecode/apps/admin/views/main_views.py --- a/rhodecode/apps/admin/views/main_views.py +++ b/rhodecode/apps/admin/views/main_views.py @@ -21,7 +21,6 @@ import logging from pyramid.httpexceptions import HTTPFound, HTTPNotFound -from pyramid.view import view_config from rhodecode.apps._base import BaseAppView from rhodecode.lib import helpers as h @@ -39,9 +38,6 @@ class AdminMainView(BaseAppView): @LoginRequired() @NotAnonymous() - @view_config( - route_name='admin_home', request_method='GET', - renderer='rhodecode:templates/admin/main.mako') def admin_main(self): c = self.load_default_context() c.active = 'admin' @@ -52,9 +48,6 @@ class AdminMainView(BaseAppView): return self._get_template_context(c) @LoginRequired() - @view_config(route_name='pull_requests_global_0', request_method='GET') - @view_config(route_name='pull_requests_global_1', request_method='GET') - @view_config(route_name='pull_requests_global', request_method='GET') def pull_requests(self): """ Global redirect for Pull Requests diff --git a/rhodecode/apps/admin/views/open_source_licenses.py b/rhodecode/apps/admin/views/open_source_licenses.py --- a/rhodecode/apps/admin/views/open_source_licenses.py +++ b/rhodecode/apps/admin/views/open_source_licenses.py @@ -21,8 +21,6 @@ import collections import logging -from pyramid.view import view_config - from rhodecode.apps._base import BaseAppView from rhodecode.apps._base.navigation import navigation_list from rhodecode.lib.auth import (LoginRequired, HasPermissionAllDecorator) @@ -39,9 +37,6 @@ class OpenSourceLicensesAdminSettingsVie @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_open_source', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def open_source_licenses(self): c = self.load_default_context() c.active = 'open_source' diff --git a/rhodecode/apps/admin/views/permissions.py b/rhodecode/apps/admin/views/permissions.py --- a/rhodecode/apps/admin/views/permissions.py +++ b/rhodecode/apps/admin/views/permissions.py @@ -25,7 +25,6 @@ import formencode.htmlfill import datetime from pyramid.interfaces import IRoutesMapper -from pyramid.view import view_config from pyramid.httpexceptions import HTTPFound from pyramid.renderers import render from pyramid.response import Response @@ -59,9 +58,6 @@ class AdminPermissionsView(BaseAppView, @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_permissions_application', request_method='GET', - renderer='rhodecode:templates/admin/permissions/permissions.mako') def permissions_application(self): c = self.load_default_context() c.active = 'application' @@ -90,9 +86,6 @@ class AdminPermissionsView(BaseAppView, @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_permissions_application_update', request_method='POST', - renderer='rhodecode:templates/admin/permissions/permissions.mako') def permissions_application_update(self): _ = self.request.translate c = self.load_default_context() @@ -149,9 +142,6 @@ class AdminPermissionsView(BaseAppView, @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_permissions_object', request_method='GET', - renderer='rhodecode:templates/admin/permissions/permissions.mako') def permissions_objects(self): c = self.load_default_context() c.active = 'objects' @@ -174,9 +164,6 @@ class AdminPermissionsView(BaseAppView, @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_permissions_object_update', request_method='POST', - renderer='rhodecode:templates/admin/permissions/permissions.mako') def permissions_objects_update(self): _ = self.request.translate c = self.load_default_context() @@ -225,9 +212,6 @@ class AdminPermissionsView(BaseAppView, @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_permissions_branch', request_method='GET', - renderer='rhodecode:templates/admin/permissions/permissions.mako') def permissions_branch(self): c = self.load_default_context() c.active = 'branch' @@ -249,9 +233,6 @@ class AdminPermissionsView(BaseAppView, @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_permissions_global', request_method='GET', - renderer='rhodecode:templates/admin/permissions/permissions.mako') def permissions_global(self): c = self.load_default_context() c.active = 'global' @@ -274,9 +255,6 @@ class AdminPermissionsView(BaseAppView, @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_permissions_global_update', request_method='POST', - renderer='rhodecode:templates/admin/permissions/permissions.mako') def permissions_global_update(self): _ = self.request.translate c = self.load_default_context() @@ -327,9 +305,6 @@ class AdminPermissionsView(BaseAppView, @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_permissions_ips', request_method='GET', - renderer='rhodecode:templates/admin/permissions/permissions.mako') def permissions_ips(self): c = self.load_default_context() c.active = 'ips' @@ -342,9 +317,6 @@ class AdminPermissionsView(BaseAppView, @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_permissions_overview', request_method='GET', - renderer='rhodecode:templates/admin/permissions/permissions.mako') def permissions_overview(self): c = self.load_default_context() c.active = 'perms' @@ -355,9 +327,6 @@ class AdminPermissionsView(BaseAppView, @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_permissions_auth_token_access', request_method='GET', - renderer='rhodecode:templates/admin/permissions/permissions.mako') def auth_token_access(self): from rhodecode import CONFIG @@ -415,9 +384,6 @@ class AdminPermissionsView(BaseAppView, @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_permissions_ssh_keys', request_method='GET', - renderer='rhodecode:templates/admin/permissions/permissions.mako') def ssh_keys(self): c = self.load_default_context() c.active = 'ssh_keys' @@ -426,9 +392,6 @@ class AdminPermissionsView(BaseAppView, @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_permissions_ssh_keys_data', request_method='GET', - renderer='json_ext', xhr=True) def ssh_keys_data(self): _ = self.request.translate self.load_default_context() @@ -498,9 +461,6 @@ class AdminPermissionsView(BaseAppView, @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_permissions_ssh_keys_update', request_method='POST', - renderer='rhodecode:templates/admin/permissions/permissions.mako') def ssh_keys_update(self): _ = self.request.translate self.load_default_context() diff --git a/rhodecode/apps/admin/views/process_management.py b/rhodecode/apps/admin/views/process_management.py --- a/rhodecode/apps/admin/views/process_management.py +++ b/rhodecode/apps/admin/views/process_management.py @@ -22,7 +22,7 @@ import logging import psutil import signal -from pyramid.view import view_config + from rhodecode.apps._base import BaseAppView from rhodecode.apps._base.navigation import navigation_list @@ -84,9 +84,6 @@ class AdminProcessManagementView(BaseApp @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_process_management', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def process_management(self): _ = self.request.translate c = self.load_default_context() @@ -99,9 +96,6 @@ class AdminProcessManagementView(BaseApp @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_process_management_data', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings_process_management_data.mako') def process_management_data(self): _ = self.request.translate c = self.load_default_context() @@ -111,9 +105,6 @@ class AdminProcessManagementView(BaseApp @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_process_management_signal', - request_method='POST', renderer='json_ext') def process_management_signal(self): pids = self.request.json.get('pids', []) result = [] @@ -155,9 +146,6 @@ class AdminProcessManagementView(BaseApp @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_process_management_master_signal', - request_method='POST', renderer='json_ext') def process_management_master_signal(self): pid_data = self.request.json.get('pid_data', {}) pid = safe_int(pid_data['pid']) diff --git a/rhodecode/apps/admin/views/repo_groups.py b/rhodecode/apps/admin/views/repo_groups.py --- a/rhodecode/apps/admin/views/repo_groups.py +++ b/rhodecode/apps/admin/views/repo_groups.py @@ -25,7 +25,7 @@ import formencode import formencode.htmlfill from pyramid.httpexceptions import HTTPFound, HTTPForbidden -from pyramid.view import view_config + from pyramid.renderers import render from pyramid.response import Response @@ -96,9 +96,6 @@ class AdminRepoGroupsView(BaseAppView, D # `repo_group_list_data` via RepoGroupList @LoginRequired() @NotAnonymous() - @view_config( - route_name='repo_groups', request_method='GET', - renderer='rhodecode:templates/admin/repo_groups/repo_groups.mako') def repo_group_list(self): c = self.load_default_context() return self._get_template_context(c) @@ -106,9 +103,6 @@ class AdminRepoGroupsView(BaseAppView, D # permission check inside @LoginRequired() @NotAnonymous() - @view_config( - route_name='repo_groups_data', request_method='GET', - renderer='json_ext', xhr=True) def repo_group_list_data(self): self.load_default_context() column_map = { @@ -254,9 +248,6 @@ class AdminRepoGroupsView(BaseAppView, D @LoginRequired() @NotAnonymous() # perm checks inside - @view_config( - route_name='repo_group_new', request_method='GET', - renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako') def repo_group_new(self): c = self.load_default_context() @@ -296,9 +287,6 @@ class AdminRepoGroupsView(BaseAppView, D @NotAnonymous() @CSRFRequired() # perm checks inside - @view_config( - route_name='repo_group_create', request_method='POST', - renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako') def repo_group_create(self): c = self.load_default_context() _ = self.request.translate diff --git a/rhodecode/apps/admin/views/repositories.py b/rhodecode/apps/admin/views/repositories.py --- a/rhodecode/apps/admin/views/repositories.py +++ b/rhodecode/apps/admin/views/repositories.py @@ -23,7 +23,7 @@ import formencode import formencode.htmlfill from pyramid.httpexceptions import HTTPFound, HTTPForbidden -from pyramid.view import view_config + from pyramid.renderers import render from pyramid.response import Response @@ -52,7 +52,6 @@ class AdminReposView(BaseAppView, DataGr def load_default_context(self): c = self._get_local_tmpl_context() - return c def _load_form_data(self, c): @@ -65,9 +64,6 @@ class AdminReposView(BaseAppView, DataGr @LoginRequired() @NotAnonymous() # perms check inside - @view_config( - route_name='repos', request_method='GET', - renderer='rhodecode:templates/admin/repos/repos.mako') def repository_list(self): c = self.load_default_context() return self._get_template_context(c) @@ -75,9 +71,6 @@ class AdminReposView(BaseAppView, DataGr @LoginRequired() @NotAnonymous() # perms check inside - @view_config( - route_name='repos_data', request_method='GET', - renderer='json_ext', xhr=True) def repository_list_data(self): self.load_default_context() column_map = { @@ -162,9 +155,6 @@ class AdminReposView(BaseAppView, DataGr @LoginRequired() @NotAnonymous() # perms check inside - @view_config( - route_name='repo_new', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_add.mako') def repository_new(self): c = self.load_default_context() @@ -216,9 +206,6 @@ class AdminReposView(BaseAppView, DataGr @NotAnonymous() @CSRFRequired() # perms check inside - @view_config( - route_name='repo_create', request_method='POST', - renderer='rhodecode:templates/admin/repos/repos.mako') def repository_create(self): c = self.load_default_context() diff --git a/rhodecode/apps/admin/views/sessions.py b/rhodecode/apps/admin/views/sessions.py --- a/rhodecode/apps/admin/views/sessions.py +++ b/rhodecode/apps/admin/views/sessions.py @@ -20,7 +20,7 @@ import logging -from pyramid.view import view_config + from pyramid.httpexceptions import HTTPFound from rhodecode.apps._base import BaseAppView @@ -37,17 +37,13 @@ log = logging.getLogger(__name__) class AdminSessionSettingsView(BaseAppView): + def load_default_context(self): c = self._get_local_tmpl_context() - - return c @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_sessions', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_sessions(self): c = self.load_default_context() @@ -71,8 +67,6 @@ class AdminSessionSettingsView(BaseAppVi @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_sessions_cleanup', request_method='POST') def settings_sessions_cleanup(self): _ = self.request.translate expire_days = safe_int(self.request.params.get('expire_days')) diff --git a/rhodecode/apps/admin/views/settings.py b/rhodecode/apps/admin/views/settings.py --- a/rhodecode/apps/admin/views/settings.py +++ b/rhodecode/apps/admin/views/settings.py @@ -27,7 +27,7 @@ import formencode import formencode.htmlfill import rhodecode -from pyramid.view import view_config + from pyramid.httpexceptions import HTTPFound, HTTPNotFound from pyramid.renderers import render from pyramid.response import Response @@ -68,7 +68,6 @@ class AdminSettingsView(BaseAppView): c.labs_active = str2bool( rhodecode.CONFIG.get('labs_settings_active', 'true')) c.navlist = navigation_list(self.request) - return c @classmethod @@ -109,9 +108,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_vcs', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_vcs(self): c = self.load_default_context() c.active = 'vcs' @@ -139,9 +135,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_vcs_update', request_method='POST', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_vcs_update(self): _ = self.request.translate c = self.load_default_context() @@ -207,9 +200,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_vcs_svn_pattern_delete', request_method='POST', - renderer='json_ext', xhr=True) def settings_vcs_delete_svn_pattern(self): delete_pattern_id = self.request.POST.get('delete_svn_pattern') model = VcsSettingsModel() @@ -225,9 +215,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_mapping', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_mapping(self): c = self.load_default_context() c.active = 'mapping' @@ -245,9 +232,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_mapping_update', request_method='POST', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_mapping_update(self): _ = self.request.translate c = self.load_default_context() @@ -274,12 +258,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') - @view_config( - route_name='admin_settings_global', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_global(self): c = self.load_default_context() c.active = 'global' @@ -299,12 +277,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_update', request_method='POST', - renderer='rhodecode:templates/admin/settings/settings.mako') - @view_config( - route_name='admin_settings_global_update', request_method='POST', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_global_update(self): _ = self.request.translate c = self.load_default_context() @@ -359,9 +331,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_visual', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_visual(self): c = self.load_default_context() c.active = 'visual' @@ -379,9 +348,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_visual_update', request_method='POST', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_visual_update(self): _ = self.request.translate c = self.load_default_context() @@ -441,9 +407,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_issuetracker', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_issuetracker(self): c = self.load_default_context() c.active = 'issuetracker' @@ -470,9 +433,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_issuetracker_test', request_method='POST', - renderer='string', xhr=True) def settings_issuetracker_test(self): error_container = [] @@ -490,9 +450,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_issuetracker_update', request_method='POST', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_issuetracker_update(self): _ = self.request.translate self.load_default_context() @@ -527,9 +484,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_issuetracker_delete', request_method='POST', - renderer='json_ext', xhr=True) def settings_issuetracker_delete(self): _ = self.request.translate self.load_default_context() @@ -547,9 +501,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_email', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_email(self): c = self.load_default_context() c.active = 'email' @@ -568,9 +519,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_email_update', request_method='POST', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_email_update(self): _ = self.request.translate c = self.load_default_context() @@ -600,9 +548,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_hooks', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_hooks(self): c = self.load_default_context() c.active = 'hooks' @@ -624,12 +569,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_hooks_update', request_method='POST', - renderer='rhodecode:templates/admin/settings/settings.mako') - @view_config( - route_name='admin_settings_hooks_delete', request_method='POST', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_hooks_update(self): _ = self.request.translate c = self.load_default_context() @@ -671,9 +610,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_search', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_search(self): c = self.load_default_context() c.active = 'search' @@ -685,9 +621,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_automation', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_automation(self): c = self.load_default_context() c.active = 'automation' @@ -696,9 +629,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_labs', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_labs(self): c = self.load_default_context() if not c.labs_active: @@ -720,9 +650,6 @@ class AdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_labs_update', request_method='POST', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_labs_update(self): _ = self.request.translate c = self.load_default_context() diff --git a/rhodecode/apps/admin/views/svn_config.py b/rhodecode/apps/admin/views/svn_config.py --- a/rhodecode/apps/admin/views/svn_config.py +++ b/rhodecode/apps/admin/views/svn_config.py @@ -20,7 +20,7 @@ import logging -from pyramid.view import view_config + from rhodecode.apps._base import BaseAppView from rhodecode.apps.svn_support.utils import generate_mod_dav_svn_config @@ -30,14 +30,11 @@ from rhodecode.lib.auth import ( log = logging.getLogger(__name__) -class SvnConfigAdminSettingsView(BaseAppView): +class AdminSvnConfigView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='admin_settings_vcs_svn_generate_cfg', - request_method='POST', renderer='json') def vcs_svn_generate_config(self): _ = self.request.translate try: diff --git a/rhodecode/apps/admin/views/system_info.py b/rhodecode/apps/admin/views/system_info.py --- a/rhodecode/apps/admin/views/system_info.py +++ b/rhodecode/apps/admin/views/system_info.py @@ -21,7 +21,7 @@ import logging import urllib2 -from pyramid.view import view_config + import rhodecode from rhodecode.apps._base import BaseAppView @@ -42,9 +42,6 @@ class AdminSystemInfoSettingsView(BaseAp @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_system', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings.mako') def settings_system_info(self): _ = self.request.translate c = self.load_default_context() @@ -169,9 +166,6 @@ class AdminSystemInfoSettingsView(BaseAp @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='admin_settings_system_update', request_method='GET', - renderer='rhodecode:templates/admin/settings/settings_system_update.mako') def settings_system_info_check_update(self): _ = self.request.translate c = self.load_default_context() diff --git a/rhodecode/apps/admin/views/user_groups.py b/rhodecode/apps/admin/views/user_groups.py --- a/rhodecode/apps/admin/views/user_groups.py +++ b/rhodecode/apps/admin/views/user_groups.py @@ -24,7 +24,7 @@ import formencode import formencode.htmlfill from pyramid.httpexceptions import HTTPFound -from pyramid.view import view_config + from pyramid.response import Response from pyramid.renderers import render @@ -51,19 +51,14 @@ class AdminUserGroupsView(BaseAppView, D def load_default_context(self): c = self._get_local_tmpl_context() - PermissionModel().set_global_permission_choices( c, gettext_translator=self.request.translate) - return c # permission check in data loading of # `user_groups_list_data` via UserGroupList @LoginRequired() @NotAnonymous() - @view_config( - route_name='user_groups', request_method='GET', - renderer='rhodecode:templates/admin/user_groups/user_groups.mako') def user_groups_list(self): c = self.load_default_context() return self._get_template_context(c) @@ -71,9 +66,6 @@ class AdminUserGroupsView(BaseAppView, D # permission check inside @LoginRequired() @NotAnonymous() - @view_config( - route_name='user_groups_data', request_method='GET', - renderer='json_ext', xhr=True) def user_groups_list_data(self): self.load_default_context() column_map = { @@ -197,9 +189,6 @@ class AdminUserGroupsView(BaseAppView, D @LoginRequired() @HasPermissionAnyDecorator('hg.admin', 'hg.usergroup.create.true') - @view_config( - route_name='user_groups_new', request_method='GET', - renderer='rhodecode:templates/admin/user_groups/user_group_add.mako') def user_groups_new(self): c = self.load_default_context() return self._get_template_context(c) @@ -207,9 +196,6 @@ class AdminUserGroupsView(BaseAppView, D @LoginRequired() @HasPermissionAnyDecorator('hg.admin', 'hg.usergroup.create.true') @CSRFRequired() - @view_config( - route_name='user_groups_create', request_method='POST', - renderer='rhodecode:templates/admin/user_groups/user_group_add.mako') def user_groups_create(self): _ = self.request.translate c = self.load_default_context() diff --git a/rhodecode/apps/admin/views/users.py b/rhodecode/apps/admin/views/users.py --- a/rhodecode/apps/admin/views/users.py +++ b/rhodecode/apps/admin/views/users.py @@ -24,7 +24,6 @@ import formencode import formencode.htmlfill from pyramid.httpexceptions import HTTPFound -from pyramid.view import view_config from pyramid.renderers import render from pyramid.response import Response @@ -72,19 +71,12 @@ class AdminUsersView(BaseAppView, DataGr @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='users', request_method='GET', - renderer='rhodecode:templates/admin/users/users.mako') def users_list(self): c = self.load_default_context() return self._get_template_context(c) @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - # renderer defined below - route_name='users_data', request_method='GET', - renderer='json_ext', xhr=True) def users_list_data(self): self.load_default_context() column_map = { @@ -183,9 +175,6 @@ class AdminUsersView(BaseAppView, DataGr @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='users_new', request_method='GET', - renderer='rhodecode:templates/admin/users/user_add.mako') def users_new(self): _ = self.request.translate c = self.load_default_context() @@ -196,9 +185,6 @@ class AdminUsersView(BaseAppView, DataGr @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='users_create', request_method='POST', - renderer='rhodecode:templates/admin/users/user_add.mako') def users_create(self): _ = self.request.translate c = self.load_default_context() @@ -309,9 +295,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='user_update', request_method='POST', - renderer='rhodecode:templates/admin/users/user_edit.mako') def user_update(self): _ = self.request.translate c = self.load_default_context() @@ -371,9 +354,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='user_delete', request_method='POST', - renderer='rhodecode:templates/admin/users/user_edit.mako') def user_delete(self): _ = self.request.translate c = self.load_default_context() @@ -496,9 +476,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='user_edit', request_method='GET', - renderer='rhodecode:templates/admin/users/user_edit.mako') def user_edit(self): _ = self.request.translate c = self.load_default_context() @@ -525,9 +502,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='user_edit_advanced', request_method='GET', - renderer='rhodecode:templates/admin/users/user_edit.mako') def user_edit_advanced(self): _ = self.request.translate c = self.load_default_context() @@ -584,9 +558,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='user_edit_global_perms', request_method='GET', - renderer='rhodecode:templates/admin/users/user_edit.mako') def user_edit_global_perms(self): _ = self.request.translate c = self.load_default_context() @@ -614,9 +585,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='user_edit_global_perms_update', request_method='POST', - renderer='rhodecode:templates/admin/users/user_edit.mako') def user_edit_global_perms_update(self): _ = self.request.translate c = self.load_default_context() @@ -682,9 +650,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='user_enable_force_password_reset', request_method='POST', - renderer='rhodecode:templates/admin/users/user_edit.mako') def user_enable_force_password_reset(self): _ = self.request.translate c = self.load_default_context() @@ -711,9 +676,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='user_disable_force_password_reset', request_method='POST', - renderer='rhodecode:templates/admin/users/user_edit.mako') def user_disable_force_password_reset(self): _ = self.request.translate c = self.load_default_context() @@ -741,9 +703,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='user_notice_dismiss', request_method='POST', - renderer='json_ext', xhr=True) def user_notice_dismiss(self): _ = self.request.translate c = self.load_default_context() @@ -767,9 +726,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='user_create_personal_repo_group', request_method='POST', - renderer='rhodecode:templates/admin/users/user_edit.mako') def user_create_personal_repo_group(self): """ Create personal repository group for this user @@ -821,9 +777,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='edit_user_auth_tokens', request_method='GET', - renderer='rhodecode:templates/admin/users/user_edit.mako') def auth_tokens(self): _ = self.request.translate c = self.load_default_context() @@ -843,9 +796,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='edit_user_auth_tokens_view', request_method='POST', - renderer='json_ext', xhr=True) def auth_tokens_view(self): _ = self.request.translate c = self.load_default_context() @@ -867,8 +817,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='edit_user_auth_tokens_add', request_method='POST') def auth_tokens_add(self): _ = self.request.translate c = self.load_default_context() @@ -899,8 +847,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='edit_user_auth_tokens_delete', request_method='POST') def auth_tokens_delete(self): _ = self.request.translate c = self.load_default_context() @@ -928,9 +874,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='edit_user_ssh_keys', request_method='GET', - renderer='rhodecode:templates/admin/users/user_edit.mako') def ssh_keys(self): _ = self.request.translate c = self.load_default_context() @@ -943,9 +886,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='edit_user_ssh_keys_generate_keypair', request_method='GET', - renderer='rhodecode:templates/admin/users/user_edit.mako') def ssh_keys_generate_keypair(self): _ = self.request.translate c = self.load_default_context() @@ -964,8 +904,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='edit_user_ssh_keys_add', request_method='POST') def ssh_keys_add(self): _ = self.request.translate c = self.load_default_context() @@ -1017,8 +955,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='edit_user_ssh_keys_delete', request_method='POST') def ssh_keys_delete(self): _ = self.request.translate c = self.load_default_context() @@ -1048,9 +984,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='edit_user_emails', request_method='GET', - renderer='rhodecode:templates/admin/users/user_edit.mako') def emails(self): _ = self.request.translate c = self.load_default_context() @@ -1065,8 +998,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='edit_user_emails_add', request_method='POST') def emails_add(self): _ = self.request.translate c = self.load_default_context() @@ -1105,8 +1036,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='edit_user_emails_delete', request_method='POST') def emails_delete(self): _ = self.request.translate c = self.load_default_context() @@ -1131,9 +1060,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='edit_user_ips', request_method='GET', - renderer='rhodecode:templates/admin/users/user_edit.mako') def ips(self): _ = self.request.translate c = self.load_default_context() @@ -1152,8 +1078,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='edit_user_ips_add', request_method='POST') # NOTE(marcink): this view is allowed for default users, as we can # edit their IP white list def ips_add(self): @@ -1207,8 +1131,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='edit_user_ips_delete', request_method='POST') # NOTE(marcink): this view is allowed for default users, as we can # edit their IP white list def ips_delete(self): @@ -1236,9 +1158,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='edit_user_groups_management', request_method='GET', - renderer='rhodecode:templates/admin/users/user_edit.mako') def groups_management(self): c = self.load_default_context() c.user = self.db_user @@ -1254,8 +1173,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='edit_user_groups_management_updates', request_method='POST') def groups_management_updates(self): _ = self.request.translate c = self.load_default_context() @@ -1299,9 +1216,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='edit_user_audit_logs', request_method='GET', - renderer='rhodecode:templates/admin/users/user_edit.mako') def user_audit_logs(self): _ = self.request.translate c = self.load_default_context() @@ -1329,9 +1243,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='edit_user_audit_logs_download', request_method='GET', - renderer='string') def user_audit_logs_download(self): _ = self.request.translate c = self.load_default_context() @@ -1352,9 +1263,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='edit_user_perms_summary', request_method='GET', - renderer='rhodecode:templates/admin/users/user_edit.mako') def user_perms_summary(self): _ = self.request.translate c = self.load_default_context() @@ -1367,9 +1275,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='edit_user_perms_summary_json', request_method='GET', - renderer='json_ext') def user_perms_summary_json(self): self.load_default_context() perm_user = self.db_user.AuthUser(ip_addr=self.request.remote_addr) @@ -1378,9 +1283,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') - @view_config( - route_name='edit_user_caches', request_method='GET', - renderer='rhodecode:templates/admin/users/user_edit.mako') def user_caches(self): _ = self.request.translate c = self.load_default_context() @@ -1399,8 +1301,6 @@ class UsersView(UserAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') @CSRFRequired() - @view_config( - route_name='edit_user_caches_update', request_method='POST') def user_caches_update(self): _ = self.request.translate c = self.load_default_context() diff --git a/rhodecode/apps/channelstream/__init__.py b/rhodecode/apps/channelstream/__init__.py --- a/rhodecode/apps/channelstream/__init__.py +++ b/rhodecode/apps/channelstream/__init__.py @@ -67,6 +67,8 @@ def maybe_create_history_store(event): def includeme(config): + from rhodecode.apps.channelstream.views import ChannelstreamView + settings = config.registry.settings PLUGIN_DEFINITION['config']['enabled'] = asbool( settings.get('channelstream.enabled')) @@ -85,12 +87,20 @@ def includeme(config): config.add_route( name='channelstream_connect', pattern=ADMIN_PREFIX + '/channelstream/connect') + config.add_view( + ChannelstreamView, + attr='channelstream_connect', + route_name='channelstream_connect', renderer='json_ext') + config.add_route( name='channelstream_subscribe', pattern=ADMIN_PREFIX + '/channelstream/subscribe') + config.add_view( + ChannelstreamView, + attr='channelstream_subscribe', + route_name='channelstream_subscribe', renderer='json_ext') + config.add_route( name='channelstream_proxy', pattern=settings.get('channelstream.proxy_path') or '/_channelstream') - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') diff --git a/rhodecode/apps/channelstream/views.py b/rhodecode/apps/channelstream/views.py --- a/rhodecode/apps/channelstream/views.py +++ b/rhodecode/apps/channelstream/views.py @@ -21,7 +21,7 @@ import logging import uuid -from pyramid.view import view_config + from pyramid.httpexceptions import HTTPBadRequest, HTTPForbidden, HTTPBadGateway from rhodecode.apps._base import BaseAppView @@ -54,8 +54,7 @@ class ChannelstreamView(BaseAppView): return c @NotAnonymous() - @view_config(route_name='channelstream_connect', renderer='json_ext') - def connect(self): + def channelstream_connect(self): """ handle authorization of users trying to connect """ self.load_default_context() @@ -132,8 +131,7 @@ class ChannelstreamView(BaseAppView): return connect_result @NotAnonymous() - @view_config(route_name='channelstream_subscribe', renderer='json_ext') - def subscribe(self): + def channelstream_subscribe(self): """ can be used to subscribe specific connection to other channels """ self.load_default_context() try: diff --git a/rhodecode/apps/debug_style/__init__.py b/rhodecode/apps/debug_style/__init__.py --- a/rhodecode/apps/debug_style/__init__.py +++ b/rhodecode/apps/debug_style/__init__.py @@ -35,6 +35,8 @@ class DebugStylePredicate(object): def includeme(config): + from rhodecode.apps.debug_style.views import DebugStyleView + config.add_route_predicate( 'debug_style', DebugStylePredicate) @@ -42,18 +44,38 @@ def includeme(config): name='debug_style_home', pattern=ADMIN_PREFIX + '/debug_style', debug_style=True) + config.add_view( + DebugStyleView, + attr='index', + route_name='debug_style_home', request_method='GET', + renderer=None) + config.add_route( name='debug_style_email', pattern=ADMIN_PREFIX + '/debug_style/email/{email_id}', debug_style=True) + config.add_view( + DebugStyleView, + attr='render_email', + route_name='debug_style_email', request_method='GET', + renderer=None) + config.add_route( name='debug_style_email_plain_rendered', pattern=ADMIN_PREFIX + '/debug_style/email-rendered/{email_id}', debug_style=True) + config.add_view( + DebugStyleView, + attr='render_email', + route_name='debug_style_email_plain_rendered', request_method='GET', + renderer=None) + config.add_route( name='debug_style_template', pattern=ADMIN_PREFIX + '/debug_style/t/{t_path}', debug_style=True) - - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') + config.add_view( + DebugStyleView, + attr='template', + route_name='debug_style_template', request_method='GET', + renderer=None) diff --git a/rhodecode/apps/debug_style/views.py b/rhodecode/apps/debug_style/views.py --- a/rhodecode/apps/debug_style/views.py +++ b/rhodecode/apps/debug_style/views.py @@ -22,7 +22,6 @@ import os import logging import datetime -from pyramid.view import view_config from pyramid.renderers import render_to_response from rhodecode.apps._base import BaseAppView from rhodecode.lib.celerylib import run_task, tasks @@ -37,12 +36,8 @@ class DebugStyleView(BaseAppView): def load_default_context(self): c = self._get_local_tmpl_context() - return c - @view_config( - route_name='debug_style_home', request_method='GET', - renderer=None) def index(self): c = self.load_default_context() c.active = 'index' @@ -51,12 +46,6 @@ class DebugStyleView(BaseAppView): 'debug_style/index.html', self._get_template_context(c), request=self.request) - @view_config( - route_name='debug_style_email', request_method='GET', - renderer=None) - @view_config( - route_name='debug_style_email_plain_rendered', request_method='GET', - renderer=None) def render_email(self): c = self.load_default_context() email_id = self.request.matchdict['email_id'] @@ -457,9 +446,6 @@ users: description edit fixes template, self._get_template_context(c), request=self.request) - @view_config( - route_name='debug_style_template', request_method='GET', - renderer=None) def template(self): t_path = self.request.matchdict['t_path'] c = self.load_default_context() @@ -483,4 +469,3 @@ users: description edit fixes return render_to_response( 'debug_style/' + t_path, self._get_template_context(c), request=self.request) - diff --git a/rhodecode/apps/file_store/__init__.py b/rhodecode/apps/file_store/__init__.py --- a/rhodecode/apps/file_store/__init__.py +++ b/rhodecode/apps/file_store/__init__.py @@ -35,18 +35,31 @@ def _sanitize_settings_and_apply_default def includeme(config): + from rhodecode.apps.file_store.views import FileStoreView + settings = config.registry.settings _sanitize_settings_and_apply_defaults(settings) config.add_route( name='upload_file', pattern='/_file_store/upload') + config.add_view( + FileStoreView, + attr='upload_file', + route_name='upload_file', request_method='POST', renderer='json_ext') + config.add_route( name='download_file', pattern='/_file_store/download/{fid:.*}') + config.add_view( + FileStoreView, + attr='download_file', + route_name='download_file') + config.add_route( name='download_file_by_token', pattern='/_file_store/token-download/{_auth_token}/{fid:.*}') - - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') + config.add_view( + FileStoreView, + attr='download_file_by_token', + route_name='download_file_by_token') diff --git a/rhodecode/apps/file_store/backends/local_store.py b/rhodecode/apps/file_store/backends/local_store.py --- a/rhodecode/apps/file_store/backends/local_store.py +++ b/rhodecode/apps/file_store/backends/local_store.py @@ -21,7 +21,6 @@ import os import time import errno -import shutil import hashlib from rhodecode.lib.ext_json import json @@ -212,10 +211,19 @@ class LocalFileStorage(object): filename, path = self.resolve_name(uid_filename, dest_directory) stored_file_dir = os.path.dirname(path) - file_obj.seek(0) + no_body_seek = kwargs.pop('no_body_seek', False) + if no_body_seek: + pass + else: + file_obj.seek(0) with open(path, "wb") as dest: - shutil.copyfileobj(file_obj, dest) + length = 256 * 1024 + while 1: + buf = file_obj.read(length) + if not buf: + break + dest.write(buf) metadata = {} if extra_metadata: diff --git a/rhodecode/apps/file_store/views.py b/rhodecode/apps/file_store/views.py --- a/rhodecode/apps/file_store/views.py +++ b/rhodecode/apps/file_store/views.py @@ -19,7 +19,7 @@ # and proprietary license terms, please see https://rhodecode.com/licenses/ import logging -from pyramid.view import view_config + from pyramid.response import FileResponse from pyramid.httpexceptions import HTTPFound, HTTPNotFound @@ -57,7 +57,6 @@ class FileStoreView(BaseAppView): return _content_type, _encoding def _serve_file(self, file_uid): - if not self.storage.exists(file_uid): store_path = self.storage.store_path(file_uid) log.debug('File with FID:%s not found in the store under `%s`', @@ -112,13 +111,23 @@ class FileStoreView(BaseAppView): # For file store we don't submit any session data, this logic tells the # Session lib to skip it setattr(self.request, '_file_response', True) - return FileResponse(file_path, request=self.request, - content_type=content_type, content_encoding=content_encoding) + response = FileResponse( + file_path, request=self.request, + content_type=content_type, content_encoding=content_encoding) + + file_name = db_obj.file_display_name + + response.headers["Content-Disposition"] = ( + 'attachment; filename="{}"'.format(str(file_name)) + ) + response.headers["X-RC-Artifact-Id"] = str(db_obj.file_store_id) + response.headers["X-RC-Artifact-Desc"] = str(db_obj.file_description) + response.headers["X-RC-Artifact-Sha256"] = str(db_obj.file_hash) + return response @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config(route_name='upload_file', request_method='POST', renderer='json_ext') def upload_file(self): self.load_default_context() file_obj = self.request.POST.get(self.upload_key) @@ -172,7 +181,6 @@ class FileStoreView(BaseAppView): 'access_path': h.route_path('download_file', fid=store_uid)} # ACL is checked by scopes, if no scope the file is accessible to all - @view_config(route_name='download_file') def download_file(self): self.load_default_context() file_uid = self.request.matchdict['fid'] @@ -182,7 +190,6 @@ class FileStoreView(BaseAppView): # in addition to @LoginRequired ACL is checked by scopes @LoginRequired(auth_token_access=[UserApiKeys.ROLE_ARTIFACT_DOWNLOAD]) @NotAnonymous() - @view_config(route_name='download_file_by_token') def download_file_by_token(self): """ Special view that allows to access the download file by special URL that diff --git a/rhodecode/apps/gist/__init__.py b/rhodecode/apps/gist/__init__.py --- a/rhodecode/apps/gist/__init__.py +++ b/rhodecode/apps/gist/__init__.py @@ -21,42 +21,100 @@ from rhodecode.apps._base import ADMIN_P def admin_routes(config): + from rhodecode.apps.gist.views import GistView + config.add_route( name='gists_show', pattern='/gists') + config.add_view( + GistView, + attr='gist_show_all', + route_name='gists_show', request_method='GET', + renderer='rhodecode:templates/admin/gists/gist_index.mako') + config.add_route( name='gists_new', pattern='/gists/new') + config.add_view( + GistView, + attr='gist_new', + route_name='gists_new', request_method='GET', + renderer='rhodecode:templates/admin/gists/gist_new.mako') + config.add_route( name='gists_create', pattern='/gists/create') + config.add_view( + GistView, + attr='gist_create', + route_name='gists_create', request_method='POST', + renderer='rhodecode:templates/admin/gists/gist_new.mako') config.add_route( name='gist_show', pattern='/gists/{gist_id}') + config.add_view( + GistView, + attr='gist_show', + route_name='gist_show', request_method='GET', + renderer='rhodecode:templates/admin/gists/gist_show.mako') + + config.add_route( + name='gist_show_rev', + pattern='/gists/{gist_id}/rev/{revision}') + + config.add_view( + GistView, + attr='gist_show', + route_name='gist_show_rev', request_method='GET', + renderer='rhodecode:templates/admin/gists/gist_show.mako') + + config.add_route( + name='gist_show_formatted', + pattern='/gists/{gist_id}/rev/{revision}/{format}') + config.add_view( + GistView, + attr='gist_show', + route_name='gist_show_formatted', request_method='GET', + renderer=None) + + config.add_route( + name='gist_show_formatted_path', + pattern='/gists/{gist_id}/rev/{revision}/{format}/{f_path:.*}') + config.add_view( + GistView, + attr='gist_show', + route_name='gist_show_formatted_path', request_method='GET', + renderer=None) config.add_route( name='gist_delete', pattern='/gists/{gist_id}/delete') + config.add_view( + GistView, + attr='gist_delete', + route_name='gist_delete', request_method='POST') config.add_route( name='gist_edit', pattern='/gists/{gist_id}/edit') + config.add_view( + GistView, + attr='gist_edit', + route_name='gist_edit', request_method='GET', + renderer='rhodecode:templates/admin/gists/gist_edit.mako') + + config.add_route( + name='gist_update', pattern='/gists/{gist_id}/update') + config.add_view( + GistView, + attr='gist_update', + route_name='gist_update', request_method='POST', + renderer='rhodecode:templates/admin/gists/gist_edit.mako') config.add_route( name='gist_edit_check_revision', pattern='/gists/{gist_id}/edit/check_revision') - - config.add_route( - name='gist_update', pattern='/gists/{gist_id}/update') - - config.add_route( - name='gist_show_rev', - pattern='/gists/{gist_id}/{revision}') - config.add_route( - name='gist_show_formatted', - pattern='/gists/{gist_id}/{revision}/{format}') - - config.add_route( - name='gist_show_formatted_path', - pattern='/gists/{gist_id}/{revision}/{format}/{f_path:.*}') + config.add_view( + GistView, + attr='gist_edit_check_revision', + route_name='gist_edit_check_revision', request_method='GET', + renderer='json_ext') def includeme(config): config.include(admin_routes, route_prefix=ADMIN_PREFIX) - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') diff --git a/rhodecode/apps/gist/tests/test_admin_gists.py b/rhodecode/apps/gist/tests/test_admin_gists.py --- a/rhodecode/apps/gist/tests/test_admin_gists.py +++ b/rhodecode/apps/gist/tests/test_admin_gists.py @@ -43,9 +43,9 @@ def route_path(name, params=None, **kwar 'gist_edit': ADMIN_PREFIX + '/gists/{gist_id}/edit', 'gist_edit_check_revision': ADMIN_PREFIX + '/gists/{gist_id}/edit/check_revision', 'gist_update': ADMIN_PREFIX + '/gists/{gist_id}/update', - 'gist_show_rev': ADMIN_PREFIX + '/gists/{gist_id}/{revision}', - 'gist_show_formatted': ADMIN_PREFIX + '/gists/{gist_id}/{revision}/{format}', - 'gist_show_formatted_path': ADMIN_PREFIX + '/gists/{gist_id}/{revision}/{format}/{f_path}', + 'gist_show_rev': ADMIN_PREFIX + '/gists/{gist_id}/rev/{revision}', + 'gist_show_formatted': ADMIN_PREFIX + '/gists/{gist_id}/rev/{revision}/{format}', + 'gist_show_formatted_path': ADMIN_PREFIX + '/gists/{gist_id}/rev/{revision}/{format}/{f_path}', }[name].format(**kwargs) diff --git a/rhodecode/apps/gist/views.py b/rhodecode/apps/gist/views.py --- a/rhodecode/apps/gist/views.py +++ b/rhodecode/apps/gist/views.py @@ -26,7 +26,6 @@ import formencode.htmlfill import peppercorn from pyramid.httpexceptions import HTTPNotFound, HTTPFound, HTTPBadRequest -from pyramid.view import view_config from pyramid.renderers import render from pyramid.response import Response @@ -70,9 +69,6 @@ class GistView(BaseAppView): return c @LoginRequired() - @view_config( - route_name='gists_show', request_method='GET', - renderer='rhodecode:templates/admin/gists/gist_index.mako') def gist_show_all(self): c = self.load_default_context() @@ -134,9 +130,6 @@ class GistView(BaseAppView): @LoginRequired() @NotAnonymous() - @view_config( - route_name='gists_new', request_method='GET', - renderer='rhodecode:templates/admin/gists/gist_new.mako') def gist_new(self): c = self.load_default_context() return self._get_template_context(c) @@ -144,9 +137,6 @@ class GistView(BaseAppView): @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='gists_create', request_method='POST', - renderer='rhodecode:templates/admin/gists/gist_new.mako') def gist_create(self): _ = self.request.translate c = self.load_default_context() @@ -222,8 +212,6 @@ class GistView(BaseAppView): @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='gist_delete', request_method='POST') def gist_delete(self): _ = self.request.translate gist_id = self.request.matchdict['gist_id'] @@ -263,18 +251,6 @@ class GistView(BaseAppView): return gist @LoginRequired() - @view_config( - route_name='gist_show', request_method='GET', - renderer='rhodecode:templates/admin/gists/gist_show.mako') - @view_config( - route_name='gist_show_rev', request_method='GET', - renderer='rhodecode:templates/admin/gists/gist_show.mako') - @view_config( - route_name='gist_show_formatted', request_method='GET', - renderer=None) - @view_config( - route_name='gist_show_formatted_path', request_method='GET', - renderer=None) def gist_show(self): gist_id = self.request.matchdict['gist_id'] @@ -307,9 +283,6 @@ class GistView(BaseAppView): @LoginRequired() @NotAnonymous() - @view_config( - route_name='gist_edit', request_method='GET', - renderer='rhodecode:templates/admin/gists/gist_edit.mako') def gist_edit(self): _ = self.request.translate gist_id = self.request.matchdict['gist_id'] @@ -341,9 +314,6 @@ class GistView(BaseAppView): @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='gist_update', request_method='POST', - renderer='rhodecode:templates/admin/gists/gist_edit.mako') def gist_update(self): _ = self.request.translate gist_id = self.request.matchdict['gist_id'] @@ -397,9 +367,6 @@ class GistView(BaseAppView): @LoginRequired() @NotAnonymous() - @view_config( - route_name='gist_edit_check_revision', request_method='GET', - renderer='json_ext') def gist_edit_check_revision(self): _ = self.request.translate gist_id = self.request.matchdict['gist_id'] diff --git a/rhodecode/apps/home/__init__.py b/rhodecode/apps/home/__init__.py --- a/rhodecode/apps/home/__init__.py +++ b/rhodecode/apps/home/__init__.py @@ -38,56 +38,110 @@ class VCSCallPredicate(object): def includeme(config): + from rhodecode.apps.home.views import HomeView + + config.add_route_predicate( + 'skip_vcs_call', VCSCallPredicate) config.add_route( name='home', pattern='/') + config.add_view( + HomeView, + attr='main_page', + route_name='home', request_method='GET', + renderer='rhodecode:templates/index.mako') config.add_route( name='main_page_repos_data', pattern='/_home_repos') + config.add_view( + HomeView, + attr='main_page_repos_data', + route_name='main_page_repos_data', + request_method='GET', renderer='json_ext', xhr=True) config.add_route( name='main_page_repo_groups_data', pattern='/_home_repo_groups') + config.add_view( + HomeView, + attr='main_page_repo_groups_data', + route_name='main_page_repo_groups_data', + request_method='GET', renderer='json_ext', xhr=True) config.add_route( name='user_autocomplete_data', pattern='/_users') + config.add_view( + HomeView, + attr='user_autocomplete_data', + route_name='user_autocomplete_data', request_method='GET', + renderer='json_ext', xhr=True) config.add_route( name='user_group_autocomplete_data', pattern='/_user_groups') + config.add_view( + HomeView, + attr='user_group_autocomplete_data', + route_name='user_group_autocomplete_data', request_method='GET', + renderer='json_ext', xhr=True) config.add_route( name='repo_list_data', pattern='/_repos') + config.add_view( + HomeView, + attr='repo_list_data', + route_name='repo_list_data', request_method='GET', + renderer='json_ext', xhr=True) config.add_route( name='repo_group_list_data', pattern='/_repo_groups') + config.add_view( + HomeView, + attr='repo_group_list_data', + route_name='repo_group_list_data', request_method='GET', + renderer='json_ext', xhr=True) config.add_route( name='goto_switcher_data', pattern='/_goto_data') + config.add_view( + HomeView, + attr='goto_switcher_data', + route_name='goto_switcher_data', request_method='GET', + renderer='json_ext', xhr=True) config.add_route( name='markup_preview', pattern='/_markup_preview') + config.add_view( + HomeView, + attr='markup_preview', + route_name='markup_preview', request_method='POST', + renderer='string', xhr=True) config.add_route( name='file_preview', pattern='/_file_preview') + config.add_view( + HomeView, + attr='file_preview', + route_name='file_preview', request_method='POST', + renderer='string', xhr=True) config.add_route( name='store_user_session_value', pattern='/_store_session_attr') + config.add_view( + HomeView, + attr='store_user_session_attr', + route_name='store_user_session_value', request_method='POST', + renderer='string', xhr=True) # register our static links via redirection mechanism routing_links.connect_redirection_links(config) - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') - - config.add_route_predicate( - 'skip_vcs_call', VCSCallPredicate) diff --git a/rhodecode/apps/home/views.py b/rhodecode/apps/home/views.py --- a/rhodecode/apps/home/views.py +++ b/rhodecode/apps/home/views.py @@ -23,7 +23,6 @@ import logging import collections from pyramid.httpexceptions import HTTPNotFound -from pyramid.view import view_config from rhodecode.apps._base import BaseAppView, DataGridAppView from rhodecode.lib import helpers as h @@ -50,13 +49,9 @@ class HomeView(BaseAppView, DataGridAppV def load_default_context(self): c = self._get_local_tmpl_context() c.user = c.auth_user.get_instance() - return c @LoginRequired() - @view_config( - route_name='user_autocomplete_data', request_method='GET', - renderer='json_ext', xhr=True) def user_autocomplete_data(self): self.load_default_context() query = self.request.GET.get('query') @@ -88,9 +83,6 @@ class HomeView(BaseAppView, DataGridAppV @LoginRequired() @NotAnonymous() - @view_config( - route_name='user_group_autocomplete_data', request_method='GET', - renderer='json_ext', xhr=True) def user_group_autocomplete_data(self): self.load_default_context() query = self.request.GET.get('query') @@ -434,9 +426,6 @@ class HomeView(BaseAppView, DataGridAppV return files, True @LoginRequired() - @view_config( - route_name='repo_list_data', request_method='GET', - renderer='json_ext', xhr=True) def repo_list_data(self): _ = self.request.translate self.load_default_context() @@ -461,9 +450,6 @@ class HomeView(BaseAppView, DataGridAppV return data @LoginRequired() - @view_config( - route_name='repo_group_list_data', request_method='GET', - renderer='json_ext', xhr=True) def repo_group_list_data(self): _ = self.request.translate self.load_default_context() @@ -619,9 +605,6 @@ class HomeView(BaseAppView, DataGridAppV return queries @LoginRequired() - @view_config( - route_name='goto_switcher_data', request_method='GET', - renderer='json_ext', xhr=True) def goto_switcher_data(self): c = self.load_default_context() @@ -750,9 +733,6 @@ class HomeView(BaseAppView, DataGridAppV return {'suggestions': res} @LoginRequired() - @view_config( - route_name='home', request_method='GET', - renderer='rhodecode:templates/index.mako') def main_page(self): c = self.load_default_context() c.repo_group = None @@ -789,9 +769,6 @@ class HomeView(BaseAppView, DataGridAppV self._rhodecode_user, repo_group_id) @LoginRequired() - @view_config( - route_name='main_page_repo_groups_data', - request_method='GET', renderer='json_ext', xhr=True) def main_page_repo_groups_data(self): self.load_default_context() repo_group_id = safe_int(self.request.GET.get('repo_group_id')) @@ -806,9 +783,6 @@ class HomeView(BaseAppView, DataGridAppV return self._main_page_repo_groups_data(repo_group_id) @LoginRequired() - @view_config( - route_name='main_page_repos_data', - request_method='GET', renderer='json_ext', xhr=True) def main_page_repos_data(self): self.load_default_context() repo_group_id = safe_int(self.request.GET.get('repo_group_id')) @@ -824,12 +798,6 @@ class HomeView(BaseAppView, DataGridAppV @LoginRequired() @HasRepoGroupPermissionAnyDecorator(*AuthUser.repo_group_read_perms) - @view_config( - route_name='repo_group_home', request_method='GET', - renderer='rhodecode:templates/index_repo_group.mako') - @view_config( - route_name='repo_group_home_slash', request_method='GET', - renderer='rhodecode:templates/index_repo_group.mako') def repo_group_main_page(self): c = self.load_default_context() c.repo_group = self.request.db_repo_group @@ -837,9 +805,6 @@ class HomeView(BaseAppView, DataGridAppV @LoginRequired() @CSRFRequired() - @view_config( - route_name='markup_preview', request_method='POST', - renderer='string', xhr=True) def markup_preview(self): # Technically a CSRF token is not needed as no state changes with this # call. However, as this is a POST is better to have it, so automated @@ -855,9 +820,6 @@ class HomeView(BaseAppView, DataGridAppV @LoginRequired() @CSRFRequired() - @view_config( - route_name='file_preview', request_method='POST', - renderer='string', xhr=True) def file_preview(self): # Technically a CSRF token is not needed as no state changes with this # call. However, as this is a POST is better to have it, so automated @@ -883,9 +845,6 @@ class HomeView(BaseAppView, DataGridAppV @LoginRequired() @CSRFRequired() - @view_config( - route_name='store_user_session_value', request_method='POST', - renderer='string', xhr=True) def store_user_session_attr(self): key = self.request.POST.get('key') val = self.request.POST.get('val') diff --git a/rhodecode/apps/hovercards/__init__.py b/rhodecode/apps/hovercards/__init__.py --- a/rhodecode/apps/hovercards/__init__.py +++ b/rhodecode/apps/hovercards/__init__.py @@ -20,26 +20,48 @@ def includeme(config): - + from rhodecode.apps.hovercards.views import HoverCardsView, HoverCardsRepoView config.add_route( name='hovercard_user', pattern='/_hovercard/user/{user_id}') + config.add_view( + HoverCardsView, + attr='hovercard_user', + route_name='hovercard_user', request_method='GET', xhr=True, + renderer='rhodecode:templates/hovercards/hovercard_user.mako') config.add_route( name='hovercard_username', pattern='/_hovercard/username/{username}') + config.add_view( + HoverCardsView, + attr='hovercard_username', + route_name='hovercard_username', request_method='GET', xhr=True, + renderer='rhodecode:templates/hovercards/hovercard_user.mako') config.add_route( name='hovercard_user_group', pattern='/_hovercard/user_group/{user_group_id}') + config.add_view( + HoverCardsView, + attr='hovercard_user_group', + route_name='hovercard_user_group', request_method='GET', xhr=True, + renderer='rhodecode:templates/hovercards/hovercard_user_group.mako') config.add_route( name='hovercard_pull_request', pattern='/_hovercard/pull_request/{pull_request_id}') + config.add_view( + HoverCardsView, + attr='hovercard_pull_request', + route_name='hovercard_pull_request', request_method='GET', xhr=True, + renderer='rhodecode:templates/hovercards/hovercard_pull_request.mako') config.add_route( name='hovercard_repo_commit', pattern='/_hovercard/commit/{repo_name:.*?[^/]}/{commit_id}', repo_route=True) - - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') + config.add_view( + HoverCardsRepoView, + attr='hovercard_repo_commit', + route_name='hovercard_repo_commit', request_method='GET', xhr=True, + renderer='rhodecode:templates/hovercards/hovercard_repo_commit.mako') diff --git a/rhodecode/apps/hovercards/views.py b/rhodecode/apps/hovercards/views.py --- a/rhodecode/apps/hovercards/views.py +++ b/rhodecode/apps/hovercards/views.py @@ -23,7 +23,7 @@ import logging import collections from pyramid.httpexceptions import HTTPNotFound -from pyramid.view import view_config + from rhodecode.apps._base import BaseAppView, RepoAppView from rhodecode.lib import helpers as h @@ -54,9 +54,6 @@ class HoverCardsView(BaseAppView): return c @LoginRequired() - @view_config( - route_name='hovercard_user', request_method='GET', xhr=True, - renderer='rhodecode:templates/hovercards/hovercard_user.mako') def hovercard_user(self): c = self.load_default_context() user_id = self.request.matchdict['user_id'] @@ -64,9 +61,6 @@ class HoverCardsView(BaseAppView): return self._get_template_context(c) @LoginRequired() - @view_config( - route_name='hovercard_username', request_method='GET', xhr=True, - renderer='rhodecode:templates/hovercards/hovercard_user.mako') def hovercard_username(self): c = self.load_default_context() username = self.request.matchdict['username'] @@ -77,9 +71,6 @@ class HoverCardsView(BaseAppView): return self._get_template_context(c) @LoginRequired() - @view_config( - route_name='hovercard_user_group', request_method='GET', xhr=True, - renderer='rhodecode:templates/hovercards/hovercard_user_group.mako') def hovercard_user_group(self): c = self.load_default_context() user_group_id = self.request.matchdict['user_group_id'] @@ -87,9 +78,6 @@ class HoverCardsView(BaseAppView): return self._get_template_context(c) @LoginRequired() - @view_config( - route_name='hovercard_pull_request', request_method='GET', xhr=True, - renderer='rhodecode:templates/hovercards/hovercard_pull_request.mako') def hovercard_pull_request(self): c = self.load_default_context() c.pull_request = PullRequest.get_or_404( @@ -107,9 +95,6 @@ class HoverCardsRepoView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='hovercard_repo_commit', request_method='GET', xhr=True, - renderer='rhodecode:templates/hovercards/hovercard_repo_commit.mako') def hovercard_repo_commit(self): c = self.load_default_context() commit_id = self.request.matchdict['commit_id'] diff --git a/rhodecode/apps/journal/__init__.py b/rhodecode/apps/journal/__init__.py --- a/rhodecode/apps/journal/__init__.py +++ b/rhodecode/apps/journal/__init__.py @@ -23,31 +23,80 @@ from rhodecode.apps._base import ADMIN_P def admin_routes(config): + from rhodecode.apps.journal.views import JournalView config.add_route( name='journal', pattern='/journal') + config.add_view( + JournalView, + attr='journal', + route_name='journal', request_method='GET', + renderer=None) + config.add_route( name='journal_rss', pattern='/journal/rss') + config.add_view( + JournalView, + attr='journal_rss', + route_name='journal_rss', request_method='GET', + renderer=None) + config.add_route( name='journal_atom', pattern='/journal/atom') + config.add_view( + JournalView, + attr='journal_atom', + route_name='journal_atom', request_method='GET', + renderer=None) config.add_route( name='journal_public', pattern='/public_journal') + config.add_view( + JournalView, + attr='journal_public', + route_name='journal_public', request_method='GET', + renderer=None) + config.add_route( name='journal_public_atom', pattern='/public_journal/atom') + config.add_view( + JournalView, + attr='journal_public_atom', + route_name='journal_public_atom', request_method='GET', + renderer=None) + config.add_route( name='journal_public_atom_old', pattern='/public_journal_atom') + config.add_view( + JournalView, + attr='journal_public_atom', + route_name='journal_public_atom_old', request_method='GET', + renderer=None) config.add_route( name='journal_public_rss', pattern='/public_journal/rss') + config.add_view( + JournalView, + attr='journal_public_rss', + route_name='journal_public_rss', request_method='GET', + renderer=None) + config.add_route( name='journal_public_rss_old', pattern='/public_journal_rss') + config.add_view( + JournalView, + attr='journal_public_rss', + route_name='journal_public_rss_old', request_method='GET', + renderer=None) config.add_route( name='toggle_following', pattern='/toggle_following') + config.add_view( + JournalView, + attr='toggle_following', + route_name='toggle_following', request_method='POST', + renderer='json_ext') def includeme(config): config.include(admin_routes, route_prefix=ADMIN_PREFIX) - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') diff --git a/rhodecode/apps/journal/views.py b/rhodecode/apps/journal/views.py --- a/rhodecode/apps/journal/views.py +++ b/rhodecode/apps/journal/views.py @@ -18,13 +18,9 @@ # RhodeCode Enterprise Edition, including its added features, Support services, # and proprietary license terms, please see https://rhodecode.com/licenses/ - import logging import itertools - - -from pyramid.view import view_config from pyramid.httpexceptions import HTTPBadRequest from pyramid.response import Response from pyramid.renderers import render @@ -218,9 +214,6 @@ class JournalView(BaseAppView): @LoginRequired() @NotAnonymous() - @view_config( - route_name='journal', request_method='GET', - renderer=None) def journal(self): c = self.load_default_context() @@ -258,9 +251,6 @@ class JournalView(BaseAppView): @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED]) @NotAnonymous() - @view_config( - route_name='journal_atom', request_method='GET', - renderer=None) def journal_atom(self): """ Produce an atom-1.0 feed via feedgenerator module @@ -274,9 +264,6 @@ class JournalView(BaseAppView): @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED]) @NotAnonymous() - @view_config( - route_name='journal_rss', request_method='GET', - renderer=None) def journal_rss(self): """ Produce an rss feed via feedgenerator module @@ -289,39 +276,6 @@ class JournalView(BaseAppView): return self._rss_feed(following_repos, c.search_term, public=False) @LoginRequired() - @NotAnonymous() - @CSRFRequired() - @view_config( - route_name='toggle_following', request_method='POST', - renderer='json_ext') - def toggle_following(self): - user_id = self.request.POST.get('follows_user_id') - if user_id: - try: - ScmModel().toggle_following_user(user_id, self._rhodecode_user.user_id) - Session().commit() - return 'ok' - except Exception: - raise HTTPBadRequest() - - repo_id = self.request.POST.get('follows_repo_id') - repo = Repository.get_or_404(repo_id) - perm_set = ['repository.read', 'repository.write', 'repository.admin'] - has_perm = HasRepoPermissionAny(*perm_set)(repo.repo_name, 'RepoWatch check') - if repo and has_perm: - try: - ScmModel().toggle_following_repo(repo_id, self._rhodecode_user.user_id) - Session().commit() - return 'ok' - except Exception: - raise HTTPBadRequest() - - raise HTTPBadRequest() - - @LoginRequired() - @view_config( - route_name='journal_public', request_method='GET', - renderer=None) def journal_public(self): c = self.load_default_context() # Return a rendered template @@ -357,9 +311,6 @@ class JournalView(BaseAppView): return Response(html) @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED]) - @view_config( - route_name='journal_public_atom', request_method='GET', - renderer=None) def journal_public_atom(self): """ Produce an atom-1.0 feed via feedgenerator module @@ -373,9 +324,6 @@ class JournalView(BaseAppView): return self._atom_feed(following_repos, c.search_term) @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED]) - @view_config( - route_name='journal_public_rss', request_method='GET', - renderer=None) def journal_public_rss(self): """ Produce an rss2 feed via feedgenerator module @@ -387,3 +335,30 @@ class JournalView(BaseAppView): .all() return self._rss_feed(following_repos, c.search_term) + + @LoginRequired() + @NotAnonymous() + @CSRFRequired() + def toggle_following(self): + user_id = self.request.POST.get('follows_user_id') + if user_id: + try: + ScmModel().toggle_following_user(user_id, self._rhodecode_user.user_id) + Session().commit() + return 'ok' + except Exception: + raise HTTPBadRequest() + + repo_id = self.request.POST.get('follows_repo_id') + repo = Repository.get_or_404(repo_id) + perm_set = ['repository.read', 'repository.write', 'repository.admin'] + has_perm = HasRepoPermissionAny(*perm_set)(repo.repo_name, 'RepoWatch check') + if repo and has_perm: + try: + ScmModel().toggle_following_repo(repo_id, self._rhodecode_user.user_id) + Session().commit() + return 'ok' + except Exception: + raise HTTPBadRequest() + + raise HTTPBadRequest() diff --git a/rhodecode/apps/login/__init__.py b/rhodecode/apps/login/__init__.py --- a/rhodecode/apps/login/__init__.py +++ b/rhodecode/apps/login/__init__.py @@ -23,22 +23,57 @@ from rhodecode.apps._base import ADMIN_P def includeme(config): - + from rhodecode.apps.login.views import LoginView + config.add_route( name='login', pattern=ADMIN_PREFIX + '/login') + config.add_view( + LoginView, + attr='login', + route_name='login', request_method='GET', + renderer='rhodecode:templates/login.mako') + config.add_view( + LoginView, + attr='login_post', + route_name='login', request_method='POST', + renderer='rhodecode:templates/login.mako') + config.add_route( name='logout', pattern=ADMIN_PREFIX + '/logout') + config.add_view( + LoginView, + attr='logout', + route_name='logout', request_method='POST') + config.add_route( name='register', pattern=ADMIN_PREFIX + '/register') + config.add_view( + LoginView, + attr='register', + route_name='register', request_method='GET', + renderer='rhodecode:templates/register.mako') + config.add_view( + LoginView, + attr='register_post', + route_name='register', request_method='POST', + renderer='rhodecode:templates/register.mako') + config.add_route( name='reset_password', pattern=ADMIN_PREFIX + '/password_reset') + config.add_view( + LoginView, + attr='password_reset', + route_name='reset_password', request_method=('GET', 'POST'), + renderer='rhodecode:templates/password_reset.mako') + config.add_route( name='reset_password_confirmation', pattern=ADMIN_PREFIX + '/password_reset_confirmation') - - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') + config.add_view( + LoginView, + attr='password_reset_confirmation', + route_name='reset_password_confirmation', request_method='GET') diff --git a/rhodecode/apps/login/views.py b/rhodecode/apps/login/views.py --- a/rhodecode/apps/login/views.py +++ b/rhodecode/apps/login/views.py @@ -28,7 +28,7 @@ import urlparse import requests from pyramid.httpexceptions import HTTPFound -from pyramid.view import view_config + from rhodecode.apps._base import BaseAppView from rhodecode.authentication.base import authenticate, HTTP_TYPE @@ -114,7 +114,6 @@ class LoginView(BaseAppView): def load_default_context(self): c = self._get_local_tmpl_context() c.came_from = get_came_from(self.request) - return c def _get_captcha_data(self): @@ -148,9 +147,6 @@ class LoginView(BaseAppView): return captcha_status, captcha_message - @view_config( - route_name='login', request_method='GET', - renderer='rhodecode:templates/login.mako') def login(self): c = self.load_default_context() auth_user = self._rhodecode_user @@ -175,9 +171,6 @@ class LoginView(BaseAppView): return self._get_template_context(c) - @view_config( - route_name='login', request_method='POST', - renderer='rhodecode:templates/login.mako') def login_post(self): c = self.load_default_context() @@ -229,7 +222,6 @@ class LoginView(BaseAppView): return self._get_template_context(c) @CSRFRequired() - @view_config(route_name='logout', request_method='POST') def logout(self): auth_user = self._rhodecode_user log.info('Deleting session for user: `%s`', auth_user) @@ -243,9 +235,6 @@ class LoginView(BaseAppView): @HasPermissionAnyDecorator( 'hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate') - @view_config( - route_name='register', request_method='GET', - renderer='rhodecode:templates/register.mako',) def register(self, defaults=None, errors=None): c = self.load_default_context() defaults = defaults or {} @@ -270,9 +259,6 @@ class LoginView(BaseAppView): @HasPermissionAnyDecorator( 'hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate') - @view_config( - route_name='register', request_method='POST', - renderer='rhodecode:templates/register.mako') def register_post(self): from rhodecode.authentication.plugins import auth_rhodecode @@ -353,9 +339,6 @@ class LoginView(BaseAppView): h.flash(e, category='error') return self.register() - @view_config( - route_name='reset_password', request_method=('GET', 'POST'), - renderer='rhodecode:templates/password_reset.mako') def password_reset(self): c = self.load_default_context() captcha = self._get_captcha_data() @@ -454,8 +437,6 @@ class LoginView(BaseAppView): return self._get_template_context(c, **template_context) - @view_config(route_name='reset_password_confirmation', - request_method='GET') def password_reset_confirmation(self): self.load_default_context() if self.request.GET and self.request.GET.get('key'): diff --git a/rhodecode/apps/my_account/__init__.py b/rhodecode/apps/my_account/__init__.py --- a/rhodecode/apps/my_account/__init__.py +++ b/rhodecode/apps/my_account/__init__.py @@ -23,138 +23,311 @@ from rhodecode.apps._base import ADMIN_P def includeme(config): + from rhodecode.apps.my_account.views.my_account import MyAccountView + from rhodecode.apps.my_account.views.my_account_notifications import MyAccountNotificationsView + from rhodecode.apps.my_account.views.my_account_ssh_keys import MyAccountSshKeysView config.add_route( name='my_account_profile', pattern=ADMIN_PREFIX + '/my_account/profile') + config.add_view( + MyAccountView, + attr='my_account_profile', + route_name='my_account_profile', request_method='GET', + renderer='rhodecode:templates/admin/my_account/my_account.mako') # my account edit details config.add_route( name='my_account_edit', pattern=ADMIN_PREFIX + '/my_account/edit') + config.add_view( + MyAccountView, + attr='my_account_edit', + route_name='my_account_edit', + request_method='GET', + renderer='rhodecode:templates/admin/my_account/my_account.mako') + config.add_route( name='my_account_update', pattern=ADMIN_PREFIX + '/my_account/update') + config.add_view( + MyAccountView, + attr='my_account_update', + route_name='my_account_update', + request_method='POST', + renderer='rhodecode:templates/admin/my_account/my_account.mako') # my account password config.add_route( name='my_account_password', pattern=ADMIN_PREFIX + '/my_account/password') + config.add_view( + MyAccountView, + attr='my_account_password', + route_name='my_account_password', request_method='GET', + renderer='rhodecode:templates/admin/my_account/my_account.mako') config.add_route( name='my_account_password_update', pattern=ADMIN_PREFIX + '/my_account/password/update') + config.add_view( + MyAccountView, + attr='my_account_password_update', + route_name='my_account_password_update', request_method='POST', + renderer='rhodecode:templates/admin/my_account/my_account.mako') # my account tokens config.add_route( name='my_account_auth_tokens', pattern=ADMIN_PREFIX + '/my_account/auth_tokens') + config.add_view( + MyAccountView, + attr='my_account_auth_tokens', + route_name='my_account_auth_tokens', request_method='GET', + renderer='rhodecode:templates/admin/my_account/my_account.mako') + config.add_route( name='my_account_auth_tokens_view', pattern=ADMIN_PREFIX + '/my_account/auth_tokens/view') + config.add_view( + MyAccountView, + attr='my_account_auth_tokens_view', + route_name='my_account_auth_tokens_view', request_method='POST', xhr=True, + renderer='json_ext') + config.add_route( name='my_account_auth_tokens_add', pattern=ADMIN_PREFIX + '/my_account/auth_tokens/new') + config.add_view( + MyAccountView, + attr='my_account_auth_tokens_add', + route_name='my_account_auth_tokens_add', request_method='POST') + config.add_route( name='my_account_auth_tokens_delete', pattern=ADMIN_PREFIX + '/my_account/auth_tokens/delete') + config.add_view( + MyAccountView, + attr='my_account_auth_tokens_delete', + route_name='my_account_auth_tokens_delete', request_method='POST') # my account ssh keys config.add_route( name='my_account_ssh_keys', pattern=ADMIN_PREFIX + '/my_account/ssh_keys') + config.add_view( + MyAccountSshKeysView, + attr='my_account_ssh_keys', + route_name='my_account_ssh_keys', request_method='GET', + renderer='rhodecode:templates/admin/my_account/my_account.mako') + config.add_route( name='my_account_ssh_keys_generate', pattern=ADMIN_PREFIX + '/my_account/ssh_keys/generate') + config.add_view( + MyAccountSshKeysView, + attr='ssh_keys_generate_keypair', + route_name='my_account_ssh_keys_generate', request_method='GET', + renderer='rhodecode:templates/admin/my_account/my_account.mako') + config.add_route( name='my_account_ssh_keys_add', pattern=ADMIN_PREFIX + '/my_account/ssh_keys/new') + config.add_view( + MyAccountSshKeysView, + attr='my_account_ssh_keys_add', + route_name='my_account_ssh_keys_add', request_method='POST',) + config.add_route( name='my_account_ssh_keys_delete', pattern=ADMIN_PREFIX + '/my_account/ssh_keys/delete') + config.add_view( + MyAccountSshKeysView, + attr='my_account_ssh_keys_delete', + route_name='my_account_ssh_keys_delete', request_method='POST') # my account user group membership config.add_route( name='my_account_user_group_membership', pattern=ADMIN_PREFIX + '/my_account/user_group_membership') + config.add_view( + MyAccountView, + attr='my_account_user_group_membership', + route_name='my_account_user_group_membership', + request_method='GET', + renderer='rhodecode:templates/admin/my_account/my_account.mako') # my account emails config.add_route( name='my_account_emails', pattern=ADMIN_PREFIX + '/my_account/emails') + config.add_view( + MyAccountView, + attr='my_account_emails', + route_name='my_account_emails', request_method='GET', + renderer='rhodecode:templates/admin/my_account/my_account.mako') + config.add_route( name='my_account_emails_add', pattern=ADMIN_PREFIX + '/my_account/emails/new') + config.add_view( + MyAccountView, + attr='my_account_emails_add', + route_name='my_account_emails_add', request_method='POST', + renderer='rhodecode:templates/admin/my_account/my_account.mako') + config.add_route( name='my_account_emails_delete', pattern=ADMIN_PREFIX + '/my_account/emails/delete') + config.add_view( + MyAccountView, + attr='my_account_emails_delete', + route_name='my_account_emails_delete', request_method='POST') config.add_route( name='my_account_repos', pattern=ADMIN_PREFIX + '/my_account/repos') + config.add_view( + MyAccountView, + attr='my_account_repos', + route_name='my_account_repos', request_method='GET', + renderer='rhodecode:templates/admin/my_account/my_account.mako') config.add_route( name='my_account_watched', pattern=ADMIN_PREFIX + '/my_account/watched') + config.add_view( + MyAccountView, + attr='my_account_watched', + route_name='my_account_watched', request_method='GET', + renderer='rhodecode:templates/admin/my_account/my_account.mako') config.add_route( name='my_account_bookmarks', pattern=ADMIN_PREFIX + '/my_account/bookmarks') + config.add_view( + MyAccountView, + attr='my_account_bookmarks', + route_name='my_account_bookmarks', request_method='GET', + renderer='rhodecode:templates/admin/my_account/my_account.mako') config.add_route( name='my_account_bookmarks_update', pattern=ADMIN_PREFIX + '/my_account/bookmarks/update') + config.add_view( + MyAccountView, + attr='my_account_bookmarks_update', + route_name='my_account_bookmarks_update', request_method='POST') config.add_route( name='my_account_goto_bookmark', pattern=ADMIN_PREFIX + '/my_account/bookmark/{bookmark_id}') + config.add_view( + MyAccountView, + attr='my_account_goto_bookmark', + route_name='my_account_goto_bookmark', request_method='GET', + renderer='rhodecode:templates/admin/my_account/my_account.mako') config.add_route( name='my_account_perms', pattern=ADMIN_PREFIX + '/my_account/perms') + config.add_view( + MyAccountView, + attr='my_account_perms', + route_name='my_account_perms', request_method='GET', + renderer='rhodecode:templates/admin/my_account/my_account.mako') config.add_route( name='my_account_notifications', pattern=ADMIN_PREFIX + '/my_account/notifications') + config.add_view( + MyAccountView, + attr='my_notifications', + route_name='my_account_notifications', request_method='GET', + renderer='rhodecode:templates/admin/my_account/my_account.mako') config.add_route( name='my_account_notifications_toggle_visibility', pattern=ADMIN_PREFIX + '/my_account/toggle_visibility') + config.add_view( + MyAccountView, + attr='my_notifications_toggle_visibility', + route_name='my_account_notifications_toggle_visibility', + request_method='POST', renderer='json_ext') # my account pull requests config.add_route( name='my_account_pullrequests', pattern=ADMIN_PREFIX + '/my_account/pull_requests') + config.add_view( + MyAccountView, + attr='my_account_pullrequests', + route_name='my_account_pullrequests', + request_method='GET', + renderer='rhodecode:templates/admin/my_account/my_account.mako') + config.add_route( name='my_account_pullrequests_data', pattern=ADMIN_PREFIX + '/my_account/pull_requests/data') + config.add_view( + MyAccountView, + attr='my_account_pullrequests_data', + route_name='my_account_pullrequests_data', + request_method='GET', renderer='json_ext') + + # channelstream test + config.add_route( + name='my_account_notifications_test_channelstream', + pattern=ADMIN_PREFIX + '/my_account/test_channelstream') + config.add_view( + MyAccountView, + attr='my_account_notifications_test_channelstream', + route_name='my_account_notifications_test_channelstream', + request_method='POST', renderer='json_ext') # notifications config.add_route( name='notifications_show_all', pattern=ADMIN_PREFIX + '/notifications') + config.add_view( + MyAccountNotificationsView, + attr='notifications_show_all', + route_name='notifications_show_all', request_method='GET', + renderer='rhodecode:templates/admin/notifications/notifications_show_all.mako') # notifications config.add_route( name='notifications_mark_all_read', - pattern=ADMIN_PREFIX + '/notifications/mark_all_read') + pattern=ADMIN_PREFIX + '/notifications_mark_all_read') + config.add_view( + MyAccountNotificationsView, + attr='notifications_mark_all_read', + route_name='notifications_mark_all_read', request_method='POST', + renderer='rhodecode:templates/admin/notifications/notifications_show_all.mako') config.add_route( name='notifications_show', pattern=ADMIN_PREFIX + '/notifications/{notification_id}') + config.add_view( + MyAccountNotificationsView, + attr='notifications_show', + route_name='notifications_show', request_method='GET', + renderer='rhodecode:templates/admin/notifications/notifications_show.mako') config.add_route( name='notifications_update', pattern=ADMIN_PREFIX + '/notifications/{notification_id}/update') + config.add_view( + MyAccountNotificationsView, + attr='notification_update', + route_name='notifications_update', request_method='POST', + renderer='json_ext') config.add_route( name='notifications_delete', pattern=ADMIN_PREFIX + '/notifications/{notification_id}/delete') - - # channelstream test - config.add_route( - name='my_account_notifications_test_channelstream', - pattern=ADMIN_PREFIX + '/my_account/test_channelstream') - - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') + config.add_view( + MyAccountNotificationsView, + attr='notification_delete', + route_name='notifications_delete', request_method='POST', + renderer='json_ext') diff --git a/rhodecode/apps/my_account/tests/test_my_account_notifications.py b/rhodecode/apps/my_account/tests/test_my_account_notifications.py --- a/rhodecode/apps/my_account/tests/test_my_account_notifications.py +++ b/rhodecode/apps/my_account/tests/test_my_account_notifications.py @@ -40,7 +40,7 @@ def route_path(name, params=None, **kwar base_url = { 'notifications_show_all': ADMIN_PREFIX + '/notifications', - 'notifications_mark_all_read': ADMIN_PREFIX + '/notifications/mark_all_read', + 'notifications_mark_all_read': ADMIN_PREFIX + '/notifications_mark_all_read', 'notifications_show': ADMIN_PREFIX + '/notifications/{notification_id}', 'notifications_update': ADMIN_PREFIX + '/notifications/{notification_id}/update', 'notifications_delete': ADMIN_PREFIX + '/notifications/{notification_id}/delete', @@ -60,6 +60,15 @@ class TestNotificationsController(TestCo Session().delete(inst) Session().commit() + def test_mark_all_read(self, user_util): + user = user_util.create_user(password='qweqwe') + self.log_user(user.username, 'qweqwe') + + self.app.post( + route_path('notifications_mark_all_read'), status=302, + params={'csrf_token': self.csrf_token} + ) + def test_show_all(self, user_util): user = user_util.create_user(password='qweqwe') user_id = user.user_id diff --git a/rhodecode/apps/my_account/views/my_account.py b/rhodecode/apps/my_account/views/my_account.py --- a/rhodecode/apps/my_account/views/my_account.py +++ b/rhodecode/apps/my_account/views/my_account.py @@ -26,7 +26,6 @@ import formencode import formencode.htmlfill import peppercorn from pyramid.httpexceptions import HTTPFound, HTTPNotFound -from pyramid.view import view_config from rhodecode.apps._base import BaseAppView, DataGridAppView from rhodecode import forms @@ -65,14 +64,10 @@ class MyAccountView(BaseAppView, DataGri c = self._get_local_tmpl_context() c.user = c.auth_user.get_instance() c.allow_scoped_tokens = self.ALLOW_SCOPED_TOKENS - return c @LoginRequired() @NotAnonymous() - @view_config( - route_name='my_account_profile', request_method='GET', - renderer='rhodecode:templates/admin/my_account/my_account.mako') def my_account_profile(self): c = self.load_default_context() c.active = 'profile' @@ -81,9 +76,75 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() - @view_config( - route_name='my_account_password', request_method='GET', - renderer='rhodecode:templates/admin/my_account/my_account.mako') + def my_account_edit(self): + c = self.load_default_context() + c.active = 'profile_edit' + c.extern_type = c.user.extern_type + c.extern_name = c.user.extern_name + + schema = user_schema.UserProfileSchema().bind( + username=c.user.username, user_emails=c.user.emails) + appstruct = { + 'username': c.user.username, + 'email': c.user.email, + 'firstname': c.user.firstname, + 'lastname': c.user.lastname, + 'description': c.user.description, + } + c.form = forms.RcForm( + schema, appstruct=appstruct, + action=h.route_path('my_account_update'), + buttons=(forms.buttons.save, forms.buttons.reset)) + + return self._get_template_context(c) + + @LoginRequired() + @NotAnonymous() + @CSRFRequired() + def my_account_update(self): + _ = self.request.translate + c = self.load_default_context() + c.active = 'profile_edit' + c.perm_user = c.auth_user + c.extern_type = c.user.extern_type + c.extern_name = c.user.extern_name + + schema = user_schema.UserProfileSchema().bind( + username=c.user.username, user_emails=c.user.emails) + form = forms.RcForm( + schema, buttons=(forms.buttons.save, forms.buttons.reset)) + + controls = self.request.POST.items() + try: + valid_data = form.validate(controls) + skip_attrs = ['admin', 'active', 'extern_type', 'extern_name', + 'new_password', 'password_confirmation'] + if c.extern_type != "rhodecode": + # forbid updating username for external accounts + skip_attrs.append('username') + old_email = c.user.email + UserModel().update_user( + self._rhodecode_user.user_id, skip_attrs=skip_attrs, + **valid_data) + if old_email != valid_data['email']: + old = UserEmailMap.query() \ + .filter(UserEmailMap.user == c.user)\ + .filter(UserEmailMap.email == valid_data['email'])\ + .first() + old.email = old_email + h.flash(_('Your account was updated successfully'), category='success') + Session().commit() + except forms.ValidationFailure as e: + c.form = e + return self._get_template_context(c) + except Exception: + log.exception("Exception updating user") + h.flash(_('Error occurred during update of user'), + category='error') + raise HTTPFound(h.route_path('my_account_profile')) + + @LoginRequired() + @NotAnonymous() def my_account_password(self): c = self.load_default_context() c.active = 'password' @@ -103,9 +164,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='my_account_password_update', request_method='POST', - renderer='rhodecode:templates/admin/my_account/my_account.mako') def my_account_password_update(self): _ = self.request.translate c = self.load_default_context() @@ -146,9 +204,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() - @view_config( - route_name='my_account_auth_tokens', request_method='GET', - renderer='rhodecode:templates/admin/my_account/my_account.mako') def my_account_auth_tokens(self): _ = self.request.translate @@ -167,9 +222,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='my_account_auth_tokens_view', request_method='POST', xhr=True, - renderer='json_ext') def my_account_auth_tokens_view(self): _ = self.request.translate c = self.load_default_context() @@ -192,8 +244,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='my_account_auth_tokens_add', request_method='POST',) def my_account_auth_tokens_add(self): _ = self.request.translate c = self.load_default_context() @@ -220,8 +270,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='my_account_auth_tokens_delete', request_method='POST') def my_account_auth_tokens_delete(self): _ = self.request.translate c = self.load_default_context() @@ -244,9 +292,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() - @view_config( - route_name='my_account_emails', request_method='GET', - renderer='rhodecode:templates/admin/my_account/my_account.mako') def my_account_emails(self): _ = self.request.translate @@ -269,9 +314,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='my_account_emails_add', request_method='POST', - renderer='rhodecode:templates/admin/my_account/my_account.mako') def my_account_emails_add(self): _ = self.request.translate c = self.load_default_context() @@ -312,8 +354,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='my_account_emails_delete', request_method='POST') def my_account_emails_delete(self): _ = self.request.translate c = self.load_default_context() @@ -334,9 +374,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='my_account_notifications_test_channelstream', - request_method='POST', renderer='json_ext') def my_account_notifications_test_channelstream(self): message = 'Test message sent via Channelstream by user: {}, on {}'.format( self._rhodecode_user.username, datetime.datetime.now()) @@ -424,9 +461,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() - @view_config( - route_name='my_account_repos', request_method='GET', - renderer='rhodecode:templates/admin/my_account/my_account.mako') def my_account_repos(self): c = self.load_default_context() c.active = 'repos' @@ -437,9 +471,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() - @view_config( - route_name='my_account_watched', request_method='GET', - renderer='rhodecode:templates/admin/my_account/my_account.mako') def my_account_watched(self): c = self.load_default_context() c.active = 'watched' @@ -450,9 +481,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() - @view_config( - route_name='my_account_bookmarks', request_method='GET', - renderer='rhodecode:templates/admin/my_account/my_account.mako') def my_account_bookmarks(self): c = self.load_default_context() c.active = 'bookmarks' @@ -519,8 +547,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='my_account_bookmarks_update', request_method='POST') def my_account_bookmarks_update(self): _ = self.request.translate c = self.load_default_context() @@ -559,9 +585,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() - @view_config( - route_name='my_account_goto_bookmark', request_method='GET', - renderer='rhodecode:templates/admin/my_account/my_account.mako') def my_account_goto_bookmark(self): bookmark_id = self.request.matchdict['bookmark_id'] @@ -606,9 +629,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() - @view_config( - route_name='my_account_perms', request_method='GET', - renderer='rhodecode:templates/admin/my_account/my_account.mako') def my_account_perms(self): c = self.load_default_context() c.active = 'perms' @@ -618,9 +638,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() - @view_config( - route_name='my_account_notifications', request_method='GET', - renderer='rhodecode:templates/admin/my_account/my_account.mako') def my_notifications(self): c = self.load_default_context() c.active = 'notifications' @@ -630,9 +647,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='my_account_notifications_toggle_visibility', - request_method='POST', renderer='json_ext') def my_notifications_toggle_visibility(self): user = self._rhodecode_db_user new_status = not user.user_data.get('notification_status', True) @@ -640,83 +654,6 @@ class MyAccountView(BaseAppView, DataGri Session().commit() return user.user_data['notification_status'] - @LoginRequired() - @NotAnonymous() - @view_config( - route_name='my_account_edit', - request_method='GET', - renderer='rhodecode:templates/admin/my_account/my_account.mako') - def my_account_edit(self): - c = self.load_default_context() - c.active = 'profile_edit' - c.extern_type = c.user.extern_type - c.extern_name = c.user.extern_name - - schema = user_schema.UserProfileSchema().bind( - username=c.user.username, user_emails=c.user.emails) - appstruct = { - 'username': c.user.username, - 'email': c.user.email, - 'firstname': c.user.firstname, - 'lastname': c.user.lastname, - 'description': c.user.description, - } - c.form = forms.RcForm( - schema, appstruct=appstruct, - action=h.route_path('my_account_update'), - buttons=(forms.buttons.save, forms.buttons.reset)) - - return self._get_template_context(c) - - @LoginRequired() - @NotAnonymous() - @CSRFRequired() - @view_config( - route_name='my_account_update', - request_method='POST', - renderer='rhodecode:templates/admin/my_account/my_account.mako') - def my_account_update(self): - _ = self.request.translate - c = self.load_default_context() - c.active = 'profile_edit' - c.perm_user = c.auth_user - c.extern_type = c.user.extern_type - c.extern_name = c.user.extern_name - - schema = user_schema.UserProfileSchema().bind( - username=c.user.username, user_emails=c.user.emails) - form = forms.RcForm( - schema, buttons=(forms.buttons.save, forms.buttons.reset)) - - controls = self.request.POST.items() - try: - valid_data = form.validate(controls) - skip_attrs = ['admin', 'active', 'extern_type', 'extern_name', - 'new_password', 'password_confirmation'] - if c.extern_type != "rhodecode": - # forbid updating username for external accounts - skip_attrs.append('username') - old_email = c.user.email - UserModel().update_user( - self._rhodecode_user.user_id, skip_attrs=skip_attrs, - **valid_data) - if old_email != valid_data['email']: - old = UserEmailMap.query() \ - .filter(UserEmailMap.user == c.user)\ - .filter(UserEmailMap.email == valid_data['email'])\ - .first() - old.email = old_email - h.flash(_('Your account was updated successfully'), category='success') - Session().commit() - except forms.ValidationFailure as e: - c.form = e - return self._get_template_context(c) - except Exception: - log.exception("Exception updating user") - h.flash(_('Error occurred during update of user'), - category='error') - raise HTTPFound(h.route_path('my_account_profile')) - def _get_pull_requests_list(self, statuses): draw, start, limit = self._extract_chunk(self.request) search_q, order_by, order_dir = self._extract_ordering(self.request) @@ -781,10 +718,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() - @view_config( - route_name='my_account_pullrequests', - request_method='GET', - renderer='rhodecode:templates/admin/my_account/my_account.mako') def my_account_pullrequests(self): c = self.load_default_context() c.active = 'pullrequests' @@ -796,9 +729,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() - @view_config( - route_name='my_account_pullrequests_data', - request_method='GET', renderer='json_ext') def my_account_pullrequests_data(self): self.load_default_context() req_get = self.request.GET @@ -813,10 +743,6 @@ class MyAccountView(BaseAppView, DataGri @LoginRequired() @NotAnonymous() - @view_config( - route_name='my_account_user_group_membership', - request_method='GET', - renderer='rhodecode:templates/admin/my_account/my_account.mako') def my_account_user_group_membership(self): c = self.load_default_context() c.active = 'user_group_membership' diff --git a/rhodecode/apps/my_account/views/my_account_notifications.py b/rhodecode/apps/my_account/views/my_account_notifications.py --- a/rhodecode/apps/my_account/views/my_account_notifications.py +++ b/rhodecode/apps/my_account/views/my_account_notifications.py @@ -22,7 +22,6 @@ import logging from pyramid.httpexceptions import ( HTTPFound, HTTPNotFound, HTTPInternalServerError) -from pyramid.view import view_config from rhodecode.apps._base import BaseAppView from rhodecode.lib.auth import LoginRequired, NotAnonymous, CSRFRequired @@ -57,9 +56,6 @@ class MyAccountNotificationsView(BaseApp @LoginRequired() @NotAnonymous() - @view_config( - route_name='notifications_show_all', request_method='GET', - renderer='rhodecode:templates/admin/notifications/notifications_show_all.mako') def notifications_show_all(self): c = self.load_default_context() @@ -105,22 +101,6 @@ class MyAccountNotificationsView(BaseApp @LoginRequired() @NotAnonymous() - @CSRFRequired() - @view_config( - route_name='notifications_mark_all_read', request_method='POST', - renderer='rhodecode:templates/admin/notifications/notifications_show_all.mako') - def notifications_mark_all_read(self): - NotificationModel().mark_all_read_for_user( - self._rhodecode_db_user.user_id, - filter_=self.request.GET.getall('type')) - Session().commit() - raise HTTPFound(h.route_path('notifications_show_all')) - - @LoginRequired() - @NotAnonymous() - @view_config( - route_name='notifications_show', request_method='GET', - renderer='rhodecode:templates/admin/notifications/notifications_show.mako') def notifications_show(self): c = self.load_default_context() notification_id = self.request.matchdict['notification_id'] @@ -150,9 +130,16 @@ class MyAccountNotificationsView(BaseApp @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='notifications_update', request_method='POST', - renderer='json_ext') + def notifications_mark_all_read(self): + NotificationModel().mark_all_read_for_user( + self._rhodecode_db_user.user_id, + filter_=self.request.GET.getall('type')) + Session().commit() + raise HTTPFound(h.route_path('notifications_show_all')) + + @LoginRequired() + @NotAnonymous() + @CSRFRequired() def notification_update(self): notification_id = self.request.matchdict['notification_id'] notification = Notification.get_or_404(notification_id) @@ -177,9 +164,6 @@ class MyAccountNotificationsView(BaseApp @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='notifications_delete', request_method='POST', - renderer='json_ext') def notification_delete(self): notification_id = self.request.matchdict['notification_id'] notification = Notification.get_or_404(notification_id) diff --git a/rhodecode/apps/my_account/views/my_account_ssh_keys.py b/rhodecode/apps/my_account/views/my_account_ssh_keys.py --- a/rhodecode/apps/my_account/views/my_account_ssh_keys.py +++ b/rhodecode/apps/my_account/views/my_account_ssh_keys.py @@ -21,7 +21,6 @@ import logging from pyramid.httpexceptions import HTTPFound -from pyramid.view import view_config from rhodecode.apps._base import BaseAppView, DataGridAppView from rhodecode.apps.ssh_support import SshKeyFileChangeEvent @@ -41,17 +40,12 @@ class MyAccountSshKeysView(BaseAppView, def load_default_context(self): c = self._get_local_tmpl_context() c.user = c.auth_user.get_instance() - c.ssh_enabled = self.request.registry.settings.get( 'ssh.generate_authorized_keyfile') - return c @LoginRequired() @NotAnonymous() - @view_config( - route_name='my_account_ssh_keys', request_method='GET', - renderer='rhodecode:templates/admin/my_account/my_account.mako') def my_account_ssh_keys(self): _ = self.request.translate @@ -63,9 +57,6 @@ class MyAccountSshKeysView(BaseAppView, @LoginRequired() @NotAnonymous() - @view_config( - route_name='my_account_ssh_keys_generate', request_method='GET', - renderer='rhodecode:templates/admin/my_account/my_account.mako') def ssh_keys_generate_keypair(self): _ = self.request.translate c = self.load_default_context() @@ -84,8 +75,6 @@ class MyAccountSshKeysView(BaseAppView, @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='my_account_ssh_keys_add', request_method='POST',) def my_account_ssh_keys_add(self): _ = self.request.translate c = self.load_default_context() @@ -132,8 +121,6 @@ class MyAccountSshKeysView(BaseAppView, @LoginRequired() @NotAnonymous() @CSRFRequired() - @view_config( - route_name='my_account_ssh_keys_delete', request_method='POST') def my_account_ssh_keys_delete(self): _ = self.request.translate c = self.load_default_context() diff --git a/rhodecode/apps/ops/__init__.py b/rhodecode/apps/ops/__init__.py --- a/rhodecode/apps/ops/__init__.py +++ b/rhodecode/apps/ops/__init__.py @@ -22,25 +22,35 @@ from rhodecode.apps._base import ADMIN_P def admin_routes(config): + from rhodecode.apps.ops.views import OpsView + config.add_route( name='ops_ping', pattern='/ping') + config.add_view( + OpsView, + attr='ops_ping', + route_name='ops_ping', request_method='GET', + renderer='json_ext') + config.add_route( name='ops_error_test', pattern='/error') + config.add_view( + OpsView, + attr='ops_error_test', + route_name='ops_error_test', request_method='GET', + renderer='json_ext') + config.add_route( name='ops_redirect_test', pattern='/redirect') + config.add_view( + OpsView, + attr='ops_redirect_test', + route_name='ops_redirect_test', request_method='GET', + renderer='json_ext') def includeme(config): - config.include(admin_routes, route_prefix=ADMIN_PREFIX + '/ops') - # make OLD entries from <4.10.0 work - config.add_route( - name='ops_ping_legacy', pattern=ADMIN_PREFIX + '/ping') - config.add_route( - name='ops_error_test_legacy', pattern=ADMIN_PREFIX + '/error_test') - - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') diff --git a/rhodecode/apps/ops/views.py b/rhodecode/apps/ops/views.py --- a/rhodecode/apps/ops/views.py +++ b/rhodecode/apps/ops/views.py @@ -21,7 +21,7 @@ import time import logging -from pyramid.view import view_config + from pyramid.httpexceptions import HTTPFound from rhodecode.apps._base import BaseAppView @@ -38,12 +38,6 @@ class OpsView(BaseAppView): return c - @view_config( - route_name='ops_ping', request_method='GET', - renderer='json_ext') - @view_config( - route_name='ops_ping_legacy', request_method='GET', - renderer='json_ext') def ops_ping(self): data = { 'instance': self.request.registry.settings.get('instance_id'), @@ -59,12 +53,6 @@ class OpsView(BaseAppView): }) return {'ok': data} - @view_config( - route_name='ops_error_test', request_method='GET', - renderer='json_ext') - @view_config( - route_name='ops_error_test_legacy', request_method='GET', - renderer='json_ext') def ops_error_test(self): """ Test exception handling and emails on errors @@ -78,9 +66,6 @@ class OpsView(BaseAppView): 'Client:{}. Generation time: {}.'.format(self.request.user, time.time())) raise TestException(msg) - @view_config( - route_name='ops_redirect_test', request_method='GET', - renderer='json_ext') def ops_redirect_test(self): """ Test redirect handling diff --git a/rhodecode/apps/repo_group/__init__.py b/rhodecode/apps/repo_group/__init__.py --- a/rhodecode/apps/repo_group/__init__.py +++ b/rhodecode/apps/repo_group/__init__.py @@ -18,6 +18,10 @@ # RhodeCode Enterprise Edition, including its added features, Support services, # and proprietary license terms, please see https://rhodecode.com/licenses/ from rhodecode.apps._base import add_route_with_slash +from rhodecode.apps.repo_group.views.repo_group_settings import RepoGroupSettingsView +from rhodecode.apps.repo_group.views.repo_group_advanced import RepoGroupAdvancedSettingsView +from rhodecode.apps.repo_group.views.repo_group_permissions import RepoGroupPermissionsView +from rhodecode.apps.home.views import HomeView def includeme(config): @@ -27,35 +31,72 @@ def includeme(config): name='edit_repo_group', pattern='/{repo_group_name:.*?[^/]}/_edit', repo_group_route=True) - # update is POST on edit_repo_group + config.add_view( + RepoGroupSettingsView, + attr='edit_settings', + route_name='edit_repo_group', request_method='GET', + renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako') + config.add_view( + RepoGroupSettingsView, + attr='edit_settings_update', + route_name='edit_repo_group', request_method='POST', + renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako') # Settings advanced config.add_route( name='edit_repo_group_advanced', pattern='/{repo_group_name:.*?[^/]}/_settings/advanced', repo_group_route=True) + config.add_view( + RepoGroupAdvancedSettingsView, + attr='edit_repo_group_advanced', + route_name='edit_repo_group_advanced', request_method='GET', + renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako') config.add_route( name='edit_repo_group_advanced_delete', pattern='/{repo_group_name:.*?[^/]}/_settings/advanced/delete', repo_group_route=True) + config.add_view( + RepoGroupAdvancedSettingsView, + attr='edit_repo_group_delete', + route_name='edit_repo_group_advanced_delete', request_method='POST', + renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako') # settings permissions config.add_route( name='edit_repo_group_perms', pattern='/{repo_group_name:.*?[^/]}/_settings/permissions', repo_group_route=True) + config.add_view( + RepoGroupPermissionsView, + attr='edit_repo_group_permissions', + route_name='edit_repo_group_perms', request_method='GET', + renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako') config.add_route( name='edit_repo_group_perms_update', pattern='/{repo_group_name:.*?[^/]}/_settings/permissions/update', repo_group_route=True) + config.add_view( + RepoGroupPermissionsView, + attr='edit_repo_groups_permissions_update', + route_name='edit_repo_group_perms_update', request_method='POST', + renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako') # Summary, NOTE(marcink): needs to be at the end for catch-all add_route_with_slash( config, name='repo_group_home', pattern='/{repo_group_name:.*?[^/]}', repo_group_route=True) + config.add_view( + HomeView, + attr='repo_group_main_page', + route_name='repo_group_home', request_method='GET', + renderer='rhodecode:templates/index_repo_group.mako') + config.add_view( + HomeView, + attr='repo_group_main_page', + route_name='repo_group_home_slash', request_method='GET', + renderer='rhodecode:templates/index_repo_group.mako') - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') diff --git a/rhodecode/apps/repo_group/views/repo_group_advanced.py b/rhodecode/apps/repo_group/views/repo_group_advanced.py --- a/rhodecode/apps/repo_group/views/repo_group_advanced.py +++ b/rhodecode/apps/repo_group/views/repo_group_advanced.py @@ -20,7 +20,7 @@ import logging -from pyramid.view import view_config + from pyramid.httpexceptions import HTTPFound from rhodecode.apps._base import RepoGroupAppView @@ -34,17 +34,13 @@ from rhodecode.model.meta import Session log = logging.getLogger(__name__) -class RepoGroupSettingsView(RepoGroupAppView): +class RepoGroupAdvancedSettingsView(RepoGroupAppView): def load_default_context(self): c = self._get_local_tmpl_context() - return c @LoginRequired() @HasRepoGroupPermissionAnyDecorator('group.admin') - @view_config( - route_name='edit_repo_group_advanced', request_method='GET', - renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako') def edit_repo_group_advanced(self): _ = self.request.translate c = self.load_default_context() @@ -61,9 +57,6 @@ class RepoGroupSettingsView(RepoGroupApp @LoginRequired() @HasRepoGroupPermissionAnyDecorator('group.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_group_advanced_delete', request_method='POST', - renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako') def edit_repo_group_delete(self): _ = self.request.translate _ungettext = self.request.plularize diff --git a/rhodecode/apps/repo_group/views/repo_group_permissions.py b/rhodecode/apps/repo_group/views/repo_group_permissions.py --- a/rhodecode/apps/repo_group/views/repo_group_permissions.py +++ b/rhodecode/apps/repo_group/views/repo_group_permissions.py @@ -20,7 +20,7 @@ import logging -from pyramid.view import view_config + from pyramid.httpexceptions import HTTPFound from rhodecode.apps._base import RepoGroupAppView @@ -45,9 +45,6 @@ class RepoGroupPermissionsView(RepoGroup @LoginRequired() @HasRepoGroupPermissionAnyDecorator('group.admin') - @view_config( - route_name='edit_repo_group_perms', request_method='GET', - renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako') def edit_repo_group_permissions(self): c = self.load_default_context() c.active = 'permissions' @@ -57,9 +54,6 @@ class RepoGroupPermissionsView(RepoGroup @LoginRequired() @HasRepoGroupPermissionAnyDecorator('group.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_group_perms_update', request_method='POST', - renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako') def edit_repo_groups_permissions_update(self): _ = self.request.translate c = self.load_default_context() diff --git a/rhodecode/apps/repo_group/views/repo_group_settings.py b/rhodecode/apps/repo_group/views/repo_group_settings.py --- a/rhodecode/apps/repo_group/views/repo_group_settings.py +++ b/rhodecode/apps/repo_group/views/repo_group_settings.py @@ -21,7 +21,7 @@ import logging import deform -from pyramid.view import view_config + from pyramid.httpexceptions import HTTPFound from rhodecode import events @@ -109,9 +109,6 @@ class RepoGroupSettingsView(RepoGroupApp @LoginRequired() @HasRepoGroupPermissionAnyDecorator('group.admin') - @view_config( - route_name='edit_repo_group', request_method='GET', - renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako') def edit_settings(self): c = self.load_default_context() c.active = 'settings' @@ -126,9 +123,6 @@ class RepoGroupSettingsView(RepoGroupApp @LoginRequired() @HasRepoGroupPermissionAnyDecorator('group.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_group', request_method='POST', - renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako') def edit_settings_update(self): _ = self.request.translate c = self.load_default_context() diff --git a/rhodecode/apps/repository/__init__.py b/rhodecode/apps/repository/__init__.py --- a/rhodecode/apps/repository/__init__.py +++ b/rhodecode/apps/repository/__init__.py @@ -21,15 +21,52 @@ from rhodecode.apps._base import add_rou def includeme(config): + from rhodecode.apps.repository.views.repo_artifacts import RepoArtifactsView + from rhodecode.apps.repository.views.repo_audit_logs import AuditLogsView + from rhodecode.apps.repository.views.repo_automation import RepoAutomationView + from rhodecode.apps.repository.views.repo_bookmarks import RepoBookmarksView + from rhodecode.apps.repository.views.repo_branch_permissions import RepoSettingsBranchPermissionsView + from rhodecode.apps.repository.views.repo_branches import RepoBranchesView + from rhodecode.apps.repository.views.repo_caches import RepoCachesView + from rhodecode.apps.repository.views.repo_changelog import RepoChangelogView + from rhodecode.apps.repository.views.repo_checks import RepoChecksView + from rhodecode.apps.repository.views.repo_commits import RepoCommitsView + from rhodecode.apps.repository.views.repo_compare import RepoCompareView + from rhodecode.apps.repository.views.repo_feed import RepoFeedView + from rhodecode.apps.repository.views.repo_files import RepoFilesView + from rhodecode.apps.repository.views.repo_forks import RepoForksView + from rhodecode.apps.repository.views.repo_maintainance import RepoMaintenanceView + from rhodecode.apps.repository.views.repo_permissions import RepoSettingsPermissionsView + from rhodecode.apps.repository.views.repo_pull_requests import RepoPullRequestsView + from rhodecode.apps.repository.views.repo_review_rules import RepoReviewRulesView + from rhodecode.apps.repository.views.repo_settings import RepoSettingsView + from rhodecode.apps.repository.views.repo_settings_advanced import RepoSettingsAdvancedView + from rhodecode.apps.repository.views.repo_settings_fields import RepoSettingsFieldsView + from rhodecode.apps.repository.views.repo_settings_issue_trackers import RepoSettingsIssueTrackersView + from rhodecode.apps.repository.views.repo_settings_remote import RepoSettingsRemoteView + from rhodecode.apps.repository.views.repo_settings_vcs import RepoSettingsVcsView + from rhodecode.apps.repository.views.repo_strip import RepoStripView + from rhodecode.apps.repository.views.repo_summary import RepoSummaryView + from rhodecode.apps.repository.views.repo_tags import RepoTagsView # repo creating checks, special cases that aren't repo routes config.add_route( name='repo_creating', pattern='/{repo_name:.*?[^/]}/repo_creating') + config.add_view( + RepoChecksView, + attr='repo_creating', + route_name='repo_creating', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_creating.mako') config.add_route( name='repo_creating_check', pattern='/{repo_name:.*?[^/]}/repo_creating_check') + config.add_view( + RepoChecksView, + attr='repo_creating_check', + route_name='repo_creating_check', request_method='GET', + renderer='json_ext') # Summary # NOTE(marcink): one additional route is defined in very bottom, catch @@ -37,191 +74,467 @@ def includeme(config): config.add_route( name='repo_summary_explicit', pattern='/{repo_name:.*?[^/]}/summary', repo_route=True) + config.add_view( + RepoSummaryView, + attr='summary', + route_name='repo_summary_explicit', request_method='GET', + renderer='rhodecode:templates/summary/summary.mako') + config.add_route( name='repo_summary_commits', pattern='/{repo_name:.*?[^/]}/summary-commits', repo_route=True) - + config.add_view( + RepoSummaryView, + attr='summary_commits', + route_name='repo_summary_commits', request_method='GET', + renderer='rhodecode:templates/summary/summary_commits.mako') + # Commits config.add_route( name='repo_commit', pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}', repo_route=True) + config.add_view( + RepoCommitsView, + attr='repo_commit_show', + route_name='repo_commit', request_method='GET', + renderer=None) config.add_route( name='repo_commit_children', pattern='/{repo_name:.*?[^/]}/changeset_children/{commit_id}', repo_route=True) + config.add_view( + RepoCommitsView, + attr='repo_commit_children', + route_name='repo_commit_children', request_method='GET', + renderer='json_ext', xhr=True) config.add_route( name='repo_commit_parents', pattern='/{repo_name:.*?[^/]}/changeset_parents/{commit_id}', repo_route=True) + config.add_view( + RepoCommitsView, + attr='repo_commit_parents', + route_name='repo_commit_parents', request_method='GET', + renderer='json_ext') config.add_route( name='repo_commit_raw', pattern='/{repo_name:.*?[^/]}/changeset-diff/{commit_id}', repo_route=True) + config.add_view( + RepoCommitsView, + attr='repo_commit_raw', + route_name='repo_commit_raw', request_method='GET', + renderer=None) config.add_route( name='repo_commit_patch', pattern='/{repo_name:.*?[^/]}/changeset-patch/{commit_id}', repo_route=True) + config.add_view( + RepoCommitsView, + attr='repo_commit_patch', + route_name='repo_commit_patch', request_method='GET', + renderer=None) config.add_route( name='repo_commit_download', pattern='/{repo_name:.*?[^/]}/changeset-download/{commit_id}', repo_route=True) + config.add_view( + RepoCommitsView, + attr='repo_commit_download', + route_name='repo_commit_download', request_method='GET', + renderer=None) config.add_route( name='repo_commit_data', pattern='/{repo_name:.*?[^/]}/changeset-data/{commit_id}', repo_route=True) + config.add_view( + RepoCommitsView, + attr='repo_commit_data', + route_name='repo_commit_data', request_method='GET', + renderer='json_ext', xhr=True) config.add_route( name='repo_commit_comment_create', pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/create', repo_route=True) + config.add_view( + RepoCommitsView, + attr='repo_commit_comment_create', + route_name='repo_commit_comment_create', request_method='POST', + renderer='json_ext') config.add_route( name='repo_commit_comment_preview', pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/preview', repo_route=True) + config.add_view( + RepoCommitsView, + attr='repo_commit_comment_preview', + route_name='repo_commit_comment_preview', request_method='POST', + renderer='string', xhr=True) config.add_route( name='repo_commit_comment_history_view', pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_history_id}/history_view', repo_route=True) + config.add_view( + RepoCommitsView, + attr='repo_commit_comment_history_view', + route_name='repo_commit_comment_history_view', request_method='POST', + renderer='string', xhr=True) config.add_route( name='repo_commit_comment_attachment_upload', pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/attachment_upload', repo_route=True) + config.add_view( + RepoCommitsView, + attr='repo_commit_comment_attachment_upload', + route_name='repo_commit_comment_attachment_upload', request_method='POST', + renderer='json_ext', xhr=True) config.add_route( name='repo_commit_comment_delete', pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/delete', repo_route=True) + config.add_view( + RepoCommitsView, + attr='repo_commit_comment_delete', + route_name='repo_commit_comment_delete', request_method='POST', + renderer='json_ext') config.add_route( name='repo_commit_comment_edit', pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/edit', repo_route=True) + config.add_view( + RepoCommitsView, + attr='repo_commit_comment_edit', + route_name='repo_commit_comment_edit', request_method='POST', + renderer='json_ext') # still working url for backward compat. config.add_route( name='repo_commit_raw_deprecated', pattern='/{repo_name:.*?[^/]}/raw-changeset/{commit_id}', repo_route=True) + config.add_view( + RepoCommitsView, + attr='repo_commit_raw', + route_name='repo_commit_raw_deprecated', request_method='GET', + renderer=None) # Files config.add_route( name='repo_archivefile', pattern='/{repo_name:.*?[^/]}/archive/{fname:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_archivefile', + route_name='repo_archivefile', request_method='GET', + renderer=None) config.add_route( name='repo_files_diff', pattern='/{repo_name:.*?[^/]}/diff/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_files_diff', + route_name='repo_files_diff', request_method='GET', + renderer=None) + config.add_route( # legacy route to make old links work name='repo_files_diff_2way_redirect', pattern='/{repo_name:.*?[^/]}/diff-2way/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_files_diff_2way_redirect', + route_name='repo_files_diff_2way_redirect', request_method='GET', + renderer=None) config.add_route( name='repo_files', pattern='/{repo_name:.*?[^/]}/files/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_files', + route_name='repo_files', request_method='GET', + renderer=None) + config.add_route( name='repo_files:default_path', pattern='/{repo_name:.*?[^/]}/files/{commit_id}/', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_files', + route_name='repo_files:default_path', request_method='GET', + renderer=None) + config.add_route( name='repo_files:default_commit', pattern='/{repo_name:.*?[^/]}/files', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_files', + route_name='repo_files:default_commit', request_method='GET', + renderer=None) config.add_route( name='repo_files:rendered', pattern='/{repo_name:.*?[^/]}/render/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_files', + route_name='repo_files:rendered', request_method='GET', + renderer=None) config.add_route( name='repo_files:annotated', pattern='/{repo_name:.*?[^/]}/annotate/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_files', + route_name='repo_files:annotated', request_method='GET', + renderer=None) + config.add_route( name='repo_files:annotated_previous', pattern='/{repo_name:.*?[^/]}/annotate-previous/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_files_annotated_previous', + route_name='repo_files:annotated_previous', request_method='GET', + renderer=None) config.add_route( name='repo_nodetree_full', pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_nodetree_full', + route_name='repo_nodetree_full', request_method='GET', + renderer=None, xhr=True) + config.add_route( name='repo_nodetree_full:default_path', pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_nodetree_full', + route_name='repo_nodetree_full:default_path', request_method='GET', + renderer=None, xhr=True) config.add_route( name='repo_files_nodelist', pattern='/{repo_name:.*?[^/]}/nodelist/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_nodelist', + route_name='repo_files_nodelist', request_method='GET', + renderer='json_ext', xhr=True) config.add_route( name='repo_file_raw', pattern='/{repo_name:.*?[^/]}/raw/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_file_raw', + route_name='repo_file_raw', request_method='GET', + renderer=None) config.add_route( name='repo_file_download', pattern='/{repo_name:.*?[^/]}/download/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_file_download', + route_name='repo_file_download', request_method='GET', + renderer=None) + config.add_route( # backward compat to keep old links working name='repo_file_download:legacy', pattern='/{repo_name:.*?[^/]}/rawfile/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_file_download', + route_name='repo_file_download:legacy', request_method='GET', + renderer=None) config.add_route( name='repo_file_history', pattern='/{repo_name:.*?[^/]}/history/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_file_history', + route_name='repo_file_history', request_method='GET', + renderer='json_ext') config.add_route( name='repo_file_authors', pattern='/{repo_name:.*?[^/]}/authors/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_file_authors', + route_name='repo_file_authors', request_method='GET', + renderer='rhodecode:templates/files/file_authors_box.mako') config.add_route( name='repo_files_check_head', pattern='/{repo_name:.*?[^/]}/check_head/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_files_check_head', + route_name='repo_files_check_head', request_method='POST', + renderer='json_ext', xhr=True) + config.add_route( name='repo_files_remove_file', pattern='/{repo_name:.*?[^/]}/remove_file/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_files_remove_file', + route_name='repo_files_remove_file', request_method='GET', + renderer='rhodecode:templates/files/files_delete.mako') + config.add_route( name='repo_files_delete_file', pattern='/{repo_name:.*?[^/]}/delete_file/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_files_delete_file', + route_name='repo_files_delete_file', request_method='POST', + renderer=None) + config.add_route( name='repo_files_edit_file', pattern='/{repo_name:.*?[^/]}/edit_file/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_files_edit_file', + route_name='repo_files_edit_file', request_method='GET', + renderer='rhodecode:templates/files/files_edit.mako') + config.add_route( name='repo_files_update_file', pattern='/{repo_name:.*?[^/]}/update_file/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_files_update_file', + route_name='repo_files_update_file', request_method='POST', + renderer=None) + config.add_route( name='repo_files_add_file', pattern='/{repo_name:.*?[^/]}/add_file/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_files_add_file', + route_name='repo_files_add_file', request_method='GET', + renderer='rhodecode:templates/files/files_add.mako') + config.add_route( name='repo_files_upload_file', pattern='/{repo_name:.*?[^/]}/upload_file/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoFilesView, + attr='repo_files_add_file', + route_name='repo_files_upload_file', request_method='GET', + renderer='rhodecode:templates/files/files_upload.mako') + config.add_view( # POST creates + RepoFilesView, + attr='repo_files_upload_file', + route_name='repo_files_upload_file', request_method='POST', + renderer='json_ext') + config.add_route( name='repo_files_create_file', pattern='/{repo_name:.*?[^/]}/create_file/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( # POST creates + RepoFilesView, + attr='repo_files_create_file', + route_name='repo_files_create_file', request_method='POST', + renderer=None) # Refs data config.add_route( name='repo_refs_data', pattern='/{repo_name:.*?[^/]}/refs-data', repo_route=True) + config.add_view( + RepoSummaryView, + attr='repo_refs_data', + route_name='repo_refs_data', request_method='GET', + renderer='json_ext') config.add_route( name='repo_refs_changelog_data', pattern='/{repo_name:.*?[^/]}/refs-data-changelog', repo_route=True) + config.add_view( + RepoSummaryView, + attr='repo_refs_changelog_data', + route_name='repo_refs_changelog_data', request_method='GET', + renderer='json_ext') config.add_route( name='repo_stats', pattern='/{repo_name:.*?[^/]}/repo_stats/{commit_id}', repo_route=True) + config.add_view( + RepoSummaryView, + attr='repo_stats', + route_name='repo_stats', request_method='GET', + renderer='json_ext') # Commits config.add_route( name='repo_commits', pattern='/{repo_name:.*?[^/]}/commits', repo_route=True) + config.add_view( + RepoChangelogView, + attr='repo_changelog', + route_name='repo_commits', request_method='GET', + renderer='rhodecode:templates/commits/changelog.mako') + # old routes for backward compat + config.add_view( + RepoChangelogView, + attr='repo_changelog', + route_name='repo_changelog', request_method='GET', + renderer='rhodecode:templates/commits/changelog.mako') + + config.add_route( + name='repo_commits_elements', + pattern='/{repo_name:.*?[^/]}/commits_elements', repo_route=True) + config.add_view( + RepoChangelogView, + attr='repo_commits_elements', + route_name='repo_commits_elements', request_method=('GET', 'POST'), + renderer='rhodecode:templates/commits/changelog_elements.mako', + xhr=True) + + config.add_route( + name='repo_commits_elements_file', + pattern='/{repo_name:.*?[^/]}/commits_elements/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoChangelogView, + attr='repo_commits_elements', + route_name='repo_commits_elements_file', request_method=('GET', 'POST'), + renderer='rhodecode:templates/commits/changelog_elements.mako', + xhr=True) + config.add_route( name='repo_commits_file', pattern='/{repo_name:.*?[^/]}/commits/{commit_id}/{f_path:.*}', repo_route=True) - config.add_route( - name='repo_commits_elements', - pattern='/{repo_name:.*?[^/]}/commits_elements', repo_route=True) - config.add_route( - name='repo_commits_elements_file', - pattern='/{repo_name:.*?[^/]}/commits_elements/{commit_id}/{f_path:.*}', repo_route=True) + config.add_view( + RepoChangelogView, + attr='repo_changelog', + route_name='repo_commits_file', request_method='GET', + renderer='rhodecode:templates/commits/changelog.mako') + # old routes for backward compat + config.add_view( + RepoChangelogView, + attr='repo_changelog', + route_name='repo_changelog_file', request_method='GET', + renderer='rhodecode:templates/commits/changelog.mako') # Changelog (old deprecated name for commits page) config.add_route( @@ -235,25 +548,50 @@ def includeme(config): config.add_route( name='repo_compare_select', pattern='/{repo_name:.*?[^/]}/compare', repo_route=True) + config.add_view( + RepoCompareView, + attr='compare_select', + route_name='repo_compare_select', request_method='GET', + renderer='rhodecode:templates/compare/compare_diff.mako') config.add_route( name='repo_compare', pattern='/{repo_name:.*?[^/]}/compare/{source_ref_type}@{source_ref:.*?}...{target_ref_type}@{target_ref:.*?}', repo_route=True) + config.add_view( + RepoCompareView, + attr='compare', + route_name='repo_compare', request_method='GET', + renderer=None) # Tags config.add_route( name='tags_home', pattern='/{repo_name:.*?[^/]}/tags', repo_route=True) + config.add_view( + RepoTagsView, + attr='tags', + route_name='tags_home', request_method='GET', + renderer='rhodecode:templates/tags/tags.mako') # Branches config.add_route( name='branches_home', pattern='/{repo_name:.*?[^/]}/branches', repo_route=True) + config.add_view( + RepoBranchesView, + attr='branches', + route_name='branches_home', request_method='GET', + renderer='rhodecode:templates/branches/branches.mako') # Bookmarks config.add_route( name='bookmarks_home', pattern='/{repo_name:.*?[^/]}/bookmarks', repo_route=True) + config.add_view( + RepoBookmarksView, + attr='bookmarks', + route_name='bookmarks_home', request_method='GET', + renderer='rhodecode:templates/bookmarks/bookmarks.mako') # Forks config.add_route( @@ -261,195 +599,426 @@ def includeme(config): pattern='/{repo_name:.*?[^/]}/fork', repo_route=True, repo_forbid_when_archived=True, repo_accepted_types=['hg', 'git']) + config.add_view( + RepoForksView, + attr='repo_fork_new', + route_name='repo_fork_new', request_method='GET', + renderer='rhodecode:templates/forks/forks.mako') config.add_route( name='repo_fork_create', pattern='/{repo_name:.*?[^/]}/fork/create', repo_route=True, repo_forbid_when_archived=True, repo_accepted_types=['hg', 'git']) + config.add_view( + RepoForksView, + attr='repo_fork_create', + route_name='repo_fork_create', request_method='POST', + renderer='rhodecode:templates/forks/fork.mako') config.add_route( name='repo_forks_show_all', pattern='/{repo_name:.*?[^/]}/forks', repo_route=True, repo_accepted_types=['hg', 'git']) + config.add_view( + RepoForksView, + attr='repo_forks_show_all', + route_name='repo_forks_show_all', request_method='GET', + renderer='rhodecode:templates/forks/forks.mako') + config.add_route( name='repo_forks_data', pattern='/{repo_name:.*?[^/]}/forks/data', repo_route=True, repo_accepted_types=['hg', 'git']) + config.add_view( + RepoForksView, + attr='repo_forks_data', + route_name='repo_forks_data', request_method='GET', + renderer='json_ext', xhr=True) # Pull Requests config.add_route( name='pullrequest_show', pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}', repo_route=True) + config.add_view( + RepoPullRequestsView, + attr='pull_request_show', + route_name='pullrequest_show', request_method='GET', + renderer='rhodecode:templates/pullrequests/pullrequest_show.mako') config.add_route( name='pullrequest_show_all', pattern='/{repo_name:.*?[^/]}/pull-request', repo_route=True, repo_accepted_types=['hg', 'git']) + config.add_view( + RepoPullRequestsView, + attr='pull_request_list', + route_name='pullrequest_show_all', request_method='GET', + renderer='rhodecode:templates/pullrequests/pullrequests.mako') config.add_route( name='pullrequest_show_all_data', pattern='/{repo_name:.*?[^/]}/pull-request-data', repo_route=True, repo_accepted_types=['hg', 'git']) + config.add_view( + RepoPullRequestsView, + attr='pull_request_list_data', + route_name='pullrequest_show_all_data', request_method='GET', + renderer='json_ext', xhr=True) config.add_route( name='pullrequest_repo_refs', pattern='/{repo_name:.*?[^/]}/pull-request/refs/{target_repo_name:.*?[^/]}', repo_route=True) + config.add_view( + RepoPullRequestsView, + attr='pull_request_repo_refs', + route_name='pullrequest_repo_refs', request_method='GET', + renderer='json_ext', xhr=True) config.add_route( name='pullrequest_repo_targets', pattern='/{repo_name:.*?[^/]}/pull-request/repo-targets', repo_route=True) + config.add_view( + RepoPullRequestsView, + attr='pullrequest_repo_targets', + route_name='pullrequest_repo_targets', request_method='GET', + renderer='json_ext', xhr=True) config.add_route( name='pullrequest_new', pattern='/{repo_name:.*?[^/]}/pull-request/new', repo_route=True, repo_accepted_types=['hg', 'git'], repo_forbid_when_archived=True) + config.add_view( + RepoPullRequestsView, + attr='pull_request_new', + route_name='pullrequest_new', request_method='GET', + renderer='rhodecode:templates/pullrequests/pullrequest.mako') config.add_route( name='pullrequest_create', pattern='/{repo_name:.*?[^/]}/pull-request/create', repo_route=True, repo_accepted_types=['hg', 'git'], repo_forbid_when_archived=True) + config.add_view( + RepoPullRequestsView, + attr='pull_request_create', + route_name='pullrequest_create', request_method='POST', + renderer=None) config.add_route( name='pullrequest_update', pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update', repo_route=True, repo_forbid_when_archived=True) + config.add_view( + RepoPullRequestsView, + attr='pull_request_update', + route_name='pullrequest_update', request_method='POST', + renderer='json_ext') config.add_route( name='pullrequest_merge', pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge', repo_route=True, repo_forbid_when_archived=True) + config.add_view( + RepoPullRequestsView, + attr='pull_request_merge', + route_name='pullrequest_merge', request_method='POST', + renderer='json_ext') config.add_route( name='pullrequest_delete', pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete', repo_route=True, repo_forbid_when_archived=True) + config.add_view( + RepoPullRequestsView, + attr='pull_request_delete', + route_name='pullrequest_delete', request_method='POST', + renderer='json_ext') config.add_route( name='pullrequest_comment_create', pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment', repo_route=True) + config.add_view( + RepoPullRequestsView, + attr='pull_request_comment_create', + route_name='pullrequest_comment_create', request_method='POST', + renderer='json_ext') config.add_route( name='pullrequest_comment_edit', pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/edit', repo_route=True, repo_accepted_types=['hg', 'git']) + config.add_view( + RepoPullRequestsView, + attr='pull_request_comment_edit', + route_name='pullrequest_comment_edit', request_method='POST', + renderer='json_ext') config.add_route( name='pullrequest_comment_delete', pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete', repo_route=True, repo_accepted_types=['hg', 'git']) + config.add_view( + RepoPullRequestsView, + attr='pull_request_comment_delete', + route_name='pullrequest_comment_delete', request_method='POST', + renderer='json_ext') config.add_route( name='pullrequest_comments', pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comments', repo_route=True) + config.add_view( + RepoPullRequestsView, + attr='pullrequest_comments', + route_name='pullrequest_comments', request_method='POST', + renderer='string_html', xhr=True) config.add_route( name='pullrequest_todos', pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/todos', repo_route=True) + config.add_view( + RepoPullRequestsView, + attr='pullrequest_todos', + route_name='pullrequest_todos', request_method='POST', + renderer='string_html', xhr=True) config.add_route( name='pullrequest_drafts', pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/drafts', repo_route=True) + config.add_view( + RepoPullRequestsView, + attr='pullrequest_drafts', + route_name='pullrequest_drafts', request_method='POST', + renderer='string_html', xhr=True) # Artifacts, (EE feature) config.add_route( name='repo_artifacts_list', pattern='/{repo_name:.*?[^/]}/artifacts', repo_route=True) + config.add_view( + RepoArtifactsView, + attr='repo_artifacts', + route_name='repo_artifacts_list', request_method='GET', + renderer='rhodecode:templates/artifacts/artifact_list.mako') # Settings config.add_route( name='edit_repo', pattern='/{repo_name:.*?[^/]}/settings', repo_route=True) + config.add_view( + RepoSettingsView, + attr='edit_settings', + route_name='edit_repo', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') # update is POST on edit_repo + config.add_view( + RepoSettingsView, + attr='edit_settings_update', + route_name='edit_repo', request_method='POST', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') # Settings advanced config.add_route( name='edit_repo_advanced', pattern='/{repo_name:.*?[^/]}/settings/advanced', repo_route=True) + config.add_view( + RepoSettingsAdvancedView, + attr='edit_advanced', + route_name='edit_repo_advanced', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') + config.add_route( name='edit_repo_advanced_archive', pattern='/{repo_name:.*?[^/]}/settings/advanced/archive', repo_route=True) + config.add_view( + RepoSettingsAdvancedView, + attr='edit_advanced_archive', + route_name='edit_repo_advanced_archive', request_method='POST', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') + config.add_route( name='edit_repo_advanced_delete', pattern='/{repo_name:.*?[^/]}/settings/advanced/delete', repo_route=True) + config.add_view( + RepoSettingsAdvancedView, + attr='edit_advanced_delete', + route_name='edit_repo_advanced_delete', request_method='POST', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') + config.add_route( name='edit_repo_advanced_locking', pattern='/{repo_name:.*?[^/]}/settings/advanced/locking', repo_route=True) + config.add_view( + RepoSettingsAdvancedView, + attr='edit_advanced_toggle_locking', + route_name='edit_repo_advanced_locking', request_method='POST', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') + config.add_route( name='edit_repo_advanced_journal', pattern='/{repo_name:.*?[^/]}/settings/advanced/journal', repo_route=True) + config.add_view( + RepoSettingsAdvancedView, + attr='edit_advanced_journal', + route_name='edit_repo_advanced_journal', request_method='POST', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') + config.add_route( name='edit_repo_advanced_fork', pattern='/{repo_name:.*?[^/]}/settings/advanced/fork', repo_route=True) + config.add_view( + RepoSettingsAdvancedView, + attr='edit_advanced_fork', + route_name='edit_repo_advanced_fork', request_method='POST', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') config.add_route( name='edit_repo_advanced_hooks', pattern='/{repo_name:.*?[^/]}/settings/advanced/hooks', repo_route=True) + config.add_view( + RepoSettingsAdvancedView, + attr='edit_advanced_install_hooks', + route_name='edit_repo_advanced_hooks', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') # Caches config.add_route( name='edit_repo_caches', pattern='/{repo_name:.*?[^/]}/settings/caches', repo_route=True) + config.add_view( + RepoCachesView, + attr='repo_caches', + route_name='edit_repo_caches', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') + config.add_view( + RepoCachesView, + attr='repo_caches_purge', + route_name='edit_repo_caches', request_method='POST') # Permissions config.add_route( name='edit_repo_perms', pattern='/{repo_name:.*?[^/]}/settings/permissions', repo_route=True) + config.add_view( + RepoSettingsPermissionsView, + attr='edit_permissions', + route_name='edit_repo_perms', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') + config.add_view( + RepoSettingsPermissionsView, + attr='edit_permissions_update', + route_name='edit_repo_perms', request_method='POST', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') config.add_route( name='edit_repo_perms_set_private', pattern='/{repo_name:.*?[^/]}/settings/permissions/set_private', repo_route=True) + config.add_view( + RepoSettingsPermissionsView, + attr='edit_permissions_set_private_repo', + route_name='edit_repo_perms_set_private', request_method='POST', + renderer='json_ext') # Permissions Branch (EE feature) config.add_route( name='edit_repo_perms_branch', pattern='/{repo_name:.*?[^/]}/settings/branch_permissions', repo_route=True) + config.add_view( + RepoBranchesView, + attr='branches', + route_name='edit_repo_perms_branch', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') + config.add_route( name='edit_repo_perms_branch_delete', pattern='/{repo_name:.*?[^/]}/settings/branch_permissions/{rule_id}/delete', repo_route=True) + ## Only implemented in EE # Maintenance config.add_route( name='edit_repo_maintenance', pattern='/{repo_name:.*?[^/]}/settings/maintenance', repo_route=True) + config.add_view( + RepoMaintenanceView, + attr='repo_maintenance', + route_name='edit_repo_maintenance_execute', request_method='GET', + renderer='json', xhr=True) config.add_route( name='edit_repo_maintenance_execute', pattern='/{repo_name:.*?[^/]}/settings/maintenance/execute', repo_route=True) + config.add_view( + RepoMaintenanceView, + attr='repo_maintenance_execute', + route_name='edit_repo_maintenance', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') # Fields config.add_route( name='edit_repo_fields', pattern='/{repo_name:.*?[^/]}/settings/fields', repo_route=True) + config.add_view( + RepoSettingsFieldsView, + attr='repo_field_edit', + route_name='edit_repo_fields', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') + config.add_route( name='edit_repo_fields_create', pattern='/{repo_name:.*?[^/]}/settings/fields/create', repo_route=True) + config.add_view( + RepoSettingsFieldsView, + attr='repo_field_create', + route_name='edit_repo_fields_create', request_method='POST', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') + config.add_route( name='edit_repo_fields_delete', pattern='/{repo_name:.*?[^/]}/settings/fields/{field_id}/delete', repo_route=True) + config.add_view( + RepoSettingsFieldsView, + attr='repo_field_delete', + route_name='edit_repo_fields_delete', request_method='POST', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') # Locking config.add_route( name='repo_edit_toggle_locking', pattern='/{repo_name:.*?[^/]}/settings/toggle_locking', repo_route=True) + config.add_view( + RepoSettingsView, + attr='edit_advanced_toggle_locking', + route_name='repo_edit_toggle_locking', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') # Remote config.add_route( name='edit_repo_remote', pattern='/{repo_name:.*?[^/]}/settings/remote', repo_route=True) + config.add_view( + RepoSettingsRemoteView, + attr='repo_remote_edit_form', + route_name='edit_repo_remote', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') + config.add_route( name='edit_repo_remote_pull', pattern='/{repo_name:.*?[^/]}/settings/remote/pull', repo_route=True) + config.add_view( + RepoSettingsRemoteView, + attr='repo_remote_pull_changes', + route_name='edit_repo_remote_pull', request_method='POST', + renderer=None) + config.add_route( name='edit_repo_remote_push', pattern='/{repo_name:.*?[^/]}/settings/remote/push', repo_route=True) @@ -458,91 +1027,201 @@ def includeme(config): config.add_route( name='edit_repo_statistics', pattern='/{repo_name:.*?[^/]}/settings/statistics', repo_route=True) + config.add_view( + RepoSettingsView, + attr='edit_statistics_form', + route_name='edit_repo_statistics', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') + config.add_route( name='edit_repo_statistics_reset', pattern='/{repo_name:.*?[^/]}/settings/statistics/update', repo_route=True) + config.add_view( + RepoSettingsView, + attr='repo_statistics_reset', + route_name='edit_repo_statistics_reset', request_method='POST', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') # Issue trackers config.add_route( name='edit_repo_issuetracker', pattern='/{repo_name:.*?[^/]}/settings/issue_trackers', repo_route=True) + config.add_view( + RepoSettingsIssueTrackersView, + attr='repo_issuetracker', + route_name='edit_repo_issuetracker', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') + config.add_route( name='edit_repo_issuetracker_test', pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/test', repo_route=True) + config.add_view( + RepoSettingsIssueTrackersView, + attr='repo_issuetracker_test', + route_name='edit_repo_issuetracker_test', request_method='POST', + renderer='string', xhr=True) + config.add_route( name='edit_repo_issuetracker_delete', pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/delete', repo_route=True) + config.add_view( + RepoSettingsIssueTrackersView, + attr='repo_issuetracker_delete', + route_name='edit_repo_issuetracker_delete', request_method='POST', + renderer='json_ext', xhr=True) + config.add_route( name='edit_repo_issuetracker_update', pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/update', repo_route=True) + config.add_view( + RepoSettingsIssueTrackersView, + attr='repo_issuetracker_update', + route_name='edit_repo_issuetracker_update', request_method='POST', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') # VCS Settings config.add_route( name='edit_repo_vcs', pattern='/{repo_name:.*?[^/]}/settings/vcs', repo_route=True) + config.add_view( + RepoSettingsVcsView, + attr='repo_vcs_settings', + route_name='edit_repo_vcs', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') + config.add_route( name='edit_repo_vcs_update', pattern='/{repo_name:.*?[^/]}/settings/vcs/update', repo_route=True) + config.add_view( + RepoSettingsVcsView, + attr='repo_settings_vcs_update', + route_name='edit_repo_vcs_update', request_method='POST', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') # svn pattern config.add_route( name='edit_repo_vcs_svn_pattern_delete', pattern='/{repo_name:.*?[^/]}/settings/vcs/svn_pattern/delete', repo_route=True) + config.add_view( + RepoSettingsVcsView, + attr='repo_settings_delete_svn_pattern', + route_name='edit_repo_vcs_svn_pattern_delete', request_method='POST', + renderer='json_ext', xhr=True) # Repo Review Rules (EE feature) config.add_route( name='repo_reviewers', pattern='/{repo_name:.*?[^/]}/settings/review/rules', repo_route=True) + config.add_view( + RepoReviewRulesView, + attr='repo_review_rules', + route_name='repo_reviewers', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') config.add_route( name='repo_default_reviewers_data', pattern='/{repo_name:.*?[^/]}/settings/review/default-reviewers', repo_route=True) + config.add_view( + RepoReviewRulesView, + attr='repo_default_reviewers_data', + route_name='repo_default_reviewers_data', request_method='GET', + renderer='json_ext') # Repo Automation (EE feature) config.add_route( name='repo_automation', pattern='/{repo_name:.*?[^/]}/settings/automation', repo_route=True) + config.add_view( + RepoAutomationView, + attr='repo_automation', + route_name='repo_automation', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') # Strip config.add_route( name='edit_repo_strip', pattern='/{repo_name:.*?[^/]}/settings/strip', repo_route=True) + config.add_view( + RepoStripView, + attr='strip', + route_name='edit_repo_strip', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') config.add_route( name='strip_check', pattern='/{repo_name:.*?[^/]}/settings/strip_check', repo_route=True) + config.add_view( + RepoStripView, + attr='strip_check', + route_name='strip_check', request_method='POST', + renderer='json', xhr=True) config.add_route( name='strip_execute', pattern='/{repo_name:.*?[^/]}/settings/strip_execute', repo_route=True) + config.add_view( + RepoStripView, + attr='strip_execute', + route_name='strip_execute', request_method='POST', + renderer='json', xhr=True) # Audit logs config.add_route( name='edit_repo_audit_logs', pattern='/{repo_name:.*?[^/]}/settings/audit_logs', repo_route=True) + config.add_view( + AuditLogsView, + attr='repo_audit_logs', + route_name='edit_repo_audit_logs', request_method='GET', + renderer='rhodecode:templates/admin/repos/repo_edit.mako') # ATOM/RSS Feed, shouldn't contain slashes for outlook compatibility config.add_route( name='rss_feed_home', pattern='/{repo_name:.*?[^/]}/feed-rss', repo_route=True) + config.add_view( + RepoFeedView, + attr='rss', + route_name='rss_feed_home', request_method='GET', renderer=None) + + config.add_route( + name='rss_feed_home_old', + pattern='/{repo_name:.*?[^/]}/feed/rss', repo_route=True) + config.add_view( + RepoFeedView, + attr='rss', + route_name='rss_feed_home_old', request_method='GET', renderer=None) config.add_route( name='atom_feed_home', pattern='/{repo_name:.*?[^/]}/feed-atom', repo_route=True) - - config.add_route( - name='rss_feed_home_old', - pattern='/{repo_name:.*?[^/]}/feed/rss', repo_route=True) + config.add_view( + RepoFeedView, + attr='atom', + route_name='atom_feed_home', request_method='GET', renderer=None) config.add_route( name='atom_feed_home_old', pattern='/{repo_name:.*?[^/]}/feed/atom', repo_route=True) + config.add_view( + RepoFeedView, + attr='atom', + route_name='atom_feed_home_old', request_method='GET', renderer=None) # NOTE(marcink): needs to be at the end for catch-all add_route_with_slash( config, name='repo_summary', pattern='/{repo_name:.*?[^/]}', repo_route=True) - - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') + config.add_view( + RepoSummaryView, + attr='summary', + route_name='repo_summary', request_method='GET', + renderer='rhodecode:templates/summary/summary.mako') + + # TODO(marcink): there's no such route?? + config.add_view( + RepoSummaryView, + attr='summary', + route_name='repo_summary_slash', request_method='GET', + renderer='rhodecode:templates/summary/summary.mako') \ No newline at end of file diff --git a/rhodecode/apps/repository/views/repo_artifacts.py b/rhodecode/apps/repository/views/repo_artifacts.py --- a/rhodecode/apps/repository/views/repo_artifacts.py +++ b/rhodecode/apps/repository/views/repo_artifacts.py @@ -20,7 +20,7 @@ import logging -from pyramid.view import view_config + from rhodecode.apps._base import RepoAppView from rhodecode.lib.auth import ( @@ -39,9 +39,6 @@ class RepoArtifactsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_artifacts_list', request_method='GET', - renderer='rhodecode:templates/artifacts/artifact_list.mako') def repo_artifacts(self): c = self.load_default_context() c.active = 'artifacts' diff --git a/rhodecode/apps/repository/views/repo_audit_logs.py b/rhodecode/apps/repository/views/repo_audit_logs.py --- a/rhodecode/apps/repository/views/repo_audit_logs.py +++ b/rhodecode/apps/repository/views/repo_audit_logs.py @@ -19,7 +19,7 @@ # and proprietary license terms, please see https://rhodecode.com/licenses/ import logging -from pyramid.view import view_config + from rhodecode.apps._base import RepoAppView from rhodecode.lib.helpers import SqlPage @@ -38,9 +38,6 @@ class AuditLogsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='edit_repo_audit_logs', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def repo_audit_logs(self): _ = self.request.translate c = self.load_default_context() diff --git a/rhodecode/apps/repository/views/repo_automation.py b/rhodecode/apps/repository/views/repo_automation.py --- a/rhodecode/apps/repository/views/repo_automation.py +++ b/rhodecode/apps/repository/views/repo_automation.py @@ -20,7 +20,7 @@ import logging -from pyramid.view import view_config + from rhodecode.apps._base import RepoAppView from rhodecode.apps.repository.utils import get_default_reviewers_data @@ -36,9 +36,6 @@ class RepoAutomationView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='repo_automation', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def repo_automation(self): c = self.load_default_context() c.active = 'automation' diff --git a/rhodecode/apps/repository/views/repo_bookmarks.py b/rhodecode/apps/repository/views/repo_bookmarks.py --- a/rhodecode/apps/repository/views/repo_bookmarks.py +++ b/rhodecode/apps/repository/views/repo_bookmarks.py @@ -20,7 +20,7 @@ import logging from pyramid.httpexceptions import HTTPNotFound -from pyramid.view import view_config + from rhodecode.apps._base import BaseReferencesView from rhodecode.lib.ext_json import json @@ -36,9 +36,6 @@ class RepoBookmarksView(BaseReferencesVi @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='bookmarks_home', request_method='GET', - renderer='rhodecode:templates/bookmarks/bookmarks.mako') def bookmarks(self): c = self.load_default_context() diff --git a/rhodecode/apps/repository/views/repo_branch_permissions.py b/rhodecode/apps/repository/views/repo_branch_permissions.py --- a/rhodecode/apps/repository/views/repo_branch_permissions.py +++ b/rhodecode/apps/repository/views/repo_branch_permissions.py @@ -20,7 +20,7 @@ import logging -from pyramid.view import view_config + from rhodecode.apps._base import RepoAppView from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator @@ -36,9 +36,6 @@ class RepoSettingsBranchPermissionsView( @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='edit_repo_perms_branch', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def branch_permissions(self): c = self.load_default_context() c.active = 'permissions_branch' diff --git a/rhodecode/apps/repository/views/repo_branches.py b/rhodecode/apps/repository/views/repo_branches.py --- a/rhodecode/apps/repository/views/repo_branches.py +++ b/rhodecode/apps/repository/views/repo_branches.py @@ -19,7 +19,7 @@ # and proprietary license terms, please see https://rhodecode.com/licenses/ import logging -from pyramid.view import view_config + from rhodecode.apps._base import BaseReferencesView from rhodecode.lib.ext_json import json @@ -34,9 +34,6 @@ class RepoBranchesView(BaseReferencesVie @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='branches_home', request_method='GET', - renderer='rhodecode:templates/branches/branches.mako') def branches(self): c = self.load_default_context() diff --git a/rhodecode/apps/repository/views/repo_caches.py b/rhodecode/apps/repository/views/repo_caches.py --- a/rhodecode/apps/repository/views/repo_caches.py +++ b/rhodecode/apps/repository/views/repo_caches.py @@ -22,7 +22,7 @@ import os import logging from pyramid.httpexceptions import HTTPFound -from pyramid.view import view_config + from rhodecode.apps._base import RepoAppView from rhodecode.lib.auth import ( @@ -42,9 +42,6 @@ class RepoCachesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='edit_repo_caches', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def repo_caches(self): c = self.load_default_context() c.active = 'caches' @@ -65,8 +62,6 @@ class RepoCachesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_caches', request_method='POST') def repo_caches_purge(self): _ = self.request.translate c = self.load_default_context() diff --git a/rhodecode/apps/repository/views/repo_changelog.py b/rhodecode/apps/repository/views/repo_changelog.py --- a/rhodecode/apps/repository/views/repo_changelog.py +++ b/rhodecode/apps/repository/views/repo_changelog.py @@ -22,7 +22,7 @@ import logging from pyramid.httpexceptions import HTTPNotFound, HTTPFound -from pyramid.view import view_config + from pyramid.renderers import render from pyramid.response import Response @@ -176,19 +176,6 @@ class RepoChangelogView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_commits', request_method='GET', - renderer='rhodecode:templates/commits/changelog.mako') - @view_config( - route_name='repo_commits_file', request_method='GET', - renderer='rhodecode:templates/commits/changelog.mako') - # old routes for backward compat - @view_config( - route_name='repo_changelog', request_method='GET', - renderer='rhodecode:templates/commits/changelog.mako') - @view_config( - route_name='repo_changelog_file', request_method='GET', - renderer='rhodecode:templates/commits/changelog.mako') def repo_changelog(self): c = self.load_default_context() @@ -216,6 +203,7 @@ class RepoChangelogView(RepoAppView): pre_load = self._get_preload_attrs() partial_xhr = self.request.environ.get('HTTP_X_PARTIAL_XHR') + try: if f_path: log.debug('generating changelog for path %s', f_path) @@ -258,8 +246,15 @@ class RepoChangelogView(RepoAppView): except (RepositoryError, CommitDoesNotExistError, Exception) as e: log.exception(safe_str(e)) h.flash(safe_str(h.escape(e)), category='error') - raise HTTPFound( - h.route_path('repo_commits', repo_name=self.db_repo_name)) + + if commit_id: + # from single commit page, we redirect to main commits + raise HTTPFound( + h.route_path('repo_commits', repo_name=self.db_repo_name)) + else: + # otherwise we redirect to summary + raise HTTPFound( + h.route_path('repo_summary', repo_name=self.db_repo_name)) if partial_xhr or self.request.environ.get('HTTP_X_PJAX'): # case when loading dynamic file history in file view @@ -283,14 +278,6 @@ class RepoChangelogView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_commits_elements', request_method=('GET', 'POST'), - renderer='rhodecode:templates/commits/changelog_elements.mako', - xhr=True) - @view_config( - route_name='repo_commits_elements_file', request_method=('GET', 'POST'), - renderer='rhodecode:templates/commits/changelog_elements.mako', - xhr=True) def repo_commits_elements(self): c = self.load_default_context() commit_id = self.request.matchdict.get('commit_id') diff --git a/rhodecode/apps/repository/views/repo_checks.py b/rhodecode/apps/repository/views/repo_checks.py --- a/rhodecode/apps/repository/views/repo_checks.py +++ b/rhodecode/apps/repository/views/repo_checks.py @@ -20,10 +20,8 @@ import logging -from pyramid.view import view_config from pyramid.httpexceptions import HTTPFound, HTTPNotFound -from rhodecode import events from rhodecode.apps._base import BaseAppView from rhodecode.lib import helpers as h from rhodecode.lib.auth import (NotAnonymous, HasRepoPermissionAny) @@ -37,13 +35,9 @@ log = logging.getLogger(__name__) class RepoChecksView(BaseAppView): def load_default_context(self): c = self._get_local_tmpl_context() - return c @NotAnonymous() - @view_config( - route_name='repo_creating', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_creating.mako') def repo_creating(self): c = self.load_default_context() repo_name = self.request.matchdict['repo_name'] @@ -71,9 +65,6 @@ class RepoChecksView(BaseAppView): return self._get_template_context(c) @NotAnonymous() - @view_config( - route_name='repo_creating_check', request_method='GET', - renderer='json_ext') def repo_creating_check(self): _ = self.request.translate task_id = self.request.GET.get('task_id') diff --git a/rhodecode/apps/repository/views/repo_commits.py b/rhodecode/apps/repository/views/repo_commits.py --- a/rhodecode/apps/repository/views/repo_commits.py +++ b/rhodecode/apps/repository/views/repo_commits.py @@ -23,7 +23,6 @@ import collections from pyramid.httpexceptions import ( HTTPNotFound, HTTPBadRequest, HTTPFound, HTTPForbidden, HTTPConflict) -from pyramid.view import view_config from pyramid.renderers import render from pyramid.response import Response @@ -41,7 +40,7 @@ from rhodecode.lib.diffs import ( get_diff_whitespace_flag) from rhodecode.lib.exceptions import StatusChangeOnClosedPullRequestError, CommentVersionMismatch import rhodecode.lib.helpers as h -from rhodecode.lib.utils2 import safe_unicode, str2bool, StrictAttributeDict +from rhodecode.lib.utils2 import safe_unicode, str2bool, StrictAttributeDict, safe_str from rhodecode.lib.vcs.backends.base import EmptyCommit from rhodecode.lib.vcs.exceptions import ( RepositoryError, CommitDoesNotExistError) @@ -110,7 +109,7 @@ class RepoCommitsView(RepoAppView): if not c.commit_ranges: raise RepositoryError('The commit range returned an empty result') except CommitDoesNotExistError as e: - msg = _('No such commit exists. Org exception: `{}`').format(e) + msg = _('No such commit exists. Org exception: `{}`').format(safe_str(e)) h.flash(msg, category='error') raise HTTPNotFound() except Exception: @@ -340,9 +339,6 @@ class RepoCommitsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_commit', request_method='GET', - renderer=None) def repo_commit_show(self): commit_id = self.request.matchdict['commit_id'] return self._commit(commit_id, method='show') @@ -350,12 +346,6 @@ class RepoCommitsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_commit_raw', request_method='GET', - renderer=None) - @view_config( - route_name='repo_commit_raw_deprecated', request_method='GET', - renderer=None) def repo_commit_raw(self): commit_id = self.request.matchdict['commit_id'] return self._commit(commit_id, method='raw') @@ -363,9 +353,6 @@ class RepoCommitsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_commit_patch', request_method='GET', - renderer=None) def repo_commit_patch(self): commit_id = self.request.matchdict['commit_id'] return self._commit(commit_id, method='patch') @@ -373,9 +360,6 @@ class RepoCommitsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_commit_download', request_method='GET', - renderer=None) def repo_commit_download(self): commit_id = self.request.matchdict['commit_id'] return self._commit(commit_id, method='download') @@ -500,9 +484,6 @@ class RepoCommitsView(RepoAppView): @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='repo_commit_comment_create', request_method='POST', - renderer='json_ext') def repo_commit_comment_create(self): _ = self.request.translate commit_id = self.request.matchdict['commit_id'] @@ -538,9 +519,6 @@ class RepoCommitsView(RepoAppView): @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='repo_commit_comment_preview', request_method='POST', - renderer='string', xhr=True) def repo_commit_comment_preview(self): # Technically a CSRF token is not needed as no state changes with this # call. However, as this is a POST is better to have it, so automated @@ -559,9 +537,6 @@ class RepoCommitsView(RepoAppView): @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='repo_commit_comment_history_view', request_method='POST', - renderer='string', xhr=True) def repo_commit_comment_history_view(self): c = self.load_default_context() @@ -587,9 +562,6 @@ class RepoCommitsView(RepoAppView): @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='repo_commit_comment_attachment_upload', request_method='POST', - renderer='json_ext', xhr=True) def repo_commit_comment_attachment_upload(self): c = self.load_default_context() upload_key = 'attachment' @@ -682,9 +654,6 @@ class RepoCommitsView(RepoAppView): @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='repo_commit_comment_delete', request_method='POST', - renderer='json_ext') def repo_commit_comment_delete(self): commit_id = self.request.matchdict['commit_id'] comment_id = self.request.matchdict['comment_id'] @@ -719,9 +688,6 @@ class RepoCommitsView(RepoAppView): @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='repo_commit_comment_edit', request_method='POST', - renderer='json_ext') def repo_commit_comment_edit(self): self.load_default_context() @@ -802,9 +768,6 @@ class RepoCommitsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_commit_data', request_method='GET', - renderer='json_ext', xhr=True) def repo_commit_data(self): commit_id = self.request.matchdict['commit_id'] self.load_default_context() @@ -817,9 +780,6 @@ class RepoCommitsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_commit_children', request_method='GET', - renderer='json_ext', xhr=True) def repo_commit_children(self): commit_id = self.request.matchdict['commit_id'] self.load_default_context() @@ -836,9 +796,6 @@ class RepoCommitsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_commit_parents', request_method='GET', - renderer='json_ext') def repo_commit_parents(self): commit_id = self.request.matchdict['commit_id'] self.load_default_context() diff --git a/rhodecode/apps/repository/views/repo_compare.py b/rhodecode/apps/repository/views/repo_compare.py --- a/rhodecode/apps/repository/views/repo_compare.py +++ b/rhodecode/apps/repository/views/repo_compare.py @@ -22,7 +22,7 @@ import logging from pyramid.httpexceptions import HTTPBadRequest, HTTPNotFound, HTTPFound -from pyramid.view import view_config + from pyramid.renderers import render from pyramid.response import Response @@ -79,9 +79,6 @@ class RepoCompareView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_compare_select', request_method='GET', - renderer='rhodecode:templates/compare/compare_diff.mako') def compare_select(self): _ = self.request.translate c = self.load_default_context() @@ -111,9 +108,6 @@ class RepoCompareView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_compare', request_method='GET', - renderer=None) def compare(self): _ = self.request.translate c = self.load_default_context() diff --git a/rhodecode/apps/repository/views/repo_feed.py b/rhodecode/apps/repository/views/repo_feed.py --- a/rhodecode/apps/repository/views/repo_feed.py +++ b/rhodecode/apps/repository/views/repo_feed.py @@ -20,10 +20,8 @@ import pytz import logging -from pyramid.view import view_config from pyramid.response import Response - from rhodecode.apps._base import RepoAppView from rhodecode.lib.feedgenerator import Rss201rev2Feed, Atom1Feed from rhodecode.lib import audit_logger @@ -118,8 +116,6 @@ class RepoFeedView(RepoAppView): @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED]) @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config(route_name='atom_feed_home', request_method='GET', renderer=None) - @view_config(route_name='atom_feed_home_old', request_method='GET', renderer=None) def atom(self): """ Produce an atom-1.0 feed via feedgenerator module @@ -166,8 +162,6 @@ class RepoFeedView(RepoAppView): @LoginRequired(auth_token_access=[UserApiKeys.ROLE_FEED]) @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config(route_name='rss_feed_home', request_method='GET', renderer=None) - @view_config(route_name='rss_feed_home_old', request_method='GET', renderer=None) def rss(self): """ Produce an rss2 feed via feedgenerator module diff --git a/rhodecode/apps/repository/views/repo_files.py b/rhodecode/apps/repository/views/repo_files.py --- a/rhodecode/apps/repository/views/repo_files.py +++ b/rhodecode/apps/repository/views/repo_files.py @@ -28,7 +28,7 @@ import urllib import pathlib2 from pyramid.httpexceptions import HTTPNotFound, HTTPBadRequest, HTTPFound -from pyramid.view import view_config + from pyramid.renderers import render from pyramid.response import Response @@ -343,9 +343,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_archivefile', request_method='GET', - renderer=None) def repo_archivefile(self): # archive cache config from rhodecode import CONFIG @@ -496,9 +493,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_files_diff', request_method='GET', - renderer=None) def repo_files_diff(self): c = self.load_default_context() f_path = self._get_f_path(self.request.matchdict) @@ -581,9 +575,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_files_diff_2way_redirect', request_method='GET', - renderer=None) def repo_files_diff_2way_redirect(self): """ Kept only to make OLD links work @@ -610,10 +601,11 @@ class RepoFilesView(RepoAppView): raise HTTPFound(compare_url) @LoginRequired() - @view_config( - route_name='repo_files:default_commit', request_method='GET', - renderer=None) - def repo_files_default(self): + def repo_files_default_commit_redirect(self): + """ + Special page that redirects to the landing page of files based on the default + commit for repository + """ c = self.load_default_context() ref_name = c.rhodecode_db_repo.landing_ref_name landing_url = h.repo_files_by_ref_url( @@ -630,18 +622,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_files', request_method='GET', - renderer=None) - @view_config( - route_name='repo_files:default_path', request_method='GET', - renderer=None) - @view_config( - route_name='repo_files:rendered', request_method='GET', - renderer=None) - @view_config( - route_name='repo_files:annotated', request_method='GET', - renderer=None) def repo_files(self): c = self.load_default_context() @@ -759,9 +739,6 @@ class RepoFilesView(RepoAppView): @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_files:annotated_previous', request_method='GET', - renderer=None) def repo_files_annotated_previous(self): self.load_default_context() @@ -790,12 +767,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_nodetree_full', request_method='GET', - renderer=None, xhr=True) - @view_config( - route_name='repo_nodetree_full:default_path', request_method='GET', - renderer=None, xhr=True) def repo_nodetree_full(self): """ Returns rendered html of file tree that contains commit date, @@ -835,9 +806,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_file_raw', request_method='GET', - renderer=None) def repo_file_raw(self): """ Action for show as raw, some mimetypes are "rendered", @@ -902,12 +870,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_file_download', request_method='GET', - renderer=None) - @view_config( - route_name='repo_file_download:legacy', request_method='GET', - renderer=None) def repo_file_download(self): c = self.load_default_context() @@ -972,9 +934,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_files_nodelist', request_method='GET', - renderer='json_ext', xhr=True) def repo_nodelist(self): self.load_default_context() @@ -1059,9 +1018,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_file_history', request_method='GET', - renderer='json_ext') def repo_file_history(self): self.load_default_context() @@ -1105,9 +1061,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_file_authors', request_method='GET', - renderer='rhodecode:templates/files/file_authors_box.mako') def repo_file_authors(self): c = self.load_default_context() @@ -1149,9 +1102,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin') - @view_config( - route_name='repo_files_check_head', request_method='POST', - renderer='json_ext', xhr=True) def repo_files_check_head(self): self.load_default_context() @@ -1186,9 +1136,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin') - @view_config( - route_name='repo_files_remove_file', request_method='GET', - renderer='rhodecode:templates/files/files_delete.mako') def repo_files_remove_file(self): _ = self.request.translate c = self.load_default_context() @@ -1214,9 +1161,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='repo_files_delete_file', request_method='POST', - renderer=None) def repo_files_delete_file(self): _ = self.request.translate @@ -1266,9 +1210,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin') - @view_config( - route_name='repo_files_edit_file', request_method='GET', - renderer='rhodecode:templates/files/files_edit.mako') def repo_files_edit_file(self): _ = self.request.translate c = self.load_default_context() @@ -1300,9 +1241,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='repo_files_update_file', request_method='POST', - renderer=None) def repo_files_update_file(self): _ = self.request.translate c = self.load_default_context() @@ -1384,12 +1322,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin') - @view_config( - route_name='repo_files_add_file', request_method='GET', - renderer='rhodecode:templates/files/files_add.mako') - @view_config( - route_name='repo_files_upload_file', request_method='GET', - renderer='rhodecode:templates/files/files_upload.mako') def repo_files_add_file(self): _ = self.request.translate c = self.load_default_context() @@ -1421,9 +1353,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='repo_files_create_file', request_method='POST', - renderer=None) def repo_files_create_file(self): _ = self.request.translate c = self.load_default_context() @@ -1518,9 +1447,6 @@ class RepoFilesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='repo_files_upload_file', request_method='POST', - renderer='json_ext') def repo_files_upload_file(self): _ = self.request.translate c = self.load_default_context() diff --git a/rhodecode/apps/repository/views/repo_forks.py b/rhodecode/apps/repository/views/repo_forks.py --- a/rhodecode/apps/repository/views/repo_forks.py +++ b/rhodecode/apps/repository/views/repo_forks.py @@ -24,7 +24,7 @@ import formencode import formencode.htmlfill from pyramid.httpexceptions import HTTPFound -from pyramid.view import view_config + from pyramid.renderers import render from pyramid.response import Response @@ -64,9 +64,6 @@ class RepoForksView(RepoAppView, DataGri @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_forks_show_all', request_method='GET', - renderer='rhodecode:templates/forks/forks.mako') def repo_forks_show_all(self): c = self.load_default_context() return self._get_template_context(c) @@ -74,9 +71,6 @@ class RepoForksView(RepoAppView, DataGri @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_forks_data', request_method='GET', - renderer='json_ext', xhr=True) def repo_forks_data(self): _ = self.request.translate self.load_default_context() @@ -174,9 +168,6 @@ class RepoForksView(RepoAppView, DataGri @HasPermissionAnyDecorator('hg.admin', 'hg.fork.repository') @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_fork_new', request_method='GET', - renderer='rhodecode:templates/forks/forks.mako') def repo_fork_new(self): c = self.load_default_context() @@ -204,9 +195,6 @@ class RepoForksView(RepoAppView, DataGri @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='repo_fork_create', request_method='POST', - renderer='rhodecode:templates/forks/fork.mako') def repo_fork_create(self): _ = self.request.translate c = self.load_default_context() diff --git a/rhodecode/apps/repository/views/repo_maintainance.py b/rhodecode/apps/repository/views/repo_maintainance.py --- a/rhodecode/apps/repository/views/repo_maintainance.py +++ b/rhodecode/apps/repository/views/repo_maintainance.py @@ -20,7 +20,7 @@ import logging -from pyramid.view import view_config + from rhodecode.apps._base import RepoAppView from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator @@ -36,9 +36,6 @@ class RepoMaintenanceView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='edit_repo_maintenance', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def repo_maintenance(self): c = self.load_default_context() c.active = 'maintenance' @@ -48,9 +45,6 @@ class RepoMaintenanceView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='edit_repo_maintenance_execute', request_method='GET', - renderer='json', xhr=True) def repo_maintenance_execute(self): c = self.load_default_context() c.active = 'maintenance' diff --git a/rhodecode/apps/repository/views/repo_permissions.py b/rhodecode/apps/repository/views/repo_permissions.py --- a/rhodecode/apps/repository/views/repo_permissions.py +++ b/rhodecode/apps/repository/views/repo_permissions.py @@ -21,7 +21,6 @@ import logging from pyramid.httpexceptions import HTTPFound -from pyramid.view import view_config from rhodecode.apps._base import RepoAppView from rhodecode.lib import helpers as h @@ -46,9 +45,6 @@ class RepoSettingsPermissionsView(RepoAp @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='edit_repo_perms', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def edit_permissions(self): _ = self.request.translate c = self.load_default_context() @@ -62,9 +58,6 @@ class RepoSettingsPermissionsView(RepoAp @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_perms', request_method='POST', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def edit_permissions_update(self): _ = self.request.translate c = self.load_default_context() @@ -104,9 +97,6 @@ class RepoSettingsPermissionsView(RepoAp @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_perms_set_private', request_method='POST', - renderer='json_ext') def edit_permissions_set_private_repo(self): _ = self.request.translate self.load_default_context() diff --git a/rhodecode/apps/repository/views/repo_pull_requests.py b/rhodecode/apps/repository/views/repo_pull_requests.py --- a/rhodecode/apps/repository/views/repo_pull_requests.py +++ b/rhodecode/apps/repository/views/repo_pull_requests.py @@ -26,7 +26,7 @@ import formencode.htmlfill import peppercorn from pyramid.httpexceptions import ( HTTPFound, HTTPNotFound, HTTPForbidden, HTTPBadRequest, HTTPConflict) -from pyramid.view import view_config + from pyramid.renderers import render from rhodecode.apps._base import RepoAppView, DataGridAppView @@ -147,9 +147,6 @@ class RepoPullRequestsView(RepoAppView, @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='pullrequest_show_all', request_method='GET', - renderer='rhodecode:templates/pullrequests/pullrequests.mako') def pull_request_list(self): c = self.load_default_context() @@ -177,9 +174,6 @@ class RepoPullRequestsView(RepoAppView, @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='pullrequest_show_all_data', request_method='GET', - renderer='json_ext', xhr=True) def pull_request_list_data(self): self.load_default_context() @@ -221,9 +215,13 @@ class RepoPullRequestsView(RepoAppView, target_commit, source_commit, diff_limit, file_limit, fulldiff, hide_whitespace_changes, diff_context, use_ancestor=True): + target_commit_final = target_commit + source_commit_final = source_commit + if use_ancestor: # we might want to not use it for versions target_ref_id = ancestor_commit.raw_id + target_commit_final = ancestor_commit vcs_diff = PullRequestModel().get_diff( source_repo, source_ref_id, target_ref_id, @@ -238,11 +236,11 @@ class RepoPullRequestsView(RepoAppView, diffset = codeblocks.DiffSet( repo_name=self.db_repo_name, source_repo_name=source_repo_name, - source_node_getter=codeblocks.diffset_node_getter(target_commit), - target_node_getter=codeblocks.diffset_node_getter(source_commit), + source_node_getter=codeblocks.diffset_node_getter(target_commit_final), + target_node_getter=codeblocks.diffset_node_getter(source_commit_final), ) diffset = self.path_filter.render_patchset_filtered( - diffset, _parsed, target_commit.raw_id, source_commit.raw_id) + diffset, _parsed, target_ref_id, source_ref_id) return diffset @@ -307,9 +305,6 @@ class RepoPullRequestsView(RepoAppView, @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='pullrequest_show', request_method='GET', - renderer='rhodecode:templates/pullrequests/pullrequest_show.mako') def pull_request_show(self): _ = self.request.translate c = self.load_default_context() @@ -838,9 +833,6 @@ class RepoPullRequestsView(RepoAppView, @NotAnonymous() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='pullrequest_new', request_method='GET', - renderer='rhodecode:templates/pullrequests/pullrequest.mako') def pull_request_new(self): _ = self.request.translate c = self.load_default_context() @@ -898,9 +890,6 @@ class RepoPullRequestsView(RepoAppView, @NotAnonymous() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='pullrequest_repo_refs', request_method='GET', - renderer='json_ext', xhr=True) def pull_request_repo_refs(self): self.load_default_context() target_repo_name = self.request.matchdict['target_repo_name'] @@ -921,9 +910,6 @@ class RepoPullRequestsView(RepoAppView, @NotAnonymous() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='pullrequest_repo_targets', request_method='GET', - renderer='json_ext', xhr=True) def pullrequest_repo_targets(self): _ = self.request.translate filter_query = self.request.GET.get('query') @@ -994,9 +980,6 @@ class RepoPullRequestsView(RepoAppView, @NotAnonymous() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='pullrequest_comments', request_method='POST', - renderer='string_html', xhr=True) def pullrequest_comments(self): self.load_default_context() @@ -1034,9 +1017,6 @@ class RepoPullRequestsView(RepoAppView, @NotAnonymous() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='pullrequest_todos', request_method='POST', - renderer='string_html', xhr=True) def pullrequest_todos(self): self.load_default_context() @@ -1076,9 +1056,6 @@ class RepoPullRequestsView(RepoAppView, @NotAnonymous() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='pullrequest_drafts', request_method='POST', - renderer='string_html', xhr=True) def pullrequest_drafts(self): self.load_default_context() @@ -1119,9 +1096,6 @@ class RepoPullRequestsView(RepoAppView, @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='pullrequest_create', request_method='POST', - renderer=None) def pull_request_create(self): _ = self.request.translate self.assure_not_empty_repo() @@ -1277,9 +1251,6 @@ class RepoPullRequestsView(RepoAppView, @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='pullrequest_update', request_method='POST', - renderer='json_ext') def pull_request_update(self): pull_request = PullRequest.get_or_404( self.request.matchdict['pull_request_id']) @@ -1461,9 +1432,6 @@ class RepoPullRequestsView(RepoAppView, @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='pullrequest_merge', request_method='POST', - renderer='json_ext') def pull_request_merge(self): """ Merge will perform a server-side merge of the specified @@ -1537,9 +1505,6 @@ class RepoPullRequestsView(RepoAppView, @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='pullrequest_delete', request_method='POST', - renderer='json_ext') def pull_request_delete(self): _ = self.request.translate @@ -1715,9 +1680,6 @@ class RepoPullRequestsView(RepoAppView, @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='pullrequest_comment_create', request_method='POST', - renderer='json_ext') def pull_request_comment_create(self): _ = self.request.translate @@ -1752,9 +1714,6 @@ class RepoPullRequestsView(RepoAppView, @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='pullrequest_comment_delete', request_method='POST', - renderer='json_ext') def pull_request_comment_delete(self): pull_request = PullRequest.get_or_404( self.request.matchdict['pull_request_id']) @@ -1806,9 +1765,6 @@ class RepoPullRequestsView(RepoAppView, @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') @CSRFRequired() - @view_config( - route_name='pullrequest_comment_edit', request_method='POST', - renderer='json_ext') def pull_request_comment_edit(self): self.load_default_context() diff --git a/rhodecode/apps/repository/views/repo_review_rules.py b/rhodecode/apps/repository/views/repo_review_rules.py --- a/rhodecode/apps/repository/views/repo_review_rules.py +++ b/rhodecode/apps/repository/views/repo_review_rules.py @@ -20,7 +20,7 @@ import logging -from pyramid.view import view_config + from rhodecode.apps._base import RepoAppView from rhodecode.apps.repository.utils import get_default_reviewers_data @@ -38,9 +38,6 @@ class RepoReviewRulesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='repo_reviewers', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def repo_review_rules(self): c = self.load_default_context() c.active = 'reviewers' @@ -50,9 +47,6 @@ class RepoReviewRulesView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_default_reviewers_data', request_method='GET', - renderer='json_ext') def repo_default_reviewers_data(self): self.load_default_context() diff --git a/rhodecode/apps/repository/views/repo_settings.py b/rhodecode/apps/repository/views/repo_settings.py --- a/rhodecode/apps/repository/views/repo_settings.py +++ b/rhodecode/apps/repository/views/repo_settings.py @@ -22,7 +22,6 @@ import logging import deform from pyramid.httpexceptions import HTTPFound -from pyramid.view import view_config from rhodecode import events from rhodecode.apps._base import RepoAppView @@ -90,9 +89,6 @@ class RepoSettingsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='edit_repo', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def edit_settings(self): c = self.load_default_context() c.active = 'settings' @@ -108,9 +104,6 @@ class RepoSettingsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo', request_method='POST', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def edit_settings_update(self): _ = self.request.translate c = self.load_default_context() @@ -192,9 +185,6 @@ class RepoSettingsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin') - @view_config( - route_name='repo_edit_toggle_locking', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def toggle_locking(self): """ Toggle locking of repository by simple GET call to url @@ -224,9 +214,6 @@ class RepoSettingsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='edit_repo_statistics', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def edit_statistics_form(self): c = self.load_default_context() @@ -250,9 +237,6 @@ class RepoSettingsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_statistics_reset', request_method='POST', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def repo_statistics_reset(self): _ = self.request.translate diff --git a/rhodecode/apps/repository/views/repo_settings_advanced.py b/rhodecode/apps/repository/views/repo_settings_advanced.py --- a/rhodecode/apps/repository/views/repo_settings_advanced.py +++ b/rhodecode/apps/repository/views/repo_settings_advanced.py @@ -20,7 +20,7 @@ import logging -from pyramid.view import view_config + from pyramid.httpexceptions import HTTPFound from packaging.version import Version @@ -42,7 +42,7 @@ from rhodecode.model.scm import ScmModel log = logging.getLogger(__name__) -class RepoSettingsView(RepoAppView): +class RepoSettingsAdvancedView(RepoAppView): def load_default_context(self): c = self._get_local_tmpl_context() @@ -57,9 +57,6 @@ class RepoSettingsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='edit_repo_advanced', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def edit_advanced(self): _ = self.request.translate c = self.load_default_context() @@ -89,9 +86,6 @@ class RepoSettingsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_advanced_archive', request_method='POST', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def edit_advanced_archive(self): """ Archives the repository. It will become read-only, and not visible in search @@ -132,9 +126,6 @@ class RepoSettingsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_advanced_delete', request_method='POST', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def edit_advanced_delete(self): """ Deletes the repository, or shows warnings if deletion is not possible @@ -209,9 +200,6 @@ class RepoSettingsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_advanced_journal', request_method='POST', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def edit_advanced_journal(self): """ Set's this repository to be visible in public journal, @@ -236,9 +224,6 @@ class RepoSettingsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_advanced_fork', request_method='POST', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def edit_advanced_fork(self): """ Mark given repository as a fork of another @@ -281,10 +266,7 @@ class RepoSettingsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_advanced_locking', request_method='POST', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') - def edit_advanced_locking(self): + def edit_advanced_toggle_locking(self): """ Toggle locking of repository """ @@ -309,9 +291,6 @@ class RepoSettingsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='edit_repo_advanced_hooks', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def edit_advanced_install_hooks(self): """ Install Hooks for repository diff --git a/rhodecode/apps/repository/views/repo_settings_fields.py b/rhodecode/apps/repository/views/repo_settings_fields.py --- a/rhodecode/apps/repository/views/repo_settings_fields.py +++ b/rhodecode/apps/repository/views/repo_settings_fields.py @@ -24,7 +24,6 @@ import formencode import formencode.htmlfill from pyramid.httpexceptions import HTTPFound -from pyramid.view import view_config from rhodecode.apps._base import RepoAppView from rhodecode.lib import audit_logger @@ -48,9 +47,6 @@ class RepoSettingsFieldsView(RepoAppView @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='edit_repo_fields', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def repo_field_edit(self): c = self.load_default_context() @@ -63,9 +59,6 @@ class RepoSettingsFieldsView(RepoAppView @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_fields_create', request_method='POST', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def repo_field_create(self): _ = self.request.translate @@ -94,9 +87,6 @@ class RepoSettingsFieldsView(RepoAppView @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_fields_delete', request_method='POST', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def repo_field_delete(self): _ = self.request.translate field = RepositoryField.get_or_404(self.request.matchdict['field_id']) diff --git a/rhodecode/apps/repository/views/repo_settings_issue_trackers.py b/rhodecode/apps/repository/views/repo_settings_issue_trackers.py --- a/rhodecode/apps/repository/views/repo_settings_issue_trackers.py +++ b/rhodecode/apps/repository/views/repo_settings_issue_trackers.py @@ -21,7 +21,7 @@ import logging from pyramid.httpexceptions import HTTPFound, HTTPNotFound -from pyramid.view import view_config + import formencode from rhodecode.apps._base import RepoAppView @@ -45,9 +45,6 @@ class RepoSettingsIssueTrackersView(Repo @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='edit_repo_issuetracker', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def repo_issuetracker(self): c = self.load_default_context() c.active = 'issuetracker' @@ -62,9 +59,6 @@ class RepoSettingsIssueTrackersView(Repo @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_issuetracker_test', request_method='POST', - renderer='string', xhr=True) def repo_issuetracker_test(self): return h.urlify_commit_message( self.request.POST.get('test_text', ''), @@ -73,9 +67,6 @@ class RepoSettingsIssueTrackersView(Repo @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_issuetracker_delete', request_method='POST', - renderer='json_ext', xhr=True) def repo_issuetracker_delete(self): _ = self.request.translate uid = self.request.POST.get('uid') @@ -107,9 +98,6 @@ class RepoSettingsIssueTrackersView(Repo @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_issuetracker_update', request_method='POST', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def repo_issuetracker_update(self): _ = self.request.translate # Save inheritance diff --git a/rhodecode/apps/repository/views/repo_settings_remote.py b/rhodecode/apps/repository/views/repo_settings_remote.py --- a/rhodecode/apps/repository/views/repo_settings_remote.py +++ b/rhodecode/apps/repository/views/repo_settings_remote.py @@ -21,7 +21,7 @@ import logging from pyramid.httpexceptions import HTTPFound -from pyramid.view import view_config + from rhodecode.apps._base import RepoAppView from rhodecode.lib import helpers as h @@ -39,9 +39,6 @@ class RepoSettingsRemoteView(RepoAppView @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='edit_repo_remote', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def repo_remote_edit_form(self): c = self.load_default_context() c.active = 'remote' @@ -51,9 +48,6 @@ class RepoSettingsRemoteView(RepoAppView @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_remote_pull', request_method='POST', - renderer=None) def repo_remote_pull_changes(self): _ = self.request.translate self.load_default_context() diff --git a/rhodecode/apps/repository/views/repo_settings_vcs.py b/rhodecode/apps/repository/views/repo_settings_vcs.py --- a/rhodecode/apps/repository/views/repo_settings_vcs.py +++ b/rhodecode/apps/repository/views/repo_settings_vcs.py @@ -25,10 +25,8 @@ import formencode.htmlfill from pyramid.httpexceptions import HTTPFound, HTTPBadRequest from pyramid.response import Response from pyramid.renderers import render -from pyramid.view import view_config from rhodecode.apps._base import RepoAppView -from rhodecode.lib import audit_logger from rhodecode.lib import helpers as h from rhodecode.lib.auth import ( LoginRequired, HasRepoPermissionAnyDecorator, CSRFRequired) @@ -71,9 +69,6 @@ class RepoSettingsVcsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='edit_repo_vcs', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def repo_vcs_settings(self): c = self.load_default_context() model = VcsSettingsModel(repo=self.db_repo_name) @@ -100,9 +95,6 @@ class RepoSettingsVcsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_vcs_update', request_method='POST', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def repo_settings_vcs_update(self): _ = self.request.translate c = self.load_default_context() @@ -153,9 +145,6 @@ class RepoSettingsVcsView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='edit_repo_vcs_svn_pattern_delete', request_method='POST', - renderer='json_ext', xhr=True) def repo_settings_delete_svn_pattern(self): self.load_default_context() delete_pattern_id = self.request.POST.get('delete_svn_pattern') diff --git a/rhodecode/apps/repository/views/repo_strip.py b/rhodecode/apps/repository/views/repo_strip.py --- a/rhodecode/apps/repository/views/repo_strip.py +++ b/rhodecode/apps/repository/views/repo_strip.py @@ -19,7 +19,7 @@ # and proprietary license terms, please see https://rhodecode.com/licenses/ import logging -from pyramid.view import view_config + from rhodecode.apps._base import RepoAppView from rhodecode.lib import audit_logger @@ -31,7 +31,7 @@ from rhodecode.lib.ext_json import json log = logging.getLogger(__name__) -class StripView(RepoAppView): +class RepoStripView(RepoAppView): def load_default_context(self): c = self._get_local_tmpl_context() @@ -40,9 +40,6 @@ class StripView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') - @view_config( - route_name='edit_repo_strip', request_method='GET', - renderer='rhodecode:templates/admin/repos/repo_edit.mako') def strip(self): c = self.load_default_context() c.active = 'strip' @@ -53,9 +50,6 @@ class StripView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='strip_check', request_method='POST', - renderer='json', xhr=True) def strip_check(self): from rhodecode.lib.vcs.backends.base import EmptyCommit data = {} @@ -79,9 +73,6 @@ class StripView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator('repository.admin') @CSRFRequired() - @view_config( - route_name='strip_execute', request_method='POST', - renderer='json', xhr=True) def strip_execute(self): from rhodecode.model.scm import ScmModel diff --git a/rhodecode/apps/repository/views/repo_summary.py b/rhodecode/apps/repository/views/repo_summary.py --- a/rhodecode/apps/repository/views/repo_summary.py +++ b/rhodecode/apps/repository/views/repo_summary.py @@ -24,7 +24,7 @@ import time import rhodecode -from pyramid.view import view_config + from rhodecode.lib.view_utils import get_format_ref_id from rhodecode.apps._base import RepoAppView @@ -101,9 +101,6 @@ class RepoSummaryView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_summary_commits', request_method='GET', - renderer='rhodecode:templates/summary/summary_commits.mako') def summary_commits(self): c = self.load_default_context() self._prepare_and_set_clone_url(c) @@ -113,15 +110,6 @@ class RepoSummaryView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_summary', request_method='GET', - renderer='rhodecode:templates/summary/summary.mako') - @view_config( - route_name='repo_summary_slash', request_method='GET', - renderer='rhodecode:templates/summary/summary.mako') - @view_config( - route_name='repo_summary_explicit', request_method='GET', - renderer='rhodecode:templates/summary/summary.mako') def summary(self): c = self.load_default_context() @@ -176,9 +164,6 @@ class RepoSummaryView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_stats', request_method='GET', - renderer='json_ext') def repo_stats(self): show_stats = bool(self.db_repo.enable_statistics) repo_id = self.db_repo.repo_id @@ -228,9 +213,6 @@ class RepoSummaryView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_refs_data', request_method='GET', - renderer='json_ext') def repo_refs_data(self): _ = self.request.translate self.load_default_context() @@ -251,9 +233,6 @@ class RepoSummaryView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='repo_refs_changelog_data', request_method='GET', - renderer='json_ext') def repo_refs_changelog_data(self): _ = self.request.translate self.load_default_context() diff --git a/rhodecode/apps/repository/views/repo_tags.py b/rhodecode/apps/repository/views/repo_tags.py --- a/rhodecode/apps/repository/views/repo_tags.py +++ b/rhodecode/apps/repository/views/repo_tags.py @@ -19,7 +19,6 @@ # and proprietary license terms, please see https://rhodecode.com/licenses/ import logging -from pyramid.view import view_config from rhodecode.apps._base import BaseReferencesView from rhodecode.lib.ext_json import json @@ -33,9 +32,6 @@ class RepoTagsView(BaseReferencesView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='tags_home', request_method='GET', - renderer='rhodecode:templates/tags/tags.mako') def tags(self): c = self.load_default_context() diff --git a/rhodecode/apps/search/__init__.py b/rhodecode/apps/search/__init__.py --- a/rhodecode/apps/search/__init__.py +++ b/rhodecode/apps/search/__init__.py @@ -21,23 +21,42 @@ from rhodecode.apps._base import ADMIN_P def includeme(config): + from rhodecode.apps.search.views import ( + SearchView, SearchRepoView, SearchRepoGroupView) config.add_route( name='search', pattern=ADMIN_PREFIX + '/search') + config.add_view( + SearchView, + attr='search', + route_name='search', request_method='GET', + renderer='rhodecode:templates/search/search.mako') config.add_route( name='search_repo', pattern='/{repo_name:.*?[^/]}/_search', repo_route=True) + config.add_view( + SearchRepoView, + attr='search_repo', + route_name='search_repo', request_method='GET', + renderer='rhodecode:templates/search/search.mako') config.add_route( name='search_repo_alt', pattern='/{repo_name:.*?[^/]}/search', repo_route=True) + config.add_view( + SearchRepoView, + attr='search_repo', + route_name='search_repo_alt', request_method='GET', + renderer='rhodecode:templates/search/search.mako') config.add_route( name='search_repo_group', pattern='/{repo_group_name:.*?[^/]}/_search', repo_group_route=True) - - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') + config.add_view( + SearchRepoGroupView, + attr='search_repo_group', + route_name='search_repo_group', request_method='GET', + renderer='rhodecode:templates/search/search.mako') diff --git a/rhodecode/apps/search/views.py b/rhodecode/apps/search/views.py --- a/rhodecode/apps/search/views.py +++ b/rhodecode/apps/search/views.py @@ -20,7 +20,7 @@ import logging import urllib -from pyramid.view import view_config + from webhelpers2.html.tools import update_params from rhodecode.apps._base import BaseAppView, RepoAppView, RepoGroupAppView @@ -130,9 +130,6 @@ class SearchView(BaseAppView): return c @LoginRequired() - @view_config( - route_name='search', request_method='GET', - renderer='rhodecode:templates/search/search.mako') def search(self): c = self.load_default_context() perform_search(self.request, c) @@ -148,12 +145,6 @@ class SearchRepoView(RepoAppView): @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') - @view_config( - route_name='search_repo', request_method='GET', - renderer='rhodecode:templates/search/search.mako') - @view_config( - route_name='search_repo_alt', request_method='GET', - renderer='rhodecode:templates/search/search.mako') def search_repo(self): c = self.load_default_context() perform_search(self.request, c, repo_name=self.db_repo_name) @@ -169,9 +160,6 @@ class SearchRepoGroupView(RepoGroupAppVi @LoginRequired() @HasRepoGroupPermissionAnyDecorator( 'group.read', 'group.write', 'group.admin') - @view_config( - route_name='search_repo_group', request_method='GET', - renderer='rhodecode:templates/search/search.mako') def search_repo_group(self): c = self.load_default_context() perform_search(self.request, c, repo_group_name=self.db_repo_group_name) diff --git a/rhodecode/apps/svn_support/__init__.py b/rhodecode/apps/svn_support/__init__.py --- a/rhodecode/apps/svn_support/__init__.py +++ b/rhodecode/apps/svn_support/__init__.py @@ -37,25 +37,6 @@ from . import config_keys log = logging.getLogger(__name__) -def includeme(config): - settings = config.registry.settings - _sanitize_settings_and_apply_defaults(settings) - - if settings[config_keys.generate_config]: - # Add subscriber to generate the Apache mod dav svn configuration on - # repository group events. - config.add_subscriber(generate_config_subscriber, RepoGroupEvent) - - # If a reload command is set add a subscriber to execute it on - # configuration changes. - reload_cmd = shlex.split(settings[config_keys.reload_command]) - if reload_cmd: - reload_timeout = settings[config_keys.reload_timeout] or None - reload_subscriber = AsyncSubprocessSubscriber( - cmd=reload_cmd, timeout=reload_timeout) - config.add_subscriber(reload_subscriber, ModDavSvnConfigChange) - - def _sanitize_settings_and_apply_defaults(settings): """ Set defaults, convert to python types and validate settings. @@ -88,3 +69,22 @@ def _append_path_sep(path): if isinstance(path, compat.string_types) and not path.endswith(os.path.sep): path += os.path.sep return path + + +def includeme(config): + settings = config.registry.settings + _sanitize_settings_and_apply_defaults(settings) + + if settings[config_keys.generate_config]: + # Add subscriber to generate the Apache mod dav svn configuration on + # repository group events. + config.add_subscriber(generate_config_subscriber, RepoGroupEvent) + + # If a reload command is set add a subscriber to execute it on + # configuration changes. + reload_cmd = settings[config_keys.reload_command] + if reload_cmd: + reload_timeout = settings[config_keys.reload_timeout] or None + reload_subscriber = AsyncSubprocessSubscriber( + cmd=reload_cmd, timeout=reload_timeout) + config.add_subscriber(reload_subscriber, ModDavSvnConfigChange) diff --git a/rhodecode/apps/user_group/__init__.py b/rhodecode/apps/user_group/__init__.py --- a/rhodecode/apps/user_group/__init__.py +++ b/rhodecode/apps/user_group/__init__.py @@ -28,74 +28,134 @@ def admin_routes(config): """ User groups /_admin prefixed routes """ + from rhodecode.apps.user_group.views import UserGroupsView config.add_route( name='user_group_members_data', pattern='/user_groups/{user_group_id:\d+}/members', user_group_route=True) + config.add_view( + UserGroupsView, + attr='user_group_members', + route_name='user_group_members_data', request_method='GET', + renderer='json_ext', xhr=True) # user groups perms config.add_route( name='edit_user_group_perms_summary', pattern='/user_groups/{user_group_id:\d+}/edit/permissions_summary', user_group_route=True) + config.add_view( + UserGroupsView, + attr='user_group_perms_summary', + route_name='edit_user_group_perms_summary', request_method='GET', + renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') + config.add_route( name='edit_user_group_perms_summary_json', pattern='/user_groups/{user_group_id:\d+}/edit/permissions_summary/json', user_group_route=True) + config.add_view( + UserGroupsView, + attr='user_group_perms_summary_json', + route_name='edit_user_group_perms_summary_json', request_method='GET', + renderer='json_ext') # user groups edit config.add_route( name='edit_user_group', pattern='/user_groups/{user_group_id:\d+}/edit', user_group_route=True) + config.add_view( + UserGroupsView, + attr='user_group_edit', + route_name='edit_user_group', request_method='GET', + renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') # user groups update config.add_route( name='user_groups_update', pattern='/user_groups/{user_group_id:\d+}/update', user_group_route=True) + config.add_view( + UserGroupsView, + attr='user_group_update', + route_name='user_groups_update', request_method='POST', + renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') config.add_route( name='edit_user_group_global_perms', pattern='/user_groups/{user_group_id:\d+}/edit/global_permissions', user_group_route=True) + config.add_view( + UserGroupsView, + attr='user_group_global_perms_edit', + route_name='edit_user_group_global_perms', request_method='GET', + renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') config.add_route( name='edit_user_group_global_perms_update', pattern='/user_groups/{user_group_id:\d+}/edit/global_permissions/update', user_group_route=True) + config.add_view( + UserGroupsView, + attr='user_group_global_perms_update', + route_name='edit_user_group_global_perms_update', request_method='POST', + renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') config.add_route( name='edit_user_group_perms', pattern='/user_groups/{user_group_id:\d+}/edit/permissions', user_group_route=True) + config.add_view( + UserGroupsView, + attr='user_group_edit_perms', + route_name='edit_user_group_perms', request_method='GET', + renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') config.add_route( name='edit_user_group_perms_update', pattern='/user_groups/{user_group_id:\d+}/edit/permissions/update', user_group_route=True) + config.add_view( + UserGroupsView, + attr='user_group_update_perms', + route_name='edit_user_group_perms_update', request_method='POST', + renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') config.add_route( name='edit_user_group_advanced', pattern='/user_groups/{user_group_id:\d+}/edit/advanced', user_group_route=True) + config.add_view( + UserGroupsView, + attr='user_group_edit_advanced', + route_name='edit_user_group_advanced', request_method='GET', + renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') config.add_route( name='edit_user_group_advanced_sync', pattern='/user_groups/{user_group_id:\d+}/edit/advanced/sync', user_group_route=True) + config.add_view( + UserGroupsView, + attr='user_group_edit_advanced_set_synchronization', + route_name='edit_user_group_advanced_sync', request_method='POST', + renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') # user groups delete config.add_route( name='user_groups_delete', pattern='/user_groups/{user_group_id:\d+}/delete', user_group_route=True) + config.add_view( + UserGroupsView, + attr='user_group_delete', + route_name='user_groups_delete', request_method='POST', + renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') def includeme(config): # main admin routes config.include(admin_routes, route_prefix=ADMIN_PREFIX) - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') diff --git a/rhodecode/apps/user_group/views/__init__.py b/rhodecode/apps/user_group/views/__init__.py --- a/rhodecode/apps/user_group/views/__init__.py +++ b/rhodecode/apps/user_group/views/__init__.py @@ -24,7 +24,7 @@ import peppercorn import formencode import formencode.htmlfill from pyramid.httpexceptions import HTTPFound -from pyramid.view import view_config + from pyramid.response import Response from pyramid.renderers import render @@ -60,9 +60,6 @@ class UserGroupsView(UserGroupAppView): @LoginRequired() @HasUserGroupPermissionAnyDecorator('usergroup.admin') - @view_config( - route_name='user_group_members_data', request_method='GET', - renderer='json_ext', xhr=True) def user_group_members(self): """ Return members of given user group @@ -93,9 +90,6 @@ class UserGroupsView(UserGroupAppView): @LoginRequired() @HasUserGroupPermissionAnyDecorator('usergroup.admin') - @view_config( - route_name='edit_user_group_perms_summary', request_method='GET', - renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') def user_group_perms_summary(self): c = self.load_default_context() c.user_group = self.db_user_group @@ -106,9 +100,6 @@ class UserGroupsView(UserGroupAppView): @LoginRequired() @HasUserGroupPermissionAnyDecorator('usergroup.admin') - @view_config( - route_name='edit_user_group_perms_summary_json', request_method='GET', - renderer='json_ext') def user_group_perms_summary_json(self): self.load_default_context() user_group = self.db_user_group @@ -131,9 +122,6 @@ class UserGroupsView(UserGroupAppView): @LoginRequired() @HasUserGroupPermissionAnyDecorator('usergroup.admin') @CSRFRequired() - @view_config( - route_name='user_groups_update', request_method='POST', - renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') def user_group_update(self): _ = self.request.translate @@ -230,9 +218,6 @@ class UserGroupsView(UserGroupAppView): @LoginRequired() @HasUserGroupPermissionAnyDecorator('usergroup.admin') @CSRFRequired() - @view_config( - route_name='user_groups_delete', request_method='POST', - renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') def user_group_delete(self): _ = self.request.translate user_group = self.db_user_group @@ -258,9 +243,6 @@ class UserGroupsView(UserGroupAppView): @LoginRequired() @HasUserGroupPermissionAnyDecorator('usergroup.admin') - @view_config( - route_name='edit_user_group', request_method='GET', - renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') def user_group_edit(self): user_group = self.db_user_group @@ -293,9 +275,6 @@ class UserGroupsView(UserGroupAppView): @LoginRequired() @HasUserGroupPermissionAnyDecorator('usergroup.admin') - @view_config( - route_name='edit_user_group_perms', request_method='GET', - renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') def user_group_edit_perms(self): user_group = self.db_user_group c = self.load_default_context() @@ -326,9 +305,6 @@ class UserGroupsView(UserGroupAppView): @LoginRequired() @HasUserGroupPermissionAnyDecorator('usergroup.admin') @CSRFRequired() - @view_config( - route_name='edit_user_group_perms_update', request_method='POST', - renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') def user_group_update_perms(self): """ grant permission for given user group @@ -390,9 +366,6 @@ class UserGroupsView(UserGroupAppView): @LoginRequired() @HasUserGroupPermissionAnyDecorator('usergroup.admin') - @view_config( - route_name='edit_user_group_global_perms', request_method='GET', - renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') def user_group_global_perms_edit(self): user_group = self.db_user_group c = self.load_default_context() @@ -418,9 +391,6 @@ class UserGroupsView(UserGroupAppView): @LoginRequired() @HasUserGroupPermissionAnyDecorator('usergroup.admin') @CSRFRequired() - @view_config( - route_name='edit_user_group_global_perms_update', request_method='POST', - renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') def user_group_global_perms_update(self): _ = self.request.translate user_group = self.db_user_group @@ -485,9 +455,6 @@ class UserGroupsView(UserGroupAppView): @LoginRequired() @HasUserGroupPermissionAnyDecorator('usergroup.admin') - @view_config( - route_name='edit_user_group_advanced', request_method='GET', - renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') def user_group_edit_advanced(self): user_group = self.db_user_group @@ -515,9 +482,6 @@ class UserGroupsView(UserGroupAppView): @LoginRequired() @HasUserGroupPermissionAnyDecorator('usergroup.admin') @CSRFRequired() - @view_config( - route_name='edit_user_group_advanced_sync', request_method='POST', - renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') def user_group_edit_advanced_set_synchronization(self): _ = self.request.translate user_group = self.db_user_group diff --git a/rhodecode/apps/user_group_profile/__init__.py b/rhodecode/apps/user_group_profile/__init__.py --- a/rhodecode/apps/user_group_profile/__init__.py +++ b/rhodecode/apps/user_group_profile/__init__.py @@ -20,8 +20,13 @@ def includeme(config): + from rhodecode.apps.user_group_profile.views import UserGroupProfileView + config.add_route( name='user_group_profile', pattern='/_profile_user_group/{user_group_name}') - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') + config.add_view( + UserGroupProfileView, + attr='user_group_profile', + route_name='user_group_profile', request_method='GET', + renderer='rhodecode:templates/user_group/user_group.mako') diff --git a/rhodecode/apps/user_group_profile/views.py b/rhodecode/apps/user_group_profile/views.py --- a/rhodecode/apps/user_group_profile/views.py +++ b/rhodecode/apps/user_group_profile/views.py @@ -21,7 +21,7 @@ import logging from pyramid.httpexceptions import HTTPNotFound -from pyramid.view import view_config + from rhodecode.apps._base import BaseAppView from rhodecode.lib.auth import HasUserGroupPermissionAnyDecorator, LoginRequired, NotAnonymous @@ -36,9 +36,6 @@ class UserGroupProfileView(BaseAppView): @LoginRequired() @NotAnonymous() @HasUserGroupPermissionAnyDecorator('usergroup.read', 'usergroup.write', 'usergroup.admin',) - @view_config( - route_name='user_group_profile', request_method='GET', - renderer='rhodecode:templates/user_group/user_group.mako') def user_group_profile(self): c = self._get_local_tmpl_context() c.active = 'profile' diff --git a/rhodecode/apps/user_profile/__init__.py b/rhodecode/apps/user_profile/__init__.py --- a/rhodecode/apps/user_profile/__init__.py +++ b/rhodecode/apps/user_profile/__init__.py @@ -20,9 +20,13 @@ def includeme(config): + from rhodecode.apps.user_profile.views import UserProfileView + config.add_route( name='user_profile', pattern='/_profiles/{username}') - - # Scan module for configuration decorators. - config.scan('.views', ignore='.tests') + config.add_view( + UserProfileView, + attr='user_profile', + route_name='user_profile', request_method='GET', + renderer='rhodecode:templates/users/user.mako') diff --git a/rhodecode/apps/user_profile/views.py b/rhodecode/apps/user_profile/views.py --- a/rhodecode/apps/user_profile/views.py +++ b/rhodecode/apps/user_profile/views.py @@ -21,7 +21,6 @@ import logging from pyramid.httpexceptions import HTTPNotFound -from pyramid.view import view_config from rhodecode.apps._base import BaseAppView from rhodecode.lib.auth import LoginRequired, NotAnonymous @@ -36,9 +35,6 @@ class UserProfileView(BaseAppView): @LoginRequired() @NotAnonymous() - @view_config( - route_name='user_profile', request_method='GET', - renderer='rhodecode:templates/users/user.mako') def user_profile(self): # register local template context c = self._get_local_tmpl_context() diff --git a/rhodecode/config/jsroutes.py b/rhodecode/config/jsroutes.py --- a/rhodecode/config/jsroutes.py +++ b/rhodecode/config/jsroutes.py @@ -20,7 +20,7 @@ def generate_jsroutes_content(jsroutes): statements = [] - for url_name, url, fields in jsroutes: + for url_name, url, fields in sorted(jsroutes): statements.append( "pyroutes.register('%s', '%s', %s);" % (url_name, url, fields)) return u''' diff --git a/rhodecode/config/middleware.py b/rhodecode/config/middleware.py --- a/rhodecode/config/middleware.py +++ b/rhodecode/config/middleware.py @@ -92,6 +92,7 @@ def make_pyramid_app(global_config, **se # Allows to use format style "{ENV_NAME}" placeholders in the configuration. It # will be replaced by the value of the environment variable "NAME" in this case. start_time = time.time() + log.info('Pyramid app config starting') debug = asbool(global_config.get('debug')) if debug: @@ -121,6 +122,7 @@ def make_pyramid_app(global_config, **se pyramid_app.config = config config.configure_celery(global_config['__file__']) + # creating the app uses a connection - return it after we are done meta.Session.remove() total_time = time.time() - start_time @@ -234,7 +236,7 @@ def includeme_first(config): '_static/rhodecode', path='rhodecode:public', cache_max_age=3600 * 24) -def includeme(config): +def includeme(config, auth_resources=None): log.debug('Initializing main includeme from %s', os.path.basename(__file__)) settings = config.registry.settings config.set_request_factory(Request) @@ -256,24 +258,29 @@ def includeme(config): config.include('pyramid_mako') config.include('rhodecode.lib.rc_beaker') config.include('rhodecode.lib.rc_cache') - config.include('rhodecode.apps._base.navigation') config.include('rhodecode.apps._base.subscribers') config.include('rhodecode.tweens') config.include('rhodecode.authentication') if load_all: - config.include('rhodecode.integrations') + ce_auth_resources = [ + 'rhodecode.authentication.plugins.auth_crowd', + 'rhodecode.authentication.plugins.auth_headers', + 'rhodecode.authentication.plugins.auth_jasig_cas', + 'rhodecode.authentication.plugins.auth_ldap', + 'rhodecode.authentication.plugins.auth_pam', + 'rhodecode.authentication.plugins.auth_rhodecode', + 'rhodecode.authentication.plugins.auth_token', + ] - if load_all: # load CE authentication plugins - config.include('rhodecode.authentication.plugins.auth_crowd') - config.include('rhodecode.authentication.plugins.auth_headers') - config.include('rhodecode.authentication.plugins.auth_jasig_cas') - config.include('rhodecode.authentication.plugins.auth_ldap') - config.include('rhodecode.authentication.plugins.auth_pam') - config.include('rhodecode.authentication.plugins.auth_rhodecode') - config.include('rhodecode.authentication.plugins.auth_token') + + if auth_resources: + ce_auth_resources.extend(auth_resources) + + for resource in ce_auth_resources: + config.include(resource) # Auto discover authentication plugins and include their configuration. if asbool(settings.get('auth_plugin.import_legacy_plugins', 'true')): @@ -282,15 +289,17 @@ def includeme(config): # apps if load_all: + config.include('rhodecode.api') config.include('rhodecode.apps._base') config.include('rhodecode.apps.hovercards') config.include('rhodecode.apps.ops') - config.include('rhodecode.apps.admin') config.include('rhodecode.apps.channelstream') config.include('rhodecode.apps.file_store') + config.include('rhodecode.apps.admin') config.include('rhodecode.apps.login') config.include('rhodecode.apps.home') config.include('rhodecode.apps.journal') + config.include('rhodecode.apps.repository') config.include('rhodecode.apps.repo_group') config.include('rhodecode.apps.user_group') @@ -298,11 +307,14 @@ def includeme(config): config.include('rhodecode.apps.user_profile') config.include('rhodecode.apps.user_group_profile') config.include('rhodecode.apps.my_account') + config.include('rhodecode.apps.gist') + config.include('rhodecode.apps.svn_support') config.include('rhodecode.apps.ssh_support') - config.include('rhodecode.apps.gist') config.include('rhodecode.apps.debug_style') - config.include('rhodecode.api') + + if load_all: + config.include('rhodecode.integrations') config.add_route('rhodecode_support', 'https://rhodecode.com/help/', static=True) config.add_translation_dirs('rhodecode:i18n/') diff --git a/rhodecode/config/rcextensions/examples/validate_pushed_files_name_and_size.py b/rhodecode/config/rcextensions/examples/validate_pushed_files_name_and_size.py --- a/rhodecode/config/rcextensions/examples/validate_pushed_files_name_and_size.py +++ b/rhodecode/config/rcextensions/examples/validate_pushed_files_name_and_size.py @@ -46,7 +46,7 @@ def _pre_push_hook(*args, **kwargs): # e.g store a list of patterns to be forbidden e.g `*.exe, *.dump` forbid_files = extra_fields.get_field(repo_extra_fields, key='forbid_files_glob', convert_type=False, default=[]) - forbid_files = aslist(forbid_files) + forbid_files = aslist(forbid_files, sep=',') # forbid_files = ['*'] # example pattern diff --git a/rhodecode/config/rcextensions/helpers/extract_pre_files.py b/rhodecode/config/rcextensions/helpers/extract_pre_files.py --- a/rhodecode/config/rcextensions/helpers/extract_pre_files.py +++ b/rhodecode/config/rcextensions/helpers/extract_pre_files.py @@ -37,6 +37,7 @@ from rhodecode.lib.vcs.backends.git.diff def get_svn_files(repo, vcs_repo, refs): txn_id = refs[0] files = [] + stdout, stderr = vcs_repo.run_svn_command( ['svnlook', 'changed', repo.repo_full_path, '--transaction', txn_id]) @@ -63,10 +64,17 @@ def get_svn_files(repo, vcs_repo, refs): parsed_entry['operation'] = rc_op if rc_op in ['A', 'M']: + stdout, stderr = vcs_repo.run_svn_command( - ['svnlook', 'filesize', repo.repo_full_path, path, '--transaction', txn_id]) - file_size = int(stdout.strip()) - parsed_entry['file_size'] = file_size + ['svnlook', 'filesize', repo.repo_full_path, path, '--transaction', txn_id], + _safe=True + ) + + if "Path '{}' is not a file".format(path.rstrip('/')) in stderr: + # skip dirs + continue + + parsed_entry['file_size'] = int(stdout.strip()) files.append(parsed_entry) diff --git a/rhodecode/events/__init__.py b/rhodecode/events/__init__.py --- a/rhodecode/events/__init__.py +++ b/rhodecode/events/__init__.py @@ -20,29 +20,9 @@ import logging from pyramid.threadlocal import get_current_registry from rhodecode.events.base import RhodeCodeIntegrationEvent - -log = logging.getLogger(__name__) - - -def trigger(event, registry=None): - """ - Helper method to send an event. This wraps the pyramid logic to send an - event. - """ - # For the first step we are using pyramids thread locals here. If the - # event mechanism works out as a good solution we should think about - # passing the registry as an argument to get rid of it. - event_name = event.__class__ - log.debug('event %s sent for execution', event_name) - registry = registry or get_current_registry() - registry.notify(event) - log.debug('event %s triggered using registry %s', event_name, registry) - - # Send the events to integrations directly - from rhodecode.integrations import integrations_event_handler - if isinstance(event, RhodeCodeIntegrationEvent): - integrations_event_handler(event) - +from rhodecode.events.base import ( # pragma: no cover + FtsBuild +) from rhodecode.events.user import ( # pragma: no cover UserPreCreate, @@ -78,3 +58,26 @@ from rhodecode.events.pullrequest import PullRequestMergeEvent, PullRequestCloseEvent, ) + + +log = logging.getLogger(__name__) + + +def trigger(event, registry=None): + """ + Helper method to send an event. This wraps the pyramid logic to send an + event. + """ + # For the first step we are using pyramids thread locals here. If the + # event mechanism works out as a good solution we should think about + # passing the registry as an argument to get rid of it. + event_name = event.__class__ + log.debug('event %s sent for execution', event_name) + registry = registry or get_current_registry() + registry.notify(event) + log.debug('event %s triggered using registry %s', event_name, registry) + + # Send the events to integrations directly + from rhodecode.integrations import integrations_event_handler + if isinstance(event, RhodeCodeIntegrationEvent): + integrations_event_handler(event) diff --git a/rhodecode/events/base.py b/rhodecode/events/base.py --- a/rhodecode/events/base.py +++ b/rhodecode/events/base.py @@ -120,3 +120,11 @@ class RhodeCodeIntegrationEvent(Rhodecod Special subclass for Integration events """ description = '' + + +class FtsBuild(RhodecodeEvent): + """ + This event will be triggered when FTS Build is triggered + """ + name = 'fts-build' + display_name = 'Start FTS Build' diff --git a/rhodecode/i18n/rhodecode.pot b/rhodecode/i18n/rhodecode.pot --- a/rhodecode/i18n/rhodecode.pot +++ b/rhodecode/i18n/rhodecode.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: rhodecode-enterprise-ce 4.21.0\n" +"Project-Id-Version: rhodecode-enterprise-ce 4.23.0\n" "Report-Msgid-Bugs-To: marcin@rhodecode.com\n" -"POT-Creation-Date: 2020-10-12 13:39+0000\n" +"POT-Creation-Date: 2020-11-23 09:00+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,9 +18,7 @@ msgstr "" "Generated-By: Babel 1.3\n" #: rhodecode/api/views/pull_request_api.py:646 -#: rhodecode/api/views/repo_api.py:1685 -#: rhodecode/apps/repository/views/repo_commits.py:471 -#: rhodecode/apps/repository/views/repo_pull_requests.py:1658 +#: rhodecode/api/views/repo_api.py:1686 msgid "posted a new {} comment" msgstr "" @@ -63,9 +61,9 @@ msgstr "" #: rhodecode/templates/admin/integrations/list.mako:172 #: rhodecode/templates/admin/my_account/my_account_profile.mako:7 #: rhodecode/templates/base/issue_tracker_settings.mako:138 -#: rhodecode/templates/changeset/changeset_file_comment.mako:213 -#: rhodecode/templates/changeset/changeset_file_comment.mako:221 -#: rhodecode/templates/changeset/changeset_file_comment.mako:230 +#: rhodecode/templates/changeset/changeset_file_comment.mako:233 +#: rhodecode/templates/changeset/changeset_file_comment.mako:247 +#: rhodecode/templates/changeset/changeset_file_comment.mako:256 #: rhodecode/templates/data_table/_dt_elements.mako:173 #: rhodecode/templates/data_table/_dt_elements.mako:251 #: rhodecode/templates/data_table/_dt_elements.mako:266 @@ -76,9 +74,9 @@ msgstr "" #: rhodecode/templates/files/files_edit.mako:57 #: rhodecode/templates/files/files_source.mako:39 #: rhodecode/templates/files/files_source.mako:52 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:83 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:588 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:645 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:81 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:622 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:679 #: rhodecode/templates/user_group/profile.mako:8 #: rhodecode/templates/users/user_profile.mako:8 msgid "Edit" @@ -377,200 +375,200 @@ msgstr "" msgid "Error occurred during creation of user %s" msgstr "" -#: rhodecode/apps/admin/views/users.py:345 +#: rhodecode/apps/admin/views/users.py:349 msgid "User updated successfully" msgstr "" -#: rhodecode/apps/admin/views/users.py:363 +#: rhodecode/apps/admin/views/users.py:367 #, python-format msgid "Error occurred during update of user %s" msgstr "" -#: rhodecode/apps/admin/views/users.py:394 +#: rhodecode/apps/admin/views/users.py:398 #, python-format msgid "Detached %s repositories" msgstr "" -#: rhodecode/apps/admin/views/users.py:397 +#: rhodecode/apps/admin/views/users.py:401 #, python-format msgid "Deleted %s repositories" msgstr "" -#: rhodecode/apps/admin/views/users.py:403 +#: rhodecode/apps/admin/views/users.py:407 #, python-format msgid "Detached %s repository groups" msgstr "" -#: rhodecode/apps/admin/views/users.py:406 +#: rhodecode/apps/admin/views/users.py:410 #, python-format msgid "Deleted %s repository groups" msgstr "" -#: rhodecode/apps/admin/views/users.py:412 +#: rhodecode/apps/admin/views/users.py:416 #, python-format msgid "Detached %s user groups" msgstr "" -#: rhodecode/apps/admin/views/users.py:415 +#: rhodecode/apps/admin/views/users.py:419 #, python-format msgid "Deleted %s user groups" msgstr "" -#: rhodecode/apps/admin/views/users.py:421 +#: rhodecode/apps/admin/views/users.py:425 #, python-format msgid "Detached %s pull requests" msgstr "" -#: rhodecode/apps/admin/views/users.py:424 +#: rhodecode/apps/admin/views/users.py:428 #, python-format msgid "Deleted %s pull requests" msgstr "" -#: rhodecode/apps/admin/views/users.py:430 +#: rhodecode/apps/admin/views/users.py:434 #, python-format msgid "Detached %s artifacts" msgstr "" -#: rhodecode/apps/admin/views/users.py:433 +#: rhodecode/apps/admin/views/users.py:437 #, python-format msgid "Deleted %s artifacts" msgstr "" -#: rhodecode/apps/admin/views/users.py:482 +#: rhodecode/apps/admin/views/users.py:486 msgid "Successfully deleted user `{}`" msgstr "" -#: rhodecode/apps/admin/views/users.py:489 +#: rhodecode/apps/admin/views/users.py:493 msgid "An error occurred during deletion of user" msgstr "" -#: rhodecode/apps/admin/views/users.py:558 +#: rhodecode/apps/admin/views/users.py:562 msgid "" "The user participates as reviewer in {} pull request and cannot be deleted. \n" "You can set the user to \"{}\" instead of deleting it." msgstr "" -#: rhodecode/apps/admin/views/users.py:564 +#: rhodecode/apps/admin/views/users.py:568 msgid "" "The user participates as reviewer in {} pull requests and cannot be deleted. \n" "You can set the user to \"{}\" instead of deleting it." msgstr "" -#: rhodecode/apps/admin/views/users.py:653 +#: rhodecode/apps/admin/views/users.py:657 msgid "User global permissions updated successfully" msgstr "" -#: rhodecode/apps/admin/views/users.py:671 +#: rhodecode/apps/admin/views/users.py:675 #: rhodecode/apps/user_group/views/__init__.py:479 msgid "An error occurred during permissions saving" msgstr "" -#: rhodecode/apps/admin/views/users.py:694 +#: rhodecode/apps/admin/views/users.py:698 msgid "Force password change enabled for user" msgstr "" -#: rhodecode/apps/admin/views/users.py:702 -#: rhodecode/apps/admin/views/users.py:732 +#: rhodecode/apps/admin/views/users.py:706 +#: rhodecode/apps/admin/views/users.py:736 msgid "An error occurred during password reset for user" msgstr "" -#: rhodecode/apps/admin/views/users.py:723 +#: rhodecode/apps/admin/views/users.py:727 msgid "Force password change disabled for user" msgstr "" -#: rhodecode/apps/admin/views/users.py:796 +#: rhodecode/apps/admin/views/users.py:800 #, python-format msgid "Linked repository group `%s` as personal" msgstr "" -#: rhodecode/apps/admin/views/users.py:802 -#, python-format -msgid "Created repository group `%s`" -msgstr "" - #: rhodecode/apps/admin/views/users.py:806 #, python-format +msgid "Created repository group `%s`" +msgstr "" + +#: rhodecode/apps/admin/views/users.py:810 +#, python-format msgid "Repository group `%s` is already taken" msgstr "" -#: rhodecode/apps/admin/views/users.py:811 +#: rhodecode/apps/admin/views/users.py:815 msgid "An error occurred during repository group creation for user" msgstr "" -#: rhodecode/apps/admin/views/users.py:834 +#: rhodecode/apps/admin/views/users.py:838 #: rhodecode/apps/my_account/views/my_account.py:161 #: rhodecode/templates/admin/my_account/my_account_auth_tokens.mako:28 #: rhodecode/templates/admin/users/user_edit_auth_tokens.mako:33 msgid "Role" msgstr "" -#: rhodecode/apps/admin/views/users.py:892 +#: rhodecode/apps/admin/views/users.py:896 #: rhodecode/apps/my_account/views/my_account.py:217 msgid "Auth token successfully created" msgstr "" -#: rhodecode/apps/admin/views/users.py:921 +#: rhodecode/apps/admin/views/users.py:925 #: rhodecode/apps/my_account/views/my_account.py:241 msgid "Auth token successfully deleted" msgstr "" -#: rhodecode/apps/admin/views/users.py:997 +#: rhodecode/apps/admin/views/users.py:1001 #: rhodecode/apps/my_account/views/my_account_ssh_keys.py:117 msgid "Ssh Key successfully created" msgstr "" -#: rhodecode/apps/admin/views/users.py:1003 #: rhodecode/apps/admin/views/users.py:1007 +#: rhodecode/apps/admin/views/users.py:1011 #: rhodecode/apps/my_account/views/my_account_ssh_keys.py:123 #: rhodecode/apps/my_account/views/my_account_ssh_keys.py:127 msgid "An error occurred during ssh key saving: {}" msgstr "" -#: rhodecode/apps/admin/views/users.py:1041 +#: rhodecode/apps/admin/views/users.py:1045 #: rhodecode/apps/my_account/views/my_account_ssh_keys.py:157 msgid "Ssh key successfully deleted" msgstr "" -#: rhodecode/apps/admin/views/users.py:1087 +#: rhodecode/apps/admin/views/users.py:1091 #, python-format msgid "Added new email address `%s` for user account" msgstr "" -#: rhodecode/apps/admin/views/users.py:1093 -msgid "Email `{}` is already registered for another user." -msgstr "" - #: rhodecode/apps/admin/views/users.py:1097 +msgid "Email `{}` is already registered for another user." +msgstr "" + +#: rhodecode/apps/admin/views/users.py:1101 msgid "An error occurred during email saving" msgstr "" -#: rhodecode/apps/admin/views/users.py:1124 +#: rhodecode/apps/admin/views/users.py:1128 msgid "Removed email address from user account" msgstr "" -#: rhodecode/apps/admin/views/users.py:1170 +#: rhodecode/apps/admin/views/users.py:1174 #, python-format msgid "An error occurred during ip saving:%s" msgstr "" -#: rhodecode/apps/admin/views/users.py:1192 -msgid "An error occurred during ip saving" -msgstr "" - #: rhodecode/apps/admin/views/users.py:1196 +msgid "An error occurred during ip saving" +msgstr "" + +#: rhodecode/apps/admin/views/users.py:1200 #, python-format msgid "Added ips %s to user whitelist" msgstr "" -#: rhodecode/apps/admin/views/users.py:1226 +#: rhodecode/apps/admin/views/users.py:1230 msgid "Removed ip address from user whitelist" msgstr "" -#: rhodecode/apps/admin/views/users.py:1291 +#: rhodecode/apps/admin/views/users.py:1295 msgid "Groups successfully changed" msgstr "" -#: rhodecode/apps/admin/views/users.py:1411 +#: rhodecode/apps/admin/views/users.py:1415 msgid "Deleted {} cache keys" msgstr "" @@ -649,7 +647,7 @@ msgid "Error occurred during update of g msgstr "" #: rhodecode/apps/home/views.py:453 -#: rhodecode/apps/repository/views/repo_pull_requests.py:976 +#: rhodecode/apps/repository/views/repo_pull_requests.py:983 #: rhodecode/templates/admin/repo_groups/repo_group_edit_permissions.mako:219 #: rhodecode/templates/admin/repos/repo_add.mako:15 #: rhodecode/templates/admin/repos/repo_add.mako:19 @@ -736,11 +734,11 @@ msgstr "" msgid "Failed to update bookmarks. Make sure an unique position is used." msgstr "" -#: rhodecode/apps/my_account/views/my_account.py:707 +#: rhodecode/apps/my_account/views/my_account.py:709 msgid "Your account was updated successfully" msgstr "" -#: rhodecode/apps/my_account/views/my_account.py:714 +#: rhodecode/apps/my_account/views/my_account.py:716 msgid "Error occurred during update of user" msgstr "" @@ -787,7 +785,7 @@ msgstr "" #: rhodecode/apps/repository/views/repo_changelog.py:66 #: rhodecode/apps/repository/views/repo_compare.py:64 -#: rhodecode/apps/repository/views/repo_pull_requests.py:825 +#: rhodecode/apps/repository/views/repo_pull_requests.py:832 msgid "There are no commits yet" msgstr "" @@ -811,20 +809,30 @@ msgstr "" msgid "Created repository %s" msgstr "" -#: rhodecode/apps/repository/views/repo_commits.py:112 +#: rhodecode/apps/repository/views/repo_commits.py:113 msgid "No such commit exists. Org exception: `{}`" msgstr "" -#: rhodecode/apps/repository/views/repo_commits.py:388 -#: rhodecode/apps/repository/views/repo_pull_requests.py:1582 +#: rhodecode/apps/repository/views/repo_commits.py:404 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1620 #, python-format msgid "Status change %(transition_icon)s %(status)s" msgstr "" -#: rhodecode/apps/repository/views/repo_commits.py:434 +#: rhodecode/apps/repository/views/repo_commits.py:442 msgid "Changing the status of a commit associated with a closed pull request is not allowed" msgstr "" +#: rhodecode/apps/repository/views/repo_commits.py:488 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1703 +msgid "posted {} new {} comment" +msgstr "" + +#: rhodecode/apps/repository/views/repo_commits.py:490 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1705 +msgid "posted {} new {} comments" +msgstr "" + #: rhodecode/apps/repository/views/repo_compare.py:102 msgid "Select commit" msgstr "" @@ -886,104 +894,104 @@ msgstr "" msgid "No such commit exists for this repository. Commit: {}" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:345 +#: rhodecode/apps/repository/views/repo_files.py:361 msgid "Downloads disabled" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:351 +#: rhodecode/apps/repository/views/repo_files.py:367 msgid "Unknown archive type for: `{}`" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:357 +#: rhodecode/apps/repository/views/repo_files.py:373 msgid "Unknown commit_id {}" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:360 +#: rhodecode/apps/repository/views/repo_files.py:376 msgid "Empty repository" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:365 +#: rhodecode/apps/repository/views/repo_files.py:381 msgid "No node at path {} for this repository" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:414 +#: rhodecode/apps/repository/views/repo_files.py:432 msgid "Unknown archive type" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1010 +#: rhodecode/apps/repository/views/repo_files.py:1027 msgid "Changesets" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1031 +#: rhodecode/apps/repository/views/repo_files.py:1048 #: rhodecode/apps/repository/views/repo_summary.py:264 -#: rhodecode/model/pull_request.py:1903 rhodecode/model/scm.py:995 +#: rhodecode/model/pull_request.py:1896 rhodecode/model/scm.py:999 #: rhodecode/templates/base/vcs_settings.mako:235 #: rhodecode/templates/summary/components.mako:10 msgid "Branches" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1035 -#: rhodecode/model/scm.py:1012 rhodecode/templates/base/vcs_settings.mako:260 +#: rhodecode/apps/repository/views/repo_files.py:1052 +#: rhodecode/model/scm.py:1016 rhodecode/templates/base/vcs_settings.mako:260 #: rhodecode/templates/summary/components.mako:34 msgid "Tags" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1191 -#: rhodecode/apps/repository/views/repo_files.py:1220 +#: rhodecode/apps/repository/views/repo_files.py:1208 +#: rhodecode/apps/repository/views/repo_files.py:1237 msgid "Deleted file {} via RhodeCode Enterprise" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1241 +#: rhodecode/apps/repository/views/repo_files.py:1258 msgid "Successfully deleted file `{}`" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1245 -#: rhodecode/apps/repository/views/repo_files.py:1364 -#: rhodecode/apps/repository/views/repo_files.py:1497 -#: rhodecode/apps/repository/views/repo_files.py:1621 +#: rhodecode/apps/repository/views/repo_files.py:1262 +#: rhodecode/apps/repository/views/repo_files.py:1381 +#: rhodecode/apps/repository/views/repo_files.py:1514 +#: rhodecode/apps/repository/views/repo_files.py:1638 msgid "Error occurred during commit" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1278 -#: rhodecode/apps/repository/views/repo_files.py:1310 +#: rhodecode/apps/repository/views/repo_files.py:1295 +#: rhodecode/apps/repository/views/repo_files.py:1327 msgid "Edited file {} via RhodeCode Enterprise" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1333 +#: rhodecode/apps/repository/views/repo_files.py:1350 msgid "No changes detected on {}" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1357 +#: rhodecode/apps/repository/views/repo_files.py:1374 msgid "Successfully committed changes to file `{}`" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1399 -#: rhodecode/apps/repository/views/repo_files.py:1441 +#: rhodecode/apps/repository/views/repo_files.py:1416 +#: rhodecode/apps/repository/views/repo_files.py:1458 msgid "Added file via RhodeCode Enterprise" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1457 +#: rhodecode/apps/repository/views/repo_files.py:1474 msgid "No filename specified" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1482 +#: rhodecode/apps/repository/views/repo_files.py:1499 msgid "Successfully committed new file `{}`" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1490 -#: rhodecode/apps/repository/views/repo_files.py:1603 +#: rhodecode/apps/repository/views/repo_files.py:1507 +#: rhodecode/apps/repository/views/repo_files.py:1620 msgid "The location specified must be a relative path and must not contain .. in the path" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1548 +#: rhodecode/apps/repository/views/repo_files.py:1565 msgid "Uploaded file via RhodeCode Enterprise" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1592 +#: rhodecode/apps/repository/views/repo_files.py:1609 msgid "Successfully committed {} new files" msgstr "" -#: rhodecode/apps/repository/views/repo_files.py:1594 +#: rhodecode/apps/repository/views/repo_files.py:1611 msgid "Successfully committed 1 new file" msgstr "" @@ -1013,72 +1021,72 @@ msgstr "" msgid "Error occurred during update of repository {}" msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:325 +#: rhodecode/apps/repository/views/repo_pull_requests.py:331 msgid "Pull Request state was force changed to `{}`" msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:855 +#: rhodecode/apps/repository/views/repo_pull_requests.py:862 msgid "Commit does not exist" msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:1092 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1142 msgid "Error creating pull request: {}" msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:1112 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1162 msgid "source_repo or target repo not found" msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:1123 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1173 msgid "Not Enough permissions to source repo `{}`." msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:1138 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1188 msgid "Not Enough permissions to target repo `{}`." msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:1208 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1258 msgid "Successfully opened new pull request" msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:1211 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1261 msgid "Error occurred during creation of this pull request." msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:1243 -#: rhodecode/apps/repository/views/repo_pull_requests.py:1312 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1293 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1362 msgid "Cannot update closed pull requests." msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:1275 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1325 msgid "Cannot update pull requests commits in state other than `{}`. Current state is: `{}`" msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:1318 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1368 msgid "Pull request title & description updated." msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:1340 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1390 msgid "Pull request updated to \"{source_commit_id}\" with {count_added} added, {count_removed} removed commits. Source of changes: {change_source}." msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:1380 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1430 msgid "Pull request reviewers updated." msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:1404 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1454 msgid "Pull request observers updated." msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:1431 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1481 msgid "Cannot merge pull requests in state other than `{}`. Current state is: `{}`" msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:1477 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1527 msgid "Pull request was successfully merged and closed." msgstr "" -#: rhodecode/apps/repository/views/repo_pull_requests.py:1508 +#: rhodecode/apps/repository/views/repo_pull_requests.py:1558 msgid "Successfully deleted pull request" msgstr "" @@ -1830,10 +1838,10 @@ msgstr "" #: rhodecode/templates/base/issue_tracker_settings.mako:147 #: rhodecode/templates/base/vcs_settings.mako:244 #: rhodecode/templates/base/vcs_settings.mako:269 -#: rhodecode/templates/changeset/changeset_file_comment.mako:216 -#: rhodecode/templates/changeset/changeset_file_comment.mako:224 -#: rhodecode/templates/changeset/changeset_file_comment.mako:233 -#: rhodecode/templates/data_table/_dt_elements.mako:436 +#: rhodecode/templates/changeset/changeset_file_comment.mako:236 +#: rhodecode/templates/changeset/changeset_file_comment.mako:250 +#: rhodecode/templates/changeset/changeset_file_comment.mako:259 +#: rhodecode/templates/data_table/_dt_elements.mako:439 #: rhodecode/templates/debug_style/buttons.html:132 #: rhodecode/templates/files/files_source.mako:40 #: rhodecode/templates/files/files_source.mako:47 @@ -1915,7 +1923,7 @@ msgid "Email address" msgstr "" #: rhodecode/integrations/types/email.py:175 -#: rhodecode/templates/register.mako:95 +#: rhodecode/templates/register.mako:97 #: rhodecode/templates/admin/my_account/my_account_profile.mako:78 #: rhodecode/templates/admin/users/user_add.mako:86 #: rhodecode/templates/admin/users/user_edit_profile.mako:65 @@ -1991,7 +1999,7 @@ msgstr "" #: rhodecode/integrations/types/slack.py:86 #: rhodecode/integrations/types/webhook.py:81 rhodecode/templates/login.mako:44 -#: rhodecode/templates/register.mako:48 +#: rhodecode/templates/register.mako:50 #: rhodecode/templates/admin/admin_log_base.mako:7 #: rhodecode/templates/admin/my_account/my_account_profile.mako:38 #: rhodecode/templates/admin/my_account/my_account_profile_edit.mako:29 @@ -2056,7 +2064,7 @@ msgid "Optional username to authenticate msgstr "" #: rhodecode/integrations/types/webhook.py:91 rhodecode/templates/login.mako:51 -#: rhodecode/templates/register.mako:62 +#: rhodecode/templates/register.mako:64 #: rhodecode/templates/admin/my_account/my_account.mako:31 #: rhodecode/templates/admin/users/user_add.mako:44 #: rhodecode/templates/debug_style/login.html:45 @@ -2237,10 +2245,6 @@ msgstr "" msgid " Reload page to load changes" msgstr "" -#: rhodecode/lib/channelstream.py:348 -msgid "Reload page to see new comments" -msgstr "" - #: rhodecode/lib/diffs.py:903 msgid "Click to select line" msgstr "" @@ -2755,10 +2759,10 @@ msgstr "" #: rhodecode/lib/dbmigrate/schema/db_4_5_0_0.py:2910 #: rhodecode/lib/dbmigrate/schema/db_4_7_0_0.py:3011 #: rhodecode/lib/dbmigrate/schema/db_4_7_0_1.py:3012 -#: rhodecode/lib/dbmigrate/schema/db_4_9_0_0.py:3230 rhodecode/model/db.py:3971 +#: rhodecode/lib/dbmigrate/schema/db_4_9_0_0.py:3230 rhodecode/model/db.py:3972 #: rhodecode/public/js/scripts.js:42424 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:70 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:445 +#: rhodecode/public/js/src/rhodecode/pullrequests.js:396 msgid "Not Reviewed" msgstr "" @@ -2801,7 +2805,7 @@ msgstr "" #: rhodecode/lib/dbmigrate/schema/db_4_5_0_0.py:2911 #: rhodecode/lib/dbmigrate/schema/db_4_7_0_0.py:3012 #: rhodecode/lib/dbmigrate/schema/db_4_7_0_1.py:3013 -#: rhodecode/lib/dbmigrate/schema/db_4_9_0_0.py:3231 rhodecode/model/db.py:3972 +#: rhodecode/lib/dbmigrate/schema/db_4_9_0_0.py:3231 rhodecode/model/db.py:3973 msgid "Approved" msgstr "" @@ -2844,7 +2848,7 @@ msgstr "" #: rhodecode/lib/dbmigrate/schema/db_4_5_0_0.py:2912 #: rhodecode/lib/dbmigrate/schema/db_4_7_0_0.py:3013 #: rhodecode/lib/dbmigrate/schema/db_4_7_0_1.py:3014 -#: rhodecode/lib/dbmigrate/schema/db_4_9_0_0.py:3232 rhodecode/model/db.py:3973 +#: rhodecode/lib/dbmigrate/schema/db_4_9_0_0.py:3232 rhodecode/model/db.py:3974 msgid "Rejected" msgstr "" @@ -2887,7 +2891,7 @@ msgstr "" #: rhodecode/lib/dbmigrate/schema/db_4_5_0_0.py:2913 #: rhodecode/lib/dbmigrate/schema/db_4_7_0_0.py:3014 #: rhodecode/lib/dbmigrate/schema/db_4_7_0_1.py:3015 -#: rhodecode/lib/dbmigrate/schema/db_4_9_0_0.py:3233 rhodecode/model/db.py:3974 +#: rhodecode/lib/dbmigrate/schema/db_4_9_0_0.py:3233 rhodecode/model/db.py:3975 msgid "Under Review" msgstr "" @@ -4064,72 +4068,72 @@ msgstr "" msgid "Enter %(min)i characters or more" msgstr "" -#: rhodecode/model/notification.py:248 +#: rhodecode/model/notification.py:263 #, python-format msgid "%(user)s commented on commit %(date_or_age)s" msgstr "" -#: rhodecode/model/notification.py:249 -#, python-format -msgid "%(user)s commented on commit at %(date_or_age)s" -msgstr "" - -#: rhodecode/model/notification.py:252 -#, python-format -msgid "%(user)s sent message %(date_or_age)s" -msgstr "" - -#: rhodecode/model/notification.py:253 -#, python-format -msgid "%(user)s sent message at %(date_or_age)s" -msgstr "" - -#: rhodecode/model/notification.py:256 -#, python-format -msgid "%(user)s mentioned you %(date_or_age)s" -msgstr "" - -#: rhodecode/model/notification.py:257 -#, python-format -msgid "%(user)s mentioned you at %(date_or_age)s" -msgstr "" - -#: rhodecode/model/notification.py:260 -#, python-format -msgid "%(user)s registered in RhodeCode %(date_or_age)s" -msgstr "" - -#: rhodecode/model/notification.py:261 -#, python-format -msgid "%(user)s registered in RhodeCode at %(date_or_age)s" -msgstr "" - #: rhodecode/model/notification.py:264 #, python-format -msgid "%(user)s opened new pull request %(date_or_age)s" -msgstr "" - -#: rhodecode/model/notification.py:265 -#, python-format -msgid "%(user)s opened new pull request at %(date_or_age)s" +msgid "%(user)s commented on commit at %(date_or_age)s" +msgstr "" + +#: rhodecode/model/notification.py:267 +#, python-format +msgid "%(user)s sent message %(date_or_age)s" msgstr "" #: rhodecode/model/notification.py:268 #, python-format -msgid "%(user)s updated pull request %(date_or_age)s" -msgstr "" - -#: rhodecode/model/notification.py:269 -#, python-format -msgid "%(user)s updated pull request at %(date_or_age)s" +msgid "%(user)s sent message at %(date_or_age)s" +msgstr "" + +#: rhodecode/model/notification.py:271 +#, python-format +msgid "%(user)s mentioned you %(date_or_age)s" msgstr "" #: rhodecode/model/notification.py:272 #, python-format +msgid "%(user)s mentioned you at %(date_or_age)s" +msgstr "" + +#: rhodecode/model/notification.py:275 +#, python-format +msgid "%(user)s registered in RhodeCode %(date_or_age)s" +msgstr "" + +#: rhodecode/model/notification.py:276 +#, python-format +msgid "%(user)s registered in RhodeCode at %(date_or_age)s" +msgstr "" + +#: rhodecode/model/notification.py:279 +#, python-format +msgid "%(user)s opened new pull request %(date_or_age)s" +msgstr "" + +#: rhodecode/model/notification.py:280 +#, python-format +msgid "%(user)s opened new pull request at %(date_or_age)s" +msgstr "" + +#: rhodecode/model/notification.py:283 +#, python-format +msgid "%(user)s updated pull request %(date_or_age)s" +msgstr "" + +#: rhodecode/model/notification.py:284 +#, python-format +msgid "%(user)s updated pull request at %(date_or_age)s" +msgstr "" + +#: rhodecode/model/notification.py:287 +#, python-format msgid "%(user)s commented on pull request %(date_or_age)s" msgstr "" -#: rhodecode/model/notification.py:273 +#: rhodecode/model/notification.py:288 #, python-format msgid "%(user)s commented on pull request at %(date_or_age)s" msgstr "" @@ -4156,9 +4160,9 @@ msgstr "" #: rhodecode/templates/admin/repo_groups/repo_group_edit_permissions.mako:13 #: rhodecode/templates/admin/repos/repo_edit_permissions.mako:13 #: rhodecode/templates/admin/user_groups/user_group_edit_perms.mako:17 -#: rhodecode/templates/changeset/changeset_file_comment.mako:364 -#: rhodecode/templates/changeset/changeset_file_comment.mako:415 -#: rhodecode/templates/data_table/_dt_elements.mako:450 +#: rhodecode/templates/changeset/changeset_file_comment.mako:392 +#: rhodecode/templates/changeset/changeset_file_comment.mako:443 +#: rhodecode/templates/data_table/_dt_elements.mako:453 msgid "Write" msgstr "" @@ -4257,79 +4261,79 @@ msgstr "" msgid "This pull request cannot be updated because the source reference is missing." msgstr "" -#: rhodecode/model/pull_request.py:1681 +#: rhodecode/model/pull_request.py:1674 msgid "Server-side pull request merging is disabled." msgstr "" -#: rhodecode/model/pull_request.py:1684 +#: rhodecode/model/pull_request.py:1677 msgid "This pull request is closed." msgstr "" -#: rhodecode/model/pull_request.py:1698 +#: rhodecode/model/pull_request.py:1691 msgid "Pull request merging is not supported." msgstr "" -#: rhodecode/model/pull_request.py:1715 +#: rhodecode/model/pull_request.py:1708 msgid "Target repository large files support is disabled." msgstr "" -#: rhodecode/model/pull_request.py:1718 +#: rhodecode/model/pull_request.py:1711 msgid "Source repository large files support is disabled." msgstr "" -#: rhodecode/model/pull_request.py:1902 rhodecode/model/scm.py:1004 +#: rhodecode/model/pull_request.py:1895 rhodecode/model/scm.py:1008 #: rhodecode/templates/admin/my_account/my_account.mako:32 #: rhodecode/templates/base/base.mako:638 #: rhodecode/templates/summary/components.mako:46 msgid "Bookmarks" msgstr "" -#: rhodecode/model/pull_request.py:1907 +#: rhodecode/model/pull_request.py:1900 msgid "Commit IDs" msgstr "" -#: rhodecode/model/pull_request.py:1910 +#: rhodecode/model/pull_request.py:1903 #: rhodecode/templates/summary/components.mako:22 msgid "Closed Branches" msgstr "" -#: rhodecode/model/pull_request.py:2094 +#: rhodecode/model/pull_request.py:2089 msgid "WIP marker in title prevents from accidental merge." msgstr "" -#: rhodecode/model/pull_request.py:2104 +#: rhodecode/model/pull_request.py:2099 msgid "User `{}` not allowed to perform merge." msgstr "" -#: rhodecode/model/pull_request.py:2122 +#: rhodecode/model/pull_request.py:2117 msgid "Target branch `{}` changes rejected by rule {}." msgstr "" -#: rhodecode/model/pull_request.py:2136 +#: rhodecode/model/pull_request.py:2132 msgid "Pull request reviewer approval is pending." msgstr "" -#: rhodecode/model/pull_request.py:2150 +#: rhodecode/model/pull_request.py:2146 msgid "Cannot merge, {} TODO still not resolved." msgstr "" -#: rhodecode/model/pull_request.py:2153 +#: rhodecode/model/pull_request.py:2149 msgid "Cannot merge, {} TODOs still not resolved." msgstr "" -#: rhodecode/model/pull_request.py:2208 +#: rhodecode/model/pull_request.py:2204 msgid "Merge strategy: rebase" msgstr "" -#: rhodecode/model/pull_request.py:2213 +#: rhodecode/model/pull_request.py:2209 msgid "Merge strategy: explicit merge commit" msgstr "" -#: rhodecode/model/pull_request.py:2221 +#: rhodecode/model/pull_request.py:2217 msgid "Source branch will be closed before the merge." msgstr "" -#: rhodecode/model/pull_request.py:2223 +#: rhodecode/model/pull_request.py:2219 msgid "Source branch will be deleted after the merge." msgstr "" @@ -4850,49 +4854,49 @@ msgstr "" #: rhodecode/public/js/scripts.js:39232 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:85 -#: rhodecode/public/js/src/rhodecode/codemirror.js:363 +#: rhodecode/public/js/src/rhodecode/codemirror.js:368 msgid "Set status to Approved" msgstr "" #: rhodecode/public/js/scripts.js:39252 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:86 -#: rhodecode/public/js/src/rhodecode/codemirror.js:383 +#: rhodecode/public/js/src/rhodecode/codemirror.js:388 msgid "Set status to Rejected" msgstr "" #: rhodecode/public/js/scripts.js:39271 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:106 -#: rhodecode/public/js/src/rhodecode/codemirror.js:402 +#: rhodecode/public/js/src/rhodecode/codemirror.js:407 msgid "TODO comment" msgstr "" #: rhodecode/public/js/scripts.js:39291 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:71 -#: rhodecode/public/js/src/rhodecode/codemirror.js:422 +#: rhodecode/public/js/src/rhodecode/codemirror.js:427 msgid "Note Comment" msgstr "" #: rhodecode/public/js/scripts.js:39592 rhodecode/public/js/scripts.js:39967 #: rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:99 -#: rhodecode/public/js/src/rhodecode/codemirror.js:723 -#: rhodecode/public/js/src/rhodecode/comments.js:254 +#: rhodecode/public/js/src/rhodecode/codemirror.js:730 +#: rhodecode/public/js/src/rhodecode/comments.js:267 msgid "Status Review" msgstr "" #: rhodecode/public/js/scripts.js:39607 rhodecode/public/js/scripts.js:39982 #: rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:24 -#: rhodecode/public/js/src/rhodecode/codemirror.js:738 -#: rhodecode/public/js/src/rhodecode/comments.js:269 +#: rhodecode/public/js/src/rhodecode/codemirror.js:745 +#: rhodecode/public/js/src/rhodecode/comments.js:284 msgid "Comment text will be set automatically based on currently selected status ({0}) ..." msgstr "" #: rhodecode/public/js/scripts.js:39688 rhodecode/public/js/scripts.js:40177 #: rhodecode/public/js/scripts.js:41535 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:48 -#: rhodecode/public/js/src/rhodecode/codemirror.js:819 -#: rhodecode/public/js/src/rhodecode/comments.js:464 +#: rhodecode/public/js/src/rhodecode/codemirror.js:826 +#: rhodecode/public/js/src/rhodecode/comments.js:493 #: rhodecode/public/js/src/rhodecode/files.js:499 #: rhodecode/templates/files/files_browser_tree.mako:57 msgid "Loading ..." @@ -4900,49 +4904,47 @@ msgstr "" #: rhodecode/public/js/scripts.js:39849 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:117 -#: rhodecode/public/js/src/rhodecode/comments.js:136 msgid "Updated Comment" msgstr "" #: rhodecode/public/js/scripts.js:39873 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:141 -#: rhodecode/public/js/src/rhodecode/comments.js:160 +#: rhodecode/public/js/src/rhodecode/comments.js:164 msgid "resolve comment" msgstr "" #: rhodecode/public/js/scripts.js:40126 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:102 -#: rhodecode/public/js/src/rhodecode/comments.js:413 +#: rhodecode/public/js/src/rhodecode/comments.js:439 msgid "Submitting..." msgstr "" #: rhodecode/public/js/scripts.js:40423 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:122 -#: rhodecode/public/js/src/rhodecode/comments.js:710 +#: rhodecode/public/js/src/rhodecode/comments.js:761 msgid "Yes, delete comment #{0}!" msgstr "" #: rhodecode/public/js/scripts.js:40487 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:46 -#: rhodecode/public/js/src/rhodecode/comments.js:774 +#: rhodecode/public/js/src/rhodecode/comments.js:901 msgid "Leave a resolution comment, or click resolve button to resolve TODO comment #{0}" msgstr "" #: rhodecode/public/js/scripts.js:40696 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:23 -#: rhodecode/public/js/src/rhodecode/comments.js:983 +#: rhodecode/public/js/src/rhodecode/comments.js:1105 msgid "Comment body was not changed." msgstr "" #: rhodecode/public/js/scripts.js:40875 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:44 -#: rhodecode/public/js/src/rhodecode/comments.js:1162 msgid "Leave a comment on line {0}." msgstr "" #: rhodecode/public/js/scripts.js:41006 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:107 -#: rhodecode/public/js/src/rhodecode/comments.js:1293 +#: rhodecode/public/js/src/rhodecode/comments.js:1491 msgid "TODO from comment {0} was fixed." msgstr "" @@ -5024,102 +5026,94 @@ msgstr "" #: rhodecode/public/js/scripts.js:42165 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:12 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:186 +#: rhodecode/public/js/src/rhodecode/pullrequests.js:185 msgid "All reviewers must vote." msgstr "" #: rhodecode/public/js/scripts.js:42174 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:11 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:195 msgid "All individual reviewers must vote." msgstr "" #: rhodecode/public/js/scripts.js:42179 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:14 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:200 msgid "At least {0} reviewer must vote." msgstr "" #: rhodecode/public/js/scripts.js:42185 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:15 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:206 msgid "At least {0} reviewers must vote." msgstr "" #: rhodecode/public/js/scripts.js:42201 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:80 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:222 msgid "Reviewers picked from source code changes." msgstr "" #: rhodecode/public/js/scripts.js:42209 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:8 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:230 msgid "Adding new reviewers is forbidden." msgstr "" #: rhodecode/public/js/scripts.js:42217 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:17 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:238 msgid "Author is not allowed to be a reviewer." msgstr "" #: rhodecode/public/js/scripts.js:42231 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:25 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:252 msgid "Commit Authors are not allowed to be a reviewer." msgstr "" #: rhodecode/public/js/scripts.js:42238 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:65 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:259 msgid "No review rules set." msgstr "" #: rhodecode/public/js/scripts.js:42283 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:49 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:304 +#: rhodecode/public/js/src/rhodecode/pullrequests.js:255 msgid "Loading diff ..." msgstr "" #: rhodecode/public/js/scripts.js:42336 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:109 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:357 +#: rhodecode/public/js/src/rhodecode/pullrequests.js:308 msgid "There are no commits to merge." msgstr "" #: rhodecode/public/js/scripts.js:42408 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:120 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:429 +#: rhodecode/public/js/src/rhodecode/pullrequests.js:380 msgid "User `{0}` not allowed to be a reviewer" msgstr "" #: rhodecode/public/js/scripts.js:42414 rhodecode/public/js/scripts.min.js:1 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:435 +#: rhodecode/public/js/src/rhodecode/pullrequests.js:386 msgid "User `{0}` already in reviewers/observers" msgstr "" #: rhodecode/public/js/scripts.js:42528 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:126 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:549 +#: rhodecode/public/js/src/rhodecode/pullrequests.js:500 msgid "added manually by \"{0}\"" msgstr "" #: rhodecode/public/js/scripts.js:42533 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:138 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:554 +#: rhodecode/public/js/src/rhodecode/pullrequests.js:505 msgid "member of \"{0}\"" msgstr "" #: rhodecode/public/js/scripts.js:42766 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:118 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:787 +#: rhodecode/public/js/src/rhodecode/pullrequests.js:738 msgid "Updating..." msgstr "" #: rhodecode/public/js/scripts.js:42776 rhodecode/public/js/scripts.min.js:1 #: rhodecode/public/js/rhodecode/i18n/js_translations.js:40 -#: rhodecode/public/js/src/rhodecode/pullrequests.js:797 +#: rhodecode/public/js/src/rhodecode/pullrequests.js:748 msgid "Force updating..." msgstr "" @@ -5198,8 +5192,6 @@ msgid "{0} files change msgstr "" #: rhodecode/public/js/rhodecode/i18n/js_translations.js:7 -#: rhodecode/templates/codeblocks/diffs.mako:648 -#: rhodecode/templates/codeblocks/diffs.mako:652 msgid "Add another comment" msgstr "" @@ -5213,14 +5205,14 @@ msgstr "" #: rhodecode/public/js/rhodecode/i18n/js_translations.js:19 #: rhodecode/public/js/src/i18n_messages.js:5 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:589 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:592 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:646 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:623 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:626 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:680 msgid "Close" msgstr "" #: rhodecode/public/js/rhodecode/i18n/js_translations.js:20 -#: rhodecode/templates/codeblocks/diffs.mako:133 +#: rhodecode/templates/codeblocks/diffs.mako:119 msgid "Collapse all files" msgstr "" @@ -5257,7 +5249,7 @@ msgid "Error during search operation" msgstr "" #: rhodecode/public/js/rhodecode/i18n/js_translations.js:33 -#: rhodecode/templates/codeblocks/diffs.mako:131 +#: rhodecode/templates/codeblocks/diffs.mako:117 msgid "Expand all files" msgstr "" @@ -5557,6 +5549,30 @@ msgstr "" msgid "MathML" msgstr "" +#: rhodecode/public/js/src/rhodecode/comments.js:140 +msgid "Update Comment" +msgstr "" + +#: rhodecode/public/js/src/rhodecode/comments.js:437 +msgid "Saving Draft..." +msgstr "" + +#: rhodecode/public/js/src/rhodecode/comments.js:806 +msgid "Submit {0} draft comment." +msgstr "" + +#: rhodecode/public/js/src/rhodecode/comments.js:809 +msgid "Yes" +msgstr "" + +#: rhodecode/public/js/src/rhodecode/comments.js:1351 +msgid "Leave a comment on file {0} line {1}." +msgstr "" + +#: rhodecode/public/js/src/rhodecode/pullrequests.js:209 +msgid "No additional review rules set." +msgstr "" + #: rhodecode/templates/index.mako:5 msgid "Dashboard" msgstr "" @@ -5622,7 +5638,7 @@ msgstr "" #: rhodecode/templates/forks/fork.mako:56 #: rhodecode/templates/forks/forks.mako:62 #: rhodecode/templates/pullrequests/pullrequest.mako:104 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:400 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:398 #: rhodecode/templates/summary/components.mako:159 #: rhodecode/templates/user_group/profile.mako:25 #: rhodecode/templates/users/user_profile.mako:59 @@ -5664,7 +5680,7 @@ msgstr "" #: rhodecode/templates/email_templates/commit_comment.mako:114 #: rhodecode/templates/email_templates/commit_comment.mako:141 #: rhodecode/templates/files/file_authors_box.mako:28 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:398 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:396 #: rhodecode/templates/search/search_commit.mako:9 #: rhodecode/templates/summary/components.mako:117 #: rhodecode/templates/summary/components.mako:125 @@ -5716,16 +5732,16 @@ msgstr "" msgid "Please contact " msgstr "" -#: rhodecode/templates/login.mako:84 rhodecode/templates/password_reset.mako:39 +#: rhodecode/templates/login.mako:84 rhodecode/templates/password_reset.mako:40 #: rhodecode/templates/base/base.mako:63 msgid "Support" msgstr "" -#: rhodecode/templates/login.mako:85 rhodecode/templates/password_reset.mako:40 +#: rhodecode/templates/login.mako:85 rhodecode/templates/password_reset.mako:41 msgid "or" msgstr "" -#: rhodecode/templates/login.mako:87 rhodecode/templates/password_reset.mako:42 +#: rhodecode/templates/login.mako:87 rhodecode/templates/password_reset.mako:43 msgid "an administrator if you need help." msgstr "" @@ -5737,32 +5753,32 @@ msgstr "" msgid "Reset Password" msgstr "" -#: rhodecode/templates/password_reset.mako:37 +#: rhodecode/templates/password_reset.mako:38 msgid "Password reset is disabled. Please contact " msgstr "" -#: rhodecode/templates/password_reset.mako:49 -msgid "Reset your Password" -msgstr "" - #: rhodecode/templates/password_reset.mako:50 +msgid "Reset your Password" +msgstr "" + +#: rhodecode/templates/password_reset.mako:51 msgid "Go to the login page to sign in." msgstr "" -#: rhodecode/templates/password_reset.mako:54 +#: rhodecode/templates/password_reset.mako:55 msgid "Email Address" msgstr "" -#: rhodecode/templates/password_reset.mako:60 +#: rhodecode/templates/password_reset.mako:61 msgid "Password reset link will be sent to matching email address" msgstr "" -#: rhodecode/templates/password_reset.mako:64 -#: rhodecode/templates/register.mako:104 +#: rhodecode/templates/password_reset.mako:65 +#: rhodecode/templates/register.mako:106 msgid "Captcha" msgstr "" -#: rhodecode/templates/password_reset.mako:75 +#: rhodecode/templates/password_reset.mako:76 msgid "Send password reset email" msgstr "" @@ -5770,23 +5786,23 @@ msgstr "" msgid "Create an Account" msgstr "" -#: rhodecode/templates/register.mako:38 +#: rhodecode/templates/register.mako:40 msgid "Create an account linked with {}" msgstr "" -#: rhodecode/templates/register.mako:40 +#: rhodecode/templates/register.mako:42 msgid "Create an account" msgstr "" -#: rhodecode/templates/register.mako:43 +#: rhodecode/templates/register.mako:45 msgid "Go to the login page to sign in with an existing account." msgstr "" -#: rhodecode/templates/register.mako:69 +#: rhodecode/templates/register.mako:71 msgid "Re-enter password" msgstr "" -#: rhodecode/templates/register.mako:81 +#: rhodecode/templates/register.mako:83 #: rhodecode/templates/admin/my_account/my_account_profile.mako:48 #: rhodecode/templates/admin/my_account/my_account_profile_edit.mako:38 #: rhodecode/templates/admin/users/user_add.mako:68 @@ -5795,7 +5811,7 @@ msgstr "" msgid "First Name" msgstr "" -#: rhodecode/templates/register.mako:88 +#: rhodecode/templates/register.mako:90 #: rhodecode/templates/admin/my_account/my_account_profile.mako:58 #: rhodecode/templates/admin/my_account/my_account_profile_edit.mako:47 #: rhodecode/templates/admin/users/user_add.mako:77 @@ -5804,15 +5820,15 @@ msgstr "" msgid "Last Name" msgstr "" -#: rhodecode/templates/register.mako:116 +#: rhodecode/templates/register.mako:118 msgid "Account activation requires admin approval." msgstr "" -#: rhodecode/templates/register.mako:123 +#: rhodecode/templates/register.mako:125 msgid "Create Account" msgstr "" -#: rhodecode/templates/register.mako:123 +#: rhodecode/templates/register.mako:125 msgid "Create Account in {}" msgstr "" @@ -6108,9 +6124,7 @@ msgstr "" #: rhodecode/templates/admin/gists/gist_edit.mako:100 #: rhodecode/templates/base/issue_tracker_settings.mako:151 -#: rhodecode/templates/changeset/changeset_file_comment.mako:487 -#: rhodecode/templates/codeblocks/diffs.mako:90 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:84 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:82 msgid "Cancel" msgstr "" @@ -6173,14 +6187,14 @@ msgid "quick filter..." msgstr "" #: rhodecode/templates/admin/gists/gist_index.mako:103 -#: rhodecode/templates/admin/my_account/my_account_pullrequests.mako:85 +#: rhodecode/templates/admin/my_account/my_account_pullrequests.mako:87 #: rhodecode/templates/bookmarks/bookmarks.mako:73 #: rhodecode/templates/branches/branches.mako:72 -#: rhodecode/templates/commits/changelog.mako:119 +#: rhodecode/templates/commits/changelog.mako:138 #: rhodecode/templates/compare/compare_commits.mako:16 #: rhodecode/templates/files/files_browser_tree.mako:20 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:397 -#: rhodecode/templates/pullrequests/pullrequests.mako:98 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:395 +#: rhodecode/templates/pullrequests/pullrequests.mako:100 #: rhodecode/templates/search/search_commit.mako:18 #: rhodecode/templates/summary/summary_commits.mako:11 #: rhodecode/templates/tags/tags.mako:73 @@ -6195,7 +6209,7 @@ msgstr "" #: rhodecode/templates/admin/user_groups/user_group_edit_advanced.mako:7 #: rhodecode/templates/admin/users/user_edit_advanced.mako:6 #: rhodecode/templates/admin/users/user_edit_ssh_keys.mako:16 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:60 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:58 msgid "Created on" msgstr "" @@ -6691,26 +6705,26 @@ msgstr "" msgid "Pull Requests You Participate In" msgstr "" -#: rhodecode/templates/admin/my_account/my_account_pullrequests.mako:73 -#: rhodecode/templates/pullrequests/pullrequests.mako:94 +#: rhodecode/templates/admin/my_account/my_account_pullrequests.mako:75 +#: rhodecode/templates/pullrequests/pullrequests.mako:96 msgid "Id" msgstr "" -#: rhodecode/templates/admin/my_account/my_account_pullrequests.mako:79 +#: rhodecode/templates/admin/my_account/my_account_pullrequests.mako:81 #: rhodecode/templates/admin/settings/settings_global.mako:9 #: rhodecode/templates/email_templates/pull_request_review.mako:47 #: rhodecode/templates/email_templates/pull_request_update.mako:43 #: rhodecode/templates/pullrequests/pullrequest.mako:91 -#: rhodecode/templates/pullrequests/pullrequests.mako:96 +#: rhodecode/templates/pullrequests/pullrequests.mako:98 msgid "Title" msgstr "" -#: rhodecode/templates/admin/my_account/my_account_pullrequests.mako:97 -#: rhodecode/templates/pullrequests/pullrequests.mako:102 +#: rhodecode/templates/admin/my_account/my_account_pullrequests.mako:99 +#: rhodecode/templates/pullrequests/pullrequests.mako:104 msgid "Last Update" msgstr "" -#: rhodecode/templates/admin/my_account/my_account_pullrequests.mako:103 +#: rhodecode/templates/admin/my_account/my_account_pullrequests.mako:105 msgid "Target Repo" msgstr "" @@ -6816,10 +6830,10 @@ msgid "Unread" msgstr "" #: rhodecode/templates/admin/notifications/notifications_show_all.mako:41 -#: rhodecode/templates/changeset/changeset.mako:254 -#: rhodecode/templates/changeset/changeset.mako:264 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:729 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:739 +#: rhodecode/templates/changeset/changeset.mako:252 +#: rhodecode/templates/changeset/changeset.mako:262 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:763 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:773 msgid "Comments" msgstr "" @@ -7858,7 +7872,7 @@ msgid "Private repository" msgstr "" #: rhodecode/templates/admin/repos/repo_edit_settings.mako:204 -#: rhodecode/templates/summary/components.mako:263 +#: rhodecode/templates/summary/components.mako:262 msgid "Enable statistics" msgstr "" @@ -9043,10 +9057,10 @@ msgstr "" #: rhodecode/templates/base/base.mako:161 #: rhodecode/templates/base/base.mako:201 -#: rhodecode/templates/changeset/changeset.mako:142 +#: rhodecode/templates/changeset/changeset.mako:140 #: rhodecode/templates/files/files_source_header.mako:57 #: rhodecode/templates/files/files_tree_header.mako:44 -#: rhodecode/templates/summary/components.mako:275 +#: rhodecode/templates/summary/components.mako:274 msgid "Show More" msgstr "" @@ -9358,9 +9372,9 @@ msgid "Confirm to remove this pattern:" msgstr "" #: rhodecode/templates/base/issue_tracker_settings.mako:300 -#: rhodecode/templates/changeset/changeset_file_comment.mako:367 -#: rhodecode/templates/changeset/changeset_file_comment.mako:418 -#: rhodecode/templates/data_table/_dt_elements.mako:453 +#: rhodecode/templates/changeset/changeset_file_comment.mako:395 +#: rhodecode/templates/changeset/changeset_file_comment.mako:446 +#: rhodecode/templates/data_table/_dt_elements.mako:456 #: rhodecode/templates/files/files_add.mako:59 #: rhodecode/templates/files/files_edit.mako:61 msgid "Preview" @@ -9708,7 +9722,7 @@ msgstr "" msgid "{} Commit" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:80 +#: rhodecode/templates/changeset/changeset.mako:78 #: rhodecode/templates/commits/changelog_elements.mako:56 #: rhodecode/templates/files/files_source_header.mako:48 #: rhodecode/templates/files/files_tree_header.mako:35 @@ -9716,119 +9730,127 @@ msgstr "" msgid "Copy the full commit id" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:85 +#: rhodecode/templates/changeset/changeset.mako:83 msgid "Commit phase" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:92 -#: rhodecode/templates/changeset/changeset.mako:99 +#: rhodecode/templates/changeset/changeset.mako:90 +#: rhodecode/templates/changeset/changeset.mako:97 msgid "Evolve State" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:93 +#: rhodecode/templates/changeset/changeset.mako:91 msgid "obsolete" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:100 +#: rhodecode/templates/changeset/changeset.mako:98 msgid "hidden" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:106 +#: rhodecode/templates/changeset/changeset.mako:104 msgid "Parent Commit" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:106 +#: rhodecode/templates/changeset/changeset.mako:104 msgid "parent" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:110 +#: rhodecode/templates/changeset/changeset.mako:108 msgid "Child Commit" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:110 +#: rhodecode/templates/changeset/changeset.mako:108 msgid "child" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:120 +#: rhodecode/templates/changeset/changeset.mako:118 msgid "Diff options" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:124 +#: rhodecode/templates/changeset/changeset.mako:122 msgid "Raw Diff" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:128 +#: rhodecode/templates/changeset/changeset.mako:126 msgid "Patch Diff" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:132 +#: rhodecode/templates/changeset/changeset.mako:130 msgid "Download Diff" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:162 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:504 +#: rhodecode/templates/changeset/changeset.mako:160 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:502 msgid "General Comments" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:203 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:585 +#: rhodecode/templates/changeset/changeset.mako:201 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:619 msgid "Reviewers" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:244 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:718 +#: rhodecode/templates/changeset/changeset.mako:242 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:579 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:752 msgid "No TODOs yet" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:276 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:769 +#: rhodecode/templates/changeset/changeset.mako:274 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:803 msgid "No Comments yet" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:332 +#: rhodecode/templates/changeset/changeset.mako:330 msgid "No Child Commits" msgstr "" -#: rhodecode/templates/changeset/changeset.mako:379 +#: rhodecode/templates/changeset/changeset.mako:377 msgid "No Parent Commits" msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:47 -msgid "Resolved by comment #{}" +#: rhodecode/templates/changeset/changeset_file_comment.mako:51 +msgid "Draft comments are only visible to the author until submitted" msgstr "" #: rhodecode/templates/changeset/changeset_file_comment.mako:55 +msgid "This comment was added while you browsed this page" +msgstr "" + +#: rhodecode/templates/changeset/changeset_file_comment.mako:65 +msgid "Resolved by comment #{}" +msgstr "" + +#: rhodecode/templates/changeset/changeset_file_comment.mako:73 msgid "Click to create resolution comment." msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:64 +#: rhodecode/templates/changeset/changeset_file_comment.mako:82 msgid "This comment resolves TODO #{}" msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:96 -msgid "Status from pull request." -msgstr "" - -#: rhodecode/templates/changeset/changeset_file_comment.mako:113 -msgid "Pull request author" -msgstr "" - #: rhodecode/templates/changeset/changeset_file_comment.mako:114 +msgid "Status from pull request." +msgstr "" + +#: rhodecode/templates/changeset/changeset_file_comment.mako:133 +msgid "Pull request author" +msgstr "" + +#: rhodecode/templates/changeset/changeset_file_comment.mako:134 msgid "author" msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:167 -#: rhodecode/templates/changeset/changeset_file_comment.mako:181 +#: rhodecode/templates/changeset/changeset_file_comment.mako:187 +#: rhodecode/templates/changeset/changeset_file_comment.mako:201 msgid "Outdated comment from pull request version v{0}, latest v{1}" msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:170 -#: rhodecode/templates/changeset/changeset_file_comment.mako:186 +#: rhodecode/templates/changeset/changeset_file_comment.mako:190 +#: rhodecode/templates/changeset/changeset_file_comment.mako:206 msgid "Comment from pull request version v{0}, latest v{1}" msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:202 -#: rhodecode/templates/changeset/changeset_file_comment.mako:480 +#: rhodecode/templates/changeset/changeset_file_comment.mako:222 #: rhodecode/templates/compare/compare_diff.mako:108 #: rhodecode/templates/compare/compare_diff.mako:116 #: rhodecode/templates/compare/compare_diff.mako:124 @@ -9836,98 +9858,93 @@ msgstr "" msgid "Comment" msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:203 +#: rhodecode/templates/changeset/changeset_file_comment.mako:223 #: rhodecode/templates/files/files_source.mako:117 msgid "Copy permalink" msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:221 -#: rhodecode/templates/changeset/changeset_file_comment.mako:224 -#: rhodecode/templates/changeset/changeset_file_comment.mako:230 -#: rhodecode/templates/changeset/changeset_file_comment.mako:233 -msgid "Action unavailable" -msgstr "" - #: rhodecode/templates/changeset/changeset_file_comment.mako:241 +msgid "Submit draft" +msgstr "" + +#: rhodecode/templates/changeset/changeset_file_comment.mako:247 +#: rhodecode/templates/changeset/changeset_file_comment.mako:250 +#: rhodecode/templates/changeset/changeset_file_comment.mako:256 +#: rhodecode/templates/changeset/changeset_file_comment.mako:259 +msgid "Action unavailable" +msgstr "" + +#: rhodecode/templates/changeset/changeset_file_comment.mako:267 msgid "Jump to the previous outdated comment" msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:242 +#: rhodecode/templates/changeset/changeset_file_comment.mako:268 msgid "Jump to the next outdated comment" msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:244 +#: rhodecode/templates/changeset/changeset_file_comment.mako:270 msgid "Jump to the previous comment" msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:245 +#: rhodecode/templates/changeset/changeset_file_comment.mako:271 msgid "Jump to the next comment" msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:284 +#: rhodecode/templates/changeset/changeset_file_comment.mako:311 msgid "Leave a comment on this Pull Request." msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:286 +#: rhodecode/templates/changeset/changeset_file_comment.mako:313 msgid "Leave a comment on {} commits in this range." msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:288 +#: rhodecode/templates/changeset/changeset_file_comment.mako:315 msgid "Leave a comment on this Commit." msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:375 -#: rhodecode/templates/codeblocks/diffs.mako:85 +#: rhodecode/templates/changeset/changeset_file_comment.mako:403 msgid "You need to be logged in to leave comments." msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:376 -#: rhodecode/templates/codeblocks/diffs.mako:85 +#: rhodecode/templates/changeset/changeset_file_comment.mako:404 msgid "Login now" msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:423 +#: rhodecode/templates/changeset/changeset_file_comment.mako:451 msgid "Mark as" msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:446 +#: rhodecode/templates/changeset/changeset_file_comment.mako:474 #: rhodecode/templates/files/files_upload.mako:86 msgid "Drag'n Drop files here or" msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:446 +#: rhodecode/templates/changeset/changeset_file_comment.mako:474 #: rhodecode/templates/files/files_upload.mako:86 msgid "Choose your files" msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:449 +#: rhodecode/templates/changeset/changeset_file_comment.mako:477 msgid "uploading..." msgstr "" -#: rhodecode/templates/changeset/changeset_file_comment.mako:499 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:48 -#: rhodecode/templates/pullrequests/pullrequests.mako:31 -msgid "Closed" -msgstr "" - #: rhodecode/templates/changeset/changeset_file_comment.mako:508 -msgid "Comments parsed using {} syntax." -msgstr "" - -#: rhodecode/templates/changeset/changeset_file_comment.mako:509 -msgid "Use @username inside this text to send notification to this RhodeCode user" -msgstr "" - -#: rhodecode/templates/changeset/changeset_file_comment.mako:510 -msgid "and" -msgstr "" - -#: rhodecode/templates/changeset/changeset_file_comment.mako:511 -msgid "Start typing with / for certain actions to be triggered via text box." -msgstr "" - -#: rhodecode/templates/changeset/changeset_file_comment.mako:512 -msgid "actions supported." +msgid "Add comment" +msgstr "" + +#: rhodecode/templates/changeset/changeset_file_comment.mako:513 +#: rhodecode/templates/changeset/changeset_file_comment.mako:515 +msgid "Add draft" +msgstr "" + +#: rhodecode/templates/changeset/changeset_file_comment.mako:526 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:46 +#: rhodecode/templates/pullrequests/pullrequests.mako:31 +msgid "Closed" +msgstr "" + +#: rhodecode/templates/changeset/changeset_file_comment.mako:545 +msgid "{} is supported." msgstr "" #: rhodecode/templates/changeset/changeset_range.mako:5 @@ -9948,6 +9965,7 @@ msgid "Diff Option" msgstr "" #: rhodecode/templates/changeset/changeset_range.mako:71 +#: rhodecode/templates/commits/changelog.mako:124 msgid "Show combined diff" msgstr "" @@ -9959,8 +9977,8 @@ msgstr "" #: rhodecode/templates/changeset/diff_block.mako:10 #: rhodecode/templates/changeset/diff_block.mako:25 #: rhodecode/templates/changeset/diff_block.mako:46 -#: rhodecode/templates/codeblocks/diffs.mako:210 -#: rhodecode/templates/codeblocks/diffs.mako:341 +#: rhodecode/templates/codeblocks/diffs.mako:196 +#: rhodecode/templates/codeblocks/diffs.mako:327 msgid "Showing a big diff might take some time and resources, continue?" msgstr "" @@ -9968,8 +9986,8 @@ msgstr "" #: rhodecode/templates/changeset/diff_block.mako:10 #: rhodecode/templates/changeset/diff_block.mako:25 #: rhodecode/templates/changeset/diff_block.mako:46 -#: rhodecode/templates/codeblocks/diffs.mako:210 -#: rhodecode/templates/codeblocks/diffs.mako:341 +#: rhodecode/templates/codeblocks/diffs.mako:196 +#: rhodecode/templates/codeblocks/diffs.mako:327 msgid "Show full diff" msgstr "" @@ -9982,148 +10000,149 @@ msgstr "" msgid "Diff was truncated. File content available only in full diff." msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:143 +#: rhodecode/templates/codeblocks/diffs.mako:129 msgid "not available in this view" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:152 +#: rhodecode/templates/codeblocks/diffs.mako:138 msgid "{} unresolved" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:155 +#: rhodecode/templates/codeblocks/diffs.mako:141 msgid "0 unresolved" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:158 +#: rhodecode/templates/codeblocks/diffs.mako:144 msgid "{} Resolved" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:209 +#: rhodecode/templates/codeblocks/diffs.mako:195 msgid "The requested changes are too big and content was truncated." msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:226 +#: rhodecode/templates/codeblocks/diffs.mako:212 msgid "Some changes may be hidden" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:228 +#: rhodecode/templates/codeblocks/diffs.mako:214 msgid "No files" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:341 +#: rhodecode/templates/codeblocks/diffs.mako:327 msgid "The requested commit or file is too big and content was truncated." msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:348 +#: rhodecode/templates/codeblocks/diffs.mako:334 #, python-format msgid "This diff has been collapsed as it changes many lines, (%i lines changed)" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:350 +#: rhodecode/templates/codeblocks/diffs.mako:336 msgid "Show them" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:353 +#: rhodecode/templates/codeblocks/diffs.mako:339 msgid "Hide them" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:390 -#: rhodecode/templates/codeblocks/diffs.mako:409 +#: rhodecode/templates/codeblocks/diffs.mako:376 +#: rhodecode/templates/codeblocks/diffs.mako:395 msgid "Unmatched/outdated inline comments below" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:415 +#: rhodecode/templates/codeblocks/diffs.mako:401 msgid "Unmatched/outdated comments below" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:489 +#: rhodecode/templates/codeblocks/diffs.mako:475 msgid "This file was removed from diff during updates to this pull-request." msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:490 +#: rhodecode/templates/codeblocks/diffs.mako:476 msgid "There are still outdated/unresolved comments attached to it." msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:596 -#: rhodecode/templates/codeblocks/diffs.mako:614 +#: rhodecode/templates/codeblocks/diffs.mako:582 +#: rhodecode/templates/codeblocks/diffs.mako:600 #, python-format msgid "Show file at commit: %(commit_id)s" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:598 -#: rhodecode/templates/codeblocks/diffs.mako:605 +#: rhodecode/templates/codeblocks/diffs.mako:584 +#: rhodecode/templates/codeblocks/diffs.mako:591 msgid "Show file before" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:603 -#: rhodecode/templates/codeblocks/diffs.mako:621 +#: rhodecode/templates/codeblocks/diffs.mako:589 +#: rhodecode/templates/codeblocks/diffs.mako:607 #, python-format msgid "File not present at commit: %(commit_id)s" msgstr "" +#: rhodecode/templates/codeblocks/diffs.mako:602 +#: rhodecode/templates/codeblocks/diffs.mako:609 +msgid "Show file after" +msgstr "" + #: rhodecode/templates/codeblocks/diffs.mako:616 -#: rhodecode/templates/codeblocks/diffs.mako:623 -msgid "Show file after" -msgstr "" - -#: rhodecode/templates/codeblocks/diffs.mako:630 -msgid "Show comments" -msgstr "" - -#: rhodecode/templates/codeblocks/diffs.mako:630 +#: rhodecode/templates/codeblocks/diffs.mako:618 msgid "Hide comments" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:721 -#: rhodecode/templates/codeblocks/diffs.mako:764 -#: rhodecode/templates/codeblocks/diffs.mako:826 -msgid "comments including outdated: {}. Click here to display them." -msgstr "" - -#: rhodecode/templates/codeblocks/diffs.mako:723 -#: rhodecode/templates/codeblocks/diffs.mako:766 -#: rhodecode/templates/codeblocks/diffs.mako:828 -msgid "comments: {}. Click to toggle them." -msgstr "" - -#: rhodecode/templates/codeblocks/diffs.mako:897 +#: rhodecode/templates/codeblocks/diffs.mako:617 +msgid "Show comments" +msgstr "" + +#: rhodecode/templates/codeblocks/diffs.mako:726 +#: rhodecode/templates/codeblocks/diffs.mako:773 +#: rhodecode/templates/codeblocks/diffs.mako:840 +msgid "Comments including outdated: {}. Click here to toggle them." +msgstr "" + +#: rhodecode/templates/codeblocks/diffs.mako:728 +#: rhodecode/templates/codeblocks/diffs.mako:775 +#: rhodecode/templates/codeblocks/diffs.mako:842 +msgid "Comments: {}. Click to toggle them." +msgstr "" + +#: rhodecode/templates/codeblocks/diffs.mako:914 msgid "Toggle wide diff" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:905 +#: rhodecode/templates/codeblocks/diffs.mako:922 msgid "View diff as side by side" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:907 +#: rhodecode/templates/codeblocks/diffs.mako:924 msgid "Side by Side" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:912 +#: rhodecode/templates/codeblocks/diffs.mako:929 msgid "View diff as unified" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:913 +#: rhodecode/templates/codeblocks/diffs.mako:930 msgid "Unified" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:918 +#: rhodecode/templates/codeblocks/diffs.mako:935 msgid "Turn off: Show the diff as commit range" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:921 -#: rhodecode/templates/codeblocks/diffs.mako:928 +#: rhodecode/templates/codeblocks/diffs.mako:938 +#: rhodecode/templates/codeblocks/diffs.mako:945 msgid "Range Diff" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:925 +#: rhodecode/templates/codeblocks/diffs.mako:942 msgid "Show the diff as commit range" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:990 +#: rhodecode/templates/codeblocks/diffs.mako:1007 msgid "Disabled on range diff" msgstr "" -#: rhodecode/templates/codeblocks/diffs.mako:1297 +#: rhodecode/templates/codeblocks/diffs.mako:1314 msgid "..." msgstr "" @@ -10171,25 +10190,25 @@ msgstr "" msgid "Select second commit" msgstr "" -#: rhodecode/templates/commits/changelog.mako:116 +#: rhodecode/templates/commits/changelog.mako:135 msgid "Commit Message" msgstr "" -#: rhodecode/templates/commits/changelog.mako:118 +#: rhodecode/templates/commits/changelog.mako:137 #: rhodecode/templates/summary/summary_commits.mako:10 msgid "Age" msgstr "" -#: rhodecode/templates/commits/changelog.mako:121 +#: rhodecode/templates/commits/changelog.mako:140 #: rhodecode/templates/summary/summary_commits.mako:12 msgid "Refs" msgstr "" -#: rhodecode/templates/commits/changelog.mako:262 +#: rhodecode/templates/commits/changelog.mako:289 msgid "Branch filter" msgstr "" -#: rhodecode/templates/commits/changelog.mako:323 +#: rhodecode/templates/commits/changelog.mako:350 msgid "There are no changes yet" msgstr "" @@ -10229,7 +10248,7 @@ msgstr "" #: rhodecode/templates/commits/changelog_elements.mako:80 #: rhodecode/templates/compare/compare_commits.mako:47 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:435 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:433 #: rhodecode/templates/search/search_commit.mako:34 msgid "Expand commit message" msgstr "" @@ -10281,7 +10300,7 @@ msgid "Compare was calculated based on t msgstr "" #: rhodecode/templates/compare/compare_commits.mako:15 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:396 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:394 msgid "Time" msgstr "" @@ -10402,7 +10421,7 @@ msgid "personal" msgstr "" #: rhodecode/templates/data_table/_dt_elements.mako:387 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:59 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:57 msgid "Pull request !{}" msgstr "" @@ -10410,11 +10429,11 @@ msgstr "" msgid "Work in progress" msgstr "" -#: rhodecode/templates/data_table/_dt_elements.mako:429 +#: rhodecode/templates/data_table/_dt_elements.mako:432 msgid "Info" msgstr "" -#: rhodecode/templates/data_table/_dt_elements.mako:470 +#: rhodecode/templates/data_table/_dt_elements.mako:473 #, python-format msgid "Parsed using %s syntax" msgstr "" @@ -10553,11 +10572,11 @@ msgid "Don't have an account ?" msgstr "" #: rhodecode/templates/email_templates/base.mako:72 -#: rhodecode/templates/email_templates/base.mako:633 +#: rhodecode/templates/email_templates/base.mako:639 msgid "This is a notification from RhodeCode." msgstr "" -#: rhodecode/templates/email_templates/base.mako:613 +#: rhodecode/templates/email_templates/base.mako:619 msgid "RhodeCode" msgstr "" @@ -10718,8 +10737,8 @@ msgstr "" #: rhodecode/templates/email_templates/pull_request_review.mako:129 #: rhodecode/templates/email_templates/pull_request_update.mako:132 #: rhodecode/templates/email_templates/pull_request_update.mako:134 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:114 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:123 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:112 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:121 msgid "of" msgstr "" @@ -10857,15 +10876,20 @@ msgstr "" msgid "Upload File" msgstr "" -#: rhodecode/templates/files/files_browser.mako:51 -msgid "Download full tree ZIP" -msgstr "" - -#: rhodecode/templates/files/files_browser.mako:55 -msgid "Download this tree ZIP" -msgstr "" - -#: rhodecode/templates/files/files_browser.mako:83 +#: rhodecode/templates/files/files_browser.mako:50 +msgid "Full tree as {}" +msgstr "" + +#: rhodecode/templates/files/files_browser.mako:53 +msgid "This tree as {}" +msgstr "" + +#: rhodecode/templates/files/files_browser.mako:63 +#: rhodecode/templates/summary/components.mako:196 +msgid "more download options" +msgstr "" + +#: rhodecode/templates/files/files_browser.mako:106 #: rhodecode/templates/summary/summary.mako:37 #, python-format msgid "Readme file from commit %s:%s" @@ -11064,7 +11088,7 @@ msgid "New pull request" msgstr "" #: rhodecode/templates/pullrequests/pullrequest.mako:33 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:104 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:102 msgid "Commit flow" msgstr "" @@ -11085,17 +11109,17 @@ msgid "Reviewers / Observers" msgstr "" #: rhodecode/templates/pullrequests/pullrequest.mako:121 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:571 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:605 msgid "Reviewer rules" msgstr "" #: rhodecode/templates/pullrequests/pullrequest.mako:167 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:613 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:647 msgid "Add reviewer or reviewer group" msgstr "" #: rhodecode/templates/pullrequests/pullrequest.mako:191 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:666 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:700 msgid "Add observer or observer group" msgstr "" @@ -11151,223 +11175,232 @@ msgstr "" msgid "{} Pull Request !{}" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:61 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:59 msgid "Last updated on" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:62 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:60 msgid "by" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:71 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:69 msgid "Update title & description" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:77 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:80 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:75 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:78 msgid "Delete pull request" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:80 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:78 msgid "Not allowed to delete this pull request" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:90 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:88 msgid "Rendered using {} renderer" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:137 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:135 msgid "Common ancestor" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:141 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:139 msgid "not available" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:153 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:151 msgid "Pull changes from source" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:154 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:152 msgid "Copy the pull url" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:166 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:164 msgid "Clone repository in its merged state using shadow repository" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:166 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:164 msgid "Clone from shadow repository" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:167 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:165 #: rhodecode/templates/summary/components.mako:78 msgid "Copy the clone url" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:171 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:169 msgid "Shadow repository data not available" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:187 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:185 msgid "Versions" msgstr "" +#: rhodecode/templates/pullrequests/pullrequest_show.mako:197 #: rhodecode/templates/pullrequests/pullrequest_show.mako:199 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:201 msgid "show versions" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:200 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:198 msgid "hide versions" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:225 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:223 msgid "Your review status at this version" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:230 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:228 msgid "Comments from pull request version v{0}" msgstr "" +#: rhodecode/templates/pullrequests/pullrequest_show.mako:246 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:250 +msgid "select versions to show changes" +msgstr "" + +#: rhodecode/templates/pullrequests/pullrequest_show.mako:247 +msgid "show changes between versions" +msgstr "" + #: rhodecode/templates/pullrequests/pullrequest_show.mako:248 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:252 -msgid "select versions to show changes" -msgstr "" - -#: rhodecode/templates/pullrequests/pullrequest_show.mako:249 -msgid "show changes between versions" -msgstr "" - -#: rhodecode/templates/pullrequests/pullrequest_show.mako:250 msgid "show pull request for this version" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:259 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:257 msgid "Pull request versions not available" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:279 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:277 msgid "Cannot show diff when pull request state is changing. Current progress state" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:297 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:295 msgid "Missing requirements:" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:298 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:296 msgid "These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled." msgstr "" +#: rhodecode/templates/pullrequests/pullrequest_show.mako:304 +msgid "Missing commits" +msgstr "" + +#: rhodecode/templates/pullrequests/pullrequest_show.mako:305 +msgid "This pull request cannot be displayed, because one or more commits no longer exist in the source repository." +msgstr "" + #: rhodecode/templates/pullrequests/pullrequest_show.mako:306 -msgid "Missing commits" +msgid "Please update this pull request, push the commits back into the source repository, or consider closing this pull request." msgstr "" #: rhodecode/templates/pullrequests/pullrequest_show.mako:307 -msgid "This pull request cannot be displayed, because one or more commits no longer exist in the source repository." -msgstr "" - -#: rhodecode/templates/pullrequests/pullrequest_show.mako:308 -msgid "Please update this pull request, push the commits back into the source repository, or consider closing this pull request." -msgstr "" - -#: rhodecode/templates/pullrequests/pullrequest_show.mako:309 msgid "Consider doing a `force update commits` in case you think this is an error." msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:317 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:315 msgid "There are new changes for `{}:{}` in source repository, please consider updating this pull request." msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:328 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:326 msgid "Showing changes at v{}, commenting is disabled." msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:351 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:373 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:349 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:371 msgid "Update commits" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:354 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:352 msgid "more update options" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:362 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:360 msgid "Force update commits" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:365 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:363 msgid "Update commits and force refresh this pull request." msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:373 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:371 msgid "Update is disabled for current view" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:385 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:383 msgid "Commits and changes between v{ver_from} and {ver_to} of this pull request, commenting is disabled" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:389 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:387 msgid "commits added: {}, removed: {}" msgstr "" +#: rhodecode/templates/pullrequests/pullrequest_show.mako:405 +msgid "Commit added in displayed changes" +msgstr "" + #: rhodecode/templates/pullrequests/pullrequest_show.mako:407 -msgid "Commit added in displayed changes" -msgstr "" - -#: rhodecode/templates/pullrequests/pullrequest_show.mako:409 msgid "Commit removed in displayed changes" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:512 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:510 msgid "there is {num} general comment from older versions" msgstr "" +#: rhodecode/templates/pullrequests/pullrequest_show.mako:511 +msgid "show it" +msgstr "" + #: rhodecode/templates/pullrequests/pullrequest_show.mako:513 -msgid "show it" -msgstr "" - -#: rhodecode/templates/pullrequests/pullrequest_show.mako:515 msgid "there are {num} general comments from older versions" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:516 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:514 msgid "show them" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:591 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:556 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:567 +msgid "Drafts" +msgstr "" + +#: rhodecode/templates/pullrequests/pullrequest_show.mako:569 +msgid "Submit" +msgstr "" + +#: rhodecode/templates/pullrequests/pullrequest_show.mako:625 msgid "Show rules" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:618 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:671 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:652 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:705 msgid "Save Changes" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:642 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:676 msgid "Observers" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:708 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:742 msgid "TODOs unavailable when browsing versions" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:780 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:788 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:814 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:822 msgid "Referenced Tickets" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:794 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:828 msgid "In pull request description" msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:808 -#: rhodecode/templates/pullrequests/pullrequest_show.mako:827 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:842 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:861 msgid "No Ticket data found." msgstr "" -#: rhodecode/templates/pullrequests/pullrequest_show.mako:813 +#: rhodecode/templates/pullrequests/pullrequest_show.mako:847 msgid "In commit messages" msgstr "" @@ -11496,23 +11529,19 @@ msgstr "" msgid "Downloads are disabled for this repository" msgstr "" -#: rhodecode/templates/summary/components.mako:196 -msgid "more download options" -msgstr "" - -#: rhodecode/templates/summary/components.mako:228 +#: rhodecode/templates/summary/components.mako:227 msgid "Repository size" msgstr "" -#: rhodecode/templates/summary/components.mako:240 +#: rhodecode/templates/summary/components.mako:239 msgid "Calculating Repository Size..." msgstr "" -#: rhodecode/templates/summary/components.mako:251 +#: rhodecode/templates/summary/components.mako:250 msgid "Code Statistics" msgstr "" -#: rhodecode/templates/summary/components.mako:260 +#: rhodecode/templates/summary/components.mako:259 msgid "Statistics are disabled for this repository" msgstr "" diff --git a/rhodecode/integrations/routes.py b/rhodecode/integrations/routes.py --- a/rhodecode/integrations/routes.py +++ b/rhodecode/integrations/routes.py @@ -24,6 +24,9 @@ from rhodecode.apps._base import ADMIN_P from rhodecode.lib.utils2 import safe_int from rhodecode.model.db import Repository, Integration, RepoGroup from rhodecode.integrations import integration_type_registry +from rhodecode.integrations.views import GlobalIntegrationsView +from rhodecode.integrations.views import RepoGroupIntegrationsView +from rhodecode.integrations.views import RepoIntegrationsView log = logging.getLogger(__name__) @@ -83,7 +86,7 @@ def includeme(config): # global integrations config.add_route('global_integrations_new', ADMIN_PREFIX + '/integrations/new') - config.add_view('rhodecode.integrations.views.GlobalIntegrationsView', + config.add_view(GlobalIntegrationsView, attr='new_integration', renderer='rhodecode:templates/admin/integrations/new.mako', request_method='GET', @@ -94,7 +97,7 @@ def includeme(config): config.add_route('global_integrations_list', ADMIN_PREFIX + '/integrations/{integration}') for route_name in ['global_integrations_home', 'global_integrations_list']: - config.add_view('rhodecode.integrations.views.GlobalIntegrationsView', + config.add_view(GlobalIntegrationsView, attr='integration_list', renderer='rhodecode:templates/admin/integrations/list.mako', request_method='GET', @@ -108,12 +111,12 @@ def includeme(config): valid_integration=True) for route_name in ['global_integrations_create', 'global_integrations_edit']: - config.add_view('rhodecode.integrations.views.GlobalIntegrationsView', + config.add_view(GlobalIntegrationsView, attr='settings_get', renderer='rhodecode:templates/admin/integrations/form.mako', request_method='GET', route_name=route_name) - config.add_view('rhodecode.integrations.views.GlobalIntegrationsView', + config.add_view(GlobalIntegrationsView, attr='settings_post', renderer='rhodecode:templates/admin/integrations/form.mako', request_method='POST', @@ -124,7 +127,7 @@ def includeme(config): add_route_requirements('/{repo_group_name}/_settings/integrations'), repo_group_route=True) - config.add_view('rhodecode.integrations.views.RepoGroupIntegrationsView', + config.add_view(RepoGroupIntegrationsView, attr='integration_list', renderer='rhodecode:templates/admin/integrations/list.mako', request_method='GET', @@ -133,7 +136,7 @@ def includeme(config): config.add_route('repo_group_integrations_new', add_route_requirements('/{repo_group_name}/_settings/integrations/new'), repo_group_route=True) - config.add_view('rhodecode.integrations.views.RepoGroupIntegrationsView', + config.add_view(RepoGroupIntegrationsView, attr='new_integration', renderer='rhodecode:templates/admin/integrations/new.mako', request_method='GET', @@ -143,7 +146,7 @@ def includeme(config): add_route_requirements('/{repo_group_name}/_settings/integrations/{integration}'), repo_group_route=True, valid_integration=True) - config.add_view('rhodecode.integrations.views.RepoGroupIntegrationsView', + config.add_view(RepoGroupIntegrationsView, attr='integration_list', renderer='rhodecode:templates/admin/integrations/list.mako', request_method='GET', @@ -153,12 +156,12 @@ def includeme(config): add_route_requirements('/{repo_group_name}/_settings/integrations/{integration}/new'), repo_group_route=True, valid_integration=True) - config.add_view('rhodecode.integrations.views.RepoGroupIntegrationsView', + config.add_view(RepoGroupIntegrationsView, attr='settings_get', renderer='rhodecode:templates/admin/integrations/form.mako', request_method='GET', route_name='repo_group_integrations_create') - config.add_view('rhodecode.integrations.views.RepoGroupIntegrationsView', + config.add_view(RepoGroupIntegrationsView, attr='settings_post', renderer='rhodecode:templates/admin/integrations/form.mako', request_method='POST', @@ -169,12 +172,12 @@ def includeme(config): repo_group_route=True, valid_integration=True) - config.add_view('rhodecode.integrations.views.RepoGroupIntegrationsView', + config.add_view(RepoGroupIntegrationsView, attr='settings_get', renderer='rhodecode:templates/admin/integrations/form.mako', request_method='GET', route_name='repo_group_integrations_edit') - config.add_view('rhodecode.integrations.views.RepoGroupIntegrationsView', + config.add_view(RepoGroupIntegrationsView, attr='settings_post', renderer='rhodecode:templates/admin/integrations/form.mako', request_method='POST', @@ -184,7 +187,7 @@ def includeme(config): config.add_route('repo_integrations_home', add_route_requirements('/{repo_name}/settings/integrations'), repo_route=True) - config.add_view('rhodecode.integrations.views.RepoIntegrationsView', + config.add_view(RepoIntegrationsView, attr='integration_list', request_method='GET', renderer='rhodecode:templates/admin/integrations/list.mako', @@ -193,7 +196,7 @@ def includeme(config): config.add_route('repo_integrations_new', add_route_requirements('/{repo_name}/settings/integrations/new'), repo_route=True) - config.add_view('rhodecode.integrations.views.RepoIntegrationsView', + config.add_view(RepoIntegrationsView, attr='new_integration', renderer='rhodecode:templates/admin/integrations/new.mako', request_method='GET', @@ -203,7 +206,7 @@ def includeme(config): add_route_requirements('/{repo_name}/settings/integrations/{integration}'), repo_route=True, valid_integration=True) - config.add_view('rhodecode.integrations.views.RepoIntegrationsView', + config.add_view(RepoIntegrationsView, attr='integration_list', request_method='GET', renderer='rhodecode:templates/admin/integrations/list.mako', @@ -213,12 +216,12 @@ def includeme(config): add_route_requirements('/{repo_name}/settings/integrations/{integration}/new'), repo_route=True, valid_integration=True) - config.add_view('rhodecode.integrations.views.RepoIntegrationsView', + config.add_view(RepoIntegrationsView, attr='settings_get', renderer='rhodecode:templates/admin/integrations/form.mako', request_method='GET', route_name='repo_integrations_create') - config.add_view('rhodecode.integrations.views.RepoIntegrationsView', + config.add_view(RepoIntegrationsView, attr='settings_post', renderer='rhodecode:templates/admin/integrations/form.mako', request_method='POST', @@ -228,12 +231,12 @@ def includeme(config): add_route_requirements('/{repo_name}/settings/integrations/{integration}/{integration_id}'), repo_route=True, valid_integration=True) - config.add_view('rhodecode.integrations.views.RepoIntegrationsView', + config.add_view(RepoIntegrationsView, attr='settings_get', renderer='rhodecode:templates/admin/integrations/form.mako', request_method='GET', route_name='repo_integrations_edit') - config.add_view('rhodecode.integrations.views.RepoIntegrationsView', + config.add_view(RepoIntegrationsView, attr='settings_post', renderer='rhodecode:templates/admin/integrations/form.mako', request_method='POST', diff --git a/rhodecode/lib/base.py b/rhodecode/lib/base.py --- a/rhodecode/lib/base.py +++ b/rhodecode/lib/base.py @@ -469,7 +469,14 @@ def get_auth_user(request): ip_addr = get_ip_addr(environ) # make sure that we update permissions each time we call controller - _auth_token = (request.GET.get('auth_token', '') or request.GET.get('api_key', '')) + _auth_token = ( + # ?auth_token=XXX + request.GET.get('auth_token', '') + # ?api_key=XXX !LEGACY + or request.GET.get('api_key', '') + # or headers.... + or request.headers.get('X-Rc-Auth-Token', '') + ) if not _auth_token and request.matchdict: url_auth_token = request.matchdict.get('_auth_token') _auth_token = url_auth_token diff --git a/rhodecode/lib/celerylib/tasks.py b/rhodecode/lib/celerylib/tasks.py --- a/rhodecode/lib/celerylib/tasks.py +++ b/rhodecode/lib/celerylib/tasks.py @@ -354,7 +354,7 @@ def check_for_update(): @async_task(ignore_result=False) def beat_check(*args, **kwargs): log = get_logger(beat_check) - log.info('Got args: %r and kwargs %r', args, kwargs) + log.info('%r: Got args: %r and kwargs %r', beat_check, args, kwargs) return time.time() diff --git a/rhodecode/lib/codeblocks.py b/rhodecode/lib/codeblocks.py --- a/rhodecode/lib/codeblocks.py +++ b/rhodecode/lib/codeblocks.py @@ -398,7 +398,10 @@ class DiffSet(object): ): self.highlight_mode = highlight_mode - self.highlighted_filenodes = {} + self.highlighted_filenodes = { + 'before': {}, + 'after': {} + } self.source_node_getter = source_node_getter self.target_node_getter = target_node_getter self.source_nodes = source_nodes or {} @@ -657,7 +660,7 @@ class DiffSet(object): else: before_tokens = self.get_line_tokens( line_text=before['line'], line_number=before['old_lineno'], - input_file=source_file, no_hl=no_hl) + input_file=source_file, no_hl=no_hl, source='before') original.lineno = before['old_lineno'] original.content = before['line'] original.action = self.action_to_op(before['action']) @@ -671,7 +674,7 @@ class DiffSet(object): else: after_tokens = self.get_line_tokens( line_text=after['line'], line_number=after['new_lineno'], - input_file=target_file, no_hl=no_hl) + input_file=target_file, no_hl=no_hl, source='after') modified.lineno = after['new_lineno'] modified.content = after['line'] modified.action = self.action_to_op(after['action']) @@ -705,7 +708,7 @@ class DiffSet(object): return lines - def get_line_tokens(self, line_text, line_number, input_file=None, no_hl=False): + def get_line_tokens(self, line_text, line_number, input_file=None, no_hl=False, source=''): filenode = None filename = None @@ -720,8 +723,7 @@ class DiffSet(object): lexer = self._get_lexer_for_filename(filename) file_size_allowed = input_file.size < self.max_file_size_limit if line_number and file_size_allowed: - return self.get_tokenized_filenode_line( - input_file, line_number, lexer) + return self.get_tokenized_filenode_line(input_file, line_number, lexer, source) if hl_mode in (self.HL_REAL, self.HL_FAST) and filename: lexer = self._get_lexer_for_filename(filename) @@ -729,16 +731,19 @@ class DiffSet(object): return list(tokenize_string(line_text, plain_text_lexer)) - def get_tokenized_filenode_line(self, filenode, line_number, lexer=None): + def get_tokenized_filenode_line(self, filenode, line_number, lexer=None, source=''): - if filenode not in self.highlighted_filenodes: - tokenized_lines = filenode_as_lines_tokens(filenode, lexer) - self.highlighted_filenodes[filenode] = tokenized_lines + def tokenize(_filenode): + self.highlighted_filenodes[source][filenode] = filenode_as_lines_tokens(filenode, lexer) + + if filenode not in self.highlighted_filenodes[source]: + tokenize(filenode) try: - return self.highlighted_filenodes[filenode][line_number - 1] + return self.highlighted_filenodes[source][filenode][line_number - 1] except Exception: - return [('', u'rhodecode diff rendering error')] + log.exception('diff rendering error') + return [('', u'L{}: rhodecode diff rendering error'.format(line_number))] def action_to_op(self, action): return { diff --git a/rhodecode/lib/ext_json_renderer.py b/rhodecode/lib/ext_json_renderer.py --- a/rhodecode/lib/ext_json_renderer.py +++ b/rhodecode/lib/ext_json_renderer.py @@ -27,11 +27,14 @@ def pyramid_ext_json(info): """ def _render(value, system): request = system.get('request') + indent = None if request is not None: response = request.response ct = response.content_type if ct == response.default_content_type: response.content_type = 'application/json' - return json.dumps(value) + indent = getattr(request, 'ext_json_indent', None) + + return json.dumps(value, indent=indent) return _render diff --git a/rhodecode/lib/rc_beaker.py b/rhodecode/lib/rc_beaker.py --- a/rhodecode/lib/rc_beaker.py +++ b/rhodecode/lib/rc_beaker.py @@ -145,60 +145,6 @@ def session_factory_from_settings(settin return BeakerSessionFactoryConfig(**options) -def set_cache_regions_from_settings(settings): - """ Add cache support to the Pylons application. - - The ``settings`` passed to the configurator are used to setup - the cache options. Cache options in the settings should start - with either 'beaker.cache.' or 'cache.'. - - """ - cache_settings = {'regions': []} - for key in settings.keys(): - for prefix in ['beaker.cache.', 'cache.']: - if key.startswith(prefix): - name = key.split(prefix)[1].strip() - cache_settings[name] = settings[key].strip() - - if ('expire' in cache_settings - and isinstance(cache_settings['expire'], basestring) - and cache_settings['expire'].lower() in ['none', 'no']): - cache_settings['expire'] = None - - coerce_cache_params(cache_settings) - - if 'enabled' not in cache_settings: - cache_settings['enabled'] = True - - regions = cache_settings['regions'] - if regions: - for region in regions: - if not region: - continue - - region_settings = { - 'data_dir': cache_settings.get('data_dir'), - 'lock_dir': cache_settings.get('lock_dir'), - 'expire': cache_settings.get('expire', 60), - 'enabled': cache_settings['enabled'], - 'key_length': cache_settings.get('key_length', 250), - 'type': cache_settings.get('type'), - 'url': cache_settings.get('url'), - } - region_prefix = '%s.' % region - region_len = len(region_prefix) - for key in list(cache_settings.keys()): - if key.startswith(region_prefix): - region_settings[key[region_len:]] = cache_settings.pop(key) - - if (isinstance(region_settings['expire'], basestring) - and region_settings['expire'].lower() in ['none', 'no']): - region_settings['expire'] = None - coerce_cache_params(region_settings) - cache.cache_regions[region] = region_settings - - def includeme(config): session_factory = session_factory_from_settings(config.registry.settings) config.set_session_factory(session_factory) - set_cache_regions_from_settings(config.registry.settings) diff --git a/rhodecode/lib/rc_cache/__init__.py b/rhodecode/lib/rc_cache/__init__.py --- a/rhodecode/lib/rc_cache/__init__.py +++ b/rhodecode/lib/rc_cache/__init__.py @@ -62,24 +62,25 @@ def configure_dogpile_cache(settings): avail_regions = set() for key in rc_cache_data.keys(): namespace_name = key.split('.', 1)[0] - avail_regions.add(namespace_name) - log.debug('dogpile: found following cache regions: %s', avail_regions) + if namespace_name in avail_regions: + continue - # register them into namespace - for region_name in avail_regions: + avail_regions.add(namespace_name) + log.debug('dogpile: found following cache regions: %s', namespace_name) + new_region = make_region( - name=region_name, + name=namespace_name, function_key_generator=None ) - new_region.configure_from_config(settings, 'rc_cache.{}.'.format(region_name)) + new_region.configure_from_config(settings, 'rc_cache.{}.'.format(namespace_name)) new_region.function_key_generator = backend_key_generator(new_region.actual_backend) if log.isEnabledFor(logging.DEBUG): region_args = dict(backend=new_region.actual_backend.__class__, region_invalidator=new_region.region_invalidator.__class__) - log.debug('dogpile: registering a new region `%s` %s', region_name, region_args) + log.debug('dogpile: registering a new region `%s` %s', namespace_name, region_args) - region_meta.dogpile_cache_regions[region_name] = new_region + region_meta.dogpile_cache_regions[namespace_name] = new_region def includeme(config): diff --git a/rhodecode/lib/vcs/exceptions.py b/rhodecode/lib/vcs/exceptions.py --- a/rhodecode/lib/vcs/exceptions.py +++ b/rhodecode/lib/vcs/exceptions.py @@ -218,8 +218,9 @@ def map_vcs_exceptions(func): if kind: if any(e.args): - args = [a for a in e.args] - args[0] = '{}:'.format(exc_name) # prefix first arg with org exc name + _args = [a for a in e.args] + # replace the first argument with a prefix exc name + args = ['{}:'.format(exc_name, _args[0] if _args else '?')] + _args[1:] else: args = [__traceback_info__ or '{}: UnhandledException'.format(exc_name)] if debug or __traceback_info__ and kind not in ['unhandled', 'lookup']: diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -749,8 +749,11 @@ class User(Base, BaseModel): def get_artifact_token(self, cache=True): artifacts_tokens = UserApiKeys.query()\ - .filter(UserApiKeys.user == self)\ + .filter(UserApiKeys.user == self) \ + .filter(or_(UserApiKeys.expires == -1, + UserApiKeys.expires >= time.time())) \ .filter(UserApiKeys.role == UserApiKeys.ROLE_ARTIFACT_DOWNLOAD) + if cache: artifacts_tokens = artifacts_tokens.options( FromCache("sql_cache_short", "get_user_artifact_token_%s" % self.user_id)) @@ -760,6 +763,24 @@ class User(Base, BaseModel): return artifacts_tokens[0].api_key return 'NO_ARTIFACT_TOKEN_AVAILABLE' + def get_or_create_artifact_token(self): + artifacts_tokens = UserApiKeys.query()\ + .filter(UserApiKeys.user == self) \ + .filter(or_(UserApiKeys.expires == -1, + UserApiKeys.expires >= time.time())) \ + .filter(UserApiKeys.role == UserApiKeys.ROLE_ARTIFACT_DOWNLOAD) + + artifacts_tokens = artifacts_tokens.all() + if artifacts_tokens: + return artifacts_tokens[0].api_key + else: + from rhodecode.model.auth_token import AuthTokenModel + artifact_token = AuthTokenModel().create( + self, 'auto-generated-artifact-token', + lifetime=-1, role=UserApiKeys.ROLE_ARTIFACT_DOWNLOAD) + Session.commit() + return artifact_token.api_key + @classmethod def get(cls, user_id, cache=False): if not user_id: @@ -3967,7 +3988,7 @@ class ChangesetStatus(Base, BaseModel): STATUS_APPROVED = 'approved' STATUS_REJECTED = 'rejected' STATUS_UNDER_REVIEW = 'under_review' - + CheckConstraint, STATUSES = [ (STATUS_NOT_REVIEWED, _("Not Reviewed")), # (no icon) and default (STATUS_APPROVED, _("Approved")), @@ -4810,6 +4831,7 @@ class Gist(Base, BaseModel): res = cls.query().filter(cls.gist_access_id == id_).scalar() if not res: + log.debug('WARN: No DB entry with id %s', id_) raise HTTPNotFound() return res @@ -5322,11 +5344,11 @@ class ScheduleEntry(Base, BaseModel): except ValueError: return dict() - def _as_raw(self, val): + def _as_raw(self, val, indent=None): if hasattr(val, 'de_coerce'): val = val.de_coerce() if val: - val = json.dumps(val) + val = json.dumps(val, indent=indent, sort_keys=True) return val @@ -5334,13 +5356,11 @@ class ScheduleEntry(Base, BaseModel): def schedule_definition_raw(self): return self._as_raw(self.schedule_definition) - @property - def args_raw(self): - return self._as_raw(self.task_args) - - @property - def kwargs_raw(self): - return self._as_raw(self.task_kwargs) + def args_raw(self, indent=None): + return self._as_raw(self.task_args, indent) + + def kwargs_raw(self, indent=None): + return self._as_raw(self.task_kwargs, indent) def __repr__(self): return ''.format( diff --git a/rhodecode/model/repo_group.py b/rhodecode/model/repo_group.py --- a/rhodecode/model/repo_group.py +++ b/rhodecode/model/repo_group.py @@ -60,6 +60,9 @@ class RepoGroupModel(BaseModel): return self._get_instance(RepoGroup, repo_group, callback=RepoGroup.get_by_group_name) + def get_repo_group(self, repo_group): + return self._get_repo_group(repo_group) + @LazyProperty def repos_path(self): """ diff --git a/rhodecode/model/validation_schema/validators.py b/rhodecode/model/validation_schema/validators.py --- a/rhodecode/model/validation_schema/validators.py +++ b/rhodecode/model/validation_schema/validators.py @@ -147,6 +147,14 @@ class CloneUriValidator(object): def json_validator(node, value): try: json.loads(value) - except (Exception,): + except (Exception,) as e: msg = _(u'Please enter a valid json object') raise colander.Invalid(node, msg) + + +def json_validator_with_exc(node, value): + try: + json.loads(value) + except (Exception,) as e: + msg = _(u'Please enter a valid json object: `{}`'.format(e)) + raise colander.Invalid(node, msg) diff --git a/rhodecode/public/css/buttons.less b/rhodecode/public/css/buttons.less --- a/rhodecode/public/css/buttons.less +++ b/rhodecode/public/css/buttons.less @@ -225,6 +225,7 @@ input[type="button"] { } } + .btn-approved-status { .border ( @border-thickness, @alert1 ); background-color: white; @@ -262,6 +263,10 @@ input[type="button"] { border-radius: @border-radius 0 0 @border-radius; } + // 2nd, if only 2 elements are there + &:nth-of-type(2) { + border-left-width: 0; + } // middle elements &:not(:first-of-type):not(:last-of-type) { border-radius: 0; @@ -429,6 +434,31 @@ input[type="button"] { } } +input[type="submit"].btn-draft { + .border ( @border-thickness, @rcblue ); + background-color: white; + color: @rcblue; + + a { + color: @rcblue; + } + + &:hover, + &.active { + .border ( @border-thickness, @rcdarkblue ); + background-color: white; + color: @rcdarkblue; + + a { + color: @rcdarkblue; + } + } + + &:disabled { + background-color: white; + color: @rcblue; + } +} input[type="submit"].btn-warning { &:extend(.btn-warning); diff --git a/rhodecode/public/css/comments.less b/rhodecode/public/css/comments.less --- a/rhodecode/public/css/comments.less +++ b/rhodecode/public/css/comments.less @@ -657,6 +657,7 @@ form.comment-form { .resolve-action { padding: 1px 0px 0px 6px; + list-style: none; } } diff --git a/rhodecode/public/css/main.less b/rhodecode/public/css/main.less --- a/rhodecode/public/css/main.less +++ b/rhodecode/public/css/main.less @@ -1540,7 +1540,6 @@ table.integrations { .reviewer_name { display: inline-block; max-width: 83%; - padding-right: 20px; vertical-align: middle; line-height: 1; diff --git a/rhodecode/public/css/rcicons.less b/rhodecode/public/css/rcicons.less --- a/rhodecode/public/css/rcicons.less +++ b/rhodecode/public/css/rcicons.less @@ -194,6 +194,7 @@ .icon-comment-toggle:before { content: '\e830'; } /* '' */ .icon-rhodecode:before { content: '\e831'; } /* '' */ .icon-up:before { content: '\e832'; } /* '' */ +.icon-down:before { content: '\e832'; } /* '' */ .icon-merge:before { content: '\e833'; } /* '' */ .icon-spin-alt:before { content: '\e834'; } /* '' */ .icon-spin:before { content: '\e838'; } /* '' */ @@ -235,6 +236,7 @@ .icon-rss-sign:before { &:extend(.icon-feed:before); } .icon-code-fork:before { &:extend(.icon-fork:before); } .icon-arrow_up:before { &:extend(.icon-up:before); } +.icon-arrow_down:before { &:extend(.icon-down:before); } .icon-file:before { &:extend(.icon-file-code:before); } .icon-file-text:before { &:extend(.icon-file-code:before); } .icon-directory:before { &:extend(.icon-folder:before); } @@ -253,6 +255,8 @@ .icon-merge:before {transform: rotate(180deg);} .icon-wide-mode:before {transform: rotate(90deg);} .icon-options:before {transform: rotate(90deg);} +.icon-down:before {transform: rotate(180deg);} + // -- END ICON CLASSES -- // diff --git a/rhodecode/public/js/rhodecode/i18n/be.js b/rhodecode/public/js/rhodecode/i18n/be.js --- a/rhodecode/public/js/rhodecode/i18n/be.js +++ b/rhodecode/public/js/rhodecode/i18n/be.js @@ -47,6 +47,7 @@ var _TM = { 'Hide full context diff': 'Hide full context diff', 'Hide whitespace changes': 'Hide whitespace changes', 'Invite reviewers to this discussion': 'Invite reviewers to this discussion', + 'Leave a comment on file {0} line {1}.': 'Leave a comment on file {0} line {1}.', 'Leave a comment on line {0}.': 'Leave a comment on line {0}.', 'Leave a comment, or click resolve button to resolve TODO comment #{0}': 'Leave a comment, or click resolve button to resolve TODO comment #{0}', 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}': 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}', @@ -56,6 +57,7 @@ var _TM = { 'Loading failed': 'Loading failed', 'Loading more results...': 'Loading more results...', 'Loading...': 'Loading...', + 'No additional review rules set.': 'No additional review rules set.', 'No bookmarks available yet.': 'No bookmarks available yet.', 'No branches available yet.': 'No branches available yet.', 'No forks available yet.': 'No forks available yet.', @@ -84,6 +86,7 @@ var _TM = { 'Please enter {0} or more characters': 'Please enter {0} or more characters', 'Please wait creating pull request...': 'Please wait creating pull request...', 'Reviewers picked from source code changes.': 'Reviewers picked from source code changes.', + 'Saving Draft...': 'Saving Draft...', 'Saving...': 'Saving...', 'Searching...': 'Searching...', 'Selection link': 'Selection link', @@ -93,6 +96,7 @@ var _TM = { 'Show': 'Show', 'Show at Commit ': 'Show at Commit ', 'Show commit range {0} ... {1}': 'Show commit range {0} ... {1}', + 'Show commit range {0}{1}': 'Show commit range {0}{1}', 'Show full context diff': 'Show full context diff', 'Show more': 'Show more', 'Show selected commit __S': 'Show selected commit __S', @@ -105,6 +109,8 @@ var _TM = { 'Status Review': 'Status Review', 'Stop following this repository': 'Stop following this repository', 'Stopped watching this repository': 'Stopped watching this repository', + 'Submit {0} draft comment.': 'Submit {0} draft comment.', + 'Submit {0} draft comments.': 'Submit {0} draft comments.', 'Submitting...': 'Submitting...', 'Switch target repository with the source.': 'Switch target repository with the source.', 'Switch to chat': 'Switch to chat', @@ -120,11 +126,14 @@ var _TM = { 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', 'Unfollow': 'Unfollow', 'Unwatch': 'Unwatch', + 'Update Comment': 'Update Comment', 'Updated Comment': 'Updated Comment', 'Updating...': 'Updating...', 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', + 'User `{0}` already in reviewers/observers': 'User `{0}` already in reviewers/observers', 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', 'Watch': 'Watch', + 'Yes': 'Yes', 'Yes, delete comment #{0}!': 'Yes, delete comment #{0}!', 'You can only select {0} item': 'You can only select {0} item', 'You can only select {0} items': 'You can only select {0} items', @@ -156,6 +165,10 @@ var _TM = { '{0} ago': '{0} ago', '{0} and {1}': '{0} and {1}', '{0} and {1} ago': '{0} and {1} ago', + '{0} bookmark': '{0} bookmark', + '{0} bookmarks': '{0} bookmarks', + '{0} branch': '{0} branch', + '{0} branches': '{0} branches', '{0} day': '{0} day', '{0} days': '{0} days', '{0} hour': '{0} hour', @@ -171,6 +184,8 @@ var _TM = { '{0} repository groups': '{0} repository groups', '{0} results are available, use up and down arrow keys to navigate.': '{0} results are available, use up and down arrow keys to navigate.', '{0} sec': '{0} sec', + '{0} tag': '{0} tag', + '{0} tags': '{0} tags', '{0} user groups ({1} inactive)': '{0} user groups ({1} inactive)', '{0} users ({1} inactive)': '{0} users ({1} inactive)', '{0} year': '{0} year', diff --git a/rhodecode/public/js/rhodecode/i18n/de.js b/rhodecode/public/js/rhodecode/i18n/de.js --- a/rhodecode/public/js/rhodecode/i18n/de.js +++ b/rhodecode/public/js/rhodecode/i18n/de.js @@ -47,6 +47,7 @@ var _TM = { 'Hide full context diff': 'Hide full context diff', 'Hide whitespace changes': 'Hide whitespace changes', 'Invite reviewers to this discussion': 'Invite reviewers to this discussion', + 'Leave a comment on file {0} line {1}.': 'Leave a comment on file {0} line {1}.', 'Leave a comment on line {0}.': 'Leave a comment on line {0}.', 'Leave a comment, or click resolve button to resolve TODO comment #{0}': 'Leave a comment, or click resolve button to resolve TODO comment #{0}', 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}': 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}', @@ -56,6 +57,7 @@ var _TM = { 'Loading failed': 'Loading failed', 'Loading more results...': 'Loading more results...', 'Loading...': 'Loading...', + 'No additional review rules set.': 'No additional review rules set.', 'No bookmarks available yet.': 'No bookmarks available yet.', 'No branches available yet.': 'No branches available yet.', 'No forks available yet.': 'No forks available yet.', @@ -84,6 +86,7 @@ var _TM = { 'Please enter {0} or more characters': 'Bitte {0} oder mehr Zeichen eingeben', 'Please wait creating pull request...': 'Please wait creating pull request...', 'Reviewers picked from source code changes.': 'Reviewers picked from source code changes.', + 'Saving Draft...': 'Saving Draft...', 'Saving...': 'Saving...', 'Searching...': 'Searching...', 'Selection link': 'Selection link', @@ -93,6 +96,7 @@ var _TM = { 'Show': 'Show', 'Show at Commit ': 'Show at Commit ', 'Show commit range {0} ... {1}': 'Show commit range {0} ... {1}', + 'Show commit range {0}{1}': 'Show commit range {0}{1}', 'Show full context diff': 'Show full context diff', 'Show more': 'Show more', 'Show selected commit __S': 'Show selected commit __S', @@ -105,6 +109,8 @@ var _TM = { 'Status Review': 'Status Review', 'Stop following this repository': 'Stop following this repository', 'Stopped watching this repository': 'Stopped watching this repository', + 'Submit {0} draft comment.': 'Submit {0} draft comment.', + 'Submit {0} draft comments.': 'Submit {0} draft comments.', 'Submitting...': 'Submitting...', 'Switch target repository with the source.': 'Switch target repository with the source.', 'Switch to chat': 'Switch to chat', @@ -120,11 +126,14 @@ var _TM = { 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', 'Unfollow': 'Unfollow', 'Unwatch': 'Unwatch', + 'Update Comment': 'Update Comment', 'Updated Comment': 'Updated Comment', 'Updating...': 'Updating...', 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', + 'User `{0}` already in reviewers/observers': 'User `{0}` already in reviewers/observers', 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', 'Watch': 'Watch', + 'Yes': 'Yes', 'Yes, delete comment #{0}!': 'Yes, delete comment #{0}!', 'You can only select {0} item': 'You can only select {0} item', 'You can only select {0} items': 'You can only select {0} items', @@ -156,6 +165,10 @@ var _TM = { '{0} ago': '{0} ago', '{0} and {1}': '{0} and {1}', '{0} and {1} ago': '{0} and {1} ago', + '{0} bookmark': '{0} bookmark', + '{0} bookmarks': '{0} bookmarks', + '{0} branch': '{0} branch', + '{0} branches': '{0} branches', '{0} day': '{0} day', '{0} days': '{0} days', '{0} hour': '{0} hour', @@ -171,6 +184,8 @@ var _TM = { '{0} repository groups': '{0} repository groups', '{0} results are available, use up and down arrow keys to navigate.': '{0} results are available, use up and down arrow keys to navigate.', '{0} sec': '{0} sec', + '{0} tag': '{0} tag', + '{0} tags': '{0} tags', '{0} user groups ({1} inactive)': '{0} user groups ({1} inactive)', '{0} users ({1} inactive)': '{0} users ({1} inactive)', '{0} year': '{0} year', diff --git a/rhodecode/public/js/rhodecode/i18n/en.js b/rhodecode/public/js/rhodecode/i18n/en.js --- a/rhodecode/public/js/rhodecode/i18n/en.js +++ b/rhodecode/public/js/rhodecode/i18n/en.js @@ -47,6 +47,7 @@ var _TM = { 'Hide full context diff': 'Hide full context diff', 'Hide whitespace changes': 'Hide whitespace changes', 'Invite reviewers to this discussion': 'Invite reviewers to this discussion', + 'Leave a comment on file {0} line {1}.': 'Leave a comment on file {0} line {1}.', 'Leave a comment on line {0}.': 'Leave a comment on line {0}.', 'Leave a comment, or click resolve button to resolve TODO comment #{0}': 'Leave a comment, or click resolve button to resolve TODO comment #{0}', 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}': 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}', @@ -56,6 +57,7 @@ var _TM = { 'Loading failed': 'Loading failed', 'Loading more results...': 'Loading more results...', 'Loading...': 'Loading...', + 'No additional review rules set.': 'No additional review rules set.', 'No bookmarks available yet.': 'No bookmarks available yet.', 'No branches available yet.': 'No branches available yet.', 'No forks available yet.': 'No forks available yet.', @@ -84,6 +86,7 @@ var _TM = { 'Please enter {0} or more characters': 'Please enter {0} or more characters', 'Please wait creating pull request...': 'Please wait creating pull request...', 'Reviewers picked from source code changes.': 'Reviewers picked from source code changes.', + 'Saving Draft...': 'Saving Draft...', 'Saving...': 'Saving...', 'Searching...': 'Searching...', 'Selection link': 'Selection link', @@ -93,6 +96,7 @@ var _TM = { 'Show': 'Show', 'Show at Commit ': 'Show at Commit ', 'Show commit range {0} ... {1}': 'Show commit range {0} ... {1}', + 'Show commit range {0}{1}': 'Show commit range {0}{1}', 'Show full context diff': 'Show full context diff', 'Show more': 'Show more', 'Show selected commit __S': 'Show selected commit __S', @@ -105,6 +109,8 @@ var _TM = { 'Status Review': 'Status Review', 'Stop following this repository': 'Stop following this repository', 'Stopped watching this repository': 'Stopped watching this repository', + 'Submit {0} draft comment.': 'Submit {0} draft comment.', + 'Submit {0} draft comments.': 'Submit {0} draft comments.', 'Submitting...': 'Submitting...', 'Switch target repository with the source.': 'Switch target repository with the source.', 'Switch to chat': 'Switch to chat', @@ -120,11 +126,14 @@ var _TM = { 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', 'Unfollow': 'Unfollow', 'Unwatch': 'Unwatch', + 'Update Comment': 'Update Comment', 'Updated Comment': 'Updated Comment', 'Updating...': 'Updating...', 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', + 'User `{0}` already in reviewers/observers': 'User `{0}` already in reviewers/observers', 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', 'Watch': 'Watch', + 'Yes': 'Yes', 'Yes, delete comment #{0}!': 'Yes, delete comment #{0}!', 'You can only select {0} item': 'You can only select {0} item', 'You can only select {0} items': 'You can only select {0} items', @@ -156,6 +165,10 @@ var _TM = { '{0} ago': '{0} ago', '{0} and {1}': '{0} and {1}', '{0} and {1} ago': '{0} and {1} ago', + '{0} bookmark': '{0} bookmark', + '{0} bookmarks': '{0} bookmarks', + '{0} branch': '{0} branch', + '{0} branches': '{0} branches', '{0} day': '{0} day', '{0} days': '{0} days', '{0} hour': '{0} hour', @@ -171,6 +184,8 @@ var _TM = { '{0} repository groups': '{0} repository groups', '{0} results are available, use up and down arrow keys to navigate.': '{0} results are available, use up and down arrow keys to navigate.', '{0} sec': '{0} sec', + '{0} tag': '{0} tag', + '{0} tags': '{0} tags', '{0} user groups ({1} inactive)': '{0} user groups ({1} inactive)', '{0} users ({1} inactive)': '{0} users ({1} inactive)', '{0} year': '{0} year', diff --git a/rhodecode/public/js/rhodecode/i18n/es.js b/rhodecode/public/js/rhodecode/i18n/es.js --- a/rhodecode/public/js/rhodecode/i18n/es.js +++ b/rhodecode/public/js/rhodecode/i18n/es.js @@ -47,6 +47,7 @@ var _TM = { 'Hide full context diff': 'Hide full context diff', 'Hide whitespace changes': 'Hide whitespace changes', 'Invite reviewers to this discussion': 'Invite reviewers to this discussion', + 'Leave a comment on file {0} line {1}.': 'Leave a comment on file {0} line {1}.', 'Leave a comment on line {0}.': 'Leave a comment on line {0}.', 'Leave a comment, or click resolve button to resolve TODO comment #{0}': 'Leave a comment, or click resolve button to resolve TODO comment #{0}', 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}': 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}', @@ -56,6 +57,7 @@ var _TM = { 'Loading failed': 'Loading failed', 'Loading more results...': 'Loading more results...', 'Loading...': 'Loading...', + 'No additional review rules set.': 'No additional review rules set.', 'No bookmarks available yet.': 'No bookmarks available yet.', 'No branches available yet.': 'No branches available yet.', 'No forks available yet.': 'No forks available yet.', @@ -84,6 +86,7 @@ var _TM = { 'Please enter {0} or more characters': 'Please enter {0} or more characters', 'Please wait creating pull request...': 'Please wait creating pull request...', 'Reviewers picked from source code changes.': 'Reviewers picked from source code changes.', + 'Saving Draft...': 'Saving Draft...', 'Saving...': 'Saving...', 'Searching...': 'Searching...', 'Selection link': 'Selection link', @@ -93,6 +96,7 @@ var _TM = { 'Show': 'Show', 'Show at Commit ': 'Show at Commit ', 'Show commit range {0} ... {1}': 'Show commit range {0} ... {1}', + 'Show commit range {0}{1}': 'Show commit range {0}{1}', 'Show full context diff': 'Show full context diff', 'Show more': 'Show more', 'Show selected commit __S': 'Show selected commit __S', @@ -105,6 +109,8 @@ var _TM = { 'Status Review': 'Status Review', 'Stop following this repository': 'Stop following this repository', 'Stopped watching this repository': 'Stopped watching this repository', + 'Submit {0} draft comment.': 'Submit {0} draft comment.', + 'Submit {0} draft comments.': 'Submit {0} draft comments.', 'Submitting...': 'Submitting...', 'Switch target repository with the source.': 'Switch target repository with the source.', 'Switch to chat': 'Switch to chat', @@ -120,11 +126,14 @@ var _TM = { 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', 'Unfollow': 'Unfollow', 'Unwatch': 'Unwatch', + 'Update Comment': 'Update Comment', 'Updated Comment': 'Updated Comment', 'Updating...': 'Updating...', 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', + 'User `{0}` already in reviewers/observers': 'User `{0}` already in reviewers/observers', 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', 'Watch': 'Watch', + 'Yes': 'Yes', 'Yes, delete comment #{0}!': 'Yes, delete comment #{0}!', 'You can only select {0} item': 'You can only select {0} item', 'You can only select {0} items': 'You can only select {0} items', @@ -156,6 +165,10 @@ var _TM = { '{0} ago': '{0} ago', '{0} and {1}': '{0} and {1}', '{0} and {1} ago': '{0} and {1} ago', + '{0} bookmark': '{0} bookmark', + '{0} bookmarks': '{0} bookmarks', + '{0} branch': '{0} branch', + '{0} branches': '{0} branches', '{0} day': '{0} day', '{0} days': '{0} days', '{0} hour': '{0} hour', @@ -171,6 +184,8 @@ var _TM = { '{0} repository groups': '{0} repository groups', '{0} results are available, use up and down arrow keys to navigate.': '{0} results are available, use up and down arrow keys to navigate.', '{0} sec': '{0} sec', + '{0} tag': '{0} tag', + '{0} tags': '{0} tags', '{0} user groups ({1} inactive)': '{0} user groups ({1} inactive)', '{0} users ({1} inactive)': '{0} users ({1} inactive)', '{0} year': '{0} year', diff --git a/rhodecode/public/js/rhodecode/i18n/fr.js b/rhodecode/public/js/rhodecode/i18n/fr.js --- a/rhodecode/public/js/rhodecode/i18n/fr.js +++ b/rhodecode/public/js/rhodecode/i18n/fr.js @@ -47,6 +47,7 @@ var _TM = { 'Hide full context diff': 'Hide full context diff', 'Hide whitespace changes': 'Hide whitespace changes', 'Invite reviewers to this discussion': 'Invite reviewers to this discussion', + 'Leave a comment on file {0} line {1}.': 'Leave a comment on file {0} line {1}.', 'Leave a comment on line {0}.': 'Leave a comment on line {0}.', 'Leave a comment, or click resolve button to resolve TODO comment #{0}': 'Leave a comment, or click resolve button to resolve TODO comment #{0}', 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}': 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}', @@ -56,6 +57,7 @@ var _TM = { 'Loading failed': 'Loading failed', 'Loading more results...': 'Loading more results...', 'Loading...': 'Loading...', + 'No additional review rules set.': 'No additional review rules set.', 'No bookmarks available yet.': 'No bookmarks available yet.', 'No branches available yet.': 'No branches available yet.', 'No forks available yet.': 'No forks available yet.', @@ -84,6 +86,7 @@ var _TM = { 'Please enter {0} or more characters': 'Please enter {0} or more characters', 'Please wait creating pull request...': 'Please wait creating pull request...', 'Reviewers picked from source code changes.': 'Reviewers picked from source code changes.', + 'Saving Draft...': 'Saving Draft...', 'Saving...': 'Saving...', 'Searching...': 'Searching...', 'Selection link': 'Lien vers la sélection', @@ -93,6 +96,7 @@ var _TM = { 'Show': 'Show', 'Show at Commit ': 'Show at Commit ', 'Show commit range {0} ... {1}': 'Show commit range {0} ... {1}', + 'Show commit range {0}{1}': 'Show commit range {0}{1}', 'Show full context diff': 'Show full context diff', 'Show more': 'Show more', 'Show selected commit __S': 'Show selected commit __S', @@ -105,6 +109,8 @@ var _TM = { 'Status Review': 'Status Review', 'Stop following this repository': 'Arrêter de suivre ce dépôt', 'Stopped watching this repository': 'Stopped watching this repository', + 'Submit {0} draft comment.': 'Submit {0} draft comment.', + 'Submit {0} draft comments.': 'Submit {0} draft comments.', 'Submitting...': 'Envoi…', 'Switch target repository with the source.': 'Switch target repository with the source.', 'Switch to chat': 'Switch to chat', @@ -120,11 +126,14 @@ var _TM = { 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', 'Unfollow': 'Unfollow', 'Unwatch': 'Unwatch', + 'Update Comment': 'Update Comment', 'Updated Comment': 'Updated Comment', 'Updating...': 'Updating...', 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', + 'User `{0}` already in reviewers/observers': 'User `{0}` already in reviewers/observers', 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', 'Watch': 'Watch', + 'Yes': 'Yes', 'Yes, delete comment #{0}!': 'Yes, delete comment #{0}!', 'You can only select {0} item': 'You can only select {0} item', 'You can only select {0} items': 'You can only select {0} items', @@ -156,6 +165,10 @@ var _TM = { '{0} ago': '{0} ago', '{0} and {1}': '{0} and {1}', '{0} and {1} ago': '{0} and {1} ago', + '{0} bookmark': '{0} bookmark', + '{0} bookmarks': '{0} bookmarks', + '{0} branch': '{0} branch', + '{0} branches': '{0} branches', '{0} day': '{0} day', '{0} days': '{0} jours', '{0} hour': '{0} hour', @@ -171,6 +184,8 @@ var _TM = { '{0} repository groups': '{0} repository groups', '{0} results are available, use up and down arrow keys to navigate.': '{0} results are available, use up and down arrow keys to navigate.', '{0} sec': '{0} sec', + '{0} tag': '{0} tag', + '{0} tags': '{0} tags', '{0} user groups ({1} inactive)': '{0} user groups ({1} inactive)', '{0} users ({1} inactive)': '{0} users ({1} inactive)', '{0} year': '{0} year', diff --git a/rhodecode/public/js/rhodecode/i18n/it.js b/rhodecode/public/js/rhodecode/i18n/it.js --- a/rhodecode/public/js/rhodecode/i18n/it.js +++ b/rhodecode/public/js/rhodecode/i18n/it.js @@ -47,6 +47,7 @@ var _TM = { 'Hide full context diff': 'Hide full context diff', 'Hide whitespace changes': 'Hide whitespace changes', 'Invite reviewers to this discussion': 'Invite reviewers to this discussion', + 'Leave a comment on file {0} line {1}.': 'Leave a comment on file {0} line {1}.', 'Leave a comment on line {0}.': 'Leave a comment on line {0}.', 'Leave a comment, or click resolve button to resolve TODO comment #{0}': 'Leave a comment, or click resolve button to resolve TODO comment #{0}', 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}': 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}', @@ -56,6 +57,7 @@ var _TM = { 'Loading failed': 'Loading failed', 'Loading more results...': 'Loading more results...', 'Loading...': 'Loading...', + 'No additional review rules set.': 'No additional review rules set.', 'No bookmarks available yet.': 'No bookmarks available yet.', 'No branches available yet.': 'No branches available yet.', 'No forks available yet.': 'No forks available yet.', @@ -84,6 +86,7 @@ var _TM = { 'Please enter {0} or more characters': 'Please enter {0} or more characters', 'Please wait creating pull request...': 'Please wait creating pull request...', 'Reviewers picked from source code changes.': 'Reviewers picked from source code changes.', + 'Saving Draft...': 'Saving Draft...', 'Saving...': 'Saving...', 'Searching...': 'Searching...', 'Selection link': 'Collegamento selezione', @@ -93,6 +96,7 @@ var _TM = { 'Show': 'Show', 'Show at Commit ': 'Show at Commit ', 'Show commit range {0} ... {1}': 'Show commit range {0} ... {1}', + 'Show commit range {0}{1}': 'Show commit range {0}{1}', 'Show full context diff': 'Show full context diff', 'Show more': 'Mostra ancora', 'Show selected commit __S': 'Show selected commit __S', @@ -105,6 +109,8 @@ var _TM = { 'Status Review': 'Status Review', 'Stop following this repository': 'Smetti di seguire il repository', 'Stopped watching this repository': 'Stopped watching this repository', + 'Submit {0} draft comment.': 'Submit {0} draft comment.', + 'Submit {0} draft comments.': 'Submit {0} draft comments.', 'Submitting...': 'Inoltro...', 'Switch target repository with the source.': 'Switch target repository with the source.', 'Switch to chat': 'Switch to chat', @@ -120,11 +126,14 @@ var _TM = { 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', 'Unfollow': 'Smetti di seguire', 'Unwatch': 'Unwatch', + 'Update Comment': 'Update Comment', 'Updated Comment': 'Updated Comment', 'Updating...': 'Updating...', 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', + 'User `{0}` already in reviewers/observers': 'User `{0}` already in reviewers/observers', 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', 'Watch': 'Watch', + 'Yes': 'Yes', 'Yes, delete comment #{0}!': 'Yes, delete comment #{0}!', 'You can only select {0} item': 'You can only select {0} item', 'You can only select {0} items': 'You can only select {0} items', @@ -156,6 +165,10 @@ var _TM = { '{0} ago': '{0} ago', '{0} and {1}': '{0} and {1}', '{0} and {1} ago': '{0} and {1} ago', + '{0} bookmark': '{0} bookmark', + '{0} bookmarks': '{0} bookmarks', + '{0} branch': '{0} branch', + '{0} branches': '{0} branches', '{0} day': '{0} day', '{0} days': '{0} days', '{0} hour': '{0} hour', @@ -171,6 +184,8 @@ var _TM = { '{0} repository groups': '{0} repository groups', '{0} results are available, use up and down arrow keys to navigate.': '{0} results are available, use up and down arrow keys to navigate.', '{0} sec': '{0} sec', + '{0} tag': '{0} tag', + '{0} tags': '{0} tags', '{0} user groups ({1} inactive)': '{0} user groups ({1} inactive)', '{0} users ({1} inactive)': '{0} users ({1} inactive)', '{0} year': '{0} year', diff --git a/rhodecode/public/js/rhodecode/i18n/ja.js b/rhodecode/public/js/rhodecode/i18n/ja.js --- a/rhodecode/public/js/rhodecode/i18n/ja.js +++ b/rhodecode/public/js/rhodecode/i18n/ja.js @@ -47,6 +47,7 @@ var _TM = { 'Hide full context diff': 'Hide full context diff', 'Hide whitespace changes': 'Hide whitespace changes', 'Invite reviewers to this discussion': 'Invite reviewers to this discussion', + 'Leave a comment on file {0} line {1}.': 'Leave a comment on file {0} line {1}.', 'Leave a comment on line {0}.': 'Leave a comment on line {0}.', 'Leave a comment, or click resolve button to resolve TODO comment #{0}': 'Leave a comment, or click resolve button to resolve TODO comment #{0}', 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}': 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}', @@ -56,6 +57,7 @@ var _TM = { 'Loading failed': '読み込み失敗', 'Loading more results...': '結果を読み込み中...', 'Loading...': 'Loading...', + 'No additional review rules set.': 'No additional review rules set.', 'No bookmarks available yet.': 'まだブックマークがありません。', 'No branches available yet.': 'まだブランチがありません。', 'No forks available yet.': 'No forks available yet.', @@ -84,6 +86,7 @@ var _TM = { 'Please enter {0} or more characters': '{0} 文字以上入力してください', 'Please wait creating pull request...': 'Please wait creating pull request...', 'Reviewers picked from source code changes.': 'Reviewers picked from source code changes.', + 'Saving Draft...': 'Saving Draft...', 'Saving...': 'Saving...', 'Searching...': '検索中...', 'Selection link': 'セレクション・リンク', @@ -93,6 +96,7 @@ var _TM = { 'Show': 'Show', 'Show at Commit ': 'Show at Commit ', 'Show commit range {0} ... {1}': 'Show commit range {0} ... {1}', + 'Show commit range {0}{1}': 'Show commit range {0}{1}', 'Show full context diff': 'Show full context diff', 'Show more': 'もっと表示', 'Show selected commit __S': 'Show selected commit __S', @@ -105,6 +109,8 @@ var _TM = { 'Status Review': 'ステータスレビュー', 'Stop following this repository': 'このリポジトリのフォローをやめる', 'Stopped watching this repository': 'Stopped watching this repository', + 'Submit {0} draft comment.': 'Submit {0} draft comment.', + 'Submit {0} draft comments.': 'Submit {0} draft comments.', 'Submitting...': '送信中...', 'Switch target repository with the source.': 'Switch target repository with the source.', 'Switch to chat': 'Switch to chat', @@ -120,11 +126,14 @@ var _TM = { 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', 'Unfollow': 'アンフォロー', 'Unwatch': 'Unwatch', + 'Update Comment': 'Update Comment', 'Updated Comment': 'Updated Comment', 'Updating...': 'Updating...', 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', + 'User `{0}` already in reviewers/observers': 'User `{0}` already in reviewers/observers', 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', 'Watch': 'Watch', + 'Yes': 'Yes', 'Yes, delete comment #{0}!': 'Yes, delete comment #{0}!', 'You can only select {0} item': '{0} 件のみ選択できます', 'You can only select {0} items': '{0} 件のみ選択できます', @@ -156,6 +165,10 @@ var _TM = { '{0} ago': '{0} 前', '{0} and {1}': '{0} and {1}', '{0} and {1} ago': '{0} and {1} ago', + '{0} bookmark': '{0} bookmark', + '{0} bookmarks': '{0} bookmarks', + '{0} branch': '{0} branch', + '{0} branches': '{0} branches', '{0} day': '{0} 日', '{0} days': '{0} days', '{0} hour': '{0} 時間', @@ -171,6 +184,8 @@ var _TM = { '{0} repository groups': '{0} repository groups', '{0} results are available, use up and down arrow keys to navigate.': '{0} 件の結果があります。矢印キーの上下で選択できます。', '{0} sec': '{0} 秒', + '{0} tag': '{0} tag', + '{0} tags': '{0} tags', '{0} user groups ({1} inactive)': '{0} user groups ({1} inactive)', '{0} users ({1} inactive)': '{0} users ({1} inactive)', '{0} year': '{0} 年', diff --git a/rhodecode/public/js/rhodecode/i18n/js_translations.js b/rhodecode/public/js/rhodecode/i18n/js_translations.js --- a/rhodecode/public/js/rhodecode/i18n/js_translations.js +++ b/rhodecode/public/js/rhodecode/i18n/js_translations.js @@ -41,6 +41,7 @@ _gettext('Hide full context diff'); _gettext('Hide whitespace changes'); _gettext('Invite reviewers to this discussion'); +_gettext('Leave a comment on file {0} line {1}.'); _gettext('Leave a comment on line {0}.'); _gettext('Leave a comment, or click resolve button to resolve TODO comment #{0}'); _gettext('Leave a resolution comment, or click resolve button to resolve TODO comment #{0}'); @@ -50,6 +51,7 @@ _gettext('Loading failed'); _gettext('Loading more results...'); _gettext('Loading...'); +_gettext('No additional review rules set.'); _gettext('No bookmarks available yet.'); _gettext('No branches available yet.'); _gettext('No forks available yet.'); @@ -78,6 +80,7 @@ _gettext('Please enter {0} or more characters'); _gettext('Please wait creating pull request...'); _gettext('Reviewers picked from source code changes.'); +_gettext('Saving Draft...'); _gettext('Saving...'); _gettext('Searching...'); _gettext('Selection link'); @@ -87,6 +90,7 @@ _gettext('Show'); _gettext('Show at Commit '); _gettext('Show commit range {0} ... {1}'); +_gettext('Show commit range {0}{1}'); _gettext('Show full context diff'); _gettext('Show more'); _gettext('Show selected commit __S'); @@ -99,6 +103,8 @@ _gettext('Status Review'); _gettext('Stop following this repository'); _gettext('Stopped watching this repository'); +_gettext('Submit {0} draft comment.'); +_gettext('Submit {0} draft comments.'); _gettext('Submitting...'); _gettext('Switch target repository with the source.'); _gettext('Switch to chat'); @@ -114,11 +120,14 @@ _gettext('Toggle Wide Mode diff'); _gettext('Unfollow'); _gettext('Unwatch'); +_gettext('Update Comment'); _gettext('Updated Comment'); _gettext('Updating...'); _gettext('User `{0}` already in reviewers'); +_gettext('User `{0}` already in reviewers/observers'); _gettext('User `{0}` not allowed to be a reviewer'); _gettext('Watch'); +_gettext('Yes'); _gettext('Yes, delete comment #{0}!'); _gettext('You can only select {0} item'); _gettext('You can only select {0} items'); @@ -150,6 +159,10 @@ _gettext('{0} ago'); _gettext('{0} and {1}'); _gettext('{0} and {1} ago'); +_gettext('{0} bookmark'); +_gettext('{0} bookmarks'); +_gettext('{0} branch'); +_gettext('{0} branches'); _gettext('{0} day'); _gettext('{0} days'); _gettext('{0} hour'); @@ -165,6 +178,8 @@ _gettext('{0} repository groups'); _gettext('{0} results are available, use up and down arrow keys to navigate.'); _gettext('{0} sec'); +_gettext('{0} tag'); +_gettext('{0} tags'); _gettext('{0} user groups ({1} inactive)'); _gettext('{0} users ({1} inactive)'); _gettext('{0} year'); diff --git a/rhodecode/public/js/rhodecode/i18n/pl.js b/rhodecode/public/js/rhodecode/i18n/pl.js --- a/rhodecode/public/js/rhodecode/i18n/pl.js +++ b/rhodecode/public/js/rhodecode/i18n/pl.js @@ -47,6 +47,7 @@ var _TM = { 'Hide full context diff': 'Hide full context diff', 'Hide whitespace changes': 'Hide whitespace changes', 'Invite reviewers to this discussion': 'Invite reviewers to this discussion', + 'Leave a comment on file {0} line {1}.': 'Leave a comment on file {0} line {1}.', 'Leave a comment on line {0}.': 'Leave a comment on line {0}.', 'Leave a comment, or click resolve button to resolve TODO comment #{0}': 'Leave a comment, or click resolve button to resolve TODO comment #{0}', 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}': 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}', @@ -56,6 +57,7 @@ var _TM = { 'Loading failed': 'Loading failed', 'Loading more results...': 'Loading more results...', 'Loading...': 'Loading...', + 'No additional review rules set.': 'No additional review rules set.', 'No bookmarks available yet.': 'No bookmarks available yet.', 'No branches available yet.': 'No branches available yet.', 'No forks available yet.': 'No forks available yet.', @@ -84,6 +86,7 @@ var _TM = { 'Please enter {0} or more characters': 'Please enter {0} or more characters', 'Please wait creating pull request...': 'Please wait creating pull request...', 'Reviewers picked from source code changes.': 'Reviewers picked from source code changes.', + 'Saving Draft...': 'Saving Draft...', 'Saving...': 'Saving...', 'Searching...': 'Searching...', 'Selection link': 'Wybór linku', @@ -93,6 +96,7 @@ var _TM = { 'Show': 'Show', 'Show at Commit ': 'Show at Commit ', 'Show commit range {0} ... {1}': 'Show commit range {0} ... {1}', + 'Show commit range {0}{1}': 'Show commit range {0}{1}', 'Show full context diff': 'Show full context diff', 'Show more': 'Pokaż więcej', 'Show selected commit __S': 'Show selected commit __S', @@ -105,6 +109,8 @@ var _TM = { 'Status Review': 'Status Review', 'Stop following this repository': 'Zakończyć obserwację tego repozytorium', 'Stopped watching this repository': 'Stopped watching this repository', + 'Submit {0} draft comment.': 'Submit {0} draft comment.', + 'Submit {0} draft comments.': 'Submit {0} draft comments.', 'Submitting...': 'Przesyłanie...', 'Switch target repository with the source.': 'Switch target repository with the source.', 'Switch to chat': 'Switch to chat', @@ -120,11 +126,14 @@ var _TM = { 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', 'Unfollow': 'Nie obserwuj', 'Unwatch': 'Unwatch', + 'Update Comment': 'Update Comment', 'Updated Comment': 'Updated Comment', 'Updating...': 'Updating...', 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', + 'User `{0}` already in reviewers/observers': 'User `{0}` already in reviewers/observers', 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', 'Watch': 'Watch', + 'Yes': 'Yes', 'Yes, delete comment #{0}!': 'Yes, delete comment #{0}!', 'You can only select {0} item': 'You can only select {0} item', 'You can only select {0} items': 'You can only select {0} items', @@ -156,6 +165,10 @@ var _TM = { '{0} ago': '{0} ago', '{0} and {1}': '{0} and {1}', '{0} and {1} ago': '{0} and {1} ago', + '{0} bookmark': '{0} bookmark', + '{0} bookmarks': '{0} bookmarks', + '{0} branch': '{0} branch', + '{0} branches': '{0} branches', '{0} day': '{0} day', '{0} days': '{0} days', '{0} hour': '{0} hour', @@ -171,6 +184,8 @@ var _TM = { '{0} repository groups': '{0} repository groups', '{0} results are available, use up and down arrow keys to navigate.': '{0} results are available, use up and down arrow keys to navigate.', '{0} sec': '{0} sec', + '{0} tag': '{0} tag', + '{0} tags': '{0} tags', '{0} user groups ({1} inactive)': '{0} user groups ({1} inactive)', '{0} users ({1} inactive)': '{0} users ({1} inactive)', '{0} year': '{0} year', diff --git a/rhodecode/public/js/rhodecode/i18n/pt.js b/rhodecode/public/js/rhodecode/i18n/pt.js --- a/rhodecode/public/js/rhodecode/i18n/pt.js +++ b/rhodecode/public/js/rhodecode/i18n/pt.js @@ -47,6 +47,7 @@ var _TM = { 'Hide full context diff': 'Hide full context diff', 'Hide whitespace changes': 'Hide whitespace changes', 'Invite reviewers to this discussion': 'Invite reviewers to this discussion', + 'Leave a comment on file {0} line {1}.': 'Leave a comment on file {0} line {1}.', 'Leave a comment on line {0}.': 'Leave a comment on line {0}.', 'Leave a comment, or click resolve button to resolve TODO comment #{0}': 'Leave a comment, or click resolve button to resolve TODO comment #{0}', 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}': 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}', @@ -56,6 +57,7 @@ var _TM = { 'Loading failed': 'Loading failed', 'Loading more results...': 'Loading more results...', 'Loading...': 'Loading...', + 'No additional review rules set.': 'No additional review rules set.', 'No bookmarks available yet.': 'No bookmarks available yet.', 'No branches available yet.': 'No branches available yet.', 'No forks available yet.': 'No forks available yet.', @@ -84,6 +86,7 @@ var _TM = { 'Please enter {0} or more characters': 'Please enter {0} or more characters', 'Please wait creating pull request...': 'Please wait creating pull request...', 'Reviewers picked from source code changes.': 'Reviewers picked from source code changes.', + 'Saving Draft...': 'Saving Draft...', 'Saving...': 'Saving...', 'Searching...': 'Searching...', 'Selection link': 'Link da seleção', @@ -93,6 +96,7 @@ var _TM = { 'Show': 'Show', 'Show at Commit ': 'Show at Commit ', 'Show commit range {0} ... {1}': 'Show commit range {0} ... {1}', + 'Show commit range {0}{1}': 'Show commit range {0}{1}', 'Show full context diff': 'Show full context diff', 'Show more': 'Mostrar mais', 'Show selected commit __S': 'Show selected commit __S', @@ -105,6 +109,8 @@ var _TM = { 'Status Review': 'Status Review', 'Stop following this repository': 'Parar de seguir este repositório', 'Stopped watching this repository': 'Stopped watching this repository', + 'Submit {0} draft comment.': 'Submit {0} draft comment.', + 'Submit {0} draft comments.': 'Submit {0} draft comments.', 'Submitting...': 'Enviando...', 'Switch target repository with the source.': 'Switch target repository with the source.', 'Switch to chat': 'Switch to chat', @@ -120,11 +126,14 @@ var _TM = { 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', 'Unfollow': 'Parar de seguir', 'Unwatch': 'Unwatch', + 'Update Comment': 'Update Comment', 'Updated Comment': 'Updated Comment', 'Updating...': 'Updating...', 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', + 'User `{0}` already in reviewers/observers': 'User `{0}` already in reviewers/observers', 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', 'Watch': 'Watch', + 'Yes': 'Yes', 'Yes, delete comment #{0}!': 'Yes, delete comment #{0}!', 'You can only select {0} item': 'You can only select {0} item', 'You can only select {0} items': 'You can only select {0} items', @@ -156,6 +165,10 @@ var _TM = { '{0} ago': '{0} ago', '{0} and {1}': '{0} and {1}', '{0} and {1} ago': '{0} and {1} ago', + '{0} bookmark': '{0} bookmark', + '{0} bookmarks': '{0} bookmarks', + '{0} branch': '{0} branch', + '{0} branches': '{0} branches', '{0} day': '{0} day', '{0} days': '{0} days', '{0} hour': '{0} hour', @@ -171,6 +184,8 @@ var _TM = { '{0} repository groups': '{0} repository groups', '{0} results are available, use up and down arrow keys to navigate.': '{0} results are available, use up and down arrow keys to navigate.', '{0} sec': '{0} sec', + '{0} tag': '{0} tag', + '{0} tags': '{0} tags', '{0} user groups ({1} inactive)': '{0} user groups ({1} inactive)', '{0} users ({1} inactive)': '{0} users ({1} inactive)', '{0} year': '{0} year', diff --git a/rhodecode/public/js/rhodecode/i18n/ru.js b/rhodecode/public/js/rhodecode/i18n/ru.js --- a/rhodecode/public/js/rhodecode/i18n/ru.js +++ b/rhodecode/public/js/rhodecode/i18n/ru.js @@ -47,6 +47,7 @@ var _TM = { 'Hide full context diff': 'Hide full context diff', 'Hide whitespace changes': 'Hide whitespace changes', 'Invite reviewers to this discussion': 'Invite reviewers to this discussion', + 'Leave a comment on file {0} line {1}.': 'Leave a comment on file {0} line {1}.', 'Leave a comment on line {0}.': 'Leave a comment on line {0}.', 'Leave a comment, or click resolve button to resolve TODO comment #{0}': 'Leave a comment, or click resolve button to resolve TODO comment #{0}', 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}': 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}', @@ -56,6 +57,7 @@ var _TM = { 'Loading failed': 'Loading failed', 'Loading more results...': 'Loading more results...', 'Loading...': 'Loading...', + 'No additional review rules set.': 'No additional review rules set.', 'No bookmarks available yet.': 'No bookmarks available yet.', 'No branches available yet.': 'No branches available yet.', 'No forks available yet.': 'No forks available yet.', @@ -84,6 +86,7 @@ var _TM = { 'Please enter {0} or more characters': 'Please enter {0} or more characters', 'Please wait creating pull request...': 'Please wait creating pull request...', 'Reviewers picked from source code changes.': 'Reviewers picked from source code changes.', + 'Saving Draft...': 'Saving Draft...', 'Saving...': 'Saving...', 'Searching...': 'Searching...', 'Selection link': 'Ссылка выбора', @@ -93,6 +96,7 @@ var _TM = { 'Show': 'Show', 'Show at Commit ': 'Show at Commit ', 'Show commit range {0} ... {1}': 'Show commit range {0} ... {1}', + 'Show commit range {0}{1}': 'Show commit range {0}{1}', 'Show full context diff': 'Show full context diff', 'Show more': 'Показать еще', 'Show selected commit __S': 'Show selected commit __S', @@ -105,6 +109,8 @@ var _TM = { 'Status Review': 'Status Review', 'Stop following this repository': 'Отменить наблюдение за репозиторием', 'Stopped watching this repository': 'Stopped watching this repository', + 'Submit {0} draft comment.': 'Submit {0} draft comment.', + 'Submit {0} draft comments.': 'Submit {0} draft comments.', 'Submitting...': 'Применение...', 'Switch target repository with the source.': 'Switch target repository with the source.', 'Switch to chat': 'Switch to chat', @@ -120,11 +126,14 @@ var _TM = { 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', 'Unfollow': 'Не наблюдать', 'Unwatch': 'Unwatch', + 'Update Comment': 'Update Comment', 'Updated Comment': 'Updated Comment', 'Updating...': 'Updating...', 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', + 'User `{0}` already in reviewers/observers': 'User `{0}` already in reviewers/observers', 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', 'Watch': 'Watch', + 'Yes': 'Yes', 'Yes, delete comment #{0}!': 'Yes, delete comment #{0}!', 'You can only select {0} item': 'You can only select {0} item', 'You can only select {0} items': 'You can only select {0} items', @@ -156,6 +165,10 @@ var _TM = { '{0} ago': '{0} ago', '{0} and {1}': '{0} and {1}', '{0} and {1} ago': '{0} and {1} ago', + '{0} bookmark': '{0} bookmark', + '{0} bookmarks': '{0} bookmarks', + '{0} branch': '{0} branch', + '{0} branches': '{0} branches', '{0} day': '{0} day', '{0} days': '{0} days', '{0} hour': '{0} hour', @@ -171,6 +184,8 @@ var _TM = { '{0} repository groups': '{0} repository groups', '{0} results are available, use up and down arrow keys to navigate.': '{0} results are available, use up and down arrow keys to navigate.', '{0} sec': '{0} sec', + '{0} tag': '{0} tag', + '{0} tags': '{0} tags', '{0} user groups ({1} inactive)': '{0} user groups ({1} inactive)', '{0} users ({1} inactive)': '{0} users ({1} inactive)', '{0} year': '{0} year', diff --git a/rhodecode/public/js/rhodecode/i18n/zh.js b/rhodecode/public/js/rhodecode/i18n/zh.js --- a/rhodecode/public/js/rhodecode/i18n/zh.js +++ b/rhodecode/public/js/rhodecode/i18n/zh.js @@ -47,6 +47,7 @@ var _TM = { 'Hide full context diff': 'Hide full context diff', 'Hide whitespace changes': 'Hide whitespace changes', 'Invite reviewers to this discussion': 'Invite reviewers to this discussion', + 'Leave a comment on file {0} line {1}.': 'Leave a comment on file {0} line {1}.', 'Leave a comment on line {0}.': 'Leave a comment on line {0}.', 'Leave a comment, or click resolve button to resolve TODO comment #{0}': 'Leave a comment, or click resolve button to resolve TODO comment #{0}', 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}': 'Leave a resolution comment, or click resolve button to resolve TODO comment #{0}', @@ -56,6 +57,7 @@ var _TM = { 'Loading failed': 'Loading failed', 'Loading more results...': 'Loading more results...', 'Loading...': 'Loading...', + 'No additional review rules set.': 'No additional review rules set.', 'No bookmarks available yet.': 'No bookmarks available yet.', 'No branches available yet.': 'No branches available yet.', 'No forks available yet.': 'No forks available yet.', @@ -84,6 +86,7 @@ var _TM = { 'Please enter {0} or more characters': 'Please enter {0} or more characters', 'Please wait creating pull request...': 'Please wait creating pull request...', 'Reviewers picked from source code changes.': 'Reviewers picked from source code changes.', + 'Saving Draft...': 'Saving Draft...', 'Saving...': 'Saving...', 'Searching...': 'Searching...', 'Selection link': '选择链接', @@ -93,6 +96,7 @@ var _TM = { 'Show': 'Show', 'Show at Commit ': 'Show at Commit ', 'Show commit range {0} ... {1}': 'Show commit range {0} ... {1}', + 'Show commit range {0}{1}': 'Show commit range {0}{1}', 'Show full context diff': 'Show full context diff', 'Show more': 'Show more', 'Show selected commit __S': 'Show selected commit __S', @@ -105,6 +109,8 @@ var _TM = { 'Status Review': 'Status Review', 'Stop following this repository': '停止关注该版本库', 'Stopped watching this repository': 'Stopped watching this repository', + 'Submit {0} draft comment.': 'Submit {0} draft comment.', + 'Submit {0} draft comments.': 'Submit {0} draft comments.', 'Submitting...': '提交中……', 'Switch target repository with the source.': 'Switch target repository with the source.', 'Switch to chat': 'Switch to chat', @@ -120,11 +126,14 @@ var _TM = { 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', 'Unfollow': 'Unfollow', 'Unwatch': 'Unwatch', + 'Update Comment': 'Update Comment', 'Updated Comment': 'Updated Comment', 'Updating...': 'Updating...', 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', + 'User `{0}` already in reviewers/observers': 'User `{0}` already in reviewers/observers', 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', 'Watch': 'Watch', + 'Yes': 'Yes', 'Yes, delete comment #{0}!': 'Yes, delete comment #{0}!', 'You can only select {0} item': 'You can only select {0} item', 'You can only select {0} items': 'You can only select {0} items', @@ -156,6 +165,10 @@ var _TM = { '{0} ago': '{0} ago', '{0} and {1}': '{0} and {1}', '{0} and {1} ago': '{0} and {1} ago', + '{0} bookmark': '{0} bookmark', + '{0} bookmarks': '{0} bookmarks', + '{0} branch': '{0} branch', + '{0} branches': '{0} branches', '{0} day': '{0} day', '{0} days': '{0} days', '{0} hour': '{0} hour', @@ -171,6 +184,8 @@ var _TM = { '{0} repository groups': '{0} repository groups', '{0} results are available, use up and down arrow keys to navigate.': '{0} results are available, use up and down arrow keys to navigate.', '{0} sec': '{0} sec', + '{0} tag': '{0} tag', + '{0} tags': '{0} tags', '{0} user groups ({1} inactive)': '{0} user groups ({1} inactive)', '{0} users ({1} inactive)': '{0} users ({1} inactive)', '{0} year': '{0} year', diff --git a/rhodecode/public/js/rhodecode/routes.js b/rhodecode/public/js/rhodecode/routes.js --- a/rhodecode/public/js/rhodecode/routes.js +++ b/rhodecode/public/js/rhodecode/routes.js @@ -12,394 +12,394 @@ ******************************************************************************/ function registerRCRoutes() { // routes registration - pyroutes.register('favicon', '/favicon.ico', []); - pyroutes.register('robots', '/robots.txt', []); - pyroutes.register('auth_home', '/_admin/auth*traverse', []); - pyroutes.register('global_integrations_new', '/_admin/integrations/new', []); - pyroutes.register('global_integrations_home', '/_admin/integrations', []); - pyroutes.register('global_integrations_list', '/_admin/integrations/%(integration)s', ['integration']); - pyroutes.register('global_integrations_create', '/_admin/integrations/%(integration)s/new', ['integration']); - pyroutes.register('global_integrations_edit', '/_admin/integrations/%(integration)s/%(integration_id)s', ['integration', 'integration_id']); - pyroutes.register('repo_group_integrations_home', '/%(repo_group_name)s/_settings/integrations', ['repo_group_name']); - pyroutes.register('repo_group_integrations_new', '/%(repo_group_name)s/_settings/integrations/new', ['repo_group_name']); - pyroutes.register('repo_group_integrations_list', '/%(repo_group_name)s/_settings/integrations/%(integration)s', ['repo_group_name', 'integration']); - pyroutes.register('repo_group_integrations_create', '/%(repo_group_name)s/_settings/integrations/%(integration)s/new', ['repo_group_name', 'integration']); - pyroutes.register('repo_group_integrations_edit', '/%(repo_group_name)s/_settings/integrations/%(integration)s/%(integration_id)s', ['repo_group_name', 'integration', 'integration_id']); - pyroutes.register('repo_integrations_home', '/%(repo_name)s/settings/integrations', ['repo_name']); - pyroutes.register('repo_integrations_new', '/%(repo_name)s/settings/integrations/new', ['repo_name']); - pyroutes.register('repo_integrations_list', '/%(repo_name)s/settings/integrations/%(integration)s', ['repo_name', 'integration']); - pyroutes.register('repo_integrations_create', '/%(repo_name)s/settings/integrations/%(integration)s/new', ['repo_name', 'integration']); - pyroutes.register('repo_integrations_edit', '/%(repo_name)s/settings/integrations/%(integration)s/%(integration_id)s', ['repo_name', 'integration', 'integration_id']); - pyroutes.register('hovercard_user', '/_hovercard/user/%(user_id)s', ['user_id']); - pyroutes.register('hovercard_username', '/_hovercard/username/%(username)s', ['username']); - pyroutes.register('hovercard_user_group', '/_hovercard/user_group/%(user_group_id)s', ['user_group_id']); - pyroutes.register('hovercard_pull_request', '/_hovercard/pull_request/%(pull_request_id)s', ['pull_request_id']); - pyroutes.register('hovercard_repo_commit', '/_hovercard/commit/%(repo_name)s/%(commit_id)s', ['repo_name', 'commit_id']); - pyroutes.register('ops_ping', '/_admin/ops/ping', []); - pyroutes.register('ops_error_test', '/_admin/ops/error', []); - pyroutes.register('ops_redirect_test', '/_admin/ops/redirect', []); - pyroutes.register('ops_ping_legacy', '/_admin/ping', []); - pyroutes.register('ops_error_test_legacy', '/_admin/error_test', []); - pyroutes.register('admin_home', '/_admin', []); + pyroutes.register('admin_audit_log_entry', '/_admin/audit_logs/%(audit_log_id)s', ['audit_log_id']); pyroutes.register('admin_audit_logs', '/_admin/audit_logs', []); - pyroutes.register('admin_audit_log_entry', '/_admin/audit_logs/%(audit_log_id)s', ['audit_log_id']); - pyroutes.register('pull_requests_global_0', '/_admin/pull_requests/%(pull_request_id)s', ['pull_request_id']); - pyroutes.register('pull_requests_global_1', '/_admin/pull-requests/%(pull_request_id)s', ['pull_request_id']); - pyroutes.register('pull_requests_global', '/_admin/pull-request/%(pull_request_id)s', ['pull_request_id']); - pyroutes.register('admin_settings_open_source', '/_admin/settings/open_source', []); - pyroutes.register('admin_settings_vcs_svn_generate_cfg', '/_admin/settings/vcs/svn_generate_cfg', []); - pyroutes.register('admin_settings_system', '/_admin/settings/system', []); - pyroutes.register('admin_settings_system_update', '/_admin/settings/system/updates', []); - pyroutes.register('admin_settings_exception_tracker', '/_admin/settings/exceptions', []); - pyroutes.register('admin_settings_exception_tracker_delete_all', '/_admin/settings/exceptions/delete', []); - pyroutes.register('admin_settings_exception_tracker_show', '/_admin/settings/exceptions/%(exception_id)s', ['exception_id']); - pyroutes.register('admin_settings_exception_tracker_delete', '/_admin/settings/exceptions/%(exception_id)s/delete', ['exception_id']); - pyroutes.register('admin_settings_sessions', '/_admin/settings/sessions', []); - pyroutes.register('admin_settings_sessions_cleanup', '/_admin/settings/sessions/cleanup', []); - pyroutes.register('admin_settings_process_management', '/_admin/settings/process_management', []); - pyroutes.register('admin_settings_process_management_data', '/_admin/settings/process_management/data', []); - pyroutes.register('admin_settings_process_management_signal', '/_admin/settings/process_management/signal', []); - pyroutes.register('admin_settings_process_management_master_signal', '/_admin/settings/process_management/master_signal', []); pyroutes.register('admin_defaults_repositories', '/_admin/defaults/repositories', []); pyroutes.register('admin_defaults_repositories_update', '/_admin/defaults/repositories/update', []); - pyroutes.register('admin_settings', '/_admin/settings', []); - pyroutes.register('admin_settings_update', '/_admin/settings/update', []); - pyroutes.register('admin_settings_global', '/_admin/settings/global', []); - pyroutes.register('admin_settings_global_update', '/_admin/settings/global/update', []); - pyroutes.register('admin_settings_vcs', '/_admin/settings/vcs', []); - pyroutes.register('admin_settings_vcs_update', '/_admin/settings/vcs/update', []); - pyroutes.register('admin_settings_vcs_svn_pattern_delete', '/_admin/settings/vcs/svn_pattern_delete', []); - pyroutes.register('admin_settings_mapping', '/_admin/settings/mapping', []); - pyroutes.register('admin_settings_mapping_update', '/_admin/settings/mapping/update', []); - pyroutes.register('admin_settings_visual', '/_admin/settings/visual', []); - pyroutes.register('admin_settings_visual_update', '/_admin/settings/visual/update', []); - pyroutes.register('admin_settings_issuetracker', '/_admin/settings/issue-tracker', []); - pyroutes.register('admin_settings_issuetracker_update', '/_admin/settings/issue-tracker/update', []); - pyroutes.register('admin_settings_issuetracker_test', '/_admin/settings/issue-tracker/test', []); - pyroutes.register('admin_settings_issuetracker_delete', '/_admin/settings/issue-tracker/delete', []); - pyroutes.register('admin_settings_email', '/_admin/settings/email', []); - pyroutes.register('admin_settings_email_update', '/_admin/settings/email/update', []); - pyroutes.register('admin_settings_hooks', '/_admin/settings/hooks', []); - pyroutes.register('admin_settings_hooks_update', '/_admin/settings/hooks/update', []); - pyroutes.register('admin_settings_hooks_delete', '/_admin/settings/hooks/delete', []); - pyroutes.register('admin_settings_search', '/_admin/settings/search', []); - pyroutes.register('admin_settings_labs', '/_admin/settings/labs', []); - pyroutes.register('admin_settings_labs_update', '/_admin/settings/labs/update', []); + pyroutes.register('admin_home', '/_admin', []); pyroutes.register('admin_permissions_application', '/_admin/permissions/application', []); pyroutes.register('admin_permissions_application_update', '/_admin/permissions/application/update', []); + pyroutes.register('admin_permissions_auth_token_access', '/_admin/permissions/auth_token_access', []); + pyroutes.register('admin_permissions_branch', '/_admin/permissions/branch', []); + pyroutes.register('admin_permissions_branch_update', '/_admin/permissions/branch/update', []); pyroutes.register('admin_permissions_global', '/_admin/permissions/global', []); pyroutes.register('admin_permissions_global_update', '/_admin/permissions/global/update', []); + pyroutes.register('admin_permissions_ips', '/_admin/permissions/ips', []); pyroutes.register('admin_permissions_object', '/_admin/permissions/object', []); pyroutes.register('admin_permissions_object_update', '/_admin/permissions/object/update', []); - pyroutes.register('admin_permissions_ips', '/_admin/permissions/ips', []); pyroutes.register('admin_permissions_overview', '/_admin/permissions/overview', []); - pyroutes.register('admin_permissions_auth_token_access', '/_admin/permissions/auth_token_access', []); pyroutes.register('admin_permissions_ssh_keys', '/_admin/permissions/ssh_keys', []); pyroutes.register('admin_permissions_ssh_keys_data', '/_admin/permissions/ssh_keys/data', []); pyroutes.register('admin_permissions_ssh_keys_update', '/_admin/permissions/ssh_keys/update', []); - pyroutes.register('users', '/_admin/users', []); - pyroutes.register('users_data', '/_admin/users_data', []); - pyroutes.register('users_create', '/_admin/users/create', []); - pyroutes.register('users_new', '/_admin/users/new', []); - pyroutes.register('user_edit', '/_admin/users/%(user_id)s/edit', ['user_id']); - pyroutes.register('user_edit_advanced', '/_admin/users/%(user_id)s/edit/advanced', ['user_id']); - pyroutes.register('user_edit_global_perms', '/_admin/users/%(user_id)s/edit/global_permissions', ['user_id']); - pyroutes.register('user_edit_global_perms_update', '/_admin/users/%(user_id)s/edit/global_permissions/update', ['user_id']); - pyroutes.register('user_update', '/_admin/users/%(user_id)s/update', ['user_id']); - pyroutes.register('user_delete', '/_admin/users/%(user_id)s/delete', ['user_id']); - pyroutes.register('user_enable_force_password_reset', '/_admin/users/%(user_id)s/password_reset_enable', ['user_id']); - pyroutes.register('user_disable_force_password_reset', '/_admin/users/%(user_id)s/password_reset_disable', ['user_id']); - pyroutes.register('user_create_personal_repo_group', '/_admin/users/%(user_id)s/create_repo_group', ['user_id']); - pyroutes.register('user_notice_dismiss', '/_admin/users/%(user_id)s/notice_dismiss', ['user_id']); + pyroutes.register('admin_settings', '/_admin/settings', []); + pyroutes.register('admin_settings_automation', '/_admin/settings/automation', []); + pyroutes.register('admin_settings_automation_update', '/_admin/settings/automation/%(entry_id)s/update', ['entry_id']); + pyroutes.register('admin_settings_email', '/_admin/settings/email', []); + pyroutes.register('admin_settings_email_update', '/_admin/settings/email/update', []); + pyroutes.register('admin_settings_exception_tracker', '/_admin/settings/exceptions', []); + pyroutes.register('admin_settings_exception_tracker_delete', '/_admin/settings/exceptions/%(exception_id)s/delete', ['exception_id']); + pyroutes.register('admin_settings_exception_tracker_delete_all', '/_admin/settings/exceptions_delete_all', []); + pyroutes.register('admin_settings_exception_tracker_show', '/_admin/settings/exceptions/%(exception_id)s', ['exception_id']); + pyroutes.register('admin_settings_global', '/_admin/settings/global', []); + pyroutes.register('admin_settings_global_update', '/_admin/settings/global/update', []); + pyroutes.register('admin_settings_hooks', '/_admin/settings/hooks', []); + pyroutes.register('admin_settings_hooks_delete', '/_admin/settings/hooks/delete', []); + pyroutes.register('admin_settings_hooks_update', '/_admin/settings/hooks/update', []); + pyroutes.register('admin_settings_issuetracker', '/_admin/settings/issue-tracker', []); + pyroutes.register('admin_settings_issuetracker_delete', '/_admin/settings/issue-tracker/delete', []); + pyroutes.register('admin_settings_issuetracker_test', '/_admin/settings/issue-tracker/test', []); + pyroutes.register('admin_settings_issuetracker_update', '/_admin/settings/issue-tracker/update', []); + pyroutes.register('admin_settings_labs', '/_admin/settings/labs', []); + pyroutes.register('admin_settings_labs_update', '/_admin/settings/labs/update', []); + pyroutes.register('admin_settings_license', '/_admin/settings/license', []); + pyroutes.register('admin_settings_license_unlock', '/_admin/settings/license_unlock', []); + pyroutes.register('admin_settings_mapping', '/_admin/settings/mapping', []); + pyroutes.register('admin_settings_mapping_update', '/_admin/settings/mapping/update', []); + pyroutes.register('admin_settings_open_source', '/_admin/settings/open_source', []); + pyroutes.register('admin_settings_process_management', '/_admin/settings/process_management', []); + pyroutes.register('admin_settings_process_management_data', '/_admin/settings/process_management/data', []); + pyroutes.register('admin_settings_process_management_master_signal', '/_admin/settings/process_management/master_signal', []); + pyroutes.register('admin_settings_process_management_signal', '/_admin/settings/process_management/signal', []); + pyroutes.register('admin_settings_scheduler_create', '/_admin/settings/scheduler/create', []); + pyroutes.register('admin_settings_scheduler_delete', '/_admin/settings/scheduler/%(schedule_id)s/delete', ['schedule_id']); + pyroutes.register('admin_settings_scheduler_edit', '/_admin/settings/scheduler/%(schedule_id)s', ['schedule_id']); + pyroutes.register('admin_settings_scheduler_execute', '/_admin/settings/scheduler/%(schedule_id)s/execute', ['schedule_id']); + pyroutes.register('admin_settings_scheduler_new', '/_admin/settings/scheduler/new', []); + pyroutes.register('admin_settings_scheduler_show_all', '/_admin/settings/scheduler', []); + pyroutes.register('admin_settings_scheduler_show_tasks', '/_admin/settings/scheduler/_tasks', []); + pyroutes.register('admin_settings_scheduler_update', '/_admin/settings/scheduler/%(schedule_id)s/update', ['schedule_id']); + pyroutes.register('admin_settings_search', '/_admin/settings/search', []); + pyroutes.register('admin_settings_sessions', '/_admin/settings/sessions', []); + pyroutes.register('admin_settings_sessions_cleanup', '/_admin/settings/sessions/cleanup', []); + pyroutes.register('admin_settings_system', '/_admin/settings/system', []); + pyroutes.register('admin_settings_system_update', '/_admin/settings/system/updates', []); + pyroutes.register('admin_settings_update', '/_admin/settings/update', []); + pyroutes.register('admin_settings_vcs', '/_admin/settings/vcs', []); + pyroutes.register('admin_settings_vcs_svn_generate_cfg', '/_admin/settings/vcs/svn_generate_cfg', []); + pyroutes.register('admin_settings_vcs_svn_pattern_delete', '/_admin/settings/vcs/svn_pattern_delete', []); + pyroutes.register('admin_settings_vcs_update', '/_admin/settings/vcs/update', []); + pyroutes.register('admin_settings_visual', '/_admin/settings/visual', []); + pyroutes.register('admin_settings_visual_update', '/_admin/settings/visual/update', []); + pyroutes.register('apiv2', '/_admin/api', []); + pyroutes.register('atom_feed_home', '/%(repo_name)s/feed-atom', ['repo_name']); + pyroutes.register('atom_feed_home_old', '/%(repo_name)s/feed/atom', ['repo_name']); + pyroutes.register('auth_home', '/_admin/auth*traverse', []); + pyroutes.register('bookmarks_home', '/%(repo_name)s/bookmarks', ['repo_name']); + pyroutes.register('branches_home', '/%(repo_name)s/branches', ['repo_name']); + pyroutes.register('channelstream_connect', '/_admin/channelstream/connect', []); + pyroutes.register('channelstream_proxy', '/_channelstream', []); + pyroutes.register('channelstream_subscribe', '/_admin/channelstream/subscribe', []); + pyroutes.register('commit_draft_comments_submit', '/%(repo_name)s/changeset/%(commit_id)s/draft_comments_submit', ['repo_name', 'commit_id']); + pyroutes.register('debug_style_email', '/_admin/debug_style/email/%(email_id)s', ['email_id']); + pyroutes.register('debug_style_email_plain_rendered', '/_admin/debug_style/email-rendered/%(email_id)s', ['email_id']); + pyroutes.register('debug_style_home', '/_admin/debug_style', []); + pyroutes.register('debug_style_template', '/_admin/debug_style/t/%(t_path)s', ['t_path']); + pyroutes.register('download_file', '/_file_store/download/%(fid)s', ['fid']); + pyroutes.register('download_file_by_token', '/_file_store/token-download/%(_auth_token)s/%(fid)s', ['_auth_token', 'fid']); + pyroutes.register('edit_repo', '/%(repo_name)s/settings', ['repo_name']); + pyroutes.register('edit_repo_advanced', '/%(repo_name)s/settings/advanced', ['repo_name']); + pyroutes.register('edit_repo_advanced_archive', '/%(repo_name)s/settings/advanced/archive', ['repo_name']); + pyroutes.register('edit_repo_advanced_delete', '/%(repo_name)s/settings/advanced/delete', ['repo_name']); + pyroutes.register('edit_repo_advanced_fork', '/%(repo_name)s/settings/advanced/fork', ['repo_name']); + pyroutes.register('edit_repo_advanced_hooks', '/%(repo_name)s/settings/advanced/hooks', ['repo_name']); + pyroutes.register('edit_repo_advanced_journal', '/%(repo_name)s/settings/advanced/journal', ['repo_name']); + pyroutes.register('edit_repo_advanced_locking', '/%(repo_name)s/settings/advanced/locking', ['repo_name']); + pyroutes.register('edit_repo_audit_logs', '/%(repo_name)s/settings/audit_logs', ['repo_name']); + pyroutes.register('edit_repo_caches', '/%(repo_name)s/settings/caches', ['repo_name']); + pyroutes.register('edit_repo_fields', '/%(repo_name)s/settings/fields', ['repo_name']); + pyroutes.register('edit_repo_fields_create', '/%(repo_name)s/settings/fields/create', ['repo_name']); + pyroutes.register('edit_repo_fields_delete', '/%(repo_name)s/settings/fields/%(field_id)s/delete', ['repo_name', 'field_id']); + pyroutes.register('edit_repo_group', '/%(repo_group_name)s/_edit', ['repo_group_name']); + pyroutes.register('edit_repo_group_advanced', '/%(repo_group_name)s/_settings/advanced', ['repo_group_name']); + pyroutes.register('edit_repo_group_advanced_delete', '/%(repo_group_name)s/_settings/advanced/delete', ['repo_group_name']); + pyroutes.register('edit_repo_group_perms', '/%(repo_group_name)s/_settings/permissions', ['repo_group_name']); + pyroutes.register('edit_repo_group_perms_update', '/%(repo_group_name)s/_settings/permissions/update', ['repo_group_name']); + pyroutes.register('edit_repo_issuetracker', '/%(repo_name)s/settings/issue_trackers', ['repo_name']); + pyroutes.register('edit_repo_issuetracker_delete', '/%(repo_name)s/settings/issue_trackers/delete', ['repo_name']); + pyroutes.register('edit_repo_issuetracker_test', '/%(repo_name)s/settings/issue_trackers/test', ['repo_name']); + pyroutes.register('edit_repo_issuetracker_update', '/%(repo_name)s/settings/issue_trackers/update', ['repo_name']); + pyroutes.register('edit_repo_maintenance', '/%(repo_name)s/settings/maintenance', ['repo_name']); + pyroutes.register('edit_repo_maintenance_execute', '/%(repo_name)s/settings/maintenance/execute', ['repo_name']); + pyroutes.register('edit_repo_perms', '/%(repo_name)s/settings/permissions', ['repo_name']); + pyroutes.register('edit_repo_perms_branch', '/%(repo_name)s/settings/branch_permissions', ['repo_name']); + pyroutes.register('edit_repo_perms_branch_delete', '/%(repo_name)s/settings/branch_permissions/%(rule_id)s/delete', ['repo_name', 'rule_id']); + pyroutes.register('edit_repo_perms_set_private', '/%(repo_name)s/settings/permissions/set_private', ['repo_name']); + pyroutes.register('edit_repo_remote', '/%(repo_name)s/settings/remote', ['repo_name']); + pyroutes.register('edit_repo_remote_pull', '/%(repo_name)s/settings/remote/pull', ['repo_name']); + pyroutes.register('edit_repo_remote_push', '/%(repo_name)s/settings/remote/push', ['repo_name']); + pyroutes.register('edit_repo_statistics', '/%(repo_name)s/settings/statistics', ['repo_name']); + pyroutes.register('edit_repo_statistics_reset', '/%(repo_name)s/settings/statistics/update', ['repo_name']); + pyroutes.register('edit_repo_strip', '/%(repo_name)s/settings/strip', ['repo_name']); + pyroutes.register('edit_repo_vcs', '/%(repo_name)s/settings/vcs', ['repo_name']); + pyroutes.register('edit_repo_vcs_svn_pattern_delete', '/%(repo_name)s/settings/vcs/svn_pattern/delete', ['repo_name']); + pyroutes.register('edit_repo_vcs_update', '/%(repo_name)s/settings/vcs/update', ['repo_name']); + pyroutes.register('edit_user_audit_logs', '/_admin/users/%(user_id)s/edit/audit', ['user_id']); + pyroutes.register('edit_user_audit_logs_download', '/_admin/users/%(user_id)s/edit/audit/download', ['user_id']); + pyroutes.register('edit_user_auth_tokens', '/_admin/users/%(user_id)s/edit/auth_tokens', ['user_id']); + pyroutes.register('edit_user_auth_tokens_add', '/_admin/users/%(user_id)s/edit/auth_tokens/new', ['user_id']); + pyroutes.register('edit_user_auth_tokens_delete', '/_admin/users/%(user_id)s/edit/auth_tokens/delete', ['user_id']); pyroutes.register('edit_user_auth_tokens_view', '/_admin/users/%(user_id)s/edit/auth_tokens/view', ['user_id']); - pyroutes.register('edit_user_auth_tokens_delete', '/_admin/users/%(user_id)s/edit/auth_tokens/delete', ['user_id']); - pyroutes.register('edit_user_ssh_keys', '/_admin/users/%(user_id)s/edit/ssh_keys', ['user_id']); - pyroutes.register('edit_user_ssh_keys_generate_keypair', '/_admin/users/%(user_id)s/edit/ssh_keys/generate', ['user_id']); - pyroutes.register('edit_user_ssh_keys_add', '/_admin/users/%(user_id)s/edit/ssh_keys/new', ['user_id']); - pyroutes.register('edit_user_ssh_keys_delete', '/_admin/users/%(user_id)s/edit/ssh_keys/delete', ['user_id']); + pyroutes.register('edit_user_caches', '/_admin/users/%(user_id)s/edit/caches', ['user_id']); + pyroutes.register('edit_user_caches_update', '/_admin/users/%(user_id)s/edit/caches/update', ['user_id']); pyroutes.register('edit_user_emails', '/_admin/users/%(user_id)s/edit/emails', ['user_id']); pyroutes.register('edit_user_emails_add', '/_admin/users/%(user_id)s/edit/emails/new', ['user_id']); pyroutes.register('edit_user_emails_delete', '/_admin/users/%(user_id)s/edit/emails/delete', ['user_id']); + pyroutes.register('edit_user_group', '/_admin/user_groups/%(user_group_id)s/edit', ['user_group_id']); + pyroutes.register('edit_user_group_advanced', '/_admin/user_groups/%(user_group_id)s/edit/advanced', ['user_group_id']); + pyroutes.register('edit_user_group_advanced_sync', '/_admin/user_groups/%(user_group_id)s/edit/advanced/sync', ['user_group_id']); + pyroutes.register('edit_user_group_global_perms', '/_admin/user_groups/%(user_group_id)s/edit/global_permissions', ['user_group_id']); + pyroutes.register('edit_user_group_global_perms_update', '/_admin/user_groups/%(user_group_id)s/edit/global_permissions/update', ['user_group_id']); + pyroutes.register('edit_user_group_perms', '/_admin/user_groups/%(user_group_id)s/edit/permissions', ['user_group_id']); + pyroutes.register('edit_user_group_perms_summary', '/_admin/user_groups/%(user_group_id)s/edit/permissions_summary', ['user_group_id']); + pyroutes.register('edit_user_group_perms_summary_json', '/_admin/user_groups/%(user_group_id)s/edit/permissions_summary/json', ['user_group_id']); + pyroutes.register('edit_user_group_perms_update', '/_admin/user_groups/%(user_group_id)s/edit/permissions/update', ['user_group_id']); + pyroutes.register('edit_user_groups_management', '/_admin/users/%(user_id)s/edit/groups_management', ['user_id']); + pyroutes.register('edit_user_groups_management_updates', '/_admin/users/%(user_id)s/edit/edit_user_groups_management/updates', ['user_id']); pyroutes.register('edit_user_ips', '/_admin/users/%(user_id)s/edit/ips', ['user_id']); pyroutes.register('edit_user_ips_add', '/_admin/users/%(user_id)s/edit/ips/new', ['user_id']); pyroutes.register('edit_user_ips_delete', '/_admin/users/%(user_id)s/edit/ips/delete', ['user_id']); pyroutes.register('edit_user_perms_summary', '/_admin/users/%(user_id)s/edit/permissions_summary', ['user_id']); pyroutes.register('edit_user_perms_summary_json', '/_admin/users/%(user_id)s/edit/permissions_summary/json', ['user_id']); - pyroutes.register('edit_user_groups_management', '/_admin/users/%(user_id)s/edit/groups_management', ['user_id']); - pyroutes.register('edit_user_groups_management_updates', '/_admin/users/%(user_id)s/edit/edit_user_groups_management/updates', ['user_id']); - pyroutes.register('edit_user_audit_logs', '/_admin/users/%(user_id)s/edit/audit', ['user_id']); - pyroutes.register('edit_user_audit_logs_download', '/_admin/users/%(user_id)s/edit/audit/download', ['user_id']); - pyroutes.register('edit_user_caches', '/_admin/users/%(user_id)s/edit/caches', ['user_id']); - pyroutes.register('edit_user_caches_update', '/_admin/users/%(user_id)s/edit/caches/update', ['user_id']); - pyroutes.register('user_groups', '/_admin/user_groups', []); - pyroutes.register('user_groups_data', '/_admin/user_groups_data', []); - pyroutes.register('user_groups_new', '/_admin/user_groups/new', []); - pyroutes.register('user_groups_create', '/_admin/user_groups/create', []); - pyroutes.register('repos', '/_admin/repos', []); - pyroutes.register('repos_data', '/_admin/repos_data', []); - pyroutes.register('repo_new', '/_admin/repos/new', []); - pyroutes.register('repo_create', '/_admin/repos/create', []); - pyroutes.register('repo_groups', '/_admin/repo_groups', []); - pyroutes.register('repo_groups_data', '/_admin/repo_groups_data', []); - pyroutes.register('repo_group_new', '/_admin/repo_group/new', []); - pyroutes.register('repo_group_create', '/_admin/repo_group/create', []); - pyroutes.register('channelstream_connect', '/_admin/channelstream/connect', []); - pyroutes.register('channelstream_subscribe', '/_admin/channelstream/subscribe', []); - pyroutes.register('channelstream_proxy', '/_channelstream', []); - pyroutes.register('upload_file', '/_file_store/upload', []); - pyroutes.register('download_file', '/_file_store/download/%(fid)s', ['fid']); - pyroutes.register('download_file_by_token', '/_file_store/token-download/%(_auth_token)s/%(fid)s', ['_auth_token', 'fid']); - pyroutes.register('logout', '/_admin/logout', []); - pyroutes.register('reset_password', '/_admin/password_reset', []); - pyroutes.register('reset_password_confirmation', '/_admin/password_reset_confirmation', []); + pyroutes.register('edit_user_ssh_keys', '/_admin/users/%(user_id)s/edit/ssh_keys', ['user_id']); + pyroutes.register('edit_user_ssh_keys_add', '/_admin/users/%(user_id)s/edit/ssh_keys/new', ['user_id']); + pyroutes.register('edit_user_ssh_keys_delete', '/_admin/users/%(user_id)s/edit/ssh_keys/delete', ['user_id']); + pyroutes.register('edit_user_ssh_keys_generate_keypair', '/_admin/users/%(user_id)s/edit/ssh_keys/generate', ['user_id']); + pyroutes.register('favicon', '/favicon.ico', []); + pyroutes.register('file_preview', '/_file_preview', []); + pyroutes.register('gist_delete', '/_admin/gists/%(gist_id)s/delete', ['gist_id']); + pyroutes.register('gist_edit', '/_admin/gists/%(gist_id)s/edit', ['gist_id']); + pyroutes.register('gist_edit_check_revision', '/_admin/gists/%(gist_id)s/edit/check_revision', ['gist_id']); + pyroutes.register('gist_show', '/_admin/gists/%(gist_id)s', ['gist_id']); + pyroutes.register('gist_show_formatted', '/_admin/gists/%(gist_id)s/rev/%(revision)s/%(format)s', ['gist_id', 'revision', 'format']); + 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']); + pyroutes.register('gist_show_rev', '/_admin/gists/%(gist_id)s/rev/%(revision)s', ['gist_id', 'revision']); + pyroutes.register('gist_update', '/_admin/gists/%(gist_id)s/update', ['gist_id']); + pyroutes.register('gists_create', '/_admin/gists/create', []); + pyroutes.register('gists_new', '/_admin/gists/new', []); + pyroutes.register('gists_show', '/_admin/gists', []); + pyroutes.register('global_integrations_create', '/_admin/integrations/%(integration)s/new', ['integration']); + pyroutes.register('global_integrations_edit', '/_admin/integrations/%(integration)s/%(integration_id)s', ['integration', 'integration_id']); + pyroutes.register('global_integrations_home', '/_admin/integrations', []); + pyroutes.register('global_integrations_list', '/_admin/integrations/%(integration)s', ['integration']); + pyroutes.register('global_integrations_new', '/_admin/integrations/new', []); + pyroutes.register('goto_switcher_data', '/_goto_data', []); pyroutes.register('home', '/', []); - pyroutes.register('main_page_repos_data', '/_home_repos', []); - pyroutes.register('main_page_repo_groups_data', '/_home_repo_groups', []); - pyroutes.register('user_autocomplete_data', '/_users', []); - pyroutes.register('user_group_autocomplete_data', '/_user_groups', []); - pyroutes.register('repo_list_data', '/_repos', []); - pyroutes.register('repo_group_list_data', '/_repo_groups', []); - pyroutes.register('goto_switcher_data', '/_goto_data', []); - pyroutes.register('markup_preview', '/_markup_preview', []); - pyroutes.register('file_preview', '/_file_preview', []); - pyroutes.register('store_user_session_value', '/_store_session_attr', []); + pyroutes.register('hovercard_pull_request', '/_hovercard/pull_request/%(pull_request_id)s', ['pull_request_id']); + pyroutes.register('hovercard_repo_commit', '/_hovercard/commit/%(repo_name)s/%(commit_id)s', ['repo_name', 'commit_id']); + pyroutes.register('hovercard_user', '/_hovercard/user/%(user_id)s', ['user_id']); + pyroutes.register('hovercard_user_group', '/_hovercard/user_group/%(user_group_id)s', ['user_group_id']); + pyroutes.register('hovercard_username', '/_hovercard/username/%(username)s', ['username']); pyroutes.register('journal', '/_admin/journal', []); - pyroutes.register('journal_rss', '/_admin/journal/rss', []); pyroutes.register('journal_atom', '/_admin/journal/atom', []); pyroutes.register('journal_public', '/_admin/public_journal', []); pyroutes.register('journal_public_atom', '/_admin/public_journal/atom', []); pyroutes.register('journal_public_atom_old', '/_admin/public_journal_atom', []); pyroutes.register('journal_public_rss', '/_admin/public_journal/rss', []); pyroutes.register('journal_public_rss_old', '/_admin/public_journal_rss', []); - pyroutes.register('toggle_following', '/_admin/toggle_following', []); - pyroutes.register('repo_creating', '/%(repo_name)s/repo_creating', ['repo_name']); - pyroutes.register('repo_creating_check', '/%(repo_name)s/repo_creating_check', ['repo_name']); - pyroutes.register('repo_summary_explicit', '/%(repo_name)s/summary', ['repo_name']); - pyroutes.register('repo_summary_commits', '/%(repo_name)s/summary-commits', ['repo_name']); - pyroutes.register('repo_commit', '/%(repo_name)s/changeset/%(commit_id)s', ['repo_name', 'commit_id']); - pyroutes.register('repo_commit_children', '/%(repo_name)s/changeset_children/%(commit_id)s', ['repo_name', 'commit_id']); - pyroutes.register('repo_commit_parents', '/%(repo_name)s/changeset_parents/%(commit_id)s', ['repo_name', 'commit_id']); - pyroutes.register('repo_commit_raw', '/%(repo_name)s/changeset-diff/%(commit_id)s', ['repo_name', 'commit_id']); - pyroutes.register('repo_commit_patch', '/%(repo_name)s/changeset-patch/%(commit_id)s', ['repo_name', 'commit_id']); - pyroutes.register('repo_commit_download', '/%(repo_name)s/changeset-download/%(commit_id)s', ['repo_name', 'commit_id']); - pyroutes.register('repo_commit_data', '/%(repo_name)s/changeset-data/%(commit_id)s', ['repo_name', 'commit_id']); - pyroutes.register('repo_commit_comment_create', '/%(repo_name)s/changeset/%(commit_id)s/comment/create', ['repo_name', 'commit_id']); - pyroutes.register('repo_commit_comment_preview', '/%(repo_name)s/changeset/%(commit_id)s/comment/preview', ['repo_name', 'commit_id']); - 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']); - pyroutes.register('repo_commit_comment_attachment_upload', '/%(repo_name)s/changeset/%(commit_id)s/comment/attachment_upload', ['repo_name', 'commit_id']); - pyroutes.register('repo_commit_comment_delete', '/%(repo_name)s/changeset/%(commit_id)s/comment/%(comment_id)s/delete', ['repo_name', 'commit_id', 'comment_id']); - pyroutes.register('repo_commit_comment_edit', '/%(repo_name)s/changeset/%(commit_id)s/comment/%(comment_id)s/edit', ['repo_name', 'commit_id', 'comment_id']); - pyroutes.register('repo_commit_raw_deprecated', '/%(repo_name)s/raw-changeset/%(commit_id)s', ['repo_name', 'commit_id']); - pyroutes.register('repo_archivefile', '/%(repo_name)s/archive/%(fname)s', ['repo_name', 'fname']); - pyroutes.register('repo_files_diff', '/%(repo_name)s/diff/%(f_path)s', ['repo_name', 'f_path']); - pyroutes.register('repo_files_diff_2way_redirect', '/%(repo_name)s/diff-2way/%(f_path)s', ['repo_name', 'f_path']); - pyroutes.register('repo_files', '/%(repo_name)s/files/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_files:default_path', '/%(repo_name)s/files/%(commit_id)s/', ['repo_name', 'commit_id']); - pyroutes.register('repo_files:default_commit', '/%(repo_name)s/files', ['repo_name']); - pyroutes.register('repo_files:rendered', '/%(repo_name)s/render/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_files:annotated', '/%(repo_name)s/annotate/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_files:annotated_previous', '/%(repo_name)s/annotate-previous/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_nodetree_full', '/%(repo_name)s/nodetree_full/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_nodetree_full:default_path', '/%(repo_name)s/nodetree_full/%(commit_id)s/', ['repo_name', 'commit_id']); - pyroutes.register('repo_files_nodelist', '/%(repo_name)s/nodelist/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_file_raw', '/%(repo_name)s/raw/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_file_download', '/%(repo_name)s/download/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_file_download:legacy', '/%(repo_name)s/rawfile/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_file_history', '/%(repo_name)s/history/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_file_authors', '/%(repo_name)s/authors/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_files_check_head', '/%(repo_name)s/check_head/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_files_remove_file', '/%(repo_name)s/remove_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_files_delete_file', '/%(repo_name)s/delete_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_files_edit_file', '/%(repo_name)s/edit_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_files_update_file', '/%(repo_name)s/update_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_files_add_file', '/%(repo_name)s/add_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_files_upload_file', '/%(repo_name)s/upload_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_files_create_file', '/%(repo_name)s/create_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_refs_data', '/%(repo_name)s/refs-data', ['repo_name']); - pyroutes.register('repo_refs_changelog_data', '/%(repo_name)s/refs-data-changelog', ['repo_name']); - pyroutes.register('repo_stats', '/%(repo_name)s/repo_stats/%(commit_id)s', ['repo_name', 'commit_id']); - pyroutes.register('repo_commits', '/%(repo_name)s/commits', ['repo_name']); - pyroutes.register('repo_commits_file', '/%(repo_name)s/commits/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_commits_elements', '/%(repo_name)s/commits_elements', ['repo_name']); - pyroutes.register('repo_commits_elements_file', '/%(repo_name)s/commits_elements/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_changelog', '/%(repo_name)s/changelog', ['repo_name']); - pyroutes.register('repo_changelog_file', '/%(repo_name)s/changelog/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); - pyroutes.register('repo_compare_select', '/%(repo_name)s/compare', ['repo_name']); - 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']); - pyroutes.register('tags_home', '/%(repo_name)s/tags', ['repo_name']); - pyroutes.register('branches_home', '/%(repo_name)s/branches', ['repo_name']); - pyroutes.register('bookmarks_home', '/%(repo_name)s/bookmarks', ['repo_name']); - pyroutes.register('repo_fork_new', '/%(repo_name)s/fork', ['repo_name']); - pyroutes.register('repo_fork_create', '/%(repo_name)s/fork/create', ['repo_name']); - pyroutes.register('repo_forks_show_all', '/%(repo_name)s/forks', ['repo_name']); - pyroutes.register('repo_forks_data', '/%(repo_name)s/forks/data', ['repo_name']); + pyroutes.register('journal_rss', '/_admin/journal/rss', []); + pyroutes.register('login', '/_admin/login', []); + pyroutes.register('logout', '/_admin/logout', []); + pyroutes.register('main_page_repo_groups_data', '/_home_repo_groups', []); + pyroutes.register('main_page_repos_data', '/_home_repos', []); + pyroutes.register('markup_preview', '/_markup_preview', []); + pyroutes.register('my_account_auth_tokens', '/_admin/my_account/auth_tokens', []); + pyroutes.register('my_account_auth_tokens_add', '/_admin/my_account/auth_tokens/new', []); + pyroutes.register('my_account_auth_tokens_delete', '/_admin/my_account/auth_tokens/delete', []); + pyroutes.register('my_account_auth_tokens_view', '/_admin/my_account/auth_tokens/view', []); + pyroutes.register('my_account_bookmarks', '/_admin/my_account/bookmarks', []); + pyroutes.register('my_account_bookmarks_update', '/_admin/my_account/bookmarks/update', []); + pyroutes.register('my_account_edit', '/_admin/my_account/edit', []); + pyroutes.register('my_account_emails', '/_admin/my_account/emails', []); + pyroutes.register('my_account_emails_add', '/_admin/my_account/emails/new', []); + pyroutes.register('my_account_emails_delete', '/_admin/my_account/emails/delete', []); + pyroutes.register('my_account_external_identity', '/_admin/my_account/external-identity', []); + pyroutes.register('my_account_external_identity_delete', '/_admin/my_account/external-identity/delete', []); + pyroutes.register('my_account_goto_bookmark', '/_admin/my_account/bookmark/%(bookmark_id)s', ['bookmark_id']); + pyroutes.register('my_account_notifications', '/_admin/my_account/notifications', []); + pyroutes.register('my_account_notifications_test_channelstream', '/_admin/my_account/test_channelstream', []); + pyroutes.register('my_account_notifications_toggle_visibility', '/_admin/my_account/toggle_visibility', []); + pyroutes.register('my_account_password', '/_admin/my_account/password', []); + pyroutes.register('my_account_password_update', '/_admin/my_account/password/update', []); + pyroutes.register('my_account_perms', '/_admin/my_account/perms', []); + pyroutes.register('my_account_profile', '/_admin/my_account/profile', []); + pyroutes.register('my_account_pullrequests', '/_admin/my_account/pull_requests', []); + pyroutes.register('my_account_pullrequests_data', '/_admin/my_account/pull_requests/data', []); + pyroutes.register('my_account_repos', '/_admin/my_account/repos', []); + pyroutes.register('my_account_ssh_keys', '/_admin/my_account/ssh_keys', []); + pyroutes.register('my_account_ssh_keys_add', '/_admin/my_account/ssh_keys/new', []); + pyroutes.register('my_account_ssh_keys_delete', '/_admin/my_account/ssh_keys/delete', []); + pyroutes.register('my_account_ssh_keys_generate', '/_admin/my_account/ssh_keys/generate', []); + pyroutes.register('my_account_update', '/_admin/my_account/update', []); + pyroutes.register('my_account_user_group_membership', '/_admin/my_account/user_group_membership', []); + pyroutes.register('my_account_watched', '/_admin/my_account/watched', []); + pyroutes.register('notifications_delete', '/_admin/notifications/%(notification_id)s/delete', ['notification_id']); + pyroutes.register('notifications_mark_all_read', '/_admin/notifications_mark_all_read', []); + pyroutes.register('notifications_show', '/_admin/notifications/%(notification_id)s', ['notification_id']); + pyroutes.register('notifications_show_all', '/_admin/notifications', []); + pyroutes.register('notifications_update', '/_admin/notifications/%(notification_id)s/update', ['notification_id']); + pyroutes.register('ops_error_test', '/_admin/ops/error', []); + pyroutes.register('ops_ping', '/_admin/ops/ping', []); + pyroutes.register('ops_redirect_test', '/_admin/ops/redirect', []); + pyroutes.register('plugin_admin_chat', '/_admin/plugin_admin_chat/%(action)s', ['action']); + pyroutes.register('pull_requests_global', '/_admin/pull-request/%(pull_request_id)s', ['pull_request_id']); + pyroutes.register('pull_requests_global_0', '/_admin/pull_requests/%(pull_request_id)s', ['pull_request_id']); + pyroutes.register('pull_requests_global_1', '/_admin/pull-requests/%(pull_request_id)s', ['pull_request_id']); + pyroutes.register('pullrequest_comment_create', '/%(repo_name)s/pull-request/%(pull_request_id)s/comment', ['repo_name', 'pull_request_id']); + 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']); + 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']); + pyroutes.register('pullrequest_comments', '/%(repo_name)s/pull-request/%(pull_request_id)s/comments', ['repo_name', 'pull_request_id']); + pyroutes.register('pullrequest_create', '/%(repo_name)s/pull-request/create', ['repo_name']); + pyroutes.register('pullrequest_delete', '/%(repo_name)s/pull-request/%(pull_request_id)s/delete', ['repo_name', 'pull_request_id']); + pyroutes.register('pullrequest_draft_comments_submit', '/%(repo_name)s/pull-request/%(pull_request_id)s/draft_comments_submit', ['repo_name', 'pull_request_id']); + pyroutes.register('pullrequest_drafts', '/%(repo_name)s/pull-request/%(pull_request_id)s/drafts', ['repo_name', 'pull_request_id']); + pyroutes.register('pullrequest_merge', '/%(repo_name)s/pull-request/%(pull_request_id)s/merge', ['repo_name', 'pull_request_id']); + pyroutes.register('pullrequest_new', '/%(repo_name)s/pull-request/new', ['repo_name']); + pyroutes.register('pullrequest_repo_refs', '/%(repo_name)s/pull-request/refs/%(target_repo_name)s', ['repo_name', 'target_repo_name']); + pyroutes.register('pullrequest_repo_targets', '/%(repo_name)s/pull-request/repo-targets', ['repo_name']); pyroutes.register('pullrequest_show', '/%(repo_name)s/pull-request/%(pull_request_id)s', ['repo_name', 'pull_request_id']); pyroutes.register('pullrequest_show_all', '/%(repo_name)s/pull-request', ['repo_name']); pyroutes.register('pullrequest_show_all_data', '/%(repo_name)s/pull-request-data', ['repo_name']); - pyroutes.register('pullrequest_repo_refs', '/%(repo_name)s/pull-request/refs/%(target_repo_name)s', ['repo_name', 'target_repo_name']); - pyroutes.register('pullrequest_repo_targets', '/%(repo_name)s/pull-request/repo-targets', ['repo_name']); - pyroutes.register('pullrequest_new', '/%(repo_name)s/pull-request/new', ['repo_name']); - pyroutes.register('pullrequest_create', '/%(repo_name)s/pull-request/create', ['repo_name']); + pyroutes.register('pullrequest_todos', '/%(repo_name)s/pull-request/%(pull_request_id)s/todos', ['repo_name', 'pull_request_id']); pyroutes.register('pullrequest_update', '/%(repo_name)s/pull-request/%(pull_request_id)s/update', ['repo_name', 'pull_request_id']); - pyroutes.register('pullrequest_merge', '/%(repo_name)s/pull-request/%(pull_request_id)s/merge', ['repo_name', 'pull_request_id']); - pyroutes.register('pullrequest_delete', '/%(repo_name)s/pull-request/%(pull_request_id)s/delete', ['repo_name', 'pull_request_id']); - pyroutes.register('pullrequest_comment_create', '/%(repo_name)s/pull-request/%(pull_request_id)s/comment', ['repo_name', 'pull_request_id']); - 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']); - 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']); - pyroutes.register('pullrequest_comments', '/%(repo_name)s/pull-request/%(pull_request_id)s/comments', ['repo_name', 'pull_request_id']); - pyroutes.register('pullrequest_todos', '/%(repo_name)s/pull-request/%(pull_request_id)s/todos', ['repo_name', 'pull_request_id']); - pyroutes.register('pullrequest_drafts', '/%(repo_name)s/pull-request/%(pull_request_id)s/drafts', ['repo_name', 'pull_request_id']); - pyroutes.register('edit_repo', '/%(repo_name)s/settings', ['repo_name']); - pyroutes.register('edit_repo_advanced', '/%(repo_name)s/settings/advanced', ['repo_name']); - pyroutes.register('edit_repo_advanced_archive', '/%(repo_name)s/settings/advanced/archive', ['repo_name']); - pyroutes.register('edit_repo_advanced_delete', '/%(repo_name)s/settings/advanced/delete', ['repo_name']); - pyroutes.register('edit_repo_advanced_locking', '/%(repo_name)s/settings/advanced/locking', ['repo_name']); - pyroutes.register('edit_repo_advanced_journal', '/%(repo_name)s/settings/advanced/journal', ['repo_name']); - pyroutes.register('edit_repo_advanced_fork', '/%(repo_name)s/settings/advanced/fork', ['repo_name']); - pyroutes.register('edit_repo_advanced_hooks', '/%(repo_name)s/settings/advanced/hooks', ['repo_name']); - pyroutes.register('edit_repo_caches', '/%(repo_name)s/settings/caches', ['repo_name']); - pyroutes.register('edit_repo_perms', '/%(repo_name)s/settings/permissions', ['repo_name']); - pyroutes.register('edit_repo_perms_set_private', '/%(repo_name)s/settings/permissions/set_private', ['repo_name']); - pyroutes.register('edit_repo_maintenance', '/%(repo_name)s/settings/maintenance', ['repo_name']); - pyroutes.register('edit_repo_maintenance_execute', '/%(repo_name)s/settings/maintenance/execute', ['repo_name']); - pyroutes.register('edit_repo_fields', '/%(repo_name)s/settings/fields', ['repo_name']); - pyroutes.register('edit_repo_fields_create', '/%(repo_name)s/settings/fields/create', ['repo_name']); - pyroutes.register('edit_repo_fields_delete', '/%(repo_name)s/settings/fields/%(field_id)s/delete', ['repo_name', 'field_id']); + pyroutes.register('register', '/_admin/register', []); + pyroutes.register('repo_archivefile', '/%(repo_name)s/archive/%(fname)s', ['repo_name', 'fname']); + pyroutes.register('repo_artifacts_data', '/%(repo_name)s/artifacts_data', ['repo_name']); + pyroutes.register('repo_artifacts_delete', '/%(repo_name)s/artifacts/delete/%(uid)s', ['repo_name', 'uid']); + pyroutes.register('repo_artifacts_get', '/%(repo_name)s/artifacts/download/%(uid)s', ['repo_name', 'uid']); + pyroutes.register('repo_artifacts_info', '/%(repo_name)s/artifacts/info/%(uid)s', ['repo_name', 'uid']); + pyroutes.register('repo_artifacts_list', '/%(repo_name)s/artifacts', ['repo_name']); + pyroutes.register('repo_artifacts_new', '/%(repo_name)s/artifacts/new', ['repo_name']); + pyroutes.register('repo_artifacts_store', '/%(repo_name)s/artifacts/store', ['repo_name']); + pyroutes.register('repo_artifacts_stream_script', '/_file_store/stream-upload-script', []); + pyroutes.register('repo_artifacts_stream_store', '/_file_store/stream-upload', []); + pyroutes.register('repo_artifacts_update', '/%(repo_name)s/artifacts/update/%(uid)s', ['repo_name', 'uid']); + pyroutes.register('repo_automation', '/%(repo_name)s/settings/automation', ['repo_name']); + pyroutes.register('repo_automation_update', '/%(repo_name)s/settings/automation/%(entry_id)s/update', ['repo_name', 'entry_id']); + pyroutes.register('repo_changelog', '/%(repo_name)s/changelog', ['repo_name']); + pyroutes.register('repo_changelog_file', '/%(repo_name)s/changelog/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_commit', '/%(repo_name)s/changeset/%(commit_id)s', ['repo_name', 'commit_id']); + pyroutes.register('repo_commit_children', '/%(repo_name)s/changeset_children/%(commit_id)s', ['repo_name', 'commit_id']); + pyroutes.register('repo_commit_comment_attachment_upload', '/%(repo_name)s/changeset/%(commit_id)s/comment/attachment_upload', ['repo_name', 'commit_id']); + pyroutes.register('repo_commit_comment_create', '/%(repo_name)s/changeset/%(commit_id)s/comment/create', ['repo_name', 'commit_id']); + pyroutes.register('repo_commit_comment_delete', '/%(repo_name)s/changeset/%(commit_id)s/comment/%(comment_id)s/delete', ['repo_name', 'commit_id', 'comment_id']); + pyroutes.register('repo_commit_comment_edit', '/%(repo_name)s/changeset/%(commit_id)s/comment/%(comment_id)s/edit', ['repo_name', 'commit_id', 'comment_id']); + 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']); + pyroutes.register('repo_commit_comment_preview', '/%(repo_name)s/changeset/%(commit_id)s/comment/preview', ['repo_name', 'commit_id']); + pyroutes.register('repo_commit_data', '/%(repo_name)s/changeset-data/%(commit_id)s', ['repo_name', 'commit_id']); + pyroutes.register('repo_commit_download', '/%(repo_name)s/changeset-download/%(commit_id)s', ['repo_name', 'commit_id']); + pyroutes.register('repo_commit_parents', '/%(repo_name)s/changeset_parents/%(commit_id)s', ['repo_name', 'commit_id']); + pyroutes.register('repo_commit_patch', '/%(repo_name)s/changeset-patch/%(commit_id)s', ['repo_name', 'commit_id']); + pyroutes.register('repo_commit_raw', '/%(repo_name)s/changeset-diff/%(commit_id)s', ['repo_name', 'commit_id']); + pyroutes.register('repo_commit_raw_deprecated', '/%(repo_name)s/raw-changeset/%(commit_id)s', ['repo_name', 'commit_id']); + pyroutes.register('repo_commits', '/%(repo_name)s/commits', ['repo_name']); + pyroutes.register('repo_commits_elements', '/%(repo_name)s/commits_elements', ['repo_name']); + pyroutes.register('repo_commits_elements_file', '/%(repo_name)s/commits_elements/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_commits_file', '/%(repo_name)s/commits/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + 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']); + pyroutes.register('repo_compare_select', '/%(repo_name)s/compare', ['repo_name']); + pyroutes.register('repo_create', '/_admin/repos/create', []); + pyroutes.register('repo_creating', '/%(repo_name)s/repo_creating', ['repo_name']); + pyroutes.register('repo_creating_check', '/%(repo_name)s/repo_creating_check', ['repo_name']); + pyroutes.register('repo_default_reviewers_data', '/%(repo_name)s/settings/review/default-reviewers', ['repo_name']); pyroutes.register('repo_edit_toggle_locking', '/%(repo_name)s/settings/toggle_locking', ['repo_name']); - pyroutes.register('edit_repo_remote', '/%(repo_name)s/settings/remote', ['repo_name']); - pyroutes.register('edit_repo_remote_pull', '/%(repo_name)s/settings/remote/pull', ['repo_name']); - pyroutes.register('edit_repo_statistics', '/%(repo_name)s/settings/statistics', ['repo_name']); - pyroutes.register('edit_repo_statistics_reset', '/%(repo_name)s/settings/statistics/update', ['repo_name']); - pyroutes.register('edit_repo_issuetracker', '/%(repo_name)s/settings/issue_trackers', ['repo_name']); - pyroutes.register('edit_repo_issuetracker_test', '/%(repo_name)s/settings/issue_trackers/test', ['repo_name']); - pyroutes.register('edit_repo_issuetracker_delete', '/%(repo_name)s/settings/issue_trackers/delete', ['repo_name']); - pyroutes.register('edit_repo_issuetracker_update', '/%(repo_name)s/settings/issue_trackers/update', ['repo_name']); - pyroutes.register('edit_repo_vcs', '/%(repo_name)s/settings/vcs', ['repo_name']); - pyroutes.register('edit_repo_vcs_update', '/%(repo_name)s/settings/vcs/update', ['repo_name']); - pyroutes.register('edit_repo_vcs_svn_pattern_delete', '/%(repo_name)s/settings/vcs/svn_pattern/delete', ['repo_name']); - pyroutes.register('repo_reviewers', '/%(repo_name)s/settings/review/rules', ['repo_name']); - pyroutes.register('repo_default_reviewers_data', '/%(repo_name)s/settings/review/default-reviewers', ['repo_name']); - pyroutes.register('edit_repo_strip', '/%(repo_name)s/settings/strip', ['repo_name']); - pyroutes.register('strip_check', '/%(repo_name)s/settings/strip_check', ['repo_name']); - pyroutes.register('strip_execute', '/%(repo_name)s/settings/strip_execute', ['repo_name']); - pyroutes.register('edit_repo_audit_logs', '/%(repo_name)s/settings/audit_logs', ['repo_name']); - pyroutes.register('rss_feed_home', '/%(repo_name)s/feed-rss', ['repo_name']); - pyroutes.register('atom_feed_home', '/%(repo_name)s/feed-atom', ['repo_name']); - pyroutes.register('rss_feed_home_old', '/%(repo_name)s/feed/rss', ['repo_name']); - pyroutes.register('atom_feed_home_old', '/%(repo_name)s/feed/atom', ['repo_name']); - pyroutes.register('repo_summary', '/%(repo_name)s', ['repo_name']); - pyroutes.register('repo_summary_slash', '/%(repo_name)s/', ['repo_name']); - pyroutes.register('edit_repo_group', '/%(repo_group_name)s/_edit', ['repo_group_name']); - pyroutes.register('edit_repo_group_advanced', '/%(repo_group_name)s/_settings/advanced', ['repo_group_name']); - pyroutes.register('edit_repo_group_advanced_delete', '/%(repo_group_name)s/_settings/advanced/delete', ['repo_group_name']); - pyroutes.register('edit_repo_group_perms', '/%(repo_group_name)s/_settings/permissions', ['repo_group_name']); - pyroutes.register('edit_repo_group_perms_update', '/%(repo_group_name)s/_settings/permissions/update', ['repo_group_name']); + pyroutes.register('repo_file_authors', '/%(repo_name)s/authors/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_file_download', '/%(repo_name)s/download/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_file_download:legacy', '/%(repo_name)s/rawfile/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_file_history', '/%(repo_name)s/history/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_file_raw', '/%(repo_name)s/raw/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_files', '/%(repo_name)s/files/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_files:annotated', '/%(repo_name)s/annotate/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_files:annotated_previous', '/%(repo_name)s/annotate-previous/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_files:default_commit', '/%(repo_name)s/files', ['repo_name']); + pyroutes.register('repo_files:default_path', '/%(repo_name)s/files/%(commit_id)s/', ['repo_name', 'commit_id']); + pyroutes.register('repo_files:rendered', '/%(repo_name)s/render/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_files_add_file', '/%(repo_name)s/add_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_files_check_head', '/%(repo_name)s/check_head/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_files_create_file', '/%(repo_name)s/create_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_files_delete_file', '/%(repo_name)s/delete_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_files_diff', '/%(repo_name)s/diff/%(f_path)s', ['repo_name', 'f_path']); + pyroutes.register('repo_files_diff_2way_redirect', '/%(repo_name)s/diff-2way/%(f_path)s', ['repo_name', 'f_path']); + pyroutes.register('repo_files_edit_file', '/%(repo_name)s/edit_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_files_nodelist', '/%(repo_name)s/nodelist/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_files_remove_file', '/%(repo_name)s/remove_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_files_update_file', '/%(repo_name)s/update_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_files_upload_file', '/%(repo_name)s/upload_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_fork_create', '/%(repo_name)s/fork/create', ['repo_name']); + pyroutes.register('repo_fork_new', '/%(repo_name)s/fork', ['repo_name']); + pyroutes.register('repo_forks_data', '/%(repo_name)s/forks/data', ['repo_name']); + pyroutes.register('repo_forks_show_all', '/%(repo_name)s/forks', ['repo_name']); + pyroutes.register('repo_group_create', '/_admin/repo_group/create', []); pyroutes.register('repo_group_home', '/%(repo_group_name)s', ['repo_group_name']); pyroutes.register('repo_group_home_slash', '/%(repo_group_name)s/', ['repo_group_name']); - pyroutes.register('user_group_members_data', '/_admin/user_groups/%(user_group_id)s/members', ['user_group_id']); - pyroutes.register('edit_user_group_perms_summary', '/_admin/user_groups/%(user_group_id)s/edit/permissions_summary', ['user_group_id']); - pyroutes.register('edit_user_group_perms_summary_json', '/_admin/user_groups/%(user_group_id)s/edit/permissions_summary/json', ['user_group_id']); - pyroutes.register('edit_user_group', '/_admin/user_groups/%(user_group_id)s/edit', ['user_group_id']); - pyroutes.register('user_groups_update', '/_admin/user_groups/%(user_group_id)s/update', ['user_group_id']); - pyroutes.register('edit_user_group_global_perms', '/_admin/user_groups/%(user_group_id)s/edit/global_permissions', ['user_group_id']); - pyroutes.register('edit_user_group_global_perms_update', '/_admin/user_groups/%(user_group_id)s/edit/global_permissions/update', ['user_group_id']); - pyroutes.register('edit_user_group_perms', '/_admin/user_groups/%(user_group_id)s/edit/permissions', ['user_group_id']); - pyroutes.register('edit_user_group_perms_update', '/_admin/user_groups/%(user_group_id)s/edit/permissions/update', ['user_group_id']); - pyroutes.register('edit_user_group_advanced', '/_admin/user_groups/%(user_group_id)s/edit/advanced', ['user_group_id']); - pyroutes.register('edit_user_group_advanced_sync', '/_admin/user_groups/%(user_group_id)s/edit/advanced/sync', ['user_group_id']); - pyroutes.register('user_groups_delete', '/_admin/user_groups/%(user_group_id)s/delete', ['user_group_id']); + pyroutes.register('repo_group_integrations_create', '/%(repo_group_name)s/_settings/integrations/%(integration)s/new', ['repo_group_name', 'integration']); + pyroutes.register('repo_group_integrations_edit', '/%(repo_group_name)s/_settings/integrations/%(integration)s/%(integration_id)s', ['repo_group_name', 'integration', 'integration_id']); + pyroutes.register('repo_group_integrations_home', '/%(repo_group_name)s/_settings/integrations', ['repo_group_name']); + pyroutes.register('repo_group_integrations_list', '/%(repo_group_name)s/_settings/integrations/%(integration)s', ['repo_group_name', 'integration']); + pyroutes.register('repo_group_integrations_new', '/%(repo_group_name)s/_settings/integrations/new', ['repo_group_name']); + pyroutes.register('repo_group_list_data', '/_repo_groups', []); + pyroutes.register('repo_group_new', '/_admin/repo_group/new', []); + pyroutes.register('repo_groups', '/_admin/repo_groups', []); + pyroutes.register('repo_groups_data', '/_admin/repo_groups_data', []); + pyroutes.register('repo_integrations_create', '/%(repo_name)s/settings/integrations/%(integration)s/new', ['repo_name', 'integration']); + pyroutes.register('repo_integrations_edit', '/%(repo_name)s/settings/integrations/%(integration)s/%(integration_id)s', ['repo_name', 'integration', 'integration_id']); + pyroutes.register('repo_integrations_home', '/%(repo_name)s/settings/integrations', ['repo_name']); + pyroutes.register('repo_integrations_list', '/%(repo_name)s/settings/integrations/%(integration)s', ['repo_name', 'integration']); + pyroutes.register('repo_integrations_new', '/%(repo_name)s/settings/integrations/new', ['repo_name']); + pyroutes.register('repo_list_data', '/_repos', []); + pyroutes.register('repo_new', '/_admin/repos/new', []); + pyroutes.register('repo_nodetree_full', '/%(repo_name)s/nodetree_full/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']); + pyroutes.register('repo_nodetree_full:default_path', '/%(repo_name)s/nodetree_full/%(commit_id)s/', ['repo_name', 'commit_id']); + pyroutes.register('repo_refs_changelog_data', '/%(repo_name)s/refs-data-changelog', ['repo_name']); + pyroutes.register('repo_refs_data', '/%(repo_name)s/refs-data', ['repo_name']); + pyroutes.register('repo_reviewers', '/%(repo_name)s/settings/review/rules', ['repo_name']); + pyroutes.register('repo_reviewers_review_rule_delete', '/%(repo_name)s/settings/review/rules/%(rule_id)s/delete', ['repo_name', 'rule_id']); + pyroutes.register('repo_reviewers_review_rule_edit', '/%(repo_name)s/settings/review/rules/%(rule_id)s', ['repo_name', 'rule_id']); + pyroutes.register('repo_reviewers_review_rule_new', '/%(repo_name)s/settings/review/rules/new', ['repo_name']); + pyroutes.register('repo_stats', '/%(repo_name)s/repo_stats/%(commit_id)s', ['repo_name', 'commit_id']); + pyroutes.register('repo_summary', '/%(repo_name)s', ['repo_name']); + pyroutes.register('repo_summary_commits', '/%(repo_name)s/summary-commits', ['repo_name']); + pyroutes.register('repo_summary_explicit', '/%(repo_name)s/summary', ['repo_name']); + pyroutes.register('repo_summary_slash', '/%(repo_name)s/', ['repo_name']); + pyroutes.register('repos', '/_admin/repos', []); + pyroutes.register('repos_data', '/_admin/repos_data', []); + pyroutes.register('reset_password', '/_admin/password_reset', []); + pyroutes.register('reset_password_confirmation', '/_admin/password_reset_confirmation', []); + pyroutes.register('robots', '/robots.txt', []); + pyroutes.register('rss_feed_home', '/%(repo_name)s/feed-rss', ['repo_name']); + pyroutes.register('rss_feed_home_old', '/%(repo_name)s/feed/rss', ['repo_name']); pyroutes.register('search', '/_admin/search', []); pyroutes.register('search_repo', '/%(repo_name)s/_search', ['repo_name']); pyroutes.register('search_repo_alt', '/%(repo_name)s/search', ['repo_name']); pyroutes.register('search_repo_group', '/%(repo_group_name)s/_search', ['repo_group_name']); - pyroutes.register('user_profile', '/_profiles/%(username)s', ['username']); + pyroutes.register('store_user_session_value', '/_store_session_attr', []); + pyroutes.register('strip_check', '/%(repo_name)s/settings/strip_check', ['repo_name']); + pyroutes.register('strip_execute', '/%(repo_name)s/settings/strip_execute', ['repo_name']); + pyroutes.register('tags_home', '/%(repo_name)s/tags', ['repo_name']); + pyroutes.register('toggle_following', '/_admin/toggle_following', []); + pyroutes.register('upload_file', '/_file_store/upload', []); + pyroutes.register('user_autocomplete_data', '/_users', []); + pyroutes.register('user_create_personal_repo_group', '/_admin/users/%(user_id)s/create_repo_group', ['user_id']); + pyroutes.register('user_delete', '/_admin/users/%(user_id)s/delete', ['user_id']); + pyroutes.register('user_disable_force_password_reset', '/_admin/users/%(user_id)s/password_reset_disable', ['user_id']); + pyroutes.register('user_edit', '/_admin/users/%(user_id)s/edit', ['user_id']); + pyroutes.register('user_edit_advanced', '/_admin/users/%(user_id)s/edit/advanced', ['user_id']); + pyroutes.register('user_edit_global_perms', '/_admin/users/%(user_id)s/edit/global_permissions', ['user_id']); + pyroutes.register('user_edit_global_perms_update', '/_admin/users/%(user_id)s/edit/global_permissions/update', ['user_id']); + pyroutes.register('user_enable_force_password_reset', '/_admin/users/%(user_id)s/password_reset_enable', ['user_id']); + pyroutes.register('user_group_autocomplete_data', '/_user_groups', []); + pyroutes.register('user_group_members_data', '/_admin/user_groups/%(user_group_id)s/members', ['user_group_id']); pyroutes.register('user_group_profile', '/_profile_user_group/%(user_group_name)s', ['user_group_name']); - pyroutes.register('my_account_profile', '/_admin/my_account/profile', []); - pyroutes.register('my_account_edit', '/_admin/my_account/edit', []); - pyroutes.register('my_account_update', '/_admin/my_account/update', []); - pyroutes.register('my_account_password', '/_admin/my_account/password', []); - pyroutes.register('my_account_password_update', '/_admin/my_account/password/update', []); - pyroutes.register('my_account_auth_tokens_view', '/_admin/my_account/auth_tokens/view', []); - pyroutes.register('my_account_auth_tokens_delete', '/_admin/my_account/auth_tokens/delete', []); - pyroutes.register('my_account_ssh_keys', '/_admin/my_account/ssh_keys', []); - pyroutes.register('my_account_ssh_keys_generate', '/_admin/my_account/ssh_keys/generate', []); - pyroutes.register('my_account_ssh_keys_add', '/_admin/my_account/ssh_keys/new', []); - pyroutes.register('my_account_ssh_keys_delete', '/_admin/my_account/ssh_keys/delete', []); - pyroutes.register('my_account_user_group_membership', '/_admin/my_account/user_group_membership', []); - pyroutes.register('my_account_emails', '/_admin/my_account/emails', []); - pyroutes.register('my_account_emails_add', '/_admin/my_account/emails/new', []); - pyroutes.register('my_account_emails_delete', '/_admin/my_account/emails/delete', []); - pyroutes.register('my_account_repos', '/_admin/my_account/repos', []); - pyroutes.register('my_account_watched', '/_admin/my_account/watched', []); - pyroutes.register('my_account_bookmarks', '/_admin/my_account/bookmarks', []); - pyroutes.register('my_account_bookmarks_update', '/_admin/my_account/bookmarks/update', []); - pyroutes.register('my_account_goto_bookmark', '/_admin/my_account/bookmark/%(bookmark_id)s', ['bookmark_id']); - pyroutes.register('my_account_perms', '/_admin/my_account/perms', []); - pyroutes.register('my_account_notifications', '/_admin/my_account/notifications', []); - pyroutes.register('my_account_notifications_toggle_visibility', '/_admin/my_account/toggle_visibility', []); - pyroutes.register('my_account_pullrequests', '/_admin/my_account/pull_requests', []); - pyroutes.register('my_account_pullrequests_data', '/_admin/my_account/pull_requests/data', []); - pyroutes.register('notifications_show_all', '/_admin/notifications', []); - pyroutes.register('notifications_mark_all_read', '/_admin/notifications/mark_all_read', []); - pyroutes.register('notifications_show', '/_admin/notifications/%(notification_id)s', ['notification_id']); - pyroutes.register('notifications_update', '/_admin/notifications/%(notification_id)s/update', ['notification_id']); - pyroutes.register('notifications_delete', '/_admin/notifications/%(notification_id)s/delete', ['notification_id']); - pyroutes.register('my_account_notifications_test_channelstream', '/_admin/my_account/test_channelstream', []); - pyroutes.register('gists_show', '/_admin/gists', []); - pyroutes.register('gists_new', '/_admin/gists/new', []); - pyroutes.register('gists_create', '/_admin/gists/create', []); - pyroutes.register('gist_show', '/_admin/gists/%(gist_id)s', ['gist_id']); - pyroutes.register('gist_delete', '/_admin/gists/%(gist_id)s/delete', ['gist_id']); - pyroutes.register('gist_edit', '/_admin/gists/%(gist_id)s/edit', ['gist_id']); - pyroutes.register('gist_edit_check_revision', '/_admin/gists/%(gist_id)s/edit/check_revision', ['gist_id']); - pyroutes.register('gist_update', '/_admin/gists/%(gist_id)s/update', ['gist_id']); - pyroutes.register('gist_show_rev', '/_admin/gists/%(gist_id)s/%(revision)s', ['gist_id', 'revision']); - pyroutes.register('gist_show_formatted', '/_admin/gists/%(gist_id)s/%(revision)s/%(format)s', ['gist_id', 'revision', 'format']); - pyroutes.register('gist_show_formatted_path', '/_admin/gists/%(gist_id)s/%(revision)s/%(format)s/%(f_path)s', ['gist_id', 'revision', 'format', 'f_path']); - pyroutes.register('debug_style_home', '/_admin/debug_style', []); - pyroutes.register('debug_style_email', '/_admin/debug_style/email/%(email_id)s', ['email_id']); - pyroutes.register('debug_style_email_plain_rendered', '/_admin/debug_style/email-rendered/%(email_id)s', ['email_id']); - pyroutes.register('debug_style_template', '/_admin/debug_style/t/%(t_path)s', ['t_path']); - pyroutes.register('apiv2', '/_admin/api', []); - pyroutes.register('admin_settings_license', '/_admin/settings/license', []); - pyroutes.register('admin_settings_license_unlock', '/_admin/settings/license_unlock', []); - pyroutes.register('login', '/_admin/login', []); - pyroutes.register('register', '/_admin/register', []); - pyroutes.register('repo_reviewers_review_rule_new', '/%(repo_name)s/settings/review/rules/new', ['repo_name']); - pyroutes.register('repo_reviewers_review_rule_edit', '/%(repo_name)s/settings/review/rules/%(rule_id)s', ['repo_name', 'rule_id']); - pyroutes.register('repo_reviewers_review_rule_delete', '/%(repo_name)s/settings/review/rules/%(rule_id)s/delete', ['repo_name', 'rule_id']); - pyroutes.register('plugin_admin_chat', '/_admin/plugin_admin_chat/%(action)s', ['action']); - pyroutes.register('edit_user_auth_tokens', '/_admin/users/%(user_id)s/edit/auth_tokens', ['user_id']); - pyroutes.register('edit_user_auth_tokens_add', '/_admin/users/%(user_id)s/edit/auth_tokens/new', ['user_id']); - pyroutes.register('admin_settings_scheduler_show_tasks', '/_admin/settings/scheduler/_tasks', []); - pyroutes.register('admin_settings_scheduler_show_all', '/_admin/settings/scheduler', []); - pyroutes.register('admin_settings_scheduler_new', '/_admin/settings/scheduler/new', []); - pyroutes.register('admin_settings_scheduler_create', '/_admin/settings/scheduler/create', []); - pyroutes.register('admin_settings_scheduler_edit', '/_admin/settings/scheduler/%(schedule_id)s', ['schedule_id']); - pyroutes.register('admin_settings_scheduler_update', '/_admin/settings/scheduler/%(schedule_id)s/update', ['schedule_id']); - pyroutes.register('admin_settings_scheduler_delete', '/_admin/settings/scheduler/%(schedule_id)s/delete', ['schedule_id']); - pyroutes.register('admin_settings_scheduler_execute', '/_admin/settings/scheduler/%(schedule_id)s/execute', ['schedule_id']); - pyroutes.register('admin_settings_automation', '/_admin/settings/automation', []); - pyroutes.register('admin_settings_automation_update', '/_admin/settings/automation/%(entry_id)s/update', ['entry_id']); - pyroutes.register('admin_permissions_branch', '/_admin/permissions/branch', []); - pyroutes.register('admin_permissions_branch_update', '/_admin/permissions/branch/update', []); - pyroutes.register('my_account_auth_tokens', '/_admin/my_account/auth_tokens', []); - pyroutes.register('my_account_auth_tokens_add', '/_admin/my_account/auth_tokens/new', []); - pyroutes.register('my_account_external_identity', '/_admin/my_account/external-identity', []); - pyroutes.register('my_account_external_identity_delete', '/_admin/my_account/external-identity/delete', []); - pyroutes.register('pullrequest_draft_comments_submit', '/%(repo_name)s/pull-request/%(pull_request_id)s/draft_comments_submit', ['repo_name', 'pull_request_id']); - pyroutes.register('commit_draft_comments_submit', '/%(repo_name)s/changeset/%(commit_id)s/draft_comments_submit', ['repo_name', 'commit_id']); - pyroutes.register('repo_artifacts_list', '/%(repo_name)s/artifacts', ['repo_name']); - pyroutes.register('repo_artifacts_data', '/%(repo_name)s/artifacts_data', ['repo_name']); - pyroutes.register('repo_artifacts_new', '/%(repo_name)s/artifacts/new', ['repo_name']); - pyroutes.register('repo_artifacts_get', '/%(repo_name)s/artifacts/download/%(uid)s', ['repo_name', 'uid']); - pyroutes.register('repo_artifacts_store', '/%(repo_name)s/artifacts/store', ['repo_name']); - pyroutes.register('repo_artifacts_info', '/%(repo_name)s/artifacts/info/%(uid)s', ['repo_name', 'uid']); - pyroutes.register('repo_artifacts_delete', '/%(repo_name)s/artifacts/delete/%(uid)s', ['repo_name', 'uid']); - pyroutes.register('repo_artifacts_update', '/%(repo_name)s/artifacts/update/%(uid)s', ['repo_name', 'uid']); - pyroutes.register('repo_automation', '/%(repo_name)s/settings/automation', ['repo_name']); - pyroutes.register('repo_automation_update', '/%(repo_name)s/settings/automation/%(entry_id)s/update', ['repo_name', 'entry_id']); - pyroutes.register('edit_repo_remote_push', '/%(repo_name)s/settings/remote/push', ['repo_name']); - pyroutes.register('edit_repo_perms_branch', '/%(repo_name)s/settings/branch_permissions', ['repo_name']); - pyroutes.register('edit_repo_perms_branch_delete', '/%(repo_name)s/settings/branch_permissions/%(rule_id)s/delete', ['repo_name', 'rule_id']); + pyroutes.register('user_groups', '/_admin/user_groups', []); + pyroutes.register('user_groups_create', '/_admin/user_groups/create', []); + pyroutes.register('user_groups_data', '/_admin/user_groups_data', []); + pyroutes.register('user_groups_delete', '/_admin/user_groups/%(user_group_id)s/delete', ['user_group_id']); + pyroutes.register('user_groups_new', '/_admin/user_groups/new', []); + pyroutes.register('user_groups_update', '/_admin/user_groups/%(user_group_id)s/update', ['user_group_id']); + pyroutes.register('user_notice_dismiss', '/_admin/users/%(user_id)s/notice_dismiss', ['user_id']); + pyroutes.register('user_profile', '/_profiles/%(username)s', ['username']); + pyroutes.register('user_update', '/_admin/users/%(user_id)s/update', ['user_id']); + pyroutes.register('users', '/_admin/users', []); + pyroutes.register('users_create', '/_admin/users/create', []); + pyroutes.register('users_data', '/_admin/users_data', []); + pyroutes.register('users_new', '/_admin/users/new', []); } diff --git a/rhodecode/public/js/src/rhodecode.js b/rhodecode/public/js/src/rhodecode.js --- a/rhodecode/public/js/src/rhodecode.js +++ b/rhodecode/public/js/src/rhodecode.js @@ -618,7 +618,7 @@ function scrollToElement(element, percen offsetScroll($line, 70); } if (!$line.hasClass('comment-outdated') && result.remainder === '/ReplyToComment') { - $line.nextAll('.cb-comment-add-button').trigger('click'); + $line.parent().find('.cb-comment-add-button').trigger('click'); } } @@ -714,3 +714,11 @@ var getUserSessionAttr = function(key) { } return null } + +window.scrollDown = function () { + $(document).scrollTop($(document).height()); +} + +window.scrollUp = function scrollUp() { + $(window).scrollTop(0); +} diff --git a/rhodecode/public/js/src/rhodecode/comments.js b/rhodecode/public/js/src/rhodecode/comments.js --- a/rhodecode/public/js/src/rhodecode/comments.js +++ b/rhodecode/public/js/src/rhodecode/comments.js @@ -371,7 +371,7 @@ var _submitAjaxPOST = function(url, post location.reload(true); } else { // inject newly created comments, json_data is {: {}} - self.attachGeneralComment(json_data) + Rhodecode.comments.attachGeneralComment(json_data) self.resetCommentFormState(); timeagoActivate(); @@ -1462,10 +1462,11 @@ var CommentsController = function() { var comment = $('#comment-'+commentId); var commentData = comment.data(); + console.log(commentData); + if (commentData.commentInline) { - var f_path = commentData.fPath; - var line_no = commentData.lineNo; - //TODO check this if we need to give f_path/line_no + var f_path = commentData.commentFPath; + var line_no = commentData.commentLineNo; this.createComment(comment, f_path, line_no, commentId) } else { this.createGeneralComment('general', "$placeholder", commentId) diff --git a/rhodecode/public/js/src/rhodecode/pullrequests.js b/rhodecode/public/js/src/rhodecode/pullrequests.js --- a/rhodecode/public/js/src/rhodecode/pullrequests.js +++ b/rhodecode/public/js/src/rhodecode/pullrequests.js @@ -269,8 +269,8 @@ window.ReviewersController = function () 'source_ref': sourceRef[2], 'target_repo': targetRepo, 'target_ref': targetRef[2], - 'target_ref_type': sourceRef[0], - 'target_ref_name': sourceRef[1] + 'target_ref_type': targetRef[0], + 'target_ref_name': targetRef[1] }); self.currentRequest = $.ajax({ @@ -397,6 +397,7 @@ window.ReviewersController = function () 'user_group': reviewer_obj.user_group, 'create': true, 'rule_show': true, + 'rhodecode_user': templateContext.rhodecode_user }) if (role === self.ROLE_REVIEWER) { @@ -820,7 +821,8 @@ window.ReviewersPanel = { 'review_status': member.review_status, 'review_status_label': member.review_status_label, 'user_group': member.user_group, - 'create': false + 'create': false, + 'rhodecode_user': templateContext.rhodecode_user }); $(self.controller.$reviewMembers.selector).append(entry) @@ -915,7 +917,8 @@ window.ObserversPanel = { 'review_status': member.review_status, 'review_status_label': member.review_status_label, 'user_group': member.user_group, - 'create': false + 'create': false, + 'rhodecode_user': templateContext.rhodecode_user }); $(self.controller.$observerMembers.selector).append(entry) diff --git a/rhodecode/subscribers.py b/rhodecode/subscribers.py --- a/rhodecode/subscribers.py +++ b/rhodecode/subscribers.py @@ -18,6 +18,8 @@ # RhodeCode Enterprise Edition, including its added features, Support services, # and proprietary license terms, please see https://rhodecode.com/licenses/ import io +import shlex + import math import re import os @@ -231,7 +233,7 @@ def write_usage_data(event): # write every 6th hour if age_in_min and age_in_min < 60 * 6: - log.debug('Usage file created %s minutes ago, skipping (threashold: %s)...', + log.debug('Usage file created %s minutes ago, skipping (threshold: %s minutes)...', age_in_min, 60 * 6) return @@ -357,10 +359,16 @@ class AsyncSubscriber(Subscriber): class AsyncSubprocessSubscriber(AsyncSubscriber): """ Subscriber that uses the subprocess32 module to execute a command if an - event is received. Events are handled asynchronously. + event is received. Events are handled asynchronously:: + + subscriber = AsyncSubprocessSubscriber('ls -la', timeout=10) + subscriber(dummyEvent) # running __call__(event) + """ def __init__(self, cmd, timeout=None): + if not isinstance(cmd, (list, tuple)): + cmd = shlex.split(cmd) super(AsyncSubprocessSubscriber, self).__init__() self._cmd = cmd self._timeout = timeout @@ -384,6 +392,6 @@ class AsyncSubprocessSubscriber(AsyncSub log.exception('Error while executing command.') if e.output: log.error('Command output: %s', e.output) - except: + except Exception: log.exception( 'Exception while executing command %s.', cmd) diff --git a/rhodecode/templates/admin/repos/repo_edit_settings.mako b/rhodecode/templates/admin/repos/repo_edit_settings.mako --- a/rhodecode/templates/admin/repos/repo_edit_settings.mako +++ b/rhodecode/templates/admin/repos/repo_edit_settings.mako @@ -235,13 +235,14 @@ %for field in c.repo_fields:
- +
${h.text(field.field_key_prefixed, field.field_value, class_='medium')} - %if field.field_desc: - ${field.field_desc} - %endif + + key: ${field.field_key}; + ${field.field_desc} +
%endfor diff --git a/rhodecode/templates/changeset/changeset_file_comment.mako b/rhodecode/templates/changeset/changeset_file_comment.mako --- a/rhodecode/templates/changeset/changeset_file_comment.mako +++ b/rhodecode/templates/changeset/changeset_file_comment.mako @@ -510,9 +510,9 @@ % if form_type == 'inline': % if c.rhodecode_edition_id == 'EE': ## Disable the button for CE, the "real" validation is in the backend code anyway - + % else: - + % endif % endif @@ -534,9 +534,9 @@ % if form_type == 'inline': - + + ${_('dismiss')} + % endif diff --git a/rhodecode/templates/codeblocks/diffs.mako b/rhodecode/templates/codeblocks/diffs.mako --- a/rhodecode/templates/codeblocks/diffs.mako +++ b/rhodecode/templates/codeblocks/diffs.mako @@ -645,12 +645,18 @@ return '%s_%s_%i' % (h.md5_safe(commit+f
+ % if c.rhodecode_user.username != h.DEFAULT_USER: ${base.gravatar(c.rhodecode_user.email, 20, tooltip=True, user=c.rhodecode_user)} + % endif
+
+ % if c.rhodecode_user.username != h.DEFAULT_USER: ## initial reply button, some JS logic can append here a FORM to leave a first comment. + % endif
+ ##% endif
@@ -910,6 +916,16 @@ def get_comments_for(diff_type, comments