##// END OF EJS Templates
repo-reviewers: expose a default placeholder on CE edition....
marcink -
r1725:d7c1b491 default
parent child Browse files
Show More
@@ -0,0 +1,51 b''
1 # -*- coding: utf-8 -*-
2
3 # Copyright (C) 2016-2017 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.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
27
28 log = logging.getLogger(__name__)
29
30
31 class RepoReviewRulesView(RepoAppView):
32 def load_default_context(self):
33 c = self._get_local_tmpl_context()
34
35 # TODO(marcink): remove repo_info and use c.rhodecode_db_repo instead
36 c.repo_info = self.db_repo
37
38 self._register_global_c(c)
39 return c
40
41 @LoginRequired()
42 @HasRepoPermissionAnyDecorator('repository.admin')
43 @view_config(
44 route_name='repo_reviewers', request_method='GET',
45 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
46 def repo_review_rules(self):
47 c = self.load_default_context()
48 c.active = 'reviewers'
49
50 return self._get_template_context(c)
51
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">${_('Default Reviewer Rules')}</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/default_reviewers.png')}"/>
8 </div>
9 </div>
@@ -31,6 +31,11 b' def includeme(config):'
31 name='edit_repo_caches',
31 name='edit_repo_caches',
32 pattern='/{repo_name:.*?[^/]}/settings/caches', repo_route=True)
32 pattern='/{repo_name:.*?[^/]}/settings/caches', repo_route=True)
33
33
34 # Repo Review Rules
35 config.add_route(
36 name='repo_reviewers',
37 pattern='/{repo_name:.*?[^/]}/settings/review/rules', repo_route=True)
38
34 # Maintenance
39 # Maintenance
35 config.add_route(
40 config.add_route(
36 name='repo_maintenance',
41 name='repo_maintenance',
@@ -99,6 +99,7 b' function registerRCRoutes() {'
99 pyroutes.register('goto_switcher_data', '/_goto_data', []);
99 pyroutes.register('goto_switcher_data', '/_goto_data', []);
100 pyroutes.register('edit_repo', '/%(repo_name)s/settings', ['repo_name']);
100 pyroutes.register('edit_repo', '/%(repo_name)s/settings', ['repo_name']);
101 pyroutes.register('edit_repo_caches', '/%(repo_name)s/settings/caches', ['repo_name']);
101 pyroutes.register('edit_repo_caches', '/%(repo_name)s/settings/caches', ['repo_name']);
102 pyroutes.register('repo_reviewers', '/%(repo_name)s/settings/review/rules', ['repo_name']);
102 pyroutes.register('repo_maintenance', '/%(repo_name)s/maintenance', ['repo_name']);
103 pyroutes.register('repo_maintenance', '/%(repo_name)s/maintenance', ['repo_name']);
103 pyroutes.register('repo_maintenance_execute', '/%(repo_name)s/maintenance/execute', ['repo_name']);
104 pyroutes.register('repo_maintenance_execute', '/%(repo_name)s/maintenance/execute', ['repo_name']);
104 pyroutes.register('strip', '/%(repo_name)s/strip', ['repo_name']);
105 pyroutes.register('strip', '/%(repo_name)s/strip', ['repo_name']);
@@ -36,7 +36,6 b''
36 </div>
36 </div>
37
37
38 <div class="sidebar-col-wrapper scw-small">
38 <div class="sidebar-col-wrapper scw-small">
39 ##main
40 <div class="sidebar">
39 <div class="sidebar">
41 <ul class="nav nav-pills nav-stacked">
40 <ul class="nav nav-pills nav-stacked">
42 <li class="${'active' if c.active=='settings' else ''}">
41 <li class="${'active' if c.active=='settings' else ''}">
@@ -71,28 +70,18 b''
71 <li class="${'active' if c.active=='integrations' else ''}">
70 <li class="${'active' if c.active=='integrations' else ''}">
72 <a href="${h.route_path('repo_integrations_home', repo_name=c.repo_name)}">${_('Integrations')}</a>
71 <a href="${h.route_path('repo_integrations_home', repo_name=c.repo_name)}">${_('Integrations')}</a>
73 </li>
72 </li>
73 %if c.repo_info.repo_type != 'svn':
74 <li class="${'active' if c.active=='reviewers' else ''}">
75 <a href="${h.route_path('repo_reviewers', repo_name=c.repo_name)}">${_('Reviewer Rules')}</a>
76 </li>
77 %endif
74 <li class="${'active' if c.active=='maintenance' else ''}">
78 <li class="${'active' if c.active=='maintenance' else ''}">
75 <a href="${h.route_path('repo_maintenance', repo_name=c.repo_name)}">${_('Maintenance')}</a>
79 <a href="${h.route_path('repo_maintenance', repo_name=c.repo_name)}">${_('Maintenance')}</a>
76 </li>
80 </li>
77 <li class="${'active' if c.active=='strip' else ''}">
81 <li class="${'active' if c.active=='strip' else ''}">
78 <a href="${h.route_path('strip', repo_name=c.repo_name)}">${_('Strip')}</a>
82 <a href="${h.route_path('strip', repo_name=c.repo_name)}">${_('Strip')}</a>
79 </li>
83 </li>
80 ## TODO: dan: replace repo navigation with navlist registry like with
84
81 ## admin menu. First must find way to allow runtime configuration
82 ## it to account for the c.repo_info.repo_type != 'svn' call above
83 <%
84 reviewer_settings = False
85 try:
86 import rc_reviewers
87 reviewer_settings = True
88 except ImportError:
89 pass
90 %>
91 %if reviewer_settings:
92 <li class="${'active' if c.active=='reviewers' else ''}">
93 <a href="${h.route_path('repo_reviewers_home', repo_name=c.repo_name)}">${_('Reviewers')}</a>
94 </li>
95 %endif
96 </ul>
85 </ul>
97 </div>
86 </div>
98
87
General Comments 0
You need to be logged in to leave comments. Login now