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 @@ -27,6 +27,7 @@ def admin_routes(config): Admin prefixed routes """ from rhodecode.apps.admin.views.audit_logs import AdminAuditLogsView + from rhodecode.apps.admin.views.artifacts import AdminArtifactsView 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 @@ -60,6 +61,34 @@ def admin_routes(config): route_name='admin_audit_log_entry', request_method='GET', renderer='rhodecode:templates/admin/admin_audit_log_entry.mako') + # Artifacts EE feature + config.add_route( + 'admin_artifacts', + pattern=ADMIN_PREFIX + '/artifacts') + config.add_route( + 'admin_artifacts_show_all', + pattern=ADMIN_PREFIX + '/artifacts') + config.add_view( + AdminArtifactsView, + attr='artifacts', + route_name='admin_artifacts', request_method='GET', + renderer='rhodecode:templates/admin/artifacts/artifacts.mako') + config.add_view( + AdminArtifactsView, + attr='artifacts', + route_name='admin_artifacts_show_all', request_method='GET', + renderer='rhodecode:templates/admin/artifacts/artifacts.mako') + # EE views + config.add_route( + name='admin_artifacts_show_info', + pattern=ADMIN_PREFIX + '/artifacts/{uid}') + config.add_route( + name='admin_artifacts_delete', + pattern=ADMIN_PREFIX + '/artifacts/{uid}/delete') + config.add_route( + name='admin_artifacts_update', + pattern=ADMIN_PREFIX + '/artifacts/{uid}/update') + config.add_route( name='admin_settings_open_source', pattern='/settings/open_source') diff --git a/rhodecode/apps/admin/views/artifacts.py b/rhodecode/apps/admin/views/artifacts.py new file mode 100644 --- /dev/null +++ b/rhodecode/apps/admin/views/artifacts.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- + +# Copyright (C) 2016-2020 RhodeCode GmbH +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License, version 3 +# (only), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +# This program is dual-licensed. If you wish to learn more about the +# RhodeCode Enterprise Edition, including its added features, Support services, +# and proprietary license terms, please see https://rhodecode.com/licenses/ + +import logging + +from rhodecode.apps._base import BaseAppView, DataGridAppView +from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator + +log = logging.getLogger(__name__) + + +class AdminArtifactsView(BaseAppView, DataGridAppView): + + def load_default_context(self): + c = self._get_local_tmpl_context() + return c + + @LoginRequired() + @HasPermissionAllDecorator('hg.admin') + def artifacts(self): + c = self.load_default_context() + c.active = 'artifacts' + return self._get_template_context(c) diff --git a/rhodecode/templates/admin/artifacts/artifacts.mako b/rhodecode/templates/admin/artifacts/artifacts.mako new file mode 100644 --- /dev/null +++ b/rhodecode/templates/admin/artifacts/artifacts.mako @@ -0,0 +1,39 @@ +## -*- coding: utf-8 -*- +<%inherit file="/base/base.mako"/> + +<%def name="title()"> + ${_('Artifacts Admin')} + %if c.rhodecode_name: + · ${h.branding(c.rhodecode_name)} + %endif + + +<%def name="breadcrumbs_links()"> + +<%def name="menu_bar_nav()"> + ${self.menu_items(active='admin')} + + +<%def name="menu_bar_subnav()"> + ${self.admin_menu(active='artifacts')} + + +<%def name="main()"> + +
+ +
+
+

${_('Artifacts Administration.')}

+
+
+

${_('This feature is available in RhodeCode EE edition only. Contact {sales_email} to obtain a trial license.').format(sales_email='sales@rhodecode.com')|n}

+ +
+
+ +
+ + + +