Show More
@@ -0,0 +1,46 b'' | |||||
|
1 | # -*- coding: utf-8 -*- | |||
|
2 | ||||
|
3 | # Copyright (C) 2016-2018 RhodeCode GmbH | |||
|
4 | # | |||
|
5 | # This program is free software: you can redistribute it and/or modify | |||
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |||
|
7 | # (only), as published by the Free Software Foundation. | |||
|
8 | # | |||
|
9 | # This program is distributed in the hope that it will be useful, | |||
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
|
12 | # GNU General Public License for more details. | |||
|
13 | # | |||
|
14 | # You should have received a copy of the GNU Affero General Public License | |||
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
|
16 | # | |||
|
17 | # This program is dual-licensed. If you wish to learn more about the | |||
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |||
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |||
|
20 | ||||
|
21 | import logging | |||
|
22 | ||||
|
23 | from pyramid.view import view_config | |||
|
24 | ||||
|
25 | from rhodecode.apps._base import RepoAppView | |||
|
26 | from rhodecode.apps.repository.utils import get_default_reviewers_data | |||
|
27 | from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator | |||
|
28 | ||||
|
29 | log = logging.getLogger(__name__) | |||
|
30 | ||||
|
31 | ||||
|
32 | class RepoAutomationView(RepoAppView): | |||
|
33 | def load_default_context(self): | |||
|
34 | c = self._get_local_tmpl_context() | |||
|
35 | return c | |||
|
36 | ||||
|
37 | @LoginRequired() | |||
|
38 | @HasRepoPermissionAnyDecorator('repository.admin') | |||
|
39 | @view_config( | |||
|
40 | route_name='repo_automation', request_method='GET', | |||
|
41 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |||
|
42 | def repo_automation(self): | |||
|
43 | c = self.load_default_context() | |||
|
44 | c.active = 'automation' | |||
|
45 | ||||
|
46 | return self._get_template_context(c) |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
@@ -0,0 +1,9 b'' | |||||
|
1 | <div class="panel panel-default"> | |||
|
2 | <div class="panel-heading"> | |||
|
3 | <h3 class="panel-title">${_('Repo Automation')}</h3> | |||
|
4 | </div> | |||
|
5 | <div class="panel-body"> | |||
|
6 | <h4>${_('This feature is available in RhodeCode EE edition only. Contact {sales_email} to obtain a trial license.').format(sales_email='<a href="mailto:sales@rhodecode.com">sales@rhodecode.com</a>')|n}</h4> | |||
|
7 | <img style="width: 100%; height: 100%" src="${h.asset('images/ee_features/repo_automation.png')}"/> | |||
|
8 | </div> | |||
|
9 | </div> |
@@ -421,6 +421,11 b' def includeme(config):' | |||||
421 | name='repo_default_reviewers_data', |
|
421 | name='repo_default_reviewers_data', | |
422 | pattern='/{repo_name:.*?[^/]}/settings/review/default-reviewers', repo_route=True) |
|
422 | pattern='/{repo_name:.*?[^/]}/settings/review/default-reviewers', repo_route=True) | |
423 |
|
423 | |||
|
424 | # Repo Automation (EE feature) | |||
|
425 | config.add_route( | |||
|
426 | name='repo_automation', | |||
|
427 | pattern='/{repo_name:.*?[^/]}/settings/automation', repo_route=True) | |||
|
428 | ||||
424 | # Strip |
|
429 | # Strip | |
425 | config.add_route( |
|
430 | config.add_route( | |
426 | name='edit_repo_strip', |
|
431 | name='edit_repo_strip', |
@@ -244,6 +244,7 b' function registerRCRoutes() {' | |||||
244 | pyroutes.register('edit_repo_vcs_svn_pattern_delete', '/%(repo_name)s/settings/vcs/svn_pattern/delete', ['repo_name']); |
|
244 | pyroutes.register('edit_repo_vcs_svn_pattern_delete', '/%(repo_name)s/settings/vcs/svn_pattern/delete', ['repo_name']); | |
245 | pyroutes.register('repo_reviewers', '/%(repo_name)s/settings/review/rules', ['repo_name']); |
|
245 | pyroutes.register('repo_reviewers', '/%(repo_name)s/settings/review/rules', ['repo_name']); | |
246 | pyroutes.register('repo_default_reviewers_data', '/%(repo_name)s/settings/review/default-reviewers', ['repo_name']); |
|
246 | pyroutes.register('repo_default_reviewers_data', '/%(repo_name)s/settings/review/default-reviewers', ['repo_name']); | |
|
247 | pyroutes.register('repo_automation', '/%(repo_name)s/settings/automation', ['repo_name']); | |||
247 | pyroutes.register('edit_repo_strip', '/%(repo_name)s/settings/strip', ['repo_name']); |
|
248 | pyroutes.register('edit_repo_strip', '/%(repo_name)s/settings/strip', ['repo_name']); | |
248 | pyroutes.register('strip_check', '/%(repo_name)s/settings/strip_check', ['repo_name']); |
|
249 | pyroutes.register('strip_check', '/%(repo_name)s/settings/strip_check', ['repo_name']); | |
249 | pyroutes.register('strip_execute', '/%(repo_name)s/settings/strip_execute', ['repo_name']); |
|
250 | pyroutes.register('strip_execute', '/%(repo_name)s/settings/strip_execute', ['repo_name']); |
@@ -79,6 +79,9 b'' | |||||
79 | <a href="${h.route_path('repo_reviewers', repo_name=c.repo_name)}">${_('Reviewer Rules')}</a> |
|
79 | <a href="${h.route_path('repo_reviewers', repo_name=c.repo_name)}">${_('Reviewer Rules')}</a> | |
80 | </li> |
|
80 | </li> | |
81 | %endif |
|
81 | %endif | |
|
82 | <li class="${'active' if c.active=='automation' else ''}"> | |||
|
83 | <a href="${h.route_path('repo_automation', repo_name=c.repo_name)}">${_('Automation')}</a> | |||
|
84 | </li> | |||
82 | <li class="${'active' if c.active=='maintenance' else ''}"> |
|
85 | <li class="${'active' if c.active=='maintenance' else ''}"> | |
83 | <a href="${h.route_path('edit_repo_maintenance', repo_name=c.repo_name)}">${_('Maintenance')}</a> |
|
86 | <a href="${h.route_path('edit_repo_maintenance', repo_name=c.repo_name)}">${_('Maintenance')}</a> | |
84 | </li> |
|
87 | </li> |
General Comments 0
You need to be logged in to leave comments.
Login now