##// END OF EJS Templates
feat: security tab in admin, routes and placeholder view for ee functionality
andverb -
r5518:3cd45018 default
parent child Browse files
Show More
@@ -0,0 +1,39 b''
1 # Copyright (C) 2010-2024 RhodeCode GmbH
2 #
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU Affero General Public License, version 3
5 # (only), as published by the Free Software Foundation.
6 #
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 # GNU General Public License for more details.
11 #
12 # You should have received a copy of the GNU Affero General Public License
13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 #
15 # This program is dual-licensed. If you wish to learn more about the
16 # RhodeCode Enterprise Edition, including its added features, Support services,
17 # and proprietary license terms, please see https://rhodecode.com/licenses/
18
19 import logging
20
21 from rhodecode.apps._base import BaseAppView
22 from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator
23
24 log = logging.getLogger(__name__)
25
26
27 class AdminSecurityView(BaseAppView):
28
29 def load_default_context(self):
30 c = self._get_local_tmpl_context()
31 return c
32
33 @LoginRequired()
34 @HasPermissionAllDecorator('hg.admin')
35 def security(self):
36 c = self.load_default_context()
37 c.active = 'security'
38 return self._get_template_context(c)
39
@@ -0,0 +1,40 b''
1 <%inherit file="/base/base.mako"/>
2
3 <%def name="title()">
4 ${_('Security Admin')}
5 %if c.rhodecode_name:
6 &middot; ${h.branding(c.rhodecode_name)}
7 %endif
8 </%def>
9
10 <%def name="breadcrumbs_links()"></%def>
11
12 <%def name="menu_bar_nav()">
13 ${self.menu_items(active='admin')}
14 </%def>
15
16 <%def name="menu_bar_subnav()">
17 ${self.admin_menu(active='security')}
18 </%def>
19
20 <%def name="main()">
21
22 <div class="box">
23
24 <div class="panel panel-default">
25 <div class="panel-heading">
26 <h3 class="panel-title">${_('Security Audit')}</h3>
27 </div>
28 <div class="panel-body">
29 <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>
30 <p>
31 You can scan your repositories for exposed secrets, passwords, etc
32 </p>
33 </div>
34 </div>
35
36 </div>
37
38
39 </%def>
40
@@ -1,71 +1,71 b''
1 syntax: glob
1 syntax: glob
2
2
3 *.egg
3 *.egg
4 *.egg-info
4 *.egg-info
5 *.idea
5 *.idea
6 *.orig
6 *.orig
7 *.pyc
7 *.pyc
8 *.sqlite-journal
8 *.sqlite-journal
9 *.swp
9 *.swp
10 *.tox
10 *.tox
11 *.DS_Store*
11 *.DS_Store*
12 rhodecode/public/js/src/components/**/*.css
12 rhodecode/public/js/src/components/**/*.css
13
13
14 syntax: regexp
14 syntax: regexp
15
15
16 #.filename
16 #.filename
17 ^\.settings$
17 ^\.settings$
18 ^\.project$
18 ^\.project$
19 ^\.pydevproject$
19 ^\.pydevproject$
20 ^\.coverage$
20 ^\.coverage$
21 ^\.cache.*$
21 ^\.cache.*$
22 ^\.ruff_cache.*$
22 ^\.ruff_cache.*$
23 ^\.rhodecode$
23 ^\.rhodecode$
24
24
25 ^rcextensions
25 ^rcextensions
26 ^.dev
26 ^.dev
27 ^._dev
27 ^._dev
28 ^build/
28 ^build/
29 ^coverage\.xml$
29 ^coverage\.xml$
30 ^data$
30 ^data$
31 ^\.eggs/
31 ^\.eggs/
32 ^configs/data$
32 ^configs/data$
33 ^dev.ini$
33 ^dev.ini$
34 ^acceptance_tests/dev.*\.ini$
34 ^acceptance_tests/dev.*\.ini$
35 ^dist/
35 ^dist/
36 ^fabfile.py
36 ^fabfile.py
37 ^htmlcov
37 ^htmlcov
38 ^junit\.xml$
38 ^junit\.xml$
39 ^node_modules/
39 ^node_modules/
40 ^node_binaries/
40 ^node_binaries/
41 ^pylint.log$
41 ^pylint.log$
42 ^rcextensions/
42 ^rcextensions/
43 ^result$
43 ^result$
44 ^rhodecode/public/css/style.css$
44 ^rhodecode/public/css/style.css$
45 ^rhodecode/public/css/style-polymer.css$
45 ^rhodecode/public/css/style-polymer.css$
46 ^rhodecode/public/css/style-ipython.css$
46 ^rhodecode/public/css/style-ipython.css$
47 ^rhodecode/public/js/rhodecode-components.html$
47 ^rhodecode/public/js/rhodecode-components.html$
48 ^rhodecode/public/js/rhodecode-components.js$
48 ^rhodecode/public/js/rhodecode-components.js$
49 ^rhodecode/public/js/scripts.js$
49 ^rhodecode/public/js/scripts.js$
50 ^rhodecode/public/js/scripts.min.js$
50 ^rhodecode/public/js/scripts.min.js$
51 ^rhodecode/public/js/src/components/root-styles.gen.html$
51 ^rhodecode/public/js/src/components/root-styles.gen.html$
52 ^rhodecode/public/js/vendors/webcomponentsjs/
52 ^rhodecode/public/js/vendors/webcomponentsjs/
53 ^rhodecode\.db$
53 ^rhodecode\.db$
54 ^rhodecode\.log$
54 ^rhodecode\.log$
55 ^rhodecode_dev\.log$
55 ^rhodecode_dev\.log$
56 ^test\.db$
56 ^test\.db$
57
57 ^venv/
58
58
59 # ac-tests
59 # ac-tests
60 ^acceptance_tests/\.cache.*$
60 ^acceptance_tests/\.cache.*$
61 ^acceptance_tests/externals
61 ^acceptance_tests/externals
62 ^acceptance_tests/ghostdriver.log$
62 ^acceptance_tests/ghostdriver.log$
63 ^acceptance_tests/local(_.+)?\.ini$
63 ^acceptance_tests/local(_.+)?\.ini$
64
64
65 # docs
65 # docs
66 ^docs/_build$
66 ^docs/_build$
67 ^docs/result$
67 ^docs/result$
68 ^docs-internal/_build$
68 ^docs-internal/_build$
69
69
70 # Cythonized things
70 # Cythonized things
71 ^rhodecode/.*\.(c|so)$
71 ^rhodecode/.*\.(c|so)$
@@ -1,1093 +1,1115 b''
1 # Copyright (C) 2016-2023 RhodeCode GmbH
1 # Copyright (C) 2016-2023 RhodeCode GmbH
2 #
2 #
3 # This program is free software: you can redistribute it and/or modify
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU Affero General Public License, version 3
4 # it under the terms of the GNU Affero General Public License, version 3
5 # (only), as published by the Free Software Foundation.
5 # (only), as published by the Free Software Foundation.
6 #
6 #
7 # This program is distributed in the hope that it will be useful,
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 # GNU General Public License for more details.
10 # GNU General Public License for more details.
11 #
11 #
12 # You should have received a copy of the GNU Affero General Public License
12 # You should have received a copy of the GNU Affero General Public License
13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 #
14 #
15 # This program is dual-licensed. If you wish to learn more about the
15 # This program is dual-licensed. If you wish to learn more about the
16 # RhodeCode Enterprise Edition, including its added features, Support services,
16 # RhodeCode Enterprise Edition, including its added features, Support services,
17 # and proprietary license terms, please see https://rhodecode.com/licenses/
17 # and proprietary license terms, please see https://rhodecode.com/licenses/
18
18
19
19
20 from rhodecode.apps._base import ADMIN_PREFIX
20 from rhodecode.apps._base import ADMIN_PREFIX
21 from rhodecode.apps._base.navigation import includeme as nav_includeme
21 from rhodecode.apps._base.navigation import includeme as nav_includeme
22 from rhodecode.apps.admin.views.main_views import AdminMainView
22 from rhodecode.apps.admin.views.main_views import AdminMainView
23
23
24
24
25 def admin_routes(config):
25 def admin_routes(config):
26 """
26 """
27 Admin prefixed routes
27 Admin prefixed routes
28 """
28 """
29 from rhodecode.apps.admin.views.audit_logs import AdminAuditLogsView
29 from rhodecode.apps.admin.views.audit_logs import AdminAuditLogsView
30 from rhodecode.apps.admin.views.artifacts import AdminArtifactsView
30 from rhodecode.apps.admin.views.artifacts import AdminArtifactsView
31 from rhodecode.apps.admin.views.automation import AdminAutomationView
31 from rhodecode.apps.admin.views.automation import AdminAutomationView
32 from rhodecode.apps.admin.views.scheduler import AdminSchedulerView
32 from rhodecode.apps.admin.views.scheduler import AdminSchedulerView
33 from rhodecode.apps.admin.views.defaults import AdminDefaultSettingsView
33 from rhodecode.apps.admin.views.defaults import AdminDefaultSettingsView
34 from rhodecode.apps.admin.views.exception_tracker import ExceptionsTrackerView
34 from rhodecode.apps.admin.views.exception_tracker import ExceptionsTrackerView
35 from rhodecode.apps.admin.views.open_source_licenses import OpenSourceLicensesAdminSettingsView
35 from rhodecode.apps.admin.views.open_source_licenses import OpenSourceLicensesAdminSettingsView
36 from rhodecode.apps.admin.views.permissions import AdminPermissionsView
36 from rhodecode.apps.admin.views.permissions import AdminPermissionsView
37 from rhodecode.apps.admin.views.process_management import AdminProcessManagementView
37 from rhodecode.apps.admin.views.process_management import AdminProcessManagementView
38 from rhodecode.apps.admin.views.repo_groups import AdminRepoGroupsView
38 from rhodecode.apps.admin.views.repo_groups import AdminRepoGroupsView
39 from rhodecode.apps.admin.views.repositories import AdminReposView
39 from rhodecode.apps.admin.views.repositories import AdminReposView
40 from rhodecode.apps.admin.views.sessions import AdminSessionSettingsView
40 from rhodecode.apps.admin.views.sessions import AdminSessionSettingsView
41 from rhodecode.apps.admin.views.settings import AdminSettingsView
41 from rhodecode.apps.admin.views.settings import AdminSettingsView
42 from rhodecode.apps.admin.views.svn_config import AdminSvnConfigView
42 from rhodecode.apps.admin.views.svn_config import AdminSvnConfigView
43 from rhodecode.apps.admin.views.system_info import AdminSystemInfoSettingsView
43 from rhodecode.apps.admin.views.system_info import AdminSystemInfoSettingsView
44 from rhodecode.apps.admin.views.user_groups import AdminUserGroupsView
44 from rhodecode.apps.admin.views.user_groups import AdminUserGroupsView
45 from rhodecode.apps.admin.views.users import AdminUsersView, UsersView
45 from rhodecode.apps.admin.views.users import AdminUsersView, UsersView
46
46 from rhodecode.apps.admin.views.security import AdminSecurityView
47
48 # Security EE feature
49
50 config.add_route(
51 'admin_security',
52 pattern=ADMIN_PREFIX + '/security')
53 config.add_view(
54 AdminSecurityView,
55 attr='security' ,
56 route_name='admin_security', request_method='GET',
57 renderer='rhodecode:templates/admin/security/security.mako')
58
59 config.add_route(
60 name='admin_security_update',
61 pattern=ADMIN_PREFIX + '/security/update')
62 config.add_view(
63 AdminSecurityView,
64 attr='security_update',
65 route_name='admin_security_update', request_method='POST',
66 renderer='rhodecode:templates/admin/security/security.mako')
67
68
47 config.add_route(
69 config.add_route(
48 name='admin_audit_logs',
70 name='admin_audit_logs',
49 pattern='/audit_logs')
71 pattern='/audit_logs')
50 config.add_view(
72 config.add_view(
51 AdminAuditLogsView,
73 AdminAuditLogsView,
52 attr='admin_audit_logs',
74 attr='admin_audit_logs',
53 route_name='admin_audit_logs', request_method='GET',
75 route_name='admin_audit_logs', request_method='GET',
54 renderer='rhodecode:templates/admin/admin_audit_logs.mako')
76 renderer='rhodecode:templates/admin/admin_audit_logs.mako')
55
77
56 config.add_route(
78 config.add_route(
57 name='admin_audit_log_entry',
79 name='admin_audit_log_entry',
58 pattern='/audit_logs/{audit_log_id}')
80 pattern='/audit_logs/{audit_log_id}')
59 config.add_view(
81 config.add_view(
60 AdminAuditLogsView,
82 AdminAuditLogsView,
61 attr='admin_audit_log_entry',
83 attr='admin_audit_log_entry',
62 route_name='admin_audit_log_entry', request_method='GET',
84 route_name='admin_audit_log_entry', request_method='GET',
63 renderer='rhodecode:templates/admin/admin_audit_log_entry.mako')
85 renderer='rhodecode:templates/admin/admin_audit_log_entry.mako')
64
86
65 # Artifacts EE feature
87 # Artifacts EE feature
66 config.add_route(
88 config.add_route(
67 'admin_artifacts',
89 'admin_artifacts',
68 pattern=ADMIN_PREFIX + '/artifacts')
90 pattern=ADMIN_PREFIX + '/artifacts')
69 config.add_route(
91 config.add_route(
70 'admin_artifacts_show_all',
92 'admin_artifacts_show_all',
71 pattern=ADMIN_PREFIX + '/artifacts')
93 pattern=ADMIN_PREFIX + '/artifacts')
72 config.add_view(
94 config.add_view(
73 AdminArtifactsView,
95 AdminArtifactsView,
74 attr='artifacts',
96 attr='artifacts',
75 route_name='admin_artifacts', request_method='GET',
97 route_name='admin_artifacts', request_method='GET',
76 renderer='rhodecode:templates/admin/artifacts/artifacts.mako')
98 renderer='rhodecode:templates/admin/artifacts/artifacts.mako')
77 config.add_view(
99 config.add_view(
78 AdminArtifactsView,
100 AdminArtifactsView,
79 attr='artifacts',
101 attr='artifacts',
80 route_name='admin_artifacts_show_all', request_method='GET',
102 route_name='admin_artifacts_show_all', request_method='GET',
81 renderer='rhodecode:templates/admin/artifacts/artifacts.mako')
103 renderer='rhodecode:templates/admin/artifacts/artifacts.mako')
82
104
83 # EE views
105 # EE views
84 config.add_route(
106 config.add_route(
85 name='admin_artifacts_show_info',
107 name='admin_artifacts_show_info',
86 pattern=ADMIN_PREFIX + '/artifacts/{uid}')
108 pattern=ADMIN_PREFIX + '/artifacts/{uid}')
87 config.add_route(
109 config.add_route(
88 name='admin_artifacts_delete',
110 name='admin_artifacts_delete',
89 pattern=ADMIN_PREFIX + '/artifacts/{uid}/delete')
111 pattern=ADMIN_PREFIX + '/artifacts/{uid}/delete')
90 config.add_route(
112 config.add_route(
91 name='admin_artifacts_update',
113 name='admin_artifacts_update',
92 pattern=ADMIN_PREFIX + '/artifacts/{uid}/update')
114 pattern=ADMIN_PREFIX + '/artifacts/{uid}/update')
93
115
94 # Automation EE feature
116 # Automation EE feature
95 config.add_route(
117 config.add_route(
96 'admin_automation',
118 'admin_automation',
97 pattern=ADMIN_PREFIX + '/automation')
119 pattern=ADMIN_PREFIX + '/automation')
98 config.add_view(
120 config.add_view(
99 AdminAutomationView,
121 AdminAutomationView,
100 attr='automation',
122 attr='automation',
101 route_name='admin_automation', request_method='GET',
123 route_name='admin_automation', request_method='GET',
102 renderer='rhodecode:templates/admin/automation/automation.mako')
124 renderer='rhodecode:templates/admin/automation/automation.mako')
103
125
104 # Scheduler EE feature
126 # Scheduler EE feature
105 config.add_route(
127 config.add_route(
106 'admin_scheduler',
128 'admin_scheduler',
107 pattern=ADMIN_PREFIX + '/scheduler')
129 pattern=ADMIN_PREFIX + '/scheduler')
108 config.add_view(
130 config.add_view(
109 AdminSchedulerView,
131 AdminSchedulerView,
110 attr='scheduler',
132 attr='scheduler',
111 route_name='admin_scheduler', request_method='GET',
133 route_name='admin_scheduler', request_method='GET',
112 renderer='rhodecode:templates/admin/scheduler/scheduler.mako')
134 renderer='rhodecode:templates/admin/scheduler/scheduler.mako')
113
135
114 config.add_route(
136 config.add_route(
115 name='admin_settings_open_source',
137 name='admin_settings_open_source',
116 pattern='/settings/open_source')
138 pattern='/settings/open_source')
117 config.add_view(
139 config.add_view(
118 OpenSourceLicensesAdminSettingsView,
140 OpenSourceLicensesAdminSettingsView,
119 attr='open_source_licenses',
141 attr='open_source_licenses',
120 route_name='admin_settings_open_source', request_method='GET',
142 route_name='admin_settings_open_source', request_method='GET',
121 renderer='rhodecode:templates/admin/settings/settings.mako')
143 renderer='rhodecode:templates/admin/settings/settings.mako')
122
144
123 config.add_route(
145 config.add_route(
124 name='admin_settings_vcs_svn_generate_cfg',
146 name='admin_settings_vcs_svn_generate_cfg',
125 pattern='/settings/vcs/svn_generate_cfg')
147 pattern='/settings/vcs/svn_generate_cfg')
126 config.add_view(
148 config.add_view(
127 AdminSvnConfigView,
149 AdminSvnConfigView,
128 attr='vcs_svn_generate_config',
150 attr='vcs_svn_generate_config',
129 route_name='admin_settings_vcs_svn_generate_cfg',
151 route_name='admin_settings_vcs_svn_generate_cfg',
130 request_method='POST', renderer='json')
152 request_method='POST', renderer='json')
131
153
132 config.add_route(
154 config.add_route(
133 name='admin_settings_system',
155 name='admin_settings_system',
134 pattern='/settings/system')
156 pattern='/settings/system')
135 config.add_view(
157 config.add_view(
136 AdminSystemInfoSettingsView,
158 AdminSystemInfoSettingsView,
137 attr='settings_system_info',
159 attr='settings_system_info',
138 route_name='admin_settings_system', request_method='GET',
160 route_name='admin_settings_system', request_method='GET',
139 renderer='rhodecode:templates/admin/settings/settings.mako')
161 renderer='rhodecode:templates/admin/settings/settings.mako')
140
162
141 config.add_route(
163 config.add_route(
142 name='admin_settings_system_update',
164 name='admin_settings_system_update',
143 pattern='/settings/system/updates')
165 pattern='/settings/system/updates')
144 config.add_view(
166 config.add_view(
145 AdminSystemInfoSettingsView,
167 AdminSystemInfoSettingsView,
146 attr='settings_system_info_check_update',
168 attr='settings_system_info_check_update',
147 route_name='admin_settings_system_update', request_method='GET',
169 route_name='admin_settings_system_update', request_method='GET',
148 renderer='rhodecode:templates/admin/settings/settings_system_update.mako')
170 renderer='rhodecode:templates/admin/settings/settings_system_update.mako')
149
171
150 config.add_route(
172 config.add_route(
151 name='admin_settings_exception_tracker',
173 name='admin_settings_exception_tracker',
152 pattern='/settings/exceptions')
174 pattern='/settings/exceptions')
153 config.add_view(
175 config.add_view(
154 ExceptionsTrackerView,
176 ExceptionsTrackerView,
155 attr='browse_exceptions',
177 attr='browse_exceptions',
156 route_name='admin_settings_exception_tracker', request_method='GET',
178 route_name='admin_settings_exception_tracker', request_method='GET',
157 renderer='rhodecode:templates/admin/settings/settings.mako')
179 renderer='rhodecode:templates/admin/settings/settings.mako')
158
180
159 config.add_route(
181 config.add_route(
160 name='admin_settings_exception_tracker_delete_all',
182 name='admin_settings_exception_tracker_delete_all',
161 pattern='/settings/exceptions_delete_all')
183 pattern='/settings/exceptions_delete_all')
162 config.add_view(
184 config.add_view(
163 ExceptionsTrackerView,
185 ExceptionsTrackerView,
164 attr='exception_delete_all',
186 attr='exception_delete_all',
165 route_name='admin_settings_exception_tracker_delete_all', request_method='POST',
187 route_name='admin_settings_exception_tracker_delete_all', request_method='POST',
166 renderer='rhodecode:templates/admin/settings/settings.mako')
188 renderer='rhodecode:templates/admin/settings/settings.mako')
167
189
168 config.add_route(
190 config.add_route(
169 name='admin_settings_exception_tracker_show',
191 name='admin_settings_exception_tracker_show',
170 pattern='/settings/exceptions/{exception_id}')
192 pattern='/settings/exceptions/{exception_id}')
171 config.add_view(
193 config.add_view(
172 ExceptionsTrackerView,
194 ExceptionsTrackerView,
173 attr='exception_show',
195 attr='exception_show',
174 route_name='admin_settings_exception_tracker_show', request_method='GET',
196 route_name='admin_settings_exception_tracker_show', request_method='GET',
175 renderer='rhodecode:templates/admin/settings/settings.mako')
197 renderer='rhodecode:templates/admin/settings/settings.mako')
176
198
177 config.add_route(
199 config.add_route(
178 name='admin_settings_exception_tracker_delete',
200 name='admin_settings_exception_tracker_delete',
179 pattern='/settings/exceptions/{exception_id}/delete')
201 pattern='/settings/exceptions/{exception_id}/delete')
180 config.add_view(
202 config.add_view(
181 ExceptionsTrackerView,
203 ExceptionsTrackerView,
182 attr='exception_delete',
204 attr='exception_delete',
183 route_name='admin_settings_exception_tracker_delete', request_method='POST',
205 route_name='admin_settings_exception_tracker_delete', request_method='POST',
184 renderer='rhodecode:templates/admin/settings/settings.mako')
206 renderer='rhodecode:templates/admin/settings/settings.mako')
185
207
186 config.add_route(
208 config.add_route(
187 name='admin_settings_sessions',
209 name='admin_settings_sessions',
188 pattern='/settings/sessions')
210 pattern='/settings/sessions')
189 config.add_view(
211 config.add_view(
190 AdminSessionSettingsView,
212 AdminSessionSettingsView,
191 attr='settings_sessions',
213 attr='settings_sessions',
192 route_name='admin_settings_sessions', request_method='GET',
214 route_name='admin_settings_sessions', request_method='GET',
193 renderer='rhodecode:templates/admin/settings/settings.mako')
215 renderer='rhodecode:templates/admin/settings/settings.mako')
194
216
195 config.add_route(
217 config.add_route(
196 name='admin_settings_sessions_cleanup',
218 name='admin_settings_sessions_cleanup',
197 pattern='/settings/sessions/cleanup')
219 pattern='/settings/sessions/cleanup')
198 config.add_view(
220 config.add_view(
199 AdminSessionSettingsView,
221 AdminSessionSettingsView,
200 attr='settings_sessions_cleanup',
222 attr='settings_sessions_cleanup',
201 route_name='admin_settings_sessions_cleanup', request_method='POST')
223 route_name='admin_settings_sessions_cleanup', request_method='POST')
202
224
203 config.add_route(
225 config.add_route(
204 name='admin_settings_process_management',
226 name='admin_settings_process_management',
205 pattern='/settings/process_management')
227 pattern='/settings/process_management')
206 config.add_view(
228 config.add_view(
207 AdminProcessManagementView,
229 AdminProcessManagementView,
208 attr='process_management',
230 attr='process_management',
209 route_name='admin_settings_process_management', request_method='GET',
231 route_name='admin_settings_process_management', request_method='GET',
210 renderer='rhodecode:templates/admin/settings/settings.mako')
232 renderer='rhodecode:templates/admin/settings/settings.mako')
211
233
212 config.add_route(
234 config.add_route(
213 name='admin_settings_process_management_data',
235 name='admin_settings_process_management_data',
214 pattern='/settings/process_management/data')
236 pattern='/settings/process_management/data')
215 config.add_view(
237 config.add_view(
216 AdminProcessManagementView,
238 AdminProcessManagementView,
217 attr='process_management_data',
239 attr='process_management_data',
218 route_name='admin_settings_process_management_data', request_method='GET',
240 route_name='admin_settings_process_management_data', request_method='GET',
219 renderer='rhodecode:templates/admin/settings/settings_process_management_data.mako')
241 renderer='rhodecode:templates/admin/settings/settings_process_management_data.mako')
220
242
221 config.add_route(
243 config.add_route(
222 name='admin_settings_process_management_signal',
244 name='admin_settings_process_management_signal',
223 pattern='/settings/process_management/signal')
245 pattern='/settings/process_management/signal')
224 config.add_view(
246 config.add_view(
225 AdminProcessManagementView,
247 AdminProcessManagementView,
226 attr='process_management_signal',
248 attr='process_management_signal',
227 route_name='admin_settings_process_management_signal',
249 route_name='admin_settings_process_management_signal',
228 request_method='POST', renderer='json_ext')
250 request_method='POST', renderer='json_ext')
229
251
230 config.add_route(
252 config.add_route(
231 name='admin_settings_process_management_master_signal',
253 name='admin_settings_process_management_master_signal',
232 pattern='/settings/process_management/master_signal')
254 pattern='/settings/process_management/master_signal')
233 config.add_view(
255 config.add_view(
234 AdminProcessManagementView,
256 AdminProcessManagementView,
235 attr='process_management_master_signal',
257 attr='process_management_master_signal',
236 route_name='admin_settings_process_management_master_signal',
258 route_name='admin_settings_process_management_master_signal',
237 request_method='POST', renderer='json_ext')
259 request_method='POST', renderer='json_ext')
238
260
239 # default settings
261 # default settings
240 config.add_route(
262 config.add_route(
241 name='admin_defaults_repositories',
263 name='admin_defaults_repositories',
242 pattern='/defaults/repositories')
264 pattern='/defaults/repositories')
243 config.add_view(
265 config.add_view(
244 AdminDefaultSettingsView,
266 AdminDefaultSettingsView,
245 attr='defaults_repository_show',
267 attr='defaults_repository_show',
246 route_name='admin_defaults_repositories', request_method='GET',
268 route_name='admin_defaults_repositories', request_method='GET',
247 renderer='rhodecode:templates/admin/defaults/defaults.mako')
269 renderer='rhodecode:templates/admin/defaults/defaults.mako')
248
270
249 config.add_route(
271 config.add_route(
250 name='admin_defaults_repositories_update',
272 name='admin_defaults_repositories_update',
251 pattern='/defaults/repositories/update')
273 pattern='/defaults/repositories/update')
252 config.add_view(
274 config.add_view(
253 AdminDefaultSettingsView,
275 AdminDefaultSettingsView,
254 attr='defaults_repository_update',
276 attr='defaults_repository_update',
255 route_name='admin_defaults_repositories_update', request_method='POST',
277 route_name='admin_defaults_repositories_update', request_method='POST',
256 renderer='rhodecode:templates/admin/defaults/defaults.mako')
278 renderer='rhodecode:templates/admin/defaults/defaults.mako')
257
279
258 # admin settings
280 # admin settings
259
281
260 config.add_route(
282 config.add_route(
261 name='admin_settings',
283 name='admin_settings',
262 pattern='/settings')
284 pattern='/settings')
263 config.add_view(
285 config.add_view(
264 AdminSettingsView,
286 AdminSettingsView,
265 attr='settings_global',
287 attr='settings_global',
266 route_name='admin_settings', request_method='GET',
288 route_name='admin_settings', request_method='GET',
267 renderer='rhodecode:templates/admin/settings/settings.mako')
289 renderer='rhodecode:templates/admin/settings/settings.mako')
268
290
269 config.add_route(
291 config.add_route(
270 name='admin_settings_update',
292 name='admin_settings_update',
271 pattern='/settings/update')
293 pattern='/settings/update')
272 config.add_view(
294 config.add_view(
273 AdminSettingsView,
295 AdminSettingsView,
274 attr='settings_global_update',
296 attr='settings_global_update',
275 route_name='admin_settings_update', request_method='POST',
297 route_name='admin_settings_update', request_method='POST',
276 renderer='rhodecode:templates/admin/settings/settings.mako')
298 renderer='rhodecode:templates/admin/settings/settings.mako')
277
299
278 config.add_route(
300 config.add_route(
279 name='admin_settings_global',
301 name='admin_settings_global',
280 pattern='/settings/global')
302 pattern='/settings/global')
281 config.add_view(
303 config.add_view(
282 AdminSettingsView,
304 AdminSettingsView,
283 attr='settings_global',
305 attr='settings_global',
284 route_name='admin_settings_global', request_method='GET',
306 route_name='admin_settings_global', request_method='GET',
285 renderer='rhodecode:templates/admin/settings/settings.mako')
307 renderer='rhodecode:templates/admin/settings/settings.mako')
286
308
287 config.add_route(
309 config.add_route(
288 name='admin_settings_global_update',
310 name='admin_settings_global_update',
289 pattern='/settings/global/update')
311 pattern='/settings/global/update')
290 config.add_view(
312 config.add_view(
291 AdminSettingsView,
313 AdminSettingsView,
292 attr='settings_global_update',
314 attr='settings_global_update',
293 route_name='admin_settings_global_update', request_method='POST',
315 route_name='admin_settings_global_update', request_method='POST',
294 renderer='rhodecode:templates/admin/settings/settings.mako')
316 renderer='rhodecode:templates/admin/settings/settings.mako')
295
317
296 config.add_route(
318 config.add_route(
297 name='admin_settings_vcs',
319 name='admin_settings_vcs',
298 pattern='/settings/vcs')
320 pattern='/settings/vcs')
299 config.add_view(
321 config.add_view(
300 AdminSettingsView,
322 AdminSettingsView,
301 attr='settings_vcs',
323 attr='settings_vcs',
302 route_name='admin_settings_vcs', request_method='GET',
324 route_name='admin_settings_vcs', request_method='GET',
303 renderer='rhodecode:templates/admin/settings/settings.mako')
325 renderer='rhodecode:templates/admin/settings/settings.mako')
304
326
305 config.add_route(
327 config.add_route(
306 name='admin_settings_vcs_update',
328 name='admin_settings_vcs_update',
307 pattern='/settings/vcs/update')
329 pattern='/settings/vcs/update')
308 config.add_view(
330 config.add_view(
309 AdminSettingsView,
331 AdminSettingsView,
310 attr='settings_vcs_update',
332 attr='settings_vcs_update',
311 route_name='admin_settings_vcs_update', request_method='POST',
333 route_name='admin_settings_vcs_update', request_method='POST',
312 renderer='rhodecode:templates/admin/settings/settings.mako')
334 renderer='rhodecode:templates/admin/settings/settings.mako')
313
335
314 config.add_route(
336 config.add_route(
315 name='admin_settings_vcs_svn_pattern_delete',
337 name='admin_settings_vcs_svn_pattern_delete',
316 pattern='/settings/vcs/svn_pattern_delete')
338 pattern='/settings/vcs/svn_pattern_delete')
317 config.add_view(
339 config.add_view(
318 AdminSettingsView,
340 AdminSettingsView,
319 attr='settings_vcs_delete_svn_pattern',
341 attr='settings_vcs_delete_svn_pattern',
320 route_name='admin_settings_vcs_svn_pattern_delete', request_method='POST',
342 route_name='admin_settings_vcs_svn_pattern_delete', request_method='POST',
321 renderer='json_ext', xhr=True)
343 renderer='json_ext', xhr=True)
322
344
323 config.add_route(
345 config.add_route(
324 name='admin_settings_mapping',
346 name='admin_settings_mapping',
325 pattern='/settings/mapping')
347 pattern='/settings/mapping')
326 config.add_view(
348 config.add_view(
327 AdminSettingsView,
349 AdminSettingsView,
328 attr='settings_mapping',
350 attr='settings_mapping',
329 route_name='admin_settings_mapping', request_method='GET',
351 route_name='admin_settings_mapping', request_method='GET',
330 renderer='rhodecode:templates/admin/settings/settings.mako')
352 renderer='rhodecode:templates/admin/settings/settings.mako')
331
353
332 config.add_route(
354 config.add_route(
333 name='admin_settings_mapping_update',
355 name='admin_settings_mapping_update',
334 pattern='/settings/mapping/update')
356 pattern='/settings/mapping/update')
335 config.add_view(
357 config.add_view(
336 AdminSettingsView,
358 AdminSettingsView,
337 attr='settings_mapping_update',
359 attr='settings_mapping_update',
338 route_name='admin_settings_mapping_update', request_method='POST',
360 route_name='admin_settings_mapping_update', request_method='POST',
339 renderer='rhodecode:templates/admin/settings/settings.mako')
361 renderer='rhodecode:templates/admin/settings/settings.mako')
340
362
341 config.add_route(
363 config.add_route(
342 name='admin_settings_visual',
364 name='admin_settings_visual',
343 pattern='/settings/visual')
365 pattern='/settings/visual')
344 config.add_view(
366 config.add_view(
345 AdminSettingsView,
367 AdminSettingsView,
346 attr='settings_visual',
368 attr='settings_visual',
347 route_name='admin_settings_visual', request_method='GET',
369 route_name='admin_settings_visual', request_method='GET',
348 renderer='rhodecode:templates/admin/settings/settings.mako')
370 renderer='rhodecode:templates/admin/settings/settings.mako')
349
371
350 config.add_route(
372 config.add_route(
351 name='admin_settings_visual_update',
373 name='admin_settings_visual_update',
352 pattern='/settings/visual/update')
374 pattern='/settings/visual/update')
353 config.add_view(
375 config.add_view(
354 AdminSettingsView,
376 AdminSettingsView,
355 attr='settings_visual_update',
377 attr='settings_visual_update',
356 route_name='admin_settings_visual_update', request_method='POST',
378 route_name='admin_settings_visual_update', request_method='POST',
357 renderer='rhodecode:templates/admin/settings/settings.mako')
379 renderer='rhodecode:templates/admin/settings/settings.mako')
358
380
359 config.add_route(
381 config.add_route(
360 name='admin_settings_issuetracker',
382 name='admin_settings_issuetracker',
361 pattern='/settings/issue-tracker')
383 pattern='/settings/issue-tracker')
362 config.add_view(
384 config.add_view(
363 AdminSettingsView,
385 AdminSettingsView,
364 attr='settings_issuetracker',
386 attr='settings_issuetracker',
365 route_name='admin_settings_issuetracker', request_method='GET',
387 route_name='admin_settings_issuetracker', request_method='GET',
366 renderer='rhodecode:templates/admin/settings/settings.mako')
388 renderer='rhodecode:templates/admin/settings/settings.mako')
367
389
368 config.add_route(
390 config.add_route(
369 name='admin_settings_issuetracker_update',
391 name='admin_settings_issuetracker_update',
370 pattern='/settings/issue-tracker/update')
392 pattern='/settings/issue-tracker/update')
371 config.add_view(
393 config.add_view(
372 AdminSettingsView,
394 AdminSettingsView,
373 attr='settings_issuetracker_update',
395 attr='settings_issuetracker_update',
374 route_name='admin_settings_issuetracker_update', request_method='POST',
396 route_name='admin_settings_issuetracker_update', request_method='POST',
375 renderer='rhodecode:templates/admin/settings/settings.mako')
397 renderer='rhodecode:templates/admin/settings/settings.mako')
376
398
377 config.add_route(
399 config.add_route(
378 name='admin_settings_issuetracker_test',
400 name='admin_settings_issuetracker_test',
379 pattern='/settings/issue-tracker/test')
401 pattern='/settings/issue-tracker/test')
380 config.add_view(
402 config.add_view(
381 AdminSettingsView,
403 AdminSettingsView,
382 attr='settings_issuetracker_test',
404 attr='settings_issuetracker_test',
383 route_name='admin_settings_issuetracker_test', request_method='POST',
405 route_name='admin_settings_issuetracker_test', request_method='POST',
384 renderer='string', xhr=True)
406 renderer='string', xhr=True)
385
407
386 config.add_route(
408 config.add_route(
387 name='admin_settings_issuetracker_delete',
409 name='admin_settings_issuetracker_delete',
388 pattern='/settings/issue-tracker/delete')
410 pattern='/settings/issue-tracker/delete')
389 config.add_view(
411 config.add_view(
390 AdminSettingsView,
412 AdminSettingsView,
391 attr='settings_issuetracker_delete',
413 attr='settings_issuetracker_delete',
392 route_name='admin_settings_issuetracker_delete', request_method='POST',
414 route_name='admin_settings_issuetracker_delete', request_method='POST',
393 renderer='json_ext', xhr=True)
415 renderer='json_ext', xhr=True)
394
416
395 config.add_route(
417 config.add_route(
396 name='admin_settings_email',
418 name='admin_settings_email',
397 pattern='/settings/email')
419 pattern='/settings/email')
398 config.add_view(
420 config.add_view(
399 AdminSettingsView,
421 AdminSettingsView,
400 attr='settings_email',
422 attr='settings_email',
401 route_name='admin_settings_email', request_method='GET',
423 route_name='admin_settings_email', request_method='GET',
402 renderer='rhodecode:templates/admin/settings/settings.mako')
424 renderer='rhodecode:templates/admin/settings/settings.mako')
403
425
404 config.add_route(
426 config.add_route(
405 name='admin_settings_email_update',
427 name='admin_settings_email_update',
406 pattern='/settings/email/update')
428 pattern='/settings/email/update')
407 config.add_view(
429 config.add_view(
408 AdminSettingsView,
430 AdminSettingsView,
409 attr='settings_email_update',
431 attr='settings_email_update',
410 route_name='admin_settings_email_update', request_method='POST',
432 route_name='admin_settings_email_update', request_method='POST',
411 renderer='rhodecode:templates/admin/settings/settings.mako')
433 renderer='rhodecode:templates/admin/settings/settings.mako')
412
434
413 config.add_route(
435 config.add_route(
414 name='admin_settings_hooks',
436 name='admin_settings_hooks',
415 pattern='/settings/hooks')
437 pattern='/settings/hooks')
416 config.add_view(
438 config.add_view(
417 AdminSettingsView,
439 AdminSettingsView,
418 attr='settings_hooks',
440 attr='settings_hooks',
419 route_name='admin_settings_hooks', request_method='GET',
441 route_name='admin_settings_hooks', request_method='GET',
420 renderer='rhodecode:templates/admin/settings/settings.mako')
442 renderer='rhodecode:templates/admin/settings/settings.mako')
421
443
422 config.add_route(
444 config.add_route(
423 name='admin_settings_hooks_update',
445 name='admin_settings_hooks_update',
424 pattern='/settings/hooks/update')
446 pattern='/settings/hooks/update')
425 config.add_view(
447 config.add_view(
426 AdminSettingsView,
448 AdminSettingsView,
427 attr='settings_hooks_update',
449 attr='settings_hooks_update',
428 route_name='admin_settings_hooks_update', request_method='POST',
450 route_name='admin_settings_hooks_update', request_method='POST',
429 renderer='rhodecode:templates/admin/settings/settings.mako')
451 renderer='rhodecode:templates/admin/settings/settings.mako')
430
452
431 config.add_route(
453 config.add_route(
432 name='admin_settings_hooks_delete',
454 name='admin_settings_hooks_delete',
433 pattern='/settings/hooks/delete')
455 pattern='/settings/hooks/delete')
434 config.add_view(
456 config.add_view(
435 AdminSettingsView,
457 AdminSettingsView,
436 attr='settings_hooks_update',
458 attr='settings_hooks_update',
437 route_name='admin_settings_hooks_delete', request_method='POST',
459 route_name='admin_settings_hooks_delete', request_method='POST',
438 renderer='rhodecode:templates/admin/settings/settings.mako')
460 renderer='rhodecode:templates/admin/settings/settings.mako')
439
461
440 config.add_route(
462 config.add_route(
441 name='admin_settings_search',
463 name='admin_settings_search',
442 pattern='/settings/search')
464 pattern='/settings/search')
443 config.add_view(
465 config.add_view(
444 AdminSettingsView,
466 AdminSettingsView,
445 attr='settings_search',
467 attr='settings_search',
446 route_name='admin_settings_search', request_method='GET',
468 route_name='admin_settings_search', request_method='GET',
447 renderer='rhodecode:templates/admin/settings/settings.mako')
469 renderer='rhodecode:templates/admin/settings/settings.mako')
448
470
449 config.add_route(
471 config.add_route(
450 name='admin_settings_labs',
472 name='admin_settings_labs',
451 pattern='/settings/labs')
473 pattern='/settings/labs')
452 config.add_view(
474 config.add_view(
453 AdminSettingsView,
475 AdminSettingsView,
454 attr='settings_labs',
476 attr='settings_labs',
455 route_name='admin_settings_labs', request_method='GET',
477 route_name='admin_settings_labs', request_method='GET',
456 renderer='rhodecode:templates/admin/settings/settings.mako')
478 renderer='rhodecode:templates/admin/settings/settings.mako')
457
479
458 config.add_route(
480 config.add_route(
459 name='admin_settings_labs_update',
481 name='admin_settings_labs_update',
460 pattern='/settings/labs/update')
482 pattern='/settings/labs/update')
461 config.add_view(
483 config.add_view(
462 AdminSettingsView,
484 AdminSettingsView,
463 attr='settings_labs_update',
485 attr='settings_labs_update',
464 route_name='admin_settings_labs_update', request_method='POST',
486 route_name='admin_settings_labs_update', request_method='POST',
465 renderer='rhodecode:templates/admin/settings/settings.mako')
487 renderer='rhodecode:templates/admin/settings/settings.mako')
466
488
467 # global permissions
489 # global permissions
468
490
469 config.add_route(
491 config.add_route(
470 name='admin_permissions_application',
492 name='admin_permissions_application',
471 pattern='/permissions/application')
493 pattern='/permissions/application')
472 config.add_view(
494 config.add_view(
473 AdminPermissionsView,
495 AdminPermissionsView,
474 attr='permissions_application',
496 attr='permissions_application',
475 route_name='admin_permissions_application', request_method='GET',
497 route_name='admin_permissions_application', request_method='GET',
476 renderer='rhodecode:templates/admin/permissions/permissions.mako')
498 renderer='rhodecode:templates/admin/permissions/permissions.mako')
477
499
478 config.add_route(
500 config.add_route(
479 name='admin_permissions_application_update',
501 name='admin_permissions_application_update',
480 pattern='/permissions/application/update')
502 pattern='/permissions/application/update')
481 config.add_view(
503 config.add_view(
482 AdminPermissionsView,
504 AdminPermissionsView,
483 attr='permissions_application_update',
505 attr='permissions_application_update',
484 route_name='admin_permissions_application_update', request_method='POST',
506 route_name='admin_permissions_application_update', request_method='POST',
485 renderer='rhodecode:templates/admin/permissions/permissions.mako')
507 renderer='rhodecode:templates/admin/permissions/permissions.mako')
486
508
487 config.add_route(
509 config.add_route(
488 name='admin_permissions_global',
510 name='admin_permissions_global',
489 pattern='/permissions/global')
511 pattern='/permissions/global')
490 config.add_view(
512 config.add_view(
491 AdminPermissionsView,
513 AdminPermissionsView,
492 attr='permissions_global',
514 attr='permissions_global',
493 route_name='admin_permissions_global', request_method='GET',
515 route_name='admin_permissions_global', request_method='GET',
494 renderer='rhodecode:templates/admin/permissions/permissions.mako')
516 renderer='rhodecode:templates/admin/permissions/permissions.mako')
495
517
496 config.add_route(
518 config.add_route(
497 name='admin_permissions_global_update',
519 name='admin_permissions_global_update',
498 pattern='/permissions/global/update')
520 pattern='/permissions/global/update')
499 config.add_view(
521 config.add_view(
500 AdminPermissionsView,
522 AdminPermissionsView,
501 attr='permissions_global_update',
523 attr='permissions_global_update',
502 route_name='admin_permissions_global_update', request_method='POST',
524 route_name='admin_permissions_global_update', request_method='POST',
503 renderer='rhodecode:templates/admin/permissions/permissions.mako')
525 renderer='rhodecode:templates/admin/permissions/permissions.mako')
504
526
505 config.add_route(
527 config.add_route(
506 name='admin_permissions_object',
528 name='admin_permissions_object',
507 pattern='/permissions/object')
529 pattern='/permissions/object')
508 config.add_view(
530 config.add_view(
509 AdminPermissionsView,
531 AdminPermissionsView,
510 attr='permissions_objects',
532 attr='permissions_objects',
511 route_name='admin_permissions_object', request_method='GET',
533 route_name='admin_permissions_object', request_method='GET',
512 renderer='rhodecode:templates/admin/permissions/permissions.mako')
534 renderer='rhodecode:templates/admin/permissions/permissions.mako')
513
535
514 config.add_route(
536 config.add_route(
515 name='admin_permissions_object_update',
537 name='admin_permissions_object_update',
516 pattern='/permissions/object/update')
538 pattern='/permissions/object/update')
517 config.add_view(
539 config.add_view(
518 AdminPermissionsView,
540 AdminPermissionsView,
519 attr='permissions_objects_update',
541 attr='permissions_objects_update',
520 route_name='admin_permissions_object_update', request_method='POST',
542 route_name='admin_permissions_object_update', request_method='POST',
521 renderer='rhodecode:templates/admin/permissions/permissions.mako')
543 renderer='rhodecode:templates/admin/permissions/permissions.mako')
522
544
523 # Branch perms EE feature
545 # Branch perms EE feature
524 config.add_route(
546 config.add_route(
525 name='admin_permissions_branch',
547 name='admin_permissions_branch',
526 pattern='/permissions/branch')
548 pattern='/permissions/branch')
527 config.add_view(
549 config.add_view(
528 AdminPermissionsView,
550 AdminPermissionsView,
529 attr='permissions_branch',
551 attr='permissions_branch',
530 route_name='admin_permissions_branch', request_method='GET',
552 route_name='admin_permissions_branch', request_method='GET',
531 renderer='rhodecode:templates/admin/permissions/permissions.mako')
553 renderer='rhodecode:templates/admin/permissions/permissions.mako')
532
554
533 config.add_route(
555 config.add_route(
534 name='admin_permissions_ips',
556 name='admin_permissions_ips',
535 pattern='/permissions/ips')
557 pattern='/permissions/ips')
536 config.add_view(
558 config.add_view(
537 AdminPermissionsView,
559 AdminPermissionsView,
538 attr='permissions_ips',
560 attr='permissions_ips',
539 route_name='admin_permissions_ips', request_method='GET',
561 route_name='admin_permissions_ips', request_method='GET',
540 renderer='rhodecode:templates/admin/permissions/permissions.mako')
562 renderer='rhodecode:templates/admin/permissions/permissions.mako')
541
563
542 config.add_route(
564 config.add_route(
543 name='admin_permissions_overview',
565 name='admin_permissions_overview',
544 pattern='/permissions/overview')
566 pattern='/permissions/overview')
545 config.add_view(
567 config.add_view(
546 AdminPermissionsView,
568 AdminPermissionsView,
547 attr='permissions_overview',
569 attr='permissions_overview',
548 route_name='admin_permissions_overview', request_method='GET',
570 route_name='admin_permissions_overview', request_method='GET',
549 renderer='rhodecode:templates/admin/permissions/permissions.mako')
571 renderer='rhodecode:templates/admin/permissions/permissions.mako')
550
572
551 config.add_route(
573 config.add_route(
552 name='admin_permissions_auth_token_access',
574 name='admin_permissions_auth_token_access',
553 pattern='/permissions/auth_token_access')
575 pattern='/permissions/auth_token_access')
554 config.add_view(
576 config.add_view(
555 AdminPermissionsView,
577 AdminPermissionsView,
556 attr='auth_token_access',
578 attr='auth_token_access',
557 route_name='admin_permissions_auth_token_access', request_method='GET',
579 route_name='admin_permissions_auth_token_access', request_method='GET',
558 renderer='rhodecode:templates/admin/permissions/permissions.mako')
580 renderer='rhodecode:templates/admin/permissions/permissions.mako')
559
581
560 config.add_route(
582 config.add_route(
561 name='admin_permissions_ssh_keys',
583 name='admin_permissions_ssh_keys',
562 pattern='/permissions/ssh_keys')
584 pattern='/permissions/ssh_keys')
563 config.add_view(
585 config.add_view(
564 AdminPermissionsView,
586 AdminPermissionsView,
565 attr='ssh_keys',
587 attr='ssh_keys',
566 route_name='admin_permissions_ssh_keys', request_method='GET',
588 route_name='admin_permissions_ssh_keys', request_method='GET',
567 renderer='rhodecode:templates/admin/permissions/permissions.mako')
589 renderer='rhodecode:templates/admin/permissions/permissions.mako')
568
590
569 config.add_route(
591 config.add_route(
570 name='admin_permissions_ssh_keys_data',
592 name='admin_permissions_ssh_keys_data',
571 pattern='/permissions/ssh_keys/data')
593 pattern='/permissions/ssh_keys/data')
572 config.add_view(
594 config.add_view(
573 AdminPermissionsView,
595 AdminPermissionsView,
574 attr='ssh_keys_data',
596 attr='ssh_keys_data',
575 route_name='admin_permissions_ssh_keys_data', request_method='GET',
597 route_name='admin_permissions_ssh_keys_data', request_method='GET',
576 renderer='json_ext', xhr=True)
598 renderer='json_ext', xhr=True)
577
599
578 config.add_route(
600 config.add_route(
579 name='admin_permissions_ssh_keys_update',
601 name='admin_permissions_ssh_keys_update',
580 pattern='/permissions/ssh_keys/update')
602 pattern='/permissions/ssh_keys/update')
581 config.add_view(
603 config.add_view(
582 AdminPermissionsView,
604 AdminPermissionsView,
583 attr='ssh_keys_update',
605 attr='ssh_keys_update',
584 route_name='admin_permissions_ssh_keys_update', request_method='POST',
606 route_name='admin_permissions_ssh_keys_update', request_method='POST',
585 renderer='rhodecode:templates/admin/permissions/permissions.mako')
607 renderer='rhodecode:templates/admin/permissions/permissions.mako')
586
608
587 # users admin
609 # users admin
588 config.add_route(
610 config.add_route(
589 name='users',
611 name='users',
590 pattern='/users')
612 pattern='/users')
591 config.add_view(
613 config.add_view(
592 AdminUsersView,
614 AdminUsersView,
593 attr='users_list',
615 attr='users_list',
594 route_name='users', request_method='GET',
616 route_name='users', request_method='GET',
595 renderer='rhodecode:templates/admin/users/users.mako')
617 renderer='rhodecode:templates/admin/users/users.mako')
596
618
597 config.add_route(
619 config.add_route(
598 name='users_data',
620 name='users_data',
599 pattern='/users_data')
621 pattern='/users_data')
600 config.add_view(
622 config.add_view(
601 AdminUsersView,
623 AdminUsersView,
602 attr='users_list_data',
624 attr='users_list_data',
603 # renderer defined below
625 # renderer defined below
604 route_name='users_data', request_method='GET',
626 route_name='users_data', request_method='GET',
605 renderer='json_ext', xhr=True)
627 renderer='json_ext', xhr=True)
606
628
607 config.add_route(
629 config.add_route(
608 name='users_create',
630 name='users_create',
609 pattern='/users/create')
631 pattern='/users/create')
610 config.add_view(
632 config.add_view(
611 AdminUsersView,
633 AdminUsersView,
612 attr='users_create',
634 attr='users_create',
613 route_name='users_create', request_method='POST',
635 route_name='users_create', request_method='POST',
614 renderer='rhodecode:templates/admin/users/user_add.mako')
636 renderer='rhodecode:templates/admin/users/user_add.mako')
615
637
616 config.add_route(
638 config.add_route(
617 name='users_new',
639 name='users_new',
618 pattern='/users/new')
640 pattern='/users/new')
619 config.add_view(
641 config.add_view(
620 AdminUsersView,
642 AdminUsersView,
621 attr='users_new',
643 attr='users_new',
622 route_name='users_new', request_method='GET',
644 route_name='users_new', request_method='GET',
623 renderer='rhodecode:templates/admin/users/user_add.mako')
645 renderer='rhodecode:templates/admin/users/user_add.mako')
624
646
625 # user management
647 # user management
626 config.add_route(
648 config.add_route(
627 name='user_edit',
649 name='user_edit',
628 pattern=r'/users/{user_id:\d+}/edit',
650 pattern=r'/users/{user_id:\d+}/edit',
629 user_route=True)
651 user_route=True)
630 config.add_view(
652 config.add_view(
631 UsersView,
653 UsersView,
632 attr='user_edit',
654 attr='user_edit',
633 route_name='user_edit', request_method='GET',
655 route_name='user_edit', request_method='GET',
634 renderer='rhodecode:templates/admin/users/user_edit.mako')
656 renderer='rhodecode:templates/admin/users/user_edit.mako')
635
657
636 config.add_route(
658 config.add_route(
637 name='user_edit_advanced',
659 name='user_edit_advanced',
638 pattern=r'/users/{user_id:\d+}/edit/advanced',
660 pattern=r'/users/{user_id:\d+}/edit/advanced',
639 user_route=True)
661 user_route=True)
640 config.add_view(
662 config.add_view(
641 UsersView,
663 UsersView,
642 attr='user_edit_advanced',
664 attr='user_edit_advanced',
643 route_name='user_edit_advanced', request_method='GET',
665 route_name='user_edit_advanced', request_method='GET',
644 renderer='rhodecode:templates/admin/users/user_edit.mako')
666 renderer='rhodecode:templates/admin/users/user_edit.mako')
645
667
646 config.add_route(
668 config.add_route(
647 name='user_edit_global_perms',
669 name='user_edit_global_perms',
648 pattern=r'/users/{user_id:\d+}/edit/global_permissions',
670 pattern=r'/users/{user_id:\d+}/edit/global_permissions',
649 user_route=True)
671 user_route=True)
650 config.add_view(
672 config.add_view(
651 UsersView,
673 UsersView,
652 attr='user_edit_global_perms',
674 attr='user_edit_global_perms',
653 route_name='user_edit_global_perms', request_method='GET',
675 route_name='user_edit_global_perms', request_method='GET',
654 renderer='rhodecode:templates/admin/users/user_edit.mako')
676 renderer='rhodecode:templates/admin/users/user_edit.mako')
655
677
656 config.add_route(
678 config.add_route(
657 name='user_edit_global_perms_update',
679 name='user_edit_global_perms_update',
658 pattern=r'/users/{user_id:\d+}/edit/global_permissions/update',
680 pattern=r'/users/{user_id:\d+}/edit/global_permissions/update',
659 user_route=True)
681 user_route=True)
660 config.add_view(
682 config.add_view(
661 UsersView,
683 UsersView,
662 attr='user_edit_global_perms_update',
684 attr='user_edit_global_perms_update',
663 route_name='user_edit_global_perms_update', request_method='POST',
685 route_name='user_edit_global_perms_update', request_method='POST',
664 renderer='rhodecode:templates/admin/users/user_edit.mako')
686 renderer='rhodecode:templates/admin/users/user_edit.mako')
665
687
666 config.add_route(
688 config.add_route(
667 name='user_update',
689 name='user_update',
668 pattern=r'/users/{user_id:\d+}/update',
690 pattern=r'/users/{user_id:\d+}/update',
669 user_route=True)
691 user_route=True)
670 config.add_view(
692 config.add_view(
671 UsersView,
693 UsersView,
672 attr='user_update',
694 attr='user_update',
673 route_name='user_update', request_method='POST',
695 route_name='user_update', request_method='POST',
674 renderer='rhodecode:templates/admin/users/user_edit.mako')
696 renderer='rhodecode:templates/admin/users/user_edit.mako')
675
697
676 config.add_route(
698 config.add_route(
677 name='user_delete',
699 name='user_delete',
678 pattern=r'/users/{user_id:\d+}/delete',
700 pattern=r'/users/{user_id:\d+}/delete',
679 user_route=True)
701 user_route=True)
680 config.add_view(
702 config.add_view(
681 UsersView,
703 UsersView,
682 attr='user_delete',
704 attr='user_delete',
683 route_name='user_delete', request_method='POST',
705 route_name='user_delete', request_method='POST',
684 renderer='rhodecode:templates/admin/users/user_edit.mako')
706 renderer='rhodecode:templates/admin/users/user_edit.mako')
685
707
686 config.add_route(
708 config.add_route(
687 name='user_enable_force_password_reset',
709 name='user_enable_force_password_reset',
688 pattern=r'/users/{user_id:\d+}/password_reset_enable',
710 pattern=r'/users/{user_id:\d+}/password_reset_enable',
689 user_route=True)
711 user_route=True)
690 config.add_view(
712 config.add_view(
691 UsersView,
713 UsersView,
692 attr='user_enable_force_password_reset',
714 attr='user_enable_force_password_reset',
693 route_name='user_enable_force_password_reset', request_method='POST',
715 route_name='user_enable_force_password_reset', request_method='POST',
694 renderer='rhodecode:templates/admin/users/user_edit.mako')
716 renderer='rhodecode:templates/admin/users/user_edit.mako')
695
717
696 config.add_route(
718 config.add_route(
697 name='user_disable_force_password_reset',
719 name='user_disable_force_password_reset',
698 pattern=r'/users/{user_id:\d+}/password_reset_disable',
720 pattern=r'/users/{user_id:\d+}/password_reset_disable',
699 user_route=True)
721 user_route=True)
700 config.add_view(
722 config.add_view(
701 UsersView,
723 UsersView,
702 attr='user_disable_force_password_reset',
724 attr='user_disable_force_password_reset',
703 route_name='user_disable_force_password_reset', request_method='POST',
725 route_name='user_disable_force_password_reset', request_method='POST',
704 renderer='rhodecode:templates/admin/users/user_edit.mako')
726 renderer='rhodecode:templates/admin/users/user_edit.mako')
705
727
706 config.add_route(
728 config.add_route(
707 name='user_create_personal_repo_group',
729 name='user_create_personal_repo_group',
708 pattern=r'/users/{user_id:\d+}/create_repo_group',
730 pattern=r'/users/{user_id:\d+}/create_repo_group',
709 user_route=True)
731 user_route=True)
710 config.add_view(
732 config.add_view(
711 UsersView,
733 UsersView,
712 attr='user_create_personal_repo_group',
734 attr='user_create_personal_repo_group',
713 route_name='user_create_personal_repo_group', request_method='POST',
735 route_name='user_create_personal_repo_group', request_method='POST',
714 renderer='rhodecode:templates/admin/users/user_edit.mako')
736 renderer='rhodecode:templates/admin/users/user_edit.mako')
715
737
716 # user notice
738 # user notice
717 config.add_route(
739 config.add_route(
718 name='user_notice_dismiss',
740 name='user_notice_dismiss',
719 pattern=r'/users/{user_id:\d+}/notice_dismiss',
741 pattern=r'/users/{user_id:\d+}/notice_dismiss',
720 user_route=True)
742 user_route=True)
721 config.add_view(
743 config.add_view(
722 UsersView,
744 UsersView,
723 attr='user_notice_dismiss',
745 attr='user_notice_dismiss',
724 route_name='user_notice_dismiss', request_method='POST',
746 route_name='user_notice_dismiss', request_method='POST',
725 renderer='json_ext', xhr=True)
747 renderer='json_ext', xhr=True)
726
748
727 # user auth tokens
749 # user auth tokens
728 config.add_route(
750 config.add_route(
729 name='edit_user_auth_tokens',
751 name='edit_user_auth_tokens',
730 pattern=r'/users/{user_id:\d+}/edit/auth_tokens',
752 pattern=r'/users/{user_id:\d+}/edit/auth_tokens',
731 user_route=True)
753 user_route=True)
732 config.add_view(
754 config.add_view(
733 UsersView,
755 UsersView,
734 attr='auth_tokens',
756 attr='auth_tokens',
735 route_name='edit_user_auth_tokens', request_method='GET',
757 route_name='edit_user_auth_tokens', request_method='GET',
736 renderer='rhodecode:templates/admin/users/user_edit.mako')
758 renderer='rhodecode:templates/admin/users/user_edit.mako')
737
759
738 config.add_route(
760 config.add_route(
739 name='edit_user_auth_tokens_view',
761 name='edit_user_auth_tokens_view',
740 pattern=r'/users/{user_id:\d+}/edit/auth_tokens/view',
762 pattern=r'/users/{user_id:\d+}/edit/auth_tokens/view',
741 user_route=True)
763 user_route=True)
742 config.add_view(
764 config.add_view(
743 UsersView,
765 UsersView,
744 attr='auth_tokens_view',
766 attr='auth_tokens_view',
745 route_name='edit_user_auth_tokens_view', request_method='POST',
767 route_name='edit_user_auth_tokens_view', request_method='POST',
746 renderer='json_ext', xhr=True)
768 renderer='json_ext', xhr=True)
747
769
748 config.add_route(
770 config.add_route(
749 name='edit_user_auth_tokens_add',
771 name='edit_user_auth_tokens_add',
750 pattern=r'/users/{user_id:\d+}/edit/auth_tokens/new',
772 pattern=r'/users/{user_id:\d+}/edit/auth_tokens/new',
751 user_route=True)
773 user_route=True)
752 config.add_view(
774 config.add_view(
753 UsersView,
775 UsersView,
754 attr='auth_tokens_add',
776 attr='auth_tokens_add',
755 route_name='edit_user_auth_tokens_add', request_method='POST')
777 route_name='edit_user_auth_tokens_add', request_method='POST')
756
778
757 config.add_route(
779 config.add_route(
758 name='edit_user_auth_tokens_delete',
780 name='edit_user_auth_tokens_delete',
759 pattern=r'/users/{user_id:\d+}/edit/auth_tokens/delete',
781 pattern=r'/users/{user_id:\d+}/edit/auth_tokens/delete',
760 user_route=True)
782 user_route=True)
761 config.add_view(
783 config.add_view(
762 UsersView,
784 UsersView,
763 attr='auth_tokens_delete',
785 attr='auth_tokens_delete',
764 route_name='edit_user_auth_tokens_delete', request_method='POST')
786 route_name='edit_user_auth_tokens_delete', request_method='POST')
765
787
766 # user ssh keys
788 # user ssh keys
767 config.add_route(
789 config.add_route(
768 name='edit_user_ssh_keys',
790 name='edit_user_ssh_keys',
769 pattern=r'/users/{user_id:\d+}/edit/ssh_keys',
791 pattern=r'/users/{user_id:\d+}/edit/ssh_keys',
770 user_route=True)
792 user_route=True)
771 config.add_view(
793 config.add_view(
772 UsersView,
794 UsersView,
773 attr='ssh_keys',
795 attr='ssh_keys',
774 route_name='edit_user_ssh_keys', request_method='GET',
796 route_name='edit_user_ssh_keys', request_method='GET',
775 renderer='rhodecode:templates/admin/users/user_edit.mako')
797 renderer='rhodecode:templates/admin/users/user_edit.mako')
776
798
777 config.add_route(
799 config.add_route(
778 name='edit_user_ssh_keys_generate_keypair',
800 name='edit_user_ssh_keys_generate_keypair',
779 pattern=r'/users/{user_id:\d+}/edit/ssh_keys/generate',
801 pattern=r'/users/{user_id:\d+}/edit/ssh_keys/generate',
780 user_route=True)
802 user_route=True)
781 config.add_view(
803 config.add_view(
782 UsersView,
804 UsersView,
783 attr='ssh_keys_generate_keypair',
805 attr='ssh_keys_generate_keypair',
784 route_name='edit_user_ssh_keys_generate_keypair', request_method='GET',
806 route_name='edit_user_ssh_keys_generate_keypair', request_method='GET',
785 renderer='rhodecode:templates/admin/users/user_edit.mako')
807 renderer='rhodecode:templates/admin/users/user_edit.mako')
786
808
787 config.add_route(
809 config.add_route(
788 name='edit_user_ssh_keys_add',
810 name='edit_user_ssh_keys_add',
789 pattern=r'/users/{user_id:\d+}/edit/ssh_keys/new',
811 pattern=r'/users/{user_id:\d+}/edit/ssh_keys/new',
790 user_route=True)
812 user_route=True)
791 config.add_view(
813 config.add_view(
792 UsersView,
814 UsersView,
793 attr='ssh_keys_add',
815 attr='ssh_keys_add',
794 route_name='edit_user_ssh_keys_add', request_method='POST')
816 route_name='edit_user_ssh_keys_add', request_method='POST')
795
817
796 config.add_route(
818 config.add_route(
797 name='edit_user_ssh_keys_delete',
819 name='edit_user_ssh_keys_delete',
798 pattern=r'/users/{user_id:\d+}/edit/ssh_keys/delete',
820 pattern=r'/users/{user_id:\d+}/edit/ssh_keys/delete',
799 user_route=True)
821 user_route=True)
800 config.add_view(
822 config.add_view(
801 UsersView,
823 UsersView,
802 attr='ssh_keys_delete',
824 attr='ssh_keys_delete',
803 route_name='edit_user_ssh_keys_delete', request_method='POST')
825 route_name='edit_user_ssh_keys_delete', request_method='POST')
804
826
805 # user emails
827 # user emails
806 config.add_route(
828 config.add_route(
807 name='edit_user_emails',
829 name='edit_user_emails',
808 pattern=r'/users/{user_id:\d+}/edit/emails',
830 pattern=r'/users/{user_id:\d+}/edit/emails',
809 user_route=True)
831 user_route=True)
810 config.add_view(
832 config.add_view(
811 UsersView,
833 UsersView,
812 attr='emails',
834 attr='emails',
813 route_name='edit_user_emails', request_method='GET',
835 route_name='edit_user_emails', request_method='GET',
814 renderer='rhodecode:templates/admin/users/user_edit.mako')
836 renderer='rhodecode:templates/admin/users/user_edit.mako')
815
837
816 config.add_route(
838 config.add_route(
817 name='edit_user_emails_add',
839 name='edit_user_emails_add',
818 pattern=r'/users/{user_id:\d+}/edit/emails/new',
840 pattern=r'/users/{user_id:\d+}/edit/emails/new',
819 user_route=True)
841 user_route=True)
820 config.add_view(
842 config.add_view(
821 UsersView,
843 UsersView,
822 attr='emails_add',
844 attr='emails_add',
823 route_name='edit_user_emails_add', request_method='POST')
845 route_name='edit_user_emails_add', request_method='POST')
824
846
825 config.add_route(
847 config.add_route(
826 name='edit_user_emails_delete',
848 name='edit_user_emails_delete',
827 pattern=r'/users/{user_id:\d+}/edit/emails/delete',
849 pattern=r'/users/{user_id:\d+}/edit/emails/delete',
828 user_route=True)
850 user_route=True)
829 config.add_view(
851 config.add_view(
830 UsersView,
852 UsersView,
831 attr='emails_delete',
853 attr='emails_delete',
832 route_name='edit_user_emails_delete', request_method='POST')
854 route_name='edit_user_emails_delete', request_method='POST')
833
855
834 # user IPs
856 # user IPs
835 config.add_route(
857 config.add_route(
836 name='edit_user_ips',
858 name='edit_user_ips',
837 pattern=r'/users/{user_id:\d+}/edit/ips',
859 pattern=r'/users/{user_id:\d+}/edit/ips',
838 user_route=True)
860 user_route=True)
839 config.add_view(
861 config.add_view(
840 UsersView,
862 UsersView,
841 attr='ips',
863 attr='ips',
842 route_name='edit_user_ips', request_method='GET',
864 route_name='edit_user_ips', request_method='GET',
843 renderer='rhodecode:templates/admin/users/user_edit.mako')
865 renderer='rhodecode:templates/admin/users/user_edit.mako')
844
866
845 config.add_route(
867 config.add_route(
846 name='edit_user_ips_add',
868 name='edit_user_ips_add',
847 pattern=r'/users/{user_id:\d+}/edit/ips/new',
869 pattern=r'/users/{user_id:\d+}/edit/ips/new',
848 user_route_with_default=True) # enabled for default user too
870 user_route_with_default=True) # enabled for default user too
849 config.add_view(
871 config.add_view(
850 UsersView,
872 UsersView,
851 attr='ips_add',
873 attr='ips_add',
852 route_name='edit_user_ips_add', request_method='POST')
874 route_name='edit_user_ips_add', request_method='POST')
853
875
854 config.add_route(
876 config.add_route(
855 name='edit_user_ips_delete',
877 name='edit_user_ips_delete',
856 pattern=r'/users/{user_id:\d+}/edit/ips/delete',
878 pattern=r'/users/{user_id:\d+}/edit/ips/delete',
857 user_route_with_default=True) # enabled for default user too
879 user_route_with_default=True) # enabled for default user too
858 config.add_view(
880 config.add_view(
859 UsersView,
881 UsersView,
860 attr='ips_delete',
882 attr='ips_delete',
861 route_name='edit_user_ips_delete', request_method='POST')
883 route_name='edit_user_ips_delete', request_method='POST')
862
884
863 # user perms
885 # user perms
864 config.add_route(
886 config.add_route(
865 name='edit_user_perms_summary',
887 name='edit_user_perms_summary',
866 pattern=r'/users/{user_id:\d+}/edit/permissions_summary',
888 pattern=r'/users/{user_id:\d+}/edit/permissions_summary',
867 user_route=True)
889 user_route=True)
868 config.add_view(
890 config.add_view(
869 UsersView,
891 UsersView,
870 attr='user_perms_summary',
892 attr='user_perms_summary',
871 route_name='edit_user_perms_summary', request_method='GET',
893 route_name='edit_user_perms_summary', request_method='GET',
872 renderer='rhodecode:templates/admin/users/user_edit.mako')
894 renderer='rhodecode:templates/admin/users/user_edit.mako')
873
895
874 config.add_route(
896 config.add_route(
875 name='edit_user_perms_summary_json',
897 name='edit_user_perms_summary_json',
876 pattern=r'/users/{user_id:\d+}/edit/permissions_summary/json',
898 pattern=r'/users/{user_id:\d+}/edit/permissions_summary/json',
877 user_route=True)
899 user_route=True)
878 config.add_view(
900 config.add_view(
879 UsersView,
901 UsersView,
880 attr='user_perms_summary_json',
902 attr='user_perms_summary_json',
881 route_name='edit_user_perms_summary_json', request_method='GET',
903 route_name='edit_user_perms_summary_json', request_method='GET',
882 renderer='json_ext')
904 renderer='json_ext')
883
905
884 # user user groups management
906 # user user groups management
885 config.add_route(
907 config.add_route(
886 name='edit_user_groups_management',
908 name='edit_user_groups_management',
887 pattern=r'/users/{user_id:\d+}/edit/groups_management',
909 pattern=r'/users/{user_id:\d+}/edit/groups_management',
888 user_route=True)
910 user_route=True)
889 config.add_view(
911 config.add_view(
890 UsersView,
912 UsersView,
891 attr='groups_management',
913 attr='groups_management',
892 route_name='edit_user_groups_management', request_method='GET',
914 route_name='edit_user_groups_management', request_method='GET',
893 renderer='rhodecode:templates/admin/users/user_edit.mako')
915 renderer='rhodecode:templates/admin/users/user_edit.mako')
894
916
895 config.add_route(
917 config.add_route(
896 name='edit_user_groups_management_updates',
918 name='edit_user_groups_management_updates',
897 pattern=r'/users/{user_id:\d+}/edit/edit_user_groups_management/updates',
919 pattern=r'/users/{user_id:\d+}/edit/edit_user_groups_management/updates',
898 user_route=True)
920 user_route=True)
899 config.add_view(
921 config.add_view(
900 UsersView,
922 UsersView,
901 attr='groups_management_updates',
923 attr='groups_management_updates',
902 route_name='edit_user_groups_management_updates', request_method='POST')
924 route_name='edit_user_groups_management_updates', request_method='POST')
903
925
904 # user audit logs
926 # user audit logs
905 config.add_route(
927 config.add_route(
906 name='edit_user_audit_logs',
928 name='edit_user_audit_logs',
907 pattern=r'/users/{user_id:\d+}/edit/audit', user_route=True)
929 pattern=r'/users/{user_id:\d+}/edit/audit', user_route=True)
908 config.add_view(
930 config.add_view(
909 UsersView,
931 UsersView,
910 attr='user_audit_logs',
932 attr='user_audit_logs',
911 route_name='edit_user_audit_logs', request_method='GET',
933 route_name='edit_user_audit_logs', request_method='GET',
912 renderer='rhodecode:templates/admin/users/user_edit.mako')
934 renderer='rhodecode:templates/admin/users/user_edit.mako')
913
935
914 config.add_route(
936 config.add_route(
915 name='edit_user_audit_logs_download',
937 name='edit_user_audit_logs_download',
916 pattern=r'/users/{user_id:\d+}/edit/audit/download', user_route=True)
938 pattern=r'/users/{user_id:\d+}/edit/audit/download', user_route=True)
917 config.add_view(
939 config.add_view(
918 UsersView,
940 UsersView,
919 attr='user_audit_logs_download',
941 attr='user_audit_logs_download',
920 route_name='edit_user_audit_logs_download', request_method='GET',
942 route_name='edit_user_audit_logs_download', request_method='GET',
921 renderer='string')
943 renderer='string')
922
944
923 # user caches
945 # user caches
924 config.add_route(
946 config.add_route(
925 name='edit_user_caches',
947 name='edit_user_caches',
926 pattern=r'/users/{user_id:\d+}/edit/caches',
948 pattern=r'/users/{user_id:\d+}/edit/caches',
927 user_route=True)
949 user_route=True)
928 config.add_view(
950 config.add_view(
929 UsersView,
951 UsersView,
930 attr='user_caches',
952 attr='user_caches',
931 route_name='edit_user_caches', request_method='GET',
953 route_name='edit_user_caches', request_method='GET',
932 renderer='rhodecode:templates/admin/users/user_edit.mako')
954 renderer='rhodecode:templates/admin/users/user_edit.mako')
933
955
934 config.add_route(
956 config.add_route(
935 name='edit_user_caches_update',
957 name='edit_user_caches_update',
936 pattern=r'/users/{user_id:\d+}/edit/caches/update',
958 pattern=r'/users/{user_id:\d+}/edit/caches/update',
937 user_route=True)
959 user_route=True)
938 config.add_view(
960 config.add_view(
939 UsersView,
961 UsersView,
940 attr='user_caches_update',
962 attr='user_caches_update',
941 route_name='edit_user_caches_update', request_method='POST')
963 route_name='edit_user_caches_update', request_method='POST')
942
964
943 # user-groups admin
965 # user-groups admin
944 config.add_route(
966 config.add_route(
945 name='user_groups',
967 name='user_groups',
946 pattern='/user_groups')
968 pattern='/user_groups')
947 config.add_view(
969 config.add_view(
948 AdminUserGroupsView,
970 AdminUserGroupsView,
949 attr='user_groups_list',
971 attr='user_groups_list',
950 route_name='user_groups', request_method='GET',
972 route_name='user_groups', request_method='GET',
951 renderer='rhodecode:templates/admin/user_groups/user_groups.mako')
973 renderer='rhodecode:templates/admin/user_groups/user_groups.mako')
952
974
953 config.add_route(
975 config.add_route(
954 name='user_groups_data',
976 name='user_groups_data',
955 pattern='/user_groups_data')
977 pattern='/user_groups_data')
956 config.add_view(
978 config.add_view(
957 AdminUserGroupsView,
979 AdminUserGroupsView,
958 attr='user_groups_list_data',
980 attr='user_groups_list_data',
959 route_name='user_groups_data', request_method='GET',
981 route_name='user_groups_data', request_method='GET',
960 renderer='json_ext', xhr=True)
982 renderer='json_ext', xhr=True)
961
983
962 config.add_route(
984 config.add_route(
963 name='user_groups_new',
985 name='user_groups_new',
964 pattern='/user_groups/new')
986 pattern='/user_groups/new')
965 config.add_view(
987 config.add_view(
966 AdminUserGroupsView,
988 AdminUserGroupsView,
967 attr='user_groups_new',
989 attr='user_groups_new',
968 route_name='user_groups_new', request_method='GET',
990 route_name='user_groups_new', request_method='GET',
969 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
991 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
970
992
971 config.add_route(
993 config.add_route(
972 name='user_groups_create',
994 name='user_groups_create',
973 pattern='/user_groups/create')
995 pattern='/user_groups/create')
974 config.add_view(
996 config.add_view(
975 AdminUserGroupsView,
997 AdminUserGroupsView,
976 attr='user_groups_create',
998 attr='user_groups_create',
977 route_name='user_groups_create', request_method='POST',
999 route_name='user_groups_create', request_method='POST',
978 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
1000 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
979
1001
980 # repos admin
1002 # repos admin
981 config.add_route(
1003 config.add_route(
982 name='repos',
1004 name='repos',
983 pattern='/repos')
1005 pattern='/repos')
984 config.add_view(
1006 config.add_view(
985 AdminReposView,
1007 AdminReposView,
986 attr='repository_list',
1008 attr='repository_list',
987 route_name='repos', request_method='GET',
1009 route_name='repos', request_method='GET',
988 renderer='rhodecode:templates/admin/repos/repos.mako')
1010 renderer='rhodecode:templates/admin/repos/repos.mako')
989
1011
990 config.add_route(
1012 config.add_route(
991 name='repos_data',
1013 name='repos_data',
992 pattern='/repos_data')
1014 pattern='/repos_data')
993 config.add_view(
1015 config.add_view(
994 AdminReposView,
1016 AdminReposView,
995 attr='repository_list_data',
1017 attr='repository_list_data',
996 route_name='repos_data', request_method='GET',
1018 route_name='repos_data', request_method='GET',
997 renderer='json_ext', xhr=True)
1019 renderer='json_ext', xhr=True)
998
1020
999 config.add_route(
1021 config.add_route(
1000 name='repo_new',
1022 name='repo_new',
1001 pattern='/repos/new')
1023 pattern='/repos/new')
1002 config.add_view(
1024 config.add_view(
1003 AdminReposView,
1025 AdminReposView,
1004 attr='repository_new',
1026 attr='repository_new',
1005 route_name='repo_new', request_method='GET',
1027 route_name='repo_new', request_method='GET',
1006 renderer='rhodecode:templates/admin/repos/repo_add.mako')
1028 renderer='rhodecode:templates/admin/repos/repo_add.mako')
1007
1029
1008 config.add_route(
1030 config.add_route(
1009 name='repo_create',
1031 name='repo_create',
1010 pattern='/repos/create')
1032 pattern='/repos/create')
1011 config.add_view(
1033 config.add_view(
1012 AdminReposView,
1034 AdminReposView,
1013 attr='repository_create',
1035 attr='repository_create',
1014 route_name='repo_create', request_method='POST',
1036 route_name='repo_create', request_method='POST',
1015 renderer='rhodecode:templates/admin/repos/repos.mako')
1037 renderer='rhodecode:templates/admin/repos/repos.mako')
1016
1038
1017 # repo groups admin
1039 # repo groups admin
1018 config.add_route(
1040 config.add_route(
1019 name='repo_groups',
1041 name='repo_groups',
1020 pattern='/repo_groups')
1042 pattern='/repo_groups')
1021 config.add_view(
1043 config.add_view(
1022 AdminRepoGroupsView,
1044 AdminRepoGroupsView,
1023 attr='repo_group_list',
1045 attr='repo_group_list',
1024 route_name='repo_groups', request_method='GET',
1046 route_name='repo_groups', request_method='GET',
1025 renderer='rhodecode:templates/admin/repo_groups/repo_groups.mako')
1047 renderer='rhodecode:templates/admin/repo_groups/repo_groups.mako')
1026
1048
1027 config.add_route(
1049 config.add_route(
1028 name='repo_groups_data',
1050 name='repo_groups_data',
1029 pattern='/repo_groups_data')
1051 pattern='/repo_groups_data')
1030 config.add_view(
1052 config.add_view(
1031 AdminRepoGroupsView,
1053 AdminRepoGroupsView,
1032 attr='repo_group_list_data',
1054 attr='repo_group_list_data',
1033 route_name='repo_groups_data', request_method='GET',
1055 route_name='repo_groups_data', request_method='GET',
1034 renderer='json_ext', xhr=True)
1056 renderer='json_ext', xhr=True)
1035
1057
1036 config.add_route(
1058 config.add_route(
1037 name='repo_group_new',
1059 name='repo_group_new',
1038 pattern='/repo_group/new')
1060 pattern='/repo_group/new')
1039 config.add_view(
1061 config.add_view(
1040 AdminRepoGroupsView,
1062 AdminRepoGroupsView,
1041 attr='repo_group_new',
1063 attr='repo_group_new',
1042 route_name='repo_group_new', request_method='GET',
1064 route_name='repo_group_new', request_method='GET',
1043 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
1065 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
1044
1066
1045 config.add_route(
1067 config.add_route(
1046 name='repo_group_create',
1068 name='repo_group_create',
1047 pattern='/repo_group/create')
1069 pattern='/repo_group/create')
1048 config.add_view(
1070 config.add_view(
1049 AdminRepoGroupsView,
1071 AdminRepoGroupsView,
1050 attr='repo_group_create',
1072 attr='repo_group_create',
1051 route_name='repo_group_create', request_method='POST',
1073 route_name='repo_group_create', request_method='POST',
1052 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
1074 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
1053
1075
1054
1076
1055 def includeme(config):
1077 def includeme(config):
1056 # Create admin navigation registry and add it to the pyramid registry.
1078 # Create admin navigation registry and add it to the pyramid registry.
1057 nav_includeme(config)
1079 nav_includeme(config)
1058
1080
1059 # main admin routes
1081 # main admin routes
1060 config.add_route(
1082 config.add_route(
1061 name='admin_home', pattern=ADMIN_PREFIX)
1083 name='admin_home', pattern=ADMIN_PREFIX)
1062 config.add_view(
1084 config.add_view(
1063 AdminMainView,
1085 AdminMainView,
1064 attr='admin_main',
1086 attr='admin_main',
1065 route_name='admin_home', request_method='GET',
1087 route_name='admin_home', request_method='GET',
1066 renderer='rhodecode:templates/admin/main.mako')
1088 renderer='rhodecode:templates/admin/main.mako')
1067
1089
1068 # pr global redirect
1090 # pr global redirect
1069 config.add_route(
1091 config.add_route(
1070 name='pull_requests_global_0', # backward compat
1092 name='pull_requests_global_0', # backward compat
1071 pattern=ADMIN_PREFIX + r'/pull_requests/{pull_request_id:\d+}')
1093 pattern=ADMIN_PREFIX + r'/pull_requests/{pull_request_id:\d+}')
1072 config.add_view(
1094 config.add_view(
1073 AdminMainView,
1095 AdminMainView,
1074 attr='pull_requests',
1096 attr='pull_requests',
1075 route_name='pull_requests_global_0', request_method='GET')
1097 route_name='pull_requests_global_0', request_method='GET')
1076
1098
1077 config.add_route(
1099 config.add_route(
1078 name='pull_requests_global_1', # backward compat
1100 name='pull_requests_global_1', # backward compat
1079 pattern=ADMIN_PREFIX + r'/pull-requests/{pull_request_id:\d+}')
1101 pattern=ADMIN_PREFIX + r'/pull-requests/{pull_request_id:\d+}')
1080 config.add_view(
1102 config.add_view(
1081 AdminMainView,
1103 AdminMainView,
1082 attr='pull_requests',
1104 attr='pull_requests',
1083 route_name='pull_requests_global_1', request_method='GET')
1105 route_name='pull_requests_global_1', request_method='GET')
1084
1106
1085 config.add_route(
1107 config.add_route(
1086 name='pull_requests_global',
1108 name='pull_requests_global',
1087 pattern=ADMIN_PREFIX + r'/pull-request/{pull_request_id:\d+}')
1109 pattern=ADMIN_PREFIX + r'/pull-request/{pull_request_id:\d+}')
1088 config.add_view(
1110 config.add_view(
1089 AdminMainView,
1111 AdminMainView,
1090 attr='pull_requests',
1112 attr='pull_requests',
1091 route_name='pull_requests_global', request_method='GET')
1113 route_name='pull_requests_global', request_method='GET')
1092
1114
1093 config.include(admin_routes, route_prefix=ADMIN_PREFIX)
1115 config.include(admin_routes, route_prefix=ADMIN_PREFIX)
@@ -1,1263 +1,1264 b''
1
1
2 <%!
2 <%!
3 from rhodecode.lib import html_filters
3 from rhodecode.lib import html_filters
4 %>
4 %>
5
5
6 <%inherit file="root.mako"/>
6 <%inherit file="root.mako"/>
7
7
8 <%include file="/ejs_templates/templates.html"/>
8 <%include file="/ejs_templates/templates.html"/>
9
9
10 <div class="outerwrapper">
10 <div class="outerwrapper">
11 <!-- HEADER -->
11 <!-- HEADER -->
12 <div class="header">
12 <div class="header">
13 <div id="header-inner" class="wrapper">
13 <div id="header-inner" class="wrapper">
14 <div id="logo">
14 <div id="logo">
15 <div class="logo-wrapper">
15 <div class="logo-wrapper">
16 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
16 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
17 </div>
17 </div>
18 % if c.rhodecode_name:
18 % if c.rhodecode_name:
19 <div class="branding">
19 <div class="branding">
20 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
20 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
21 </div>
21 </div>
22 % endif
22 % endif
23 </div>
23 </div>
24 <!-- MENU BAR NAV -->
24 <!-- MENU BAR NAV -->
25 ${self.menu_bar_nav()}
25 ${self.menu_bar_nav()}
26 <!-- END MENU BAR NAV -->
26 <!-- END MENU BAR NAV -->
27 </div>
27 </div>
28 </div>
28 </div>
29 ${self.menu_bar_subnav()}
29 ${self.menu_bar_subnav()}
30 <!-- END HEADER -->
30 <!-- END HEADER -->
31
31
32 <!-- CONTENT -->
32 <!-- CONTENT -->
33 <div id="content" class="wrapper">
33 <div id="content" class="wrapper">
34
34
35 <rhodecode-toast id="notifications"></rhodecode-toast>
35 <rhodecode-toast id="notifications"></rhodecode-toast>
36
36
37 <div class="main">
37 <div class="main">
38 ${next.main()}
38 ${next.main()}
39 </div>
39 </div>
40
40
41 </div>
41 </div>
42 <!-- END CONTENT -->
42 <!-- END CONTENT -->
43
43
44 </div>
44 </div>
45
45
46 <!-- FOOTER -->
46 <!-- FOOTER -->
47 <div id="footer">
47 <div id="footer">
48 <div id="footer-inner" class="title wrapper">
48 <div id="footer-inner" class="title wrapper">
49 <div>
49 <div>
50 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
50 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
51
51
52 <p class="footer-link-right">
52 <p class="footer-link-right">
53 <a class="grey-link-action" href="${h.route_path('home', _query={'showrcid': 1})}">
53 <a class="grey-link-action" href="${h.route_path('home', _query={'showrcid': 1})}">
54 RhodeCode
54 RhodeCode
55 % if c.visual.show_version:
55 % if c.visual.show_version:
56 ${c.rhodecode_version}
56 ${c.rhodecode_version}
57 % endif
57 % endif
58 ${c.rhodecode_edition}
58 ${c.rhodecode_edition}
59 </a> |
59 </a> |
60
60
61 % if c.visual.rhodecode_support_url:
61 % if c.visual.rhodecode_support_url:
62 <a class="grey-link-action" href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a> |
62 <a class="grey-link-action" href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a> |
63 <a class="grey-link-action" href="https://docs.rhodecode.com" target="_blank">${_('Documentation')}</a>
63 <a class="grey-link-action" href="https://docs.rhodecode.com" target="_blank">${_('Documentation')}</a>
64 % endif
64 % endif
65
65
66 </p>
66 </p>
67
67
68 <p class="server-instance" style="display:${sid}">
68 <p class="server-instance" style="display:${sid}">
69 ## display hidden instance ID if specially defined
69 ## display hidden instance ID if specially defined
70 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
70 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
71 % if c.rhodecode_instanceid:
71 % if c.rhodecode_instanceid:
72 ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)}
72 ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)}
73 % endif
73 % endif
74 </p>
74 </p>
75 </div>
75 </div>
76 </div>
76 </div>
77 </div>
77 </div>
78
78
79 <!-- END FOOTER -->
79 <!-- END FOOTER -->
80
80
81 ### MAKO DEFS ###
81 ### MAKO DEFS ###
82
82
83 <%def name="menu_bar_subnav()">
83 <%def name="menu_bar_subnav()">
84 </%def>
84 </%def>
85
85
86 <%def name="breadcrumbs(class_='breadcrumbs')">
86 <%def name="breadcrumbs(class_='breadcrumbs')">
87 <div class="${class_}">
87 <div class="${class_}">
88 ${self.breadcrumbs_links()}
88 ${self.breadcrumbs_links()}
89 </div>
89 </div>
90 </%def>
90 </%def>
91
91
92 <%def name="admin_menu(active=None)">
92 <%def name="admin_menu(active=None)">
93
93
94 <div id="context-bar">
94 <div id="context-bar">
95 <div class="wrapper">
95 <div class="wrapper">
96 <div class="title">
96 <div class="title">
97 <div class="title-content">
97 <div class="title-content">
98 <div class="title-main">
98 <div class="title-main">
99 % if c.is_super_admin:
99 % if c.is_super_admin:
100 ${_('Super-admin Panel')}
100 ${_('Super-admin Panel')}
101 % else:
101 % else:
102 ${_('Delegated Admin Panel')}
102 ${_('Delegated Admin Panel')}
103 % endif
103 % endif
104 </div>
104 </div>
105 </div>
105 </div>
106 </div>
106 </div>
107
107
108 <ul id="context-pages" class="navigation horizontal-list">
108 <ul id="context-pages" class="navigation horizontal-list">
109
109
110 ## super-admin case (Top Menu)
110 ## super-admin case (Top Menu)
111 % if c.is_super_admin:
111 % if c.is_super_admin:
112 <li class="${h.is_active('audit_logs', active)}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
112 <li class="${h.is_active('audit_logs', active)}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
113 <li class="${h.is_active('repositories', active)}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
113 <li class="${h.is_active('repositories', active)}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
114 <li class="${h.is_active('repository_groups', active)}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
114 <li class="${h.is_active('repository_groups', active)}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
115 <li class="${h.is_active('users', active)}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
115 <li class="${h.is_active('users', active)}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
116 <li class="${h.is_active('user_groups', active)}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
116 <li class="${h.is_active('user_groups', active)}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
117 <li class="${h.is_active('security', active)}"><a href="${h.route_path('admin_security')}">${_('Security')}</a></li>
117 <li class="${h.is_active('artifacts', active)}"><a href="${h.route_path('admin_artifacts')}">${_('Artifacts')}</a></li>
118 <li class="${h.is_active('artifacts', active)}"><a href="${h.route_path('admin_artifacts')}">${_('Artifacts')}</a></li>
118 <li class="${h.is_active('automation', active)}"><a href="${h.route_path('admin_automation')}">${_('Automation')}</a></li>
119 <li class="${h.is_active('automation', active)}"><a href="${h.route_path('admin_automation')}">${_('Automation')}</a></li>
119 <li class="${h.is_active('scheduler', active)}"><a href="${h.route_path('admin_scheduler')}">${_('Scheduler')}</a></li>
120 <li class="${h.is_active('scheduler', active)}"><a href="${h.route_path('admin_scheduler')}">${_('Scheduler')}</a></li>
120 <li class="${h.is_active('permissions', active)}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
121 <li class="${h.is_active('permissions', active)}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
121 <li class="${h.is_active('authentication', active)}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
122 <li class="${h.is_active('authentication', active)}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
122 <li class="${h.is_active('integrations', active)}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
123 <li class="${h.is_active('integrations', active)}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
123 <li class="${h.is_active('defaults', active)}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
124 <li class="${h.is_active('defaults', active)}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
124 <li class="${h.is_active('settings', active)}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
125 <li class="${h.is_active('settings', active)}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
125
126
126 ## delegated admin
127 ## delegated admin
127 % elif c.is_delegated_admin:
128 % elif c.is_delegated_admin:
128 <%
129 <%
129 repositories=c.auth_user.repositories_admin or c.can_create_repo
130 repositories=c.auth_user.repositories_admin or c.can_create_repo
130 repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group
131 repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group
131 user_groups=c.auth_user.user_groups_admin or c.can_create_user_group
132 user_groups=c.auth_user.user_groups_admin or c.can_create_user_group
132 %>
133 %>
133
134
134 %if repositories:
135 %if repositories:
135 <li class="${h.is_active('repositories', active)} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
136 <li class="${h.is_active('repositories', active)} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
136 %endif
137 %endif
137 %if repository_groups:
138 %if repository_groups:
138 <li class="${h.is_active('repository_groups', active)} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
139 <li class="${h.is_active('repository_groups', active)} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
139 %endif
140 %endif
140 %if user_groups:
141 %if user_groups:
141 <li class="${h.is_active('user_groups', active)} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
142 <li class="${h.is_active('user_groups', active)} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
142 %endif
143 %endif
143 % endif
144 % endif
144 </ul>
145 </ul>
145
146
146 </div>
147 </div>
147 <div class="clear"></div>
148 <div class="clear"></div>
148 </div>
149 </div>
149 </%def>
150 </%def>
150
151
151 <%def name="dt_info_panel(elements)">
152 <%def name="dt_info_panel(elements)">
152 <dl class="dl-horizontal">
153 <dl class="dl-horizontal">
153 %for dt, dd, title, show_items in elements:
154 %for dt, dd, title, show_items in elements:
154 <dt>${dt}:</dt>
155 <dt>${dt}:</dt>
155 <dd title="${h.tooltip(title)}">
156 <dd title="${h.tooltip(title)}">
156 %if callable(dd):
157 %if callable(dd):
157 ## allow lazy evaluation of elements
158 ## allow lazy evaluation of elements
158 ${dd()}
159 ${dd()}
159 %else:
160 %else:
160 ${dd}
161 ${dd}
161 %endif
162 %endif
162 %if show_items:
163 %if show_items:
163 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
164 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
164 %endif
165 %endif
165 </dd>
166 </dd>
166
167
167 %if show_items:
168 %if show_items:
168 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
169 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
169 %for item in show_items:
170 %for item in show_items:
170 <dt></dt>
171 <dt></dt>
171 <dd>${item}</dd>
172 <dd>${item}</dd>
172 %endfor
173 %endfor
173 </div>
174 </div>
174 %endif
175 %endif
175
176
176 %endfor
177 %endfor
177 </dl>
178 </dl>
178 </%def>
179 </%def>
179
180
180 <%def name="tr_info_entry(element)">
181 <%def name="tr_info_entry(element)">
181 <% key, val, title, show_items = element %>
182 <% key, val, title, show_items = element %>
182
183
183 <tr>
184 <tr>
184 <td style="vertical-align: top">${key}</td>
185 <td style="vertical-align: top">${key}</td>
185 <td title="${h.tooltip(title)}">
186 <td title="${h.tooltip(title)}">
186 %if callable(val):
187 %if callable(val):
187 ## allow lazy evaluation of elements
188 ## allow lazy evaluation of elements
188 ${val()}
189 ${val()}
189 %else:
190 %else:
190 ${val}
191 ${val}
191 %endif
192 %endif
192 %if show_items:
193 %if show_items:
193 <div class="collapsable-content" data-toggle="item-${h.md5_safe(h.safe_str(val))[:6]}-details" style="display: none">
194 <div class="collapsable-content" data-toggle="item-${h.md5_safe(h.safe_str(val))[:6]}-details" style="display: none">
194 % for item in show_items:
195 % for item in show_items:
195 <dt></dt>
196 <dt></dt>
196 <dd>${item}</dd>
197 <dd>${item}</dd>
197 % endfor
198 % endfor
198 </div>
199 </div>
199 %endif
200 %endif
200 </td>
201 </td>
201 <td style="vertical-align: top">
202 <td style="vertical-align: top">
202 %if show_items:
203 %if show_items:
203 <span class="btn-collapse" data-toggle="item-${h.md5_safe(h.safe_str(val))[:6]}-details">${_('Show More')} </span>
204 <span class="btn-collapse" data-toggle="item-${h.md5_safe(h.safe_str(val))[:6]}-details">${_('Show More')} </span>
204 %endif
205 %endif
205 </td>
206 </td>
206 </tr>
207 </tr>
207
208
208 </%def>
209 </%def>
209
210
210 <%def name="gravatar(email, size=16, tooltip=False, tooltip_alt=None, user=None, extra_class=None)">
211 <%def name="gravatar(email, size=16, tooltip=False, tooltip_alt=None, user=None, extra_class=None)">
211 <%
212 <%
212 if size > 16:
213 if size > 16:
213 gravatar_class = ['gravatar','gravatar-large']
214 gravatar_class = ['gravatar','gravatar-large']
214 else:
215 else:
215 gravatar_class = ['gravatar']
216 gravatar_class = ['gravatar']
216
217
217 data_hovercard_url = ''
218 data_hovercard_url = ''
218 data_hovercard_alt = tooltip_alt.replace('<', '&lt;').replace('>', '&gt;') if tooltip_alt else ''
219 data_hovercard_alt = tooltip_alt.replace('<', '&lt;').replace('>', '&gt;') if tooltip_alt else ''
219
220
220 if tooltip:
221 if tooltip:
221 gravatar_class += ['tooltip-hovercard']
222 gravatar_class += ['tooltip-hovercard']
222 if extra_class:
223 if extra_class:
223 gravatar_class += extra_class
224 gravatar_class += extra_class
224 if tooltip and user:
225 if tooltip and user:
225 if user.username == h.DEFAULT_USER:
226 if user.username == h.DEFAULT_USER:
226 gravatar_class.pop(-1)
227 gravatar_class.pop(-1)
227 else:
228 else:
228 data_hovercard_url = request.route_path('hovercard_user', user_id=getattr(user, 'user_id', ''))
229 data_hovercard_url = request.route_path('hovercard_user', user_id=getattr(user, 'user_id', ''))
229 gravatar_class = ' '.join(gravatar_class)
230 gravatar_class = ' '.join(gravatar_class)
230
231
231 %>
232 %>
232 <%doc>
233 <%doc>
233 TODO: johbo: For now we serve double size images to make it smooth
234 TODO: johbo: For now we serve double size images to make it smooth
234 for retina. This is how it worked until now. Should be replaced
235 for retina. This is how it worked until now. Should be replaced
235 with a better solution at some point.
236 with a better solution at some point.
236 </%doc>
237 </%doc>
237
238
238 <img class="${gravatar_class}" height="${size}" width="${size}" data-hovercard-url="${data_hovercard_url}" data-hovercard-alt="${data_hovercard_alt}" src="${h.gravatar_url(email, size * 2, request=request)}" />
239 <img class="${gravatar_class}" height="${size}" width="${size}" data-hovercard-url="${data_hovercard_url}" data-hovercard-alt="${data_hovercard_alt}" src="${h.gravatar_url(email, size * 2, request=request)}" />
239 </%def>
240 </%def>
240
241
241
242
242 <%def name="gravatar_with_user(contact, size=16, show_disabled=False, tooltip=False, _class='rc-user')">
243 <%def name="gravatar_with_user(contact, size=16, show_disabled=False, tooltip=False, _class='rc-user')">
243 <%
244 <%
244 email = h.email_or_none(contact)
245 email = h.email_or_none(contact)
245 rc_user = h.discover_user(contact)
246 rc_user = h.discover_user(contact)
246 %>
247 %>
247
248
248 <div class="${_class}">
249 <div class="${_class}">
249 ${self.gravatar(email, size, tooltip=tooltip, tooltip_alt=contact, user=rc_user)}
250 ${self.gravatar(email, size, tooltip=tooltip, tooltip_alt=contact, user=rc_user)}
250 <span class="${('user user-disabled' if show_disabled else 'user')}">
251 <span class="${('user user-disabled' if show_disabled else 'user')}">
251 ${h.link_to_user(rc_user or contact)}
252 ${h.link_to_user(rc_user or contact)}
252 </span>
253 </span>
253 </div>
254 </div>
254 </%def>
255 </%def>
255
256
256
257
257 <%def name="user_group_icon(user_group=None, size=16, tooltip=False)">
258 <%def name="user_group_icon(user_group=None, size=16, tooltip=False)">
258 <%
259 <%
259 if (size > 16):
260 if (size > 16):
260 gravatar_class = 'icon-user-group-alt'
261 gravatar_class = 'icon-user-group-alt'
261 else:
262 else:
262 gravatar_class = 'icon-user-group-alt'
263 gravatar_class = 'icon-user-group-alt'
263
264
264 if tooltip:
265 if tooltip:
265 gravatar_class += ' tooltip-hovercard'
266 gravatar_class += ' tooltip-hovercard'
266
267
267 data_hovercard_url = request.route_path('hovercard_user_group', user_group_id=user_group.users_group_id)
268 data_hovercard_url = request.route_path('hovercard_user_group', user_group_id=user_group.users_group_id)
268 %>
269 %>
269 <%doc>
270 <%doc>
270 TODO: johbo: For now we serve double size images to make it smooth
271 TODO: johbo: For now we serve double size images to make it smooth
271 for retina. This is how it worked until now. Should be replaced
272 for retina. This is how it worked until now. Should be replaced
272 with a better solution at some point.
273 with a better solution at some point.
273 </%doc>
274 </%doc>
274
275
275 <i style="font-size: ${size}px" class="${gravatar_class} x-icon-size-${size}" data-hovercard-url="${data_hovercard_url}"></i>
276 <i style="font-size: ${size}px" class="${gravatar_class} x-icon-size-${size}" data-hovercard-url="${data_hovercard_url}"></i>
276 </%def>
277 </%def>
277
278
278 <%def name="repo_page_title(repo_instance)">
279 <%def name="repo_page_title(repo_instance)">
279 <div class="title-content repo-title">
280 <div class="title-content repo-title">
280
281
281 <div class="title-main">
282 <div class="title-main">
282 ## SVN/HG/GIT icons
283 ## SVN/HG/GIT icons
283 %if h.is_hg(repo_instance):
284 %if h.is_hg(repo_instance):
284 <i class="icon-hg"></i>
285 <i class="icon-hg"></i>
285 %endif
286 %endif
286 %if h.is_git(repo_instance):
287 %if h.is_git(repo_instance):
287 <i class="icon-git"></i>
288 <i class="icon-git"></i>
288 %endif
289 %endif
289 %if h.is_svn(repo_instance):
290 %if h.is_svn(repo_instance):
290 <i class="icon-svn"></i>
291 <i class="icon-svn"></i>
291 %endif
292 %endif
292
293
293 ## public/private
294 ## public/private
294 %if repo_instance.private:
295 %if repo_instance.private:
295 <i class="icon-repo-private"></i>
296 <i class="icon-repo-private"></i>
296 %else:
297 %else:
297 <i class="icon-repo-public"></i>
298 <i class="icon-repo-public"></i>
298 %endif
299 %endif
299
300
300 ## repo name with group name
301 ## repo name with group name
301 ${h.breadcrumb_repo_link(repo_instance)}
302 ${h.breadcrumb_repo_link(repo_instance)}
302
303
303 ## Context Actions
304 ## Context Actions
304 <div class="pull-right">
305 <div class="pull-right">
305 %if c.rhodecode_user.username != h.DEFAULT_USER:
306 %if c.rhodecode_user.username != h.DEFAULT_USER:
306 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_uid, _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
307 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_uid, _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
307
308
308 <a href="#WatchRepo" onclick="toggleFollowingRepo(this, templateContext.repo_id); return false" title="${_('Watch this Repository and actions on it in your personalized journal')}" class="btn btn-sm ${('watching' if c.repository_is_user_following else '')}">
309 <a href="#WatchRepo" onclick="toggleFollowingRepo(this, templateContext.repo_id); return false" title="${_('Watch this Repository and actions on it in your personalized journal')}" class="btn btn-sm ${('watching' if c.repository_is_user_following else '')}">
309 % if c.repository_is_user_following:
310 % if c.repository_is_user_following:
310 <i class="icon-eye-off"></i>${_('Unwatch')}
311 <i class="icon-eye-off"></i>${_('Unwatch')}
311 % else:
312 % else:
312 <i class="icon-eye"></i>${_('Watch')}
313 <i class="icon-eye"></i>${_('Watch')}
313 % endif
314 % endif
314
315
315 </a>
316 </a>
316 %else:
317 %else:
317 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_uid)}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
318 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_uid)}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
318 %endif
319 %endif
319 </div>
320 </div>
320
321
321 </div>
322 </div>
322
323
323 ## FORKED
324 ## FORKED
324 %if repo_instance.fork:
325 %if repo_instance.fork:
325 <p class="discreet">
326 <p class="discreet">
326 <i class="icon-code-fork"></i> ${_('Fork of')}
327 <i class="icon-code-fork"></i> ${_('Fork of')}
327 ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))}
328 ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))}
328 </p>
329 </p>
329 %endif
330 %endif
330
331
331 ## IMPORTED FROM REMOTE
332 ## IMPORTED FROM REMOTE
332 %if repo_instance.clone_uri:
333 %if repo_instance.clone_uri:
333 <p class="discreet">
334 <p class="discreet">
334 <i class="icon-code-fork"></i> ${_('Clone from')}
335 <i class="icon-code-fork"></i> ${_('Clone from')}
335 <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
336 <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
336 </p>
337 </p>
337 %endif
338 %endif
338
339
339 ## LOCKING STATUS
340 ## LOCKING STATUS
340 %if repo_instance.locked[0]:
341 %if repo_instance.locked[0]:
341 <p class="locking_locked discreet">
342 <p class="locking_locked discreet">
342 <i class="icon-repo-lock"></i>
343 <i class="icon-repo-lock"></i>
343 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
344 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
344 </p>
345 </p>
345 %elif repo_instance.enable_locking:
346 %elif repo_instance.enable_locking:
346 <p class="locking_unlocked discreet">
347 <p class="locking_unlocked discreet">
347 ${_('Repository not locked. Pull repository to lock it.')}
348 ${_('Repository not locked. Pull repository to lock it.')}
348 </p>
349 </p>
349 %endif
350 %endif
350
351
351 </div>
352 </div>
352 </%def>
353 </%def>
353
354
354 <%def name="repo_menu(active=None)">
355 <%def name="repo_menu(active=None)">
355 <%
356 <%
356 ## determine if we have "any" option available
357 ## determine if we have "any" option available
357 can_lock = h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking
358 can_lock = h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking
358 has_actions = can_lock
359 has_actions = can_lock
359
360
360 %>
361 %>
361 % if c.rhodecode_db_repo.archived:
362 % if c.rhodecode_db_repo.archived:
362 <div class="alert alert-warning text-center">
363 <div class="alert alert-warning text-center">
363 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
364 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
364 </div>
365 </div>
365 % endif
366 % endif
366
367
367 <!--- REPO CONTEXT BAR -->
368 <!--- REPO CONTEXT BAR -->
368 <div id="context-bar">
369 <div id="context-bar">
369 <div class="wrapper">
370 <div class="wrapper">
370
371
371 <div class="title">
372 <div class="title">
372 ${self.repo_page_title(c.rhodecode_db_repo)}
373 ${self.repo_page_title(c.rhodecode_db_repo)}
373 </div>
374 </div>
374
375
375 <ul id="context-pages" class="navigation horizontal-list">
376 <ul id="context-pages" class="navigation horizontal-list">
376 <li class="${h.is_active('summary', active)}"><a class="menulink" href="${h.route_path('repo_summary_explicit', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li>
377 <li class="${h.is_active('summary', active)}"><a class="menulink" href="${h.route_path('repo_summary_explicit', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li>
377 <li class="${h.is_active('commits', active)}"><a class="menulink" href="${h.route_path('repo_commits', repo_name=c.repo_name)}"><div class="menulabel">${_('Commits')}</div></a></li>
378 <li class="${h.is_active('commits', active)}"><a class="menulink" href="${h.route_path('repo_commits', repo_name=c.repo_name)}"><div class="menulabel">${_('Commits')}</div></a></li>
378 <li class="${h.is_active('files', active)}"><a class="menulink" href="${h.repo_files_by_ref_url(c.repo_name, c.rhodecode_db_repo.repo_type, f_path='', ref_name=c.rhodecode_db_repo.landing_ref_name, commit_id='tip', query={'at':c.rhodecode_db_repo.landing_ref_name})}"><div class="menulabel">${_('Files')}</div></a></li>
379 <li class="${h.is_active('files', active)}"><a class="menulink" href="${h.repo_files_by_ref_url(c.repo_name, c.rhodecode_db_repo.repo_type, f_path='', ref_name=c.rhodecode_db_repo.landing_ref_name, commit_id='tip', query={'at':c.rhodecode_db_repo.landing_ref_name})}"><div class="menulabel">${_('Files')}</div></a></li>
379 <li class="${h.is_active('compare', active)}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li>
380 <li class="${h.is_active('compare', active)}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li>
380
381
381 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
382 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
382 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
383 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
383 <li class="${h.is_active('showpullrequest', active)}">
384 <li class="${h.is_active('showpullrequest', active)}">
384 <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${h.tooltip(_('Show Pull Requests for %s') % c.repo_name)}">
385 <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${h.tooltip(_('Show Pull Requests for %s') % c.repo_name)}">
385 <div class="menulabel">
386 <div class="menulabel">
386 ${_('Pull Requests')} <span class="menulink-counter">${c.repository_pull_requests}</span>
387 ${_('Pull Requests')} <span class="menulink-counter">${c.repository_pull_requests}</span>
387 </div>
388 </div>
388 </a>
389 </a>
389 </li>
390 </li>
390 %endif
391 %endif
391
392
392 <li class="${h.is_active('artifacts', active)}">
393 <li class="${h.is_active('artifacts', active)}">
393 <a class="menulink" href="${h.route_path('repo_artifacts_list',repo_name=c.repo_name)}">
394 <a class="menulink" href="${h.route_path('repo_artifacts_list',repo_name=c.repo_name)}">
394 <div class="menulabel">
395 <div class="menulabel">
395 ${_('Artifacts')} <span class="menulink-counter">${c.repository_artifacts}</span>
396 ${_('Artifacts')} <span class="menulink-counter">${c.repository_artifacts}</span>
396 </div>
397 </div>
397 </a>
398 </a>
398 </li>
399 </li>
399
400
400 %if not c.rhodecode_db_repo.archived and h.HasRepoPermissionAll('repository.admin')(c.repo_name):
401 %if not c.rhodecode_db_repo.archived and h.HasRepoPermissionAll('repository.admin')(c.repo_name):
401 <li class="${h.is_active('settings', active)}"><a class="menulink" href="${h.route_path('edit_repo',repo_name=c.repo_name)}"><div class="menulabel">${_('Repository Settings')}</div></a></li>
402 <li class="${h.is_active('settings', active)}"><a class="menulink" href="${h.route_path('edit_repo',repo_name=c.repo_name)}"><div class="menulabel">${_('Repository Settings')}</div></a></li>
402 %endif
403 %endif
403
404
404 <li class="${h.is_active('options', active)}">
405 <li class="${h.is_active('options', active)}">
405 % if has_actions:
406 % if has_actions:
406 <a class="menulink dropdown">
407 <a class="menulink dropdown">
407 <div class="menulabel">${_('Quick Actions')}<div class="show_more"></div></div>
408 <div class="menulabel">${_('Quick Actions')}<div class="show_more"></div></div>
408 </a>
409 </a>
409 <ul class="submenu">
410 <ul class="submenu">
410 %if can_lock:
411 %if can_lock:
411 %if c.rhodecode_db_repo.locked[0]:
412 %if c.rhodecode_db_repo.locked[0]:
412 <li><a class="locking_del" href="${h.route_path('repo_settings_quick_actions',repo_name=c.repo_name, _query={'action': 'toggle-lock', 'set_unlock': 1})}">${_('Unlock Repository')}</a></li>
413 <li><a class="locking_del" href="${h.route_path('repo_settings_quick_actions',repo_name=c.repo_name, _query={'action': 'toggle-lock', 'set_unlock': 1})}">${_('Unlock Repository')}</a></li>
413 %else:
414 %else:
414 <li><a class="locking_add" href="${h.route_path('repo_settings_quick_actions',repo_name=c.repo_name, _query={'action': 'toggle-lock', 'set_lock': 1})}">${_('Lock Repository')}</a></li>
415 <li><a class="locking_add" href="${h.route_path('repo_settings_quick_actions',repo_name=c.repo_name, _query={'action': 'toggle-lock', 'set_lock': 1})}">${_('Lock Repository')}</a></li>
415 %endif
416 %endif
416 %endif
417 %endif
417 </ul>
418 </ul>
418 % endif
419 % endif
419 </li>
420 </li>
420
421
421 </ul>
422 </ul>
422 </div>
423 </div>
423 <div class="clear"></div>
424 <div class="clear"></div>
424 </div>
425 </div>
425
426
426 <!--- REPO END CONTEXT BAR -->
427 <!--- REPO END CONTEXT BAR -->
427
428
428 </%def>
429 </%def>
429
430
430 <%def name="repo_group_page_title(repo_group_instance)">
431 <%def name="repo_group_page_title(repo_group_instance)">
431 <div class="title-content">
432 <div class="title-content">
432 <div class="title-main">
433 <div class="title-main">
433 ## Repository Group icon
434 ## Repository Group icon
434 <i class="icon-repo-group"></i>
435 <i class="icon-repo-group"></i>
435
436
436 ## repo name with group name
437 ## repo name with group name
437 ${h.breadcrumb_repo_group_link(repo_group_instance)}
438 ${h.breadcrumb_repo_group_link(repo_group_instance)}
438 </div>
439 </div>
439
440
440 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
441 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
441 <div class="repo-group-desc discreet">
442 <div class="repo-group-desc discreet">
442 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
443 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
443 </div>
444 </div>
444
445
445 </div>
446 </div>
446 </%def>
447 </%def>
447
448
448
449
449 <%def name="repo_group_menu(active=None)">
450 <%def name="repo_group_menu(active=None)">
450 <%
451 <%
451 gr_name = c.repo_group.group_name if c.repo_group else None
452 gr_name = c.repo_group.group_name if c.repo_group else None
452 # create repositories with write permission on group is set to true
453 # create repositories with write permission on group is set to true
453 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
454 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
454
455
455 %>
456 %>
456
457
457
458
458 <!--- REPO GROUP CONTEXT BAR -->
459 <!--- REPO GROUP CONTEXT BAR -->
459 <div id="context-bar">
460 <div id="context-bar">
460 <div class="wrapper">
461 <div class="wrapper">
461 <div class="title">
462 <div class="title">
462 ${self.repo_group_page_title(c.repo_group)}
463 ${self.repo_group_page_title(c.repo_group)}
463 </div>
464 </div>
464
465
465 <ul id="context-pages" class="navigation horizontal-list">
466 <ul id="context-pages" class="navigation horizontal-list">
466 <li class="${h.is_active('home', active)}">
467 <li class="${h.is_active('home', active)}">
467 <a class="menulink" href="${h.route_path('repo_group_home', repo_group_name=c.repo_group.group_name)}"><div class="menulabel">${_('Group Home')}</div></a>
468 <a class="menulink" href="${h.route_path('repo_group_home', repo_group_name=c.repo_group.group_name)}"><div class="menulabel">${_('Group Home')}</div></a>
468 </li>
469 </li>
469 % if c.is_super_admin or group_admin:
470 % if c.is_super_admin or group_admin:
470 <li class="${h.is_active('settings', active)}">
471 <li class="${h.is_active('settings', active)}">
471 <a class="menulink" href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}"><div class="menulabel">${_('Group Settings')}</div></a>
472 <a class="menulink" href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}"><div class="menulabel">${_('Group Settings')}</div></a>
472 </li>
473 </li>
473 % endif
474 % endif
474
475
475 </ul>
476 </ul>
476 </div>
477 </div>
477 <div class="clear"></div>
478 <div class="clear"></div>
478 </div>
479 </div>
479
480
480 <!--- REPO GROUP CONTEXT BAR -->
481 <!--- REPO GROUP CONTEXT BAR -->
481
482
482 </%def>
483 </%def>
483
484
484
485
485 <%def name="usermenu(active=False)">
486 <%def name="usermenu(active=False)">
486 <%
487 <%
487 not_anonymous = c.rhodecode_user.username != h.DEFAULT_USER
488 not_anonymous = c.rhodecode_user.username != h.DEFAULT_USER
488
489
489 gr_name = c.repo_group.group_name if (hasattr(c, 'repo_group') and c.repo_group) else None
490 gr_name = c.repo_group.group_name if (hasattr(c, 'repo_group') and c.repo_group) else None
490 # create repositories with write permission on group is set to true
491 # create repositories with write permission on group is set to true
491
492
492 can_fork = c.is_super_admin or h.HasPermissionAny('hg.fork.repository')()
493 can_fork = c.is_super_admin or h.HasPermissionAny('hg.fork.repository')()
493 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
494 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
494 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
495 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
495 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
496 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
496
497
497 can_create_repos = c.is_super_admin or c.can_create_repo
498 can_create_repos = c.is_super_admin or c.can_create_repo
498 can_create_repo_groups = c.is_super_admin or c.can_create_repo_group
499 can_create_repo_groups = c.is_super_admin or c.can_create_repo_group
499
500
500 can_create_repos_in_group = c.is_super_admin or group_admin or (group_write and create_on_write)
501 can_create_repos_in_group = c.is_super_admin or group_admin or (group_write and create_on_write)
501 can_create_repo_groups_in_group = c.is_super_admin or group_admin
502 can_create_repo_groups_in_group = c.is_super_admin or group_admin
502 %>
503 %>
503
504
504 % if not_anonymous:
505 % if not_anonymous:
505 <%
506 <%
506 default_target_group = dict()
507 default_target_group = dict()
507 if c.rhodecode_user.personal_repo_group:
508 if c.rhodecode_user.personal_repo_group:
508 default_target_group = dict(parent_group=c.rhodecode_user.personal_repo_group.group_id)
509 default_target_group = dict(parent_group=c.rhodecode_user.personal_repo_group.group_id)
509 %>
510 %>
510
511
511 ## create action
512 ## create action
512 <li>
513 <li>
513 <a href="#create-actions" onclick="return false;" class="menulink childs">
514 <a href="#create-actions" onclick="return false;" class="menulink childs">
514 <i class="icon-plus-circled"></i>
515 <i class="icon-plus-circled"></i>
515 </a>
516 </a>
516
517
517 <div class="action-menu submenu">
518 <div class="action-menu submenu">
518
519
519 <ol>
520 <ol>
520 ## scope of within a repository
521 ## scope of within a repository
521 % if hasattr(c, 'rhodecode_db_repo') and c.rhodecode_db_repo:
522 % if hasattr(c, 'rhodecode_db_repo') and c.rhodecode_db_repo:
522 <li class="submenu-title">${_('This Repository')}</li>
523 <li class="submenu-title">${_('This Repository')}</li>
523 <li>
524 <li>
524 <a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a>
525 <a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a>
525 </li>
526 </li>
526 % if can_fork:
527 % if can_fork:
527 <li>
528 <li>
528 <a href="${h.route_path('repo_fork_new',repo_name=c.repo_name,_query=default_target_group)}">${_('Fork this repository')}</a>
529 <a href="${h.route_path('repo_fork_new',repo_name=c.repo_name,_query=default_target_group)}">${_('Fork this repository')}</a>
529 </li>
530 </li>
530 % endif
531 % endif
531 % endif
532 % endif
532
533
533 ## scope of within repository groups
534 ## scope of within repository groups
534 % if hasattr(c, 'repo_group') and c.repo_group and (can_create_repos_in_group or can_create_repo_groups_in_group):
535 % if hasattr(c, 'repo_group') and c.repo_group and (can_create_repos_in_group or can_create_repo_groups_in_group):
535 <li class="submenu-title">${_('This Repository Group')}</li>
536 <li class="submenu-title">${_('This Repository Group')}</li>
536
537
537 % if can_create_repos_in_group:
538 % if can_create_repos_in_group:
538 <li>
539 <li>
539 <a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('New Repository')}</a>
540 <a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('New Repository')}</a>
540 </li>
541 </li>
541 % endif
542 % endif
542
543
543 % if can_create_repo_groups_in_group:
544 % if can_create_repo_groups_in_group:
544 <li>
545 <li>
545 <a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('New Repository Group')}</a>
546 <a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('New Repository Group')}</a>
546 </li>
547 </li>
547 % endif
548 % endif
548 % endif
549 % endif
549
550
550 ## personal group
551 ## personal group
551 % if c.rhodecode_user.personal_repo_group:
552 % if c.rhodecode_user.personal_repo_group:
552 <li class="submenu-title">Personal Group</li>
553 <li class="submenu-title">Personal Group</li>
553
554
554 <li>
555 <li>
555 <a href="${h.route_path('repo_new',_query=dict(parent_group=c.rhodecode_user.personal_repo_group.group_id))}" >${_('New Repository')} </a>
556 <a href="${h.route_path('repo_new',_query=dict(parent_group=c.rhodecode_user.personal_repo_group.group_id))}" >${_('New Repository')} </a>
556 </li>
557 </li>
557
558
558 <li>
559 <li>
559 <a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.rhodecode_user.personal_repo_group.group_id))}">${_('New Repository Group')} </a>
560 <a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.rhodecode_user.personal_repo_group.group_id))}">${_('New Repository Group')} </a>
560 </li>
561 </li>
561 % endif
562 % endif
562
563
563 ## Global actions
564 ## Global actions
564 <li class="submenu-title">RhodeCode</li>
565 <li class="submenu-title">RhodeCode</li>
565 % if can_create_repos:
566 % if can_create_repos:
566 <li>
567 <li>
567 <a href="${h.route_path('repo_new')}" >${_('New Repository')}</a>
568 <a href="${h.route_path('repo_new')}" >${_('New Repository')}</a>
568 </li>
569 </li>
569 % endif
570 % endif
570
571
571 % if can_create_repo_groups:
572 % if can_create_repo_groups:
572 <li>
573 <li>
573 <a href="${h.route_path('repo_group_new')}" >${_('New Repository Group')}</a>
574 <a href="${h.route_path('repo_group_new')}" >${_('New Repository Group')}</a>
574 </li>
575 </li>
575 % endif
576 % endif
576
577
577 <li>
578 <li>
578 <a href="${h.route_path('gists_new')}">${_('New Gist')}</a>
579 <a href="${h.route_path('gists_new')}">${_('New Gist')}</a>
579 </li>
580 </li>
580
581
581 </ol>
582 </ol>
582
583
583 </div>
584 </div>
584 </li>
585 </li>
585
586
586 ## notifications
587 ## notifications
587 <li>
588 <li>
588 <a class="${('empty' if c.unread_notifications == 0 else '')}" href="${h.route_path('notifications_show_all')}">
589 <a class="${('empty' if c.unread_notifications == 0 else '')}" href="${h.route_path('notifications_show_all')}">
589 ${c.unread_notifications}
590 ${c.unread_notifications}
590 </a>
591 </a>
591 </li>
592 </li>
592 % endif
593 % endif
593
594
594 ## USER MENU
595 ## USER MENU
595 <li id="quick_login_li" class="${'active' if active else ''}">
596 <li id="quick_login_li" class="${'active' if active else ''}">
596 % if c.rhodecode_user.username == h.DEFAULT_USER:
597 % if c.rhodecode_user.username == h.DEFAULT_USER:
597 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
598 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
598 ${gravatar(c.rhodecode_user.email, 20)}
599 ${gravatar(c.rhodecode_user.email, 20)}
599 <span class="user">
600 <span class="user">
600 <span>${_('Sign in')}</span>
601 <span>${_('Sign in')}</span>
601 </span>
602 </span>
602 </a>
603 </a>
603 % else:
604 % else:
604 ## logged in user
605 ## logged in user
605 <a id="quick_login_link" class="menulink childs">
606 <a id="quick_login_link" class="menulink childs">
606 ${gravatar(c.rhodecode_user.email, 20)}
607 ${gravatar(c.rhodecode_user.email, 20)}
607 <span class="user">
608 <span class="user">
608 <span class="menu_link_user">${c.rhodecode_user.username}</span>
609 <span class="menu_link_user">${c.rhodecode_user.username}</span>
609 <div class="show_more"></div>
610 <div class="show_more"></div>
610 </span>
611 </span>
611 </a>
612 </a>
612 ## subnav with menu for logged in user
613 ## subnav with menu for logged in user
613 <div class="user-menu submenu">
614 <div class="user-menu submenu">
614 <div id="quick_login">
615 <div id="quick_login">
615 %if c.rhodecode_user.username != h.DEFAULT_USER:
616 %if c.rhodecode_user.username != h.DEFAULT_USER:
616 <div class="">
617 <div class="">
617 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
618 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
618 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
619 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
619 <div class="email">${c.rhodecode_user.email}</div>
620 <div class="email">${c.rhodecode_user.email}</div>
620 </div>
621 </div>
621 <div class="">
622 <div class="">
622 <ol class="links">
623 <ol class="links">
623 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
624 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
624 % if c.rhodecode_user.personal_repo_group:
625 % if c.rhodecode_user.personal_repo_group:
625 <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li>
626 <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li>
626 % endif
627 % endif
627 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
628 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
628
629
629 % if c.debug_style:
630 % if c.debug_style:
630 <li>
631 <li>
631 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
632 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
632 <div class="menulabel">${_('[Style]')}</div>
633 <div class="menulabel">${_('[Style]')}</div>
633 </a>
634 </a>
634 </li>
635 </li>
635 % endif
636 % endif
636
637
637 ## bookmark-items
638 ## bookmark-items
638 <li class="bookmark-items">
639 <li class="bookmark-items">
639 ${_('Bookmarks')}
640 ${_('Bookmarks')}
640 <div class="pull-right">
641 <div class="pull-right">
641 <a href="${h.route_path('my_account_bookmarks')}">
642 <a href="${h.route_path('my_account_bookmarks')}">
642
643
643 <i class="icon-cog"></i>
644 <i class="icon-cog"></i>
644 </a>
645 </a>
645 </div>
646 </div>
646 </li>
647 </li>
647 % if not c.bookmark_items:
648 % if not c.bookmark_items:
648 <li>
649 <li>
649 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
650 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
650 </li>
651 </li>
651 % endif
652 % endif
652 % for item in c.bookmark_items:
653 % for item in c.bookmark_items:
653 <li>
654 <li>
654 % if item.repo_id:
655 % if item.repo_id:
655 <div>
656 <div>
656 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
657 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
657 <code>${item.position}</code>
658 <code>${item.position}</code>
658 % if item.repo_type == 'hg':
659 % if item.repo_type == 'hg':
659 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
660 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
660 % elif item.repo_type == 'git':
661 % elif item.repo_type == 'git':
661 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
662 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
662 % elif item.repo_type == 'svn':
663 % elif item.repo_type == 'svn':
663 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
664 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
664 % endif
665 % endif
665 ${(item.title or h.shorter(item.repo_name, 30))}
666 ${(item.title or h.shorter(item.repo_name, 30))}
666 </a>
667 </a>
667 </div>
668 </div>
668 % elif item.group_id:
669 % elif item.group_id:
669 <div>
670 <div>
670 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
671 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
671 <code>${item.position}</code>
672 <code>${item.position}</code>
672 <i class="icon-repo-group" title="${_('Repository group')}" style="font-size: 14px"></i>
673 <i class="icon-repo-group" title="${_('Repository group')}" style="font-size: 14px"></i>
673 ${(item.title or h.shorter(item.group_name, 30))}
674 ${(item.title or h.shorter(item.group_name, 30))}
674 </a>
675 </a>
675 </div>
676 </div>
676 % else:
677 % else:
677 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
678 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
678 <code>${item.position}</code>
679 <code>${item.position}</code>
679 ${item.title}
680 ${item.title}
680 </a>
681 </a>
681 % endif
682 % endif
682 </li>
683 </li>
683 % endfor
684 % endfor
684
685
685 <li class="logout">
686 <li class="logout">
686 ${h.secure_form(h.route_path('logout'), request=request)}
687 ${h.secure_form(h.route_path('logout'), request=request)}
687 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
688 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
688 ${h.end_form()}
689 ${h.end_form()}
689 </li>
690 </li>
690 </ol>
691 </ol>
691 </div>
692 </div>
692 %endif
693 %endif
693 </div>
694 </div>
694 </div>
695 </div>
695
696
696 % endif
697 % endif
697 </li>
698 </li>
698 </%def>
699 </%def>
699
700
700 <%def name="menu_items(active=None)">
701 <%def name="menu_items(active=None)">
701 <%
702 <%
702 notice_messages, notice_level = c.rhodecode_user.get_notice_messages()
703 notice_messages, notice_level = c.rhodecode_user.get_notice_messages()
703 notice_display = 'none' if len(notice_messages) == 0 else ''
704 notice_display = 'none' if len(notice_messages) == 0 else ''
704 %>
705 %>
705
706
706 <ul id="quick" class="main_nav navigation horizontal-list">
707 <ul id="quick" class="main_nav navigation horizontal-list">
707 ## notice box for important system messages
708 ## notice box for important system messages
708 <li style="display: ${notice_display}">
709 <li style="display: ${notice_display}">
709 <a class="notice-box" href="#openNotice" onclick="$('.notice-messages-container').toggle(); return false">
710 <a class="notice-box" href="#openNotice" onclick="$('.notice-messages-container').toggle(); return false">
710 <div class="menulabel-notice ${notice_level}" >
711 <div class="menulabel-notice ${notice_level}" >
711 ${len(notice_messages)}
712 ${len(notice_messages)}
712 </div>
713 </div>
713 </a>
714 </a>
714 </li>
715 </li>
715 <div class="notice-messages-container" style="display: none">
716 <div class="notice-messages-container" style="display: none">
716 <div class="notice-messages">
717 <div class="notice-messages">
717 <table class="rctable">
718 <table class="rctable">
718 % for notice in notice_messages:
719 % for notice in notice_messages:
719 <tr id="notice-message-${notice['msg_id']}" class="notice-message-${notice['level']}">
720 <tr id="notice-message-${notice['msg_id']}" class="notice-message-${notice['level']}">
720 <td style="vertical-align: text-top; width: 20px">
721 <td style="vertical-align: text-top; width: 20px">
721 <i class="tooltip icon-info notice-color-${notice['level']}" title="${notice['level']}"></i>
722 <i class="tooltip icon-info notice-color-${notice['level']}" title="${notice['level']}"></i>
722 </td>
723 </td>
723 <td>
724 <td>
724 <span><i class="icon-plus-squared cursor-pointer" onclick="$('#notice-${notice['msg_id']}').toggle()"></i> </span>
725 <span><i class="icon-plus-squared cursor-pointer" onclick="$('#notice-${notice['msg_id']}').toggle()"></i> </span>
725 ${notice['subject']}
726 ${notice['subject']}
726
727
727 <div id="notice-${notice['msg_id']}" style="display: none">
728 <div id="notice-${notice['msg_id']}" style="display: none">
728 ${h.render(notice['body'], renderer='markdown')}
729 ${h.render(notice['body'], renderer='markdown')}
729 </div>
730 </div>
730 </td>
731 </td>
731 <td style="vertical-align: text-top; width: 35px;">
732 <td style="vertical-align: text-top; width: 35px;">
732 <a class="tooltip" title="${_('dismiss')}" href="#dismiss" onclick="dismissNotice(${notice['msg_id']});return false">
733 <a class="tooltip" title="${_('dismiss')}" href="#dismiss" onclick="dismissNotice(${notice['msg_id']});return false">
733 <i class="icon-remove icon-filled-red"></i>
734 <i class="icon-remove icon-filled-red"></i>
734 </a>
735 </a>
735 </td>
736 </td>
736 </tr>
737 </tr>
737
738
738 % endfor
739 % endfor
739 </table>
740 </table>
740 </div>
741 </div>
741 </div>
742 </div>
742 ## Main filter
743 ## Main filter
743 <li>
744 <li>
744 <div class="menulabel main_filter_box">
745 <div class="menulabel main_filter_box">
745 <div class="main_filter_input_box">
746 <div class="main_filter_input_box">
746 <ul class="searchItems">
747 <ul class="searchItems">
747
748
748 <li class="searchTag searchTagIcon">
749 <li class="searchTag searchTagIcon">
749 <i class="icon-search"></i>
750 <i class="icon-search"></i>
750 </li>
751 </li>
751
752
752 % if c.template_context['search_context']['repo_id']:
753 % if c.template_context['search_context']['repo_id']:
753 <li class="searchTag searchTagFilter searchTagHidable" >
754 <li class="searchTag searchTagFilter searchTagHidable" >
754 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
755 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
755 <span class="tag">
756 <span class="tag">
756 This repo
757 This repo
757 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
758 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
758 </span>
759 </span>
759 ##</a>
760 ##</a>
760 </li>
761 </li>
761 % elif c.template_context['search_context']['repo_group_id']:
762 % elif c.template_context['search_context']['repo_group_id']:
762 <li class="searchTag searchTagFilter searchTagHidable">
763 <li class="searchTag searchTagFilter searchTagHidable">
763 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
764 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
764 <span class="tag">
765 <span class="tag">
765 This group
766 This group
766 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
767 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
767 </span>
768 </span>
768 ##</a>
769 ##</a>
769 </li>
770 </li>
770 % endif
771 % endif
771
772
772 <li class="searchTagInput">
773 <li class="searchTagInput">
773 <input class="main_filter_input" id="main_filter" size="25" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
774 <input class="main_filter_input" id="main_filter" size="25" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
774 </li>
775 </li>
775 <li class="searchTag searchTagHelp">
776 <li class="searchTag searchTagHelp">
776 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
777 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
777 </li>
778 </li>
778 </ul>
779 </ul>
779 </div>
780 </div>
780 </div>
781 </div>
781
782
782 <div id="main_filter_help" style="display: none">
783 <div id="main_filter_help" style="display: none">
783 - Use '/' key to quickly access this field.
784 - Use '/' key to quickly access this field.
784
785
785 - Enter a name of repository, or repository group for quick search.
786 - Enter a name of repository, or repository group for quick search.
786
787
787 - Prefix query to allow special search:
788 - Prefix query to allow special search:
788
789
789 <strong>user:</strong>admin, to search for usernames, always global
790 <strong>user:</strong>admin, to search for usernames, always global
790
791
791 <strong>user_group:</strong>devops, to search for user groups, always global
792 <strong>user_group:</strong>devops, to search for user groups, always global
792
793
793 <strong>pr:</strong>303, to search for pull request number, title, or description, always global
794 <strong>pr:</strong>303, to search for pull request number, title, or description, always global
794
795
795 <strong>commit:</strong>efced4, to search for commits, scoped to repositories or groups
796 <strong>commit:</strong>efced4, to search for commits, scoped to repositories or groups
796
797
797 <strong>file:</strong>models.py, to search for file paths, scoped to repositories or groups
798 <strong>file:</strong>models.py, to search for file paths, scoped to repositories or groups
798
799
799 % if c.template_context['search_context']['repo_id']:
800 % if c.template_context['search_context']['repo_id']:
800 For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a>
801 For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a>
801 % elif c.template_context['search_context']['repo_group_id']:
802 % elif c.template_context['search_context']['repo_group_id']:
802 For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a>
803 For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a>
803 % else:
804 % else:
804 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
805 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
805 % endif
806 % endif
806 </div>
807 </div>
807 </li>
808 </li>
808
809
809 ## ROOT MENU
810 ## ROOT MENU
810 <li class="${h.is_active('home', active)}">
811 <li class="${h.is_active('home', active)}">
811 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
812 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
812 <div class="menulabel">${_('Home')}</div>
813 <div class="menulabel">${_('Home')}</div>
813 </a>
814 </a>
814 </li>
815 </li>
815
816
816 %if c.rhodecode_user.username != h.DEFAULT_USER:
817 %if c.rhodecode_user.username != h.DEFAULT_USER:
817 <li class="${h.is_active('journal', active)}">
818 <li class="${h.is_active('journal', active)}">
818 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
819 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
819 <div class="menulabel">${_('Journal')}</div>
820 <div class="menulabel">${_('Journal')}</div>
820 </a>
821 </a>
821 </li>
822 </li>
822 %else:
823 %else:
823 <li class="${h.is_active('journal', active)}">
824 <li class="${h.is_active('journal', active)}">
824 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
825 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
825 <div class="menulabel">${_('Public journal')}</div>
826 <div class="menulabel">${_('Public journal')}</div>
826 </a>
827 </a>
827 </li>
828 </li>
828 %endif
829 %endif
829
830
830 <li class="${h.is_active('gists', active)}">
831 <li class="${h.is_active('gists', active)}">
831 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
832 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
832 <div class="menulabel">${_('Gists')}</div>
833 <div class="menulabel">${_('Gists')}</div>
833 </a>
834 </a>
834 </li>
835 </li>
835
836
836 % if c.is_super_admin or c.is_delegated_admin:
837 % if c.is_super_admin or c.is_delegated_admin:
837 <li class="${h.is_active('admin', active)}">
838 <li class="${h.is_active('admin', active)}">
838 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
839 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
839 <div class="menulabel">${_('Admin')} </div>
840 <div class="menulabel">${_('Admin')} </div>
840 </a>
841 </a>
841 </li>
842 </li>
842 % endif
843 % endif
843
844
844 ## render extra user menu
845 ## render extra user menu
845 ${usermenu(active=(active=='my_account'))}
846 ${usermenu(active=(active=='my_account'))}
846
847
847 </ul>
848 </ul>
848
849
849 <script type="text/javascript">
850 <script type="text/javascript">
850 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
851 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
851
852
852 var formatRepoResult = function(result, container, query, escapeMarkup) {
853 var formatRepoResult = function(result, container, query, escapeMarkup) {
853 return function(data, escapeMarkup) {
854 return function(data, escapeMarkup) {
854 if (!data.repo_id){
855 if (!data.repo_id){
855 return data.text; // optgroup text Repositories
856 return data.text; // optgroup text Repositories
856 }
857 }
857
858
858 var tmpl = '';
859 var tmpl = '';
859 var repoType = data['repo_type'];
860 var repoType = data['repo_type'];
860 var repoName = data['text'];
861 var repoName = data['text'];
861
862
862 if(data && data.type == 'repo'){
863 if(data && data.type == 'repo'){
863 if(repoType === 'hg'){
864 if(repoType === 'hg'){
864 tmpl += '<i class="icon-hg"></i> ';
865 tmpl += '<i class="icon-hg"></i> ';
865 }
866 }
866 else if(repoType === 'git'){
867 else if(repoType === 'git'){
867 tmpl += '<i class="icon-git"></i> ';
868 tmpl += '<i class="icon-git"></i> ';
868 }
869 }
869 else if(repoType === 'svn'){
870 else if(repoType === 'svn'){
870 tmpl += '<i class="icon-svn"></i> ';
871 tmpl += '<i class="icon-svn"></i> ';
871 }
872 }
872 if(data['private']){
873 if(data['private']){
873 tmpl += '<i class="icon-lock" ></i> ';
874 tmpl += '<i class="icon-lock" ></i> ';
874 }
875 }
875 else if(visualShowPublicIcon){
876 else if(visualShowPublicIcon){
876 tmpl += '<i class="icon-unlock-alt"></i> ';
877 tmpl += '<i class="icon-unlock-alt"></i> ';
877 }
878 }
878 }
879 }
879 tmpl += escapeMarkup(repoName);
880 tmpl += escapeMarkup(repoName);
880 return tmpl;
881 return tmpl;
881
882
882 }(result, escapeMarkup);
883 }(result, escapeMarkup);
883 };
884 };
884
885
885 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
886 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
886 return function(data, escapeMarkup) {
887 return function(data, escapeMarkup) {
887 if (!data.repo_group_id){
888 if (!data.repo_group_id){
888 return data.text; // optgroup text Repositories
889 return data.text; // optgroup text Repositories
889 }
890 }
890
891
891 var tmpl = '';
892 var tmpl = '';
892 var repoGroupName = data['text'];
893 var repoGroupName = data['text'];
893
894
894 if(data){
895 if(data){
895
896
896 tmpl += '<i class="icon-repo-group"></i> ';
897 tmpl += '<i class="icon-repo-group"></i> ';
897
898
898 }
899 }
899 tmpl += escapeMarkup(repoGroupName);
900 tmpl += escapeMarkup(repoGroupName);
900 return tmpl;
901 return tmpl;
901
902
902 }(result, escapeMarkup);
903 }(result, escapeMarkup);
903 };
904 };
904
905
905 var escapeRegExChars = function (value) {
906 var escapeRegExChars = function (value) {
906 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
907 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
907 };
908 };
908
909
909 var getRepoIcon = function(repo_type) {
910 var getRepoIcon = function(repo_type) {
910 if (repo_type === 'hg') {
911 if (repo_type === 'hg') {
911 return '<i class="icon-hg"></i> ';
912 return '<i class="icon-hg"></i> ';
912 }
913 }
913 else if (repo_type === 'git') {
914 else if (repo_type === 'git') {
914 return '<i class="icon-git"></i> ';
915 return '<i class="icon-git"></i> ';
915 }
916 }
916 else if (repo_type === 'svn') {
917 else if (repo_type === 'svn') {
917 return '<i class="icon-svn"></i> ';
918 return '<i class="icon-svn"></i> ';
918 }
919 }
919 return ''
920 return ''
920 };
921 };
921
922
922 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
923 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
923
924
924 if (value.split(':').length === 2) {
925 if (value.split(':').length === 2) {
925 value = value.split(':')[1]
926 value = value.split(':')[1]
926 }
927 }
927
928
928 var searchType = data['type'];
929 var searchType = data['type'];
929 var searchSubType = data['subtype'];
930 var searchSubType = data['subtype'];
930 var valueDisplay = data['value_display'];
931 var valueDisplay = data['value_display'];
931 var valueIcon = data['value_icon'];
932 var valueIcon = data['value_icon'];
932
933
933 var pattern = '(' + escapeRegExChars(value) + ')';
934 var pattern = '(' + escapeRegExChars(value) + ')';
934
935
935 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
936 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
936
937
937 // highlight match
938 // highlight match
938 if (searchType != 'text') {
939 if (searchType != 'text') {
939 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
940 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
940 }
941 }
941
942
942 var icon = '';
943 var icon = '';
943
944
944 if (searchType === 'hint') {
945 if (searchType === 'hint') {
945 icon += '<i class="icon-repo-group"></i> ';
946 icon += '<i class="icon-repo-group"></i> ';
946 }
947 }
947 // full text search/hints
948 // full text search/hints
948 else if (searchType === 'search') {
949 else if (searchType === 'search') {
949 if (valueIcon === undefined) {
950 if (valueIcon === undefined) {
950 icon += '<i class="icon-more"></i> ';
951 icon += '<i class="icon-more"></i> ';
951 } else {
952 } else {
952 icon += valueIcon + ' ';
953 icon += valueIcon + ' ';
953 }
954 }
954
955
955 if (searchSubType !== undefined && searchSubType == 'repo') {
956 if (searchSubType !== undefined && searchSubType == 'repo') {
956 valueDisplay += '<div class="pull-right tag">repository</div>';
957 valueDisplay += '<div class="pull-right tag">repository</div>';
957 }
958 }
958 else if (searchSubType !== undefined && searchSubType == 'repo_group') {
959 else if (searchSubType !== undefined && searchSubType == 'repo_group') {
959 valueDisplay += '<div class="pull-right tag">repo group</div>';
960 valueDisplay += '<div class="pull-right tag">repo group</div>';
960 }
961 }
961 }
962 }
962 // repository
963 // repository
963 else if (searchType === 'repo') {
964 else if (searchType === 'repo') {
964
965
965 var repoIcon = getRepoIcon(data['repo_type']);
966 var repoIcon = getRepoIcon(data['repo_type']);
966 icon += repoIcon;
967 icon += repoIcon;
967
968
968 if (data['private']) {
969 if (data['private']) {
969 icon += '<i class="icon-lock" ></i> ';
970 icon += '<i class="icon-lock" ></i> ';
970 }
971 }
971 else if (visualShowPublicIcon) {
972 else if (visualShowPublicIcon) {
972 icon += '<i class="icon-unlock-alt"></i> ';
973 icon += '<i class="icon-unlock-alt"></i> ';
973 }
974 }
974 }
975 }
975 // repository groups
976 // repository groups
976 else if (searchType === 'repo_group') {
977 else if (searchType === 'repo_group') {
977 icon += '<i class="icon-repo-group"></i> ';
978 icon += '<i class="icon-repo-group"></i> ';
978 }
979 }
979 // user group
980 // user group
980 else if (searchType === 'user_group') {
981 else if (searchType === 'user_group') {
981 icon += '<i class="icon-group"></i> ';
982 icon += '<i class="icon-group"></i> ';
982 }
983 }
983 // user
984 // user
984 else if (searchType === 'user') {
985 else if (searchType === 'user') {
985 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
986 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
986 }
987 }
987 // pull request
988 // pull request
988 else if (searchType === 'pull_request') {
989 else if (searchType === 'pull_request') {
989 icon += '<i class="icon-merge"></i> ';
990 icon += '<i class="icon-merge"></i> ';
990 }
991 }
991 // commit
992 // commit
992 else if (searchType === 'commit') {
993 else if (searchType === 'commit') {
993 var repo_data = data['repo_data'];
994 var repo_data = data['repo_data'];
994 var repoIcon = getRepoIcon(repo_data['repository_type']);
995 var repoIcon = getRepoIcon(repo_data['repository_type']);
995 if (repoIcon) {
996 if (repoIcon) {
996 icon += repoIcon;
997 icon += repoIcon;
997 } else {
998 } else {
998 icon += '<i class="icon-tag"></i>';
999 icon += '<i class="icon-tag"></i>';
999 }
1000 }
1000 }
1001 }
1001 // file
1002 // file
1002 else if (searchType === 'file') {
1003 else if (searchType === 'file') {
1003 var repo_data = data['repo_data'];
1004 var repo_data = data['repo_data'];
1004 var repoIcon = getRepoIcon(repo_data['repository_type']);
1005 var repoIcon = getRepoIcon(repo_data['repository_type']);
1005 if (repoIcon) {
1006 if (repoIcon) {
1006 icon += repoIcon;
1007 icon += repoIcon;
1007 } else {
1008 } else {
1008 icon += '<i class="icon-tag"></i>';
1009 icon += '<i class="icon-tag"></i>';
1009 }
1010 }
1010 }
1011 }
1011 // generic text
1012 // generic text
1012 else if (searchType === 'text') {
1013 else if (searchType === 'text') {
1013 icon = '';
1014 icon = '';
1014 }
1015 }
1015
1016
1016 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
1017 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
1017 return tmpl.format(icon, valueDisplay);
1018 return tmpl.format(icon, valueDisplay);
1018 };
1019 };
1019
1020
1020 var handleSelect = function(element, suggestion) {
1021 var handleSelect = function(element, suggestion) {
1021 if (suggestion.type === "hint") {
1022 if (suggestion.type === "hint") {
1022 // we skip action
1023 // we skip action
1023 $('#main_filter').focus();
1024 $('#main_filter').focus();
1024 }
1025 }
1025 else if (suggestion.type === "text") {
1026 else if (suggestion.type === "text") {
1026 // we skip action
1027 // we skip action
1027 $('#main_filter').focus();
1028 $('#main_filter').focus();
1028
1029
1029 } else {
1030 } else {
1030 window.location = suggestion['url'];
1031 window.location = suggestion['url'];
1031 }
1032 }
1032 };
1033 };
1033
1034
1034 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
1035 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
1035 if (queryLowerCase.split(':').length === 2) {
1036 if (queryLowerCase.split(':').length === 2) {
1036 queryLowerCase = queryLowerCase.split(':')[1]
1037 queryLowerCase = queryLowerCase.split(':')[1]
1037 }
1038 }
1038 if (suggestion.type === "text") {
1039 if (suggestion.type === "text") {
1039 // special case we don't want to "skip" display for
1040 // special case we don't want to "skip" display for
1040 return true
1041 return true
1041 }
1042 }
1042 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
1043 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
1043 };
1044 };
1044
1045
1045 var cleanContext = {
1046 var cleanContext = {
1046 repo_view_type: null,
1047 repo_view_type: null,
1047
1048
1048 repo_id: null,
1049 repo_id: null,
1049 repo_name: "",
1050 repo_name: "",
1050
1051
1051 repo_group_id: null,
1052 repo_group_id: null,
1052 repo_group_name: null
1053 repo_group_name: null
1053 };
1054 };
1054 var removeGoToFilter = function () {
1055 var removeGoToFilter = function () {
1055 $('.searchTagHidable').hide();
1056 $('.searchTagHidable').hide();
1056 $('#main_filter').autocomplete(
1057 $('#main_filter').autocomplete(
1057 'setOptions', {params:{search_context: cleanContext}});
1058 'setOptions', {params:{search_context: cleanContext}});
1058 };
1059 };
1059
1060
1060 $('#main_filter').autocomplete({
1061 $('#main_filter').autocomplete({
1061 serviceUrl: pyroutes.url('goto_switcher_data'),
1062 serviceUrl: pyroutes.url('goto_switcher_data'),
1062 params: {
1063 params: {
1063 "search_context": templateContext.search_context
1064 "search_context": templateContext.search_context
1064 },
1065 },
1065 minChars:2,
1066 minChars:2,
1066 maxHeight:400,
1067 maxHeight:400,
1067 deferRequestBy: 300, //miliseconds
1068 deferRequestBy: 300, //miliseconds
1068 tabDisabled: true,
1069 tabDisabled: true,
1069 autoSelectFirst: false,
1070 autoSelectFirst: false,
1070 containerClass: 'autocomplete-qfilter-suggestions',
1071 containerClass: 'autocomplete-qfilter-suggestions',
1071 formatResult: autocompleteMainFilterFormatResult,
1072 formatResult: autocompleteMainFilterFormatResult,
1072 lookupFilter: autocompleteMainFilterResult,
1073 lookupFilter: autocompleteMainFilterResult,
1073 onSelect: function (element, suggestion) {
1074 onSelect: function (element, suggestion) {
1074 handleSelect(element, suggestion);
1075 handleSelect(element, suggestion);
1075 return false;
1076 return false;
1076 },
1077 },
1077 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
1078 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
1078 if (jqXHR !== 'abort') {
1079 if (jqXHR !== 'abort') {
1079 var message = formatErrorMessage(jqXHR, textStatus, errorThrown);
1080 var message = formatErrorMessage(jqXHR, textStatus, errorThrown);
1080 SwalNoAnimation.fire({
1081 SwalNoAnimation.fire({
1081 icon: 'error',
1082 icon: 'error',
1082 title: _gettext('Error during search operation'),
1083 title: _gettext('Error during search operation'),
1083 html: '<span style="white-space: pre-line">{0}</span>'.format(message),
1084 html: '<span style="white-space: pre-line">{0}</span>'.format(message),
1084 }).then(function(result) {
1085 }).then(function(result) {
1085 window.location.reload();
1086 window.location.reload();
1086 })
1087 })
1087 }
1088 }
1088 },
1089 },
1089 onSearchStart: function (params) {
1090 onSearchStart: function (params) {
1090 $('.searchTag.searchTagIcon').html('<i class="icon-spin animate-spin"></i>')
1091 $('.searchTag.searchTagIcon').html('<i class="icon-spin animate-spin"></i>')
1091 },
1092 },
1092 onSearchComplete: function (query, suggestions) {
1093 onSearchComplete: function (query, suggestions) {
1093 $('.searchTag.searchTagIcon').html('<i class="icon-search"></i>')
1094 $('.searchTag.searchTagIcon').html('<i class="icon-search"></i>')
1094 },
1095 },
1095 });
1096 });
1096
1097
1097 showMainFilterBox = function () {
1098 showMainFilterBox = function () {
1098 $('#main_filter_help').toggle();
1099 $('#main_filter_help').toggle();
1099 };
1100 };
1100
1101
1101 $('#main_filter').on('keydown.autocomplete', function (e) {
1102 $('#main_filter').on('keydown.autocomplete', function (e) {
1102
1103
1103 var BACKSPACE = 8;
1104 var BACKSPACE = 8;
1104 var el = $(e.currentTarget);
1105 var el = $(e.currentTarget);
1105 if(e.which === BACKSPACE){
1106 if(e.which === BACKSPACE){
1106 var inputVal = el.val();
1107 var inputVal = el.val();
1107 if (inputVal === ""){
1108 if (inputVal === ""){
1108 removeGoToFilter()
1109 removeGoToFilter()
1109 }
1110 }
1110 }
1111 }
1111 });
1112 });
1112
1113
1113 var dismissNotice = function(noticeId) {
1114 var dismissNotice = function(noticeId) {
1114
1115
1115 var url = pyroutes.url('user_notice_dismiss',
1116 var url = pyroutes.url('user_notice_dismiss',
1116 {"user_id": templateContext.rhodecode_user.user_id});
1117 {"user_id": templateContext.rhodecode_user.user_id});
1117
1118
1118 var postData = {
1119 var postData = {
1119 'csrf_token': CSRF_TOKEN,
1120 'csrf_token': CSRF_TOKEN,
1120 'notice_id': noticeId,
1121 'notice_id': noticeId,
1121 };
1122 };
1122
1123
1123 var success = function(response) {
1124 var success = function(response) {
1124 $('#notice-message-' + noticeId).remove();
1125 $('#notice-message-' + noticeId).remove();
1125 return false;
1126 return false;
1126 };
1127 };
1127 var failure = function(data, textStatus, xhr) {
1128 var failure = function(data, textStatus, xhr) {
1128 alert("error processing request: " + textStatus);
1129 alert("error processing request: " + textStatus);
1129 return false;
1130 return false;
1130 };
1131 };
1131 ajaxPOST(url, postData, success, failure);
1132 ajaxPOST(url, postData, success, failure);
1132 }
1133 }
1133
1134
1134 var hideLicenseWarning = function () {
1135 var hideLicenseWarning = function () {
1135 var fingerprint = templateContext.session_attrs.license_fingerprint;
1136 var fingerprint = templateContext.session_attrs.license_fingerprint;
1136 storeUserSessionAttr('rc_user_session_attr.hide_license_warning', fingerprint);
1137 storeUserSessionAttr('rc_user_session_attr.hide_license_warning', fingerprint);
1137 $('#notifications').hide();
1138 $('#notifications').hide();
1138 }
1139 }
1139
1140
1140 var hideLicenseError = function () {
1141 var hideLicenseError = function () {
1141 var fingerprint = templateContext.session_attrs.license_fingerprint;
1142 var fingerprint = templateContext.session_attrs.license_fingerprint;
1142 storeUserSessionAttr('rc_user_session_attr.hide_license_error', fingerprint);
1143 storeUserSessionAttr('rc_user_session_attr.hide_license_error', fingerprint);
1143 $('#notifications').hide();
1144 $('#notifications').hide();
1144 }
1145 }
1145
1146
1146 </script>
1147 </script>
1147 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
1148 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
1148 </%def>
1149 </%def>
1149
1150
1150 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
1151 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
1151 <div class="modal-dialog">
1152 <div class="modal-dialog">
1152 <div class="modal-content">
1153 <div class="modal-content">
1153 <div class="modal-header">
1154 <div class="modal-header">
1154 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
1155 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
1155 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
1156 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
1156 </div>
1157 </div>
1157 <div class="modal-body">
1158 <div class="modal-body">
1158 <div class="block-left">
1159 <div class="block-left">
1159 <table class="keyboard-mappings">
1160 <table class="keyboard-mappings">
1160 <tbody>
1161 <tbody>
1161 <tr>
1162 <tr>
1162 <th></th>
1163 <th></th>
1163 <th>${_('Site-wide shortcuts')}</th>
1164 <th>${_('Site-wide shortcuts')}</th>
1164 </tr>
1165 </tr>
1165 <%
1166 <%
1166 elems = [
1167 elems = [
1167 ('/', 'Use quick search box'),
1168 ('/', 'Use quick search box'),
1168 ('g h', 'Goto home page'),
1169 ('g h', 'Goto home page'),
1169 ('g g', 'Goto my private gists page'),
1170 ('g g', 'Goto my private gists page'),
1170 ('g G', 'Goto my public gists page'),
1171 ('g G', 'Goto my public gists page'),
1171 ('g 0-9', 'Goto bookmarked items from 0-9'),
1172 ('g 0-9', 'Goto bookmarked items from 0-9'),
1172 ('n r', 'New repository page'),
1173 ('n r', 'New repository page'),
1173 ('n g', 'New gist page'),
1174 ('n g', 'New gist page'),
1174 ]
1175 ]
1175 %>
1176 %>
1176 %for key, desc in elems:
1177 %for key, desc in elems:
1177 <tr>
1178 <tr>
1178 <td class="keys">
1179 <td class="keys">
1179 <span class="key tag">${key}</span>
1180 <span class="key tag">${key}</span>
1180 </td>
1181 </td>
1181 <td>${desc}</td>
1182 <td>${desc}</td>
1182 </tr>
1183 </tr>
1183 %endfor
1184 %endfor
1184 </tbody>
1185 </tbody>
1185 </table>
1186 </table>
1186 </div>
1187 </div>
1187 <div class="block-left">
1188 <div class="block-left">
1188 <table class="keyboard-mappings">
1189 <table class="keyboard-mappings">
1189 <tbody>
1190 <tbody>
1190 <tr>
1191 <tr>
1191 <th></th>
1192 <th></th>
1192 <th>${_('Repositories')}</th>
1193 <th>${_('Repositories')}</th>
1193 </tr>
1194 </tr>
1194 <%
1195 <%
1195 elems = [
1196 elems = [
1196 ('g s', 'Goto summary page'),
1197 ('g s', 'Goto summary page'),
1197 ('g c', 'Goto changelog page'),
1198 ('g c', 'Goto changelog page'),
1198 ('g f', 'Goto files page'),
1199 ('g f', 'Goto files page'),
1199 ('g F', 'Goto files page with file search activated'),
1200 ('g F', 'Goto files page with file search activated'),
1200 ('g p', 'Goto pull requests page'),
1201 ('g p', 'Goto pull requests page'),
1201 ('g o', 'Goto repository settings'),
1202 ('g o', 'Goto repository settings'),
1202 ('g O', 'Goto repository access permissions settings'),
1203 ('g O', 'Goto repository access permissions settings'),
1203 ('t s', 'Toggle sidebar on some pages'),
1204 ('t s', 'Toggle sidebar on some pages'),
1204 ]
1205 ]
1205 %>
1206 %>
1206 %for key, desc in elems:
1207 %for key, desc in elems:
1207 <tr>
1208 <tr>
1208 <td class="keys">
1209 <td class="keys">
1209 <span class="key tag">${key}</span>
1210 <span class="key tag">${key}</span>
1210 </td>
1211 </td>
1211 <td>${desc}</td>
1212 <td>${desc}</td>
1212 </tr>
1213 </tr>
1213 %endfor
1214 %endfor
1214 </tbody>
1215 </tbody>
1215 </table>
1216 </table>
1216 </div>
1217 </div>
1217 </div>
1218 </div>
1218 <div class="modal-footer">
1219 <div class="modal-footer">
1219 </div>
1220 </div>
1220 </div><!-- /.modal-content -->
1221 </div><!-- /.modal-content -->
1221 </div><!-- /.modal-dialog -->
1222 </div><!-- /.modal-dialog -->
1222 </div><!-- /.modal -->
1223 </div><!-- /.modal -->
1223
1224
1224
1225
1225 <script type="text/javascript">
1226 <script type="text/javascript">
1226 (function () {
1227 (function () {
1227 "use sctrict";
1228 "use sctrict";
1228
1229
1229 // details block auto-hide menu
1230 // details block auto-hide menu
1230 $(document).mouseup(function(e) {
1231 $(document).mouseup(function(e) {
1231 var container = $('.details-inline-block');
1232 var container = $('.details-inline-block');
1232 if (!container.is(e.target) && container.has(e.target).length === 0) {
1233 if (!container.is(e.target) && container.has(e.target).length === 0) {
1233 $('.details-inline-block[open]').removeAttr('open')
1234 $('.details-inline-block[open]').removeAttr('open')
1234 }
1235 }
1235 });
1236 });
1236
1237
1237 var $sideBar = $('.right-sidebar');
1238 var $sideBar = $('.right-sidebar');
1238 var expanded = $sideBar.hasClass('right-sidebar-expanded');
1239 var expanded = $sideBar.hasClass('right-sidebar-expanded');
1239 var sidebarState = templateContext.session_attrs.sidebarState;
1240 var sidebarState = templateContext.session_attrs.sidebarState;
1240 var sidebarEnabled = $('aside.right-sidebar').get(0);
1241 var sidebarEnabled = $('aside.right-sidebar').get(0);
1241
1242
1242 if (sidebarState === 'expanded') {
1243 if (sidebarState === 'expanded') {
1243 expanded = true
1244 expanded = true
1244 } else if (sidebarState === 'collapsed') {
1245 } else if (sidebarState === 'collapsed') {
1245 expanded = false
1246 expanded = false
1246 }
1247 }
1247 if (sidebarEnabled) {
1248 if (sidebarEnabled) {
1248 // show sidebar since it's hidden on load
1249 // show sidebar since it's hidden on load
1249 $('.right-sidebar').show();
1250 $('.right-sidebar').show();
1250
1251
1251 // init based on set initial class, or if defined user session attrs
1252 // init based on set initial class, or if defined user session attrs
1252 if (expanded) {
1253 if (expanded) {
1253 window.expandSidebar();
1254 window.expandSidebar();
1254 window.updateStickyHeader();
1255 window.updateStickyHeader();
1255
1256
1256 } else {
1257 } else {
1257 window.collapseSidebar();
1258 window.collapseSidebar();
1258 window.updateStickyHeader();
1259 window.updateStickyHeader();
1259 }
1260 }
1260 }
1261 }
1261 })()
1262 })()
1262
1263
1263 </script>
1264 </script>
General Comments 0
You need to be logged in to leave comments. Login now