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 @@ -312,6 +312,11 @@ def includeme(config): pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete', repo_route=True, repo_accepted_types=['hg', 'git']) + # Artifacts, (EE feature) + config.add_route( + name='repo_artifacts_list', + pattern='/{repo_name:.*?[^/]}/artifacts', repo_route=True) + # Settings config.add_route( name='edit_repo', diff --git a/rhodecode/apps/repository/views/repo_artifacts.py b/rhodecode/apps/repository/views/repo_artifacts.py new file mode 100644 --- /dev/null +++ b/rhodecode/apps/repository/views/repo_artifacts.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- + +# Copyright (C) 2011-2019 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 pyramid.view import view_config + +from rhodecode.apps._base import RepoAppView +from rhodecode.lib.auth import ( + LoginRequired, HasRepoPermissionAnyDecorator) + +log = logging.getLogger(__name__) + + +class RepoArtifactsView(RepoAppView): + + def load_default_context(self): + c = self._get_local_tmpl_context(include_app_defaults=True) + c.rhodecode_repo = self.rhodecode_vcs_repo + return c + + @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' + return self._get_template_context(c) diff --git a/rhodecode/templates/artifacts/artifact_list.mako b/rhodecode/templates/artifacts/artifact_list.mako new file mode 100644 --- /dev/null +++ b/rhodecode/templates/artifacts/artifact_list.mako @@ -0,0 +1,28 @@ +## -*- coding: utf-8 -*- +<%inherit file="/base/base.mako"/> + +<%def name="title()"> + ${_('{} Artifacts').format(c.repo_name)} + %if c.rhodecode_name: + · ${h.branding(c.rhodecode_name)} + %endif + + +<%def name="breadcrumbs_links()"> + +<%def name="menu_bar_nav()"> + ${self.menu_items(active='repositories')} + + +<%def name="menu_bar_subnav()"> + ${self.repo_menu(active='artifacts')} + + +<%def name="main()"> +
+ +

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

+ +
+ + diff --git a/rhodecode/templates/base/base.mako b/rhodecode/templates/base/base.mako --- a/rhodecode/templates/base/base.mako +++ b/rhodecode/templates/base/base.mako @@ -301,6 +301,8 @@ %endif +
  • + %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
  • %endif