##// END OF EJS Templates
artifacts: added missing code for CE views and admin artifacts.
milka -
r4675:fd01c700 stable
parent child Browse files
Show More
@@ -0,0 +1,40 b''
1 # -*- coding: utf-8 -*-
2
3 # Copyright (C) 2016-2020 RhodeCode GmbH
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License, version 3
7 # (only), as published by the Free Software Foundation.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 # This program is dual-licensed. If you wish to learn more about the
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
21 import logging
22
23 from rhodecode.apps._base import BaseAppView, DataGridAppView
24 from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator
25
26 log = logging.getLogger(__name__)
27
28
29 class AdminArtifactsView(BaseAppView, DataGridAppView):
30
31 def load_default_context(self):
32 c = self._get_local_tmpl_context()
33 return c
34
35 @LoginRequired()
36 @HasPermissionAllDecorator('hg.admin')
37 def artifacts(self):
38 c = self.load_default_context()
39 c.active = 'artifacts'
40 return self._get_template_context(c)
@@ -0,0 +1,39 b''
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
3
4 <%def name="title()">
5 ${_('Artifacts Admin')}
6 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
9 </%def>
10
11 <%def name="breadcrumbs_links()"></%def>
12
13 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='admin')}
15 </%def>
16
17 <%def name="menu_bar_subnav()">
18 ${self.admin_menu(active='artifacts')}
19 </%def>
20
21 <%def name="main()">
22
23 <div class="box">
24
25 <div class="panel panel-default">
26 <div class="panel-heading">
27 <h3 class="panel-title">${_('Artifacts Administration.')}</h3>
28 </div>
29 <div class="panel-body">
30 <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>
31
32 </div>
33 </div>
34
35 </div>
36
37
38 </%def>
39
@@ -1,1055 +1,1084 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 # Copyright (C) 2016-2020 RhodeCode GmbH
3 # Copyright (C) 2016-2020 RhodeCode GmbH
4 #
4 #
5 # This program is free software: you can redistribute it and/or modify
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License, version 3
6 # it under the terms of the GNU Affero General Public License, version 3
7 # (only), as published by the Free Software Foundation.
7 # (only), as published by the Free Software Foundation.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU Affero General Public License
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
16 #
17 # This program is dual-licensed. If you wish to learn more about the
17 # This program is dual-licensed. If you wish to learn more about the
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21
21
22 from rhodecode.apps._base import ADMIN_PREFIX
22 from rhodecode.apps._base import ADMIN_PREFIX
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.defaults import AdminDefaultSettingsView
31 from rhodecode.apps.admin.views.defaults import AdminDefaultSettingsView
31 from rhodecode.apps.admin.views.exception_tracker import ExceptionsTrackerView
32 from rhodecode.apps.admin.views.exception_tracker import ExceptionsTrackerView
32 from rhodecode.apps.admin.views.main_views import AdminMainView
33 from rhodecode.apps.admin.views.main_views import AdminMainView
33 from rhodecode.apps.admin.views.open_source_licenses import OpenSourceLicensesAdminSettingsView
34 from rhodecode.apps.admin.views.open_source_licenses import OpenSourceLicensesAdminSettingsView
34 from rhodecode.apps.admin.views.permissions import AdminPermissionsView
35 from rhodecode.apps.admin.views.permissions import AdminPermissionsView
35 from rhodecode.apps.admin.views.process_management import AdminProcessManagementView
36 from rhodecode.apps.admin.views.process_management import AdminProcessManagementView
36 from rhodecode.apps.admin.views.repo_groups import AdminRepoGroupsView
37 from rhodecode.apps.admin.views.repo_groups import AdminRepoGroupsView
37 from rhodecode.apps.admin.views.repositories import AdminReposView
38 from rhodecode.apps.admin.views.repositories import AdminReposView
38 from rhodecode.apps.admin.views.sessions import AdminSessionSettingsView
39 from rhodecode.apps.admin.views.sessions import AdminSessionSettingsView
39 from rhodecode.apps.admin.views.settings import AdminSettingsView
40 from rhodecode.apps.admin.views.settings import AdminSettingsView
40 from rhodecode.apps.admin.views.svn_config import AdminSvnConfigView
41 from rhodecode.apps.admin.views.svn_config import AdminSvnConfigView
41 from rhodecode.apps.admin.views.system_info import AdminSystemInfoSettingsView
42 from rhodecode.apps.admin.views.system_info import AdminSystemInfoSettingsView
42 from rhodecode.apps.admin.views.user_groups import AdminUserGroupsView
43 from rhodecode.apps.admin.views.user_groups import AdminUserGroupsView
43 from rhodecode.apps.admin.views.users import AdminUsersView, UsersView
44 from rhodecode.apps.admin.views.users import AdminUsersView, UsersView
44
45
45 config.add_route(
46 config.add_route(
46 name='admin_audit_logs',
47 name='admin_audit_logs',
47 pattern='/audit_logs')
48 pattern='/audit_logs')
48 config.add_view(
49 config.add_view(
49 AdminAuditLogsView,
50 AdminAuditLogsView,
50 attr='admin_audit_logs',
51 attr='admin_audit_logs',
51 route_name='admin_audit_logs', request_method='GET',
52 route_name='admin_audit_logs', request_method='GET',
52 renderer='rhodecode:templates/admin/admin_audit_logs.mako')
53 renderer='rhodecode:templates/admin/admin_audit_logs.mako')
53
54
54 config.add_route(
55 config.add_route(
55 name='admin_audit_log_entry',
56 name='admin_audit_log_entry',
56 pattern='/audit_logs/{audit_log_id}')
57 pattern='/audit_logs/{audit_log_id}')
57 config.add_view(
58 config.add_view(
58 AdminAuditLogsView,
59 AdminAuditLogsView,
59 attr='admin_audit_log_entry',
60 attr='admin_audit_log_entry',
60 route_name='admin_audit_log_entry', request_method='GET',
61 route_name='admin_audit_log_entry', request_method='GET',
61 renderer='rhodecode:templates/admin/admin_audit_log_entry.mako')
62 renderer='rhodecode:templates/admin/admin_audit_log_entry.mako')
62
63
64 # Artifacts EE feature
65 config.add_route(
66 'admin_artifacts',
67 pattern=ADMIN_PREFIX + '/artifacts')
68 config.add_route(
69 'admin_artifacts_show_all',
70 pattern=ADMIN_PREFIX + '/artifacts')
71 config.add_view(
72 AdminArtifactsView,
73 attr='artifacts',
74 route_name='admin_artifacts', request_method='GET',
75 renderer='rhodecode:templates/admin/artifacts/artifacts.mako')
76 config.add_view(
77 AdminArtifactsView,
78 attr='artifacts',
79 route_name='admin_artifacts_show_all', request_method='GET',
80 renderer='rhodecode:templates/admin/artifacts/artifacts.mako')
81 # EE views
82 config.add_route(
83 name='admin_artifacts_show_info',
84 pattern=ADMIN_PREFIX + '/artifacts/{uid}')
85 config.add_route(
86 name='admin_artifacts_delete',
87 pattern=ADMIN_PREFIX + '/artifacts/{uid}/delete')
88 config.add_route(
89 name='admin_artifacts_update',
90 pattern=ADMIN_PREFIX + '/artifacts/{uid}/update')
91
63 config.add_route(
92 config.add_route(
64 name='admin_settings_open_source',
93 name='admin_settings_open_source',
65 pattern='/settings/open_source')
94 pattern='/settings/open_source')
66 config.add_view(
95 config.add_view(
67 OpenSourceLicensesAdminSettingsView,
96 OpenSourceLicensesAdminSettingsView,
68 attr='open_source_licenses',
97 attr='open_source_licenses',
69 route_name='admin_settings_open_source', request_method='GET',
98 route_name='admin_settings_open_source', request_method='GET',
70 renderer='rhodecode:templates/admin/settings/settings.mako')
99 renderer='rhodecode:templates/admin/settings/settings.mako')
71
100
72 config.add_route(
101 config.add_route(
73 name='admin_settings_vcs_svn_generate_cfg',
102 name='admin_settings_vcs_svn_generate_cfg',
74 pattern='/settings/vcs/svn_generate_cfg')
103 pattern='/settings/vcs/svn_generate_cfg')
75 config.add_view(
104 config.add_view(
76 AdminSvnConfigView,
105 AdminSvnConfigView,
77 attr='vcs_svn_generate_config',
106 attr='vcs_svn_generate_config',
78 route_name='admin_settings_vcs_svn_generate_cfg',
107 route_name='admin_settings_vcs_svn_generate_cfg',
79 request_method='POST', renderer='json')
108 request_method='POST', renderer='json')
80
109
81 config.add_route(
110 config.add_route(
82 name='admin_settings_system',
111 name='admin_settings_system',
83 pattern='/settings/system')
112 pattern='/settings/system')
84 config.add_view(
113 config.add_view(
85 AdminSystemInfoSettingsView,
114 AdminSystemInfoSettingsView,
86 attr='settings_system_info',
115 attr='settings_system_info',
87 route_name='admin_settings_system', request_method='GET',
116 route_name='admin_settings_system', request_method='GET',
88 renderer='rhodecode:templates/admin/settings/settings.mako')
117 renderer='rhodecode:templates/admin/settings/settings.mako')
89
118
90 config.add_route(
119 config.add_route(
91 name='admin_settings_system_update',
120 name='admin_settings_system_update',
92 pattern='/settings/system/updates')
121 pattern='/settings/system/updates')
93 config.add_view(
122 config.add_view(
94 AdminSystemInfoSettingsView,
123 AdminSystemInfoSettingsView,
95 attr='settings_system_info_check_update',
124 attr='settings_system_info_check_update',
96 route_name='admin_settings_system_update', request_method='GET',
125 route_name='admin_settings_system_update', request_method='GET',
97 renderer='rhodecode:templates/admin/settings/settings_system_update.mako')
126 renderer='rhodecode:templates/admin/settings/settings_system_update.mako')
98
127
99 config.add_route(
128 config.add_route(
100 name='admin_settings_exception_tracker',
129 name='admin_settings_exception_tracker',
101 pattern='/settings/exceptions')
130 pattern='/settings/exceptions')
102 config.add_view(
131 config.add_view(
103 ExceptionsTrackerView,
132 ExceptionsTrackerView,
104 attr='browse_exceptions',
133 attr='browse_exceptions',
105 route_name='admin_settings_exception_tracker', request_method='GET',
134 route_name='admin_settings_exception_tracker', request_method='GET',
106 renderer='rhodecode:templates/admin/settings/settings.mako')
135 renderer='rhodecode:templates/admin/settings/settings.mako')
107
136
108 config.add_route(
137 config.add_route(
109 name='admin_settings_exception_tracker_delete_all',
138 name='admin_settings_exception_tracker_delete_all',
110 pattern='/settings/exceptions_delete_all')
139 pattern='/settings/exceptions_delete_all')
111 config.add_view(
140 config.add_view(
112 ExceptionsTrackerView,
141 ExceptionsTrackerView,
113 attr='exception_delete_all',
142 attr='exception_delete_all',
114 route_name='admin_settings_exception_tracker_delete_all', request_method='POST',
143 route_name='admin_settings_exception_tracker_delete_all', request_method='POST',
115 renderer='rhodecode:templates/admin/settings/settings.mako')
144 renderer='rhodecode:templates/admin/settings/settings.mako')
116
145
117 config.add_route(
146 config.add_route(
118 name='admin_settings_exception_tracker_show',
147 name='admin_settings_exception_tracker_show',
119 pattern='/settings/exceptions/{exception_id}')
148 pattern='/settings/exceptions/{exception_id}')
120 config.add_view(
149 config.add_view(
121 ExceptionsTrackerView,
150 ExceptionsTrackerView,
122 attr='exception_show',
151 attr='exception_show',
123 route_name='admin_settings_exception_tracker_show', request_method='GET',
152 route_name='admin_settings_exception_tracker_show', request_method='GET',
124 renderer='rhodecode:templates/admin/settings/settings.mako')
153 renderer='rhodecode:templates/admin/settings/settings.mako')
125
154
126 config.add_route(
155 config.add_route(
127 name='admin_settings_exception_tracker_delete',
156 name='admin_settings_exception_tracker_delete',
128 pattern='/settings/exceptions/{exception_id}/delete')
157 pattern='/settings/exceptions/{exception_id}/delete')
129 config.add_view(
158 config.add_view(
130 ExceptionsTrackerView,
159 ExceptionsTrackerView,
131 attr='exception_delete',
160 attr='exception_delete',
132 route_name='admin_settings_exception_tracker_delete', request_method='POST',
161 route_name='admin_settings_exception_tracker_delete', request_method='POST',
133 renderer='rhodecode:templates/admin/settings/settings.mako')
162 renderer='rhodecode:templates/admin/settings/settings.mako')
134
163
135 config.add_route(
164 config.add_route(
136 name='admin_settings_sessions',
165 name='admin_settings_sessions',
137 pattern='/settings/sessions')
166 pattern='/settings/sessions')
138 config.add_view(
167 config.add_view(
139 AdminSessionSettingsView,
168 AdminSessionSettingsView,
140 attr='settings_sessions',
169 attr='settings_sessions',
141 route_name='admin_settings_sessions', request_method='GET',
170 route_name='admin_settings_sessions', request_method='GET',
142 renderer='rhodecode:templates/admin/settings/settings.mako')
171 renderer='rhodecode:templates/admin/settings/settings.mako')
143
172
144 config.add_route(
173 config.add_route(
145 name='admin_settings_sessions_cleanup',
174 name='admin_settings_sessions_cleanup',
146 pattern='/settings/sessions/cleanup')
175 pattern='/settings/sessions/cleanup')
147 config.add_view(
176 config.add_view(
148 AdminSessionSettingsView,
177 AdminSessionSettingsView,
149 attr='settings_sessions_cleanup',
178 attr='settings_sessions_cleanup',
150 route_name='admin_settings_sessions_cleanup', request_method='POST')
179 route_name='admin_settings_sessions_cleanup', request_method='POST')
151
180
152 config.add_route(
181 config.add_route(
153 name='admin_settings_process_management',
182 name='admin_settings_process_management',
154 pattern='/settings/process_management')
183 pattern='/settings/process_management')
155 config.add_view(
184 config.add_view(
156 AdminProcessManagementView,
185 AdminProcessManagementView,
157 attr='process_management',
186 attr='process_management',
158 route_name='admin_settings_process_management', request_method='GET',
187 route_name='admin_settings_process_management', request_method='GET',
159 renderer='rhodecode:templates/admin/settings/settings.mako')
188 renderer='rhodecode:templates/admin/settings/settings.mako')
160
189
161 config.add_route(
190 config.add_route(
162 name='admin_settings_process_management_data',
191 name='admin_settings_process_management_data',
163 pattern='/settings/process_management/data')
192 pattern='/settings/process_management/data')
164 config.add_view(
193 config.add_view(
165 AdminProcessManagementView,
194 AdminProcessManagementView,
166 attr='process_management_data',
195 attr='process_management_data',
167 route_name='admin_settings_process_management_data', request_method='GET',
196 route_name='admin_settings_process_management_data', request_method='GET',
168 renderer='rhodecode:templates/admin/settings/settings_process_management_data.mako')
197 renderer='rhodecode:templates/admin/settings/settings_process_management_data.mako')
169
198
170 config.add_route(
199 config.add_route(
171 name='admin_settings_process_management_signal',
200 name='admin_settings_process_management_signal',
172 pattern='/settings/process_management/signal')
201 pattern='/settings/process_management/signal')
173 config.add_view(
202 config.add_view(
174 AdminProcessManagementView,
203 AdminProcessManagementView,
175 attr='process_management_signal',
204 attr='process_management_signal',
176 route_name='admin_settings_process_management_signal',
205 route_name='admin_settings_process_management_signal',
177 request_method='POST', renderer='json_ext')
206 request_method='POST', renderer='json_ext')
178
207
179 config.add_route(
208 config.add_route(
180 name='admin_settings_process_management_master_signal',
209 name='admin_settings_process_management_master_signal',
181 pattern='/settings/process_management/master_signal')
210 pattern='/settings/process_management/master_signal')
182 config.add_view(
211 config.add_view(
183 AdminProcessManagementView,
212 AdminProcessManagementView,
184 attr='process_management_master_signal',
213 attr='process_management_master_signal',
185 route_name='admin_settings_process_management_master_signal',
214 route_name='admin_settings_process_management_master_signal',
186 request_method='POST', renderer='json_ext')
215 request_method='POST', renderer='json_ext')
187
216
188 # default settings
217 # default settings
189 config.add_route(
218 config.add_route(
190 name='admin_defaults_repositories',
219 name='admin_defaults_repositories',
191 pattern='/defaults/repositories')
220 pattern='/defaults/repositories')
192 config.add_view(
221 config.add_view(
193 AdminDefaultSettingsView,
222 AdminDefaultSettingsView,
194 attr='defaults_repository_show',
223 attr='defaults_repository_show',
195 route_name='admin_defaults_repositories', request_method='GET',
224 route_name='admin_defaults_repositories', request_method='GET',
196 renderer='rhodecode:templates/admin/defaults/defaults.mako')
225 renderer='rhodecode:templates/admin/defaults/defaults.mako')
197
226
198 config.add_route(
227 config.add_route(
199 name='admin_defaults_repositories_update',
228 name='admin_defaults_repositories_update',
200 pattern='/defaults/repositories/update')
229 pattern='/defaults/repositories/update')
201 config.add_view(
230 config.add_view(
202 AdminDefaultSettingsView,
231 AdminDefaultSettingsView,
203 attr='defaults_repository_update',
232 attr='defaults_repository_update',
204 route_name='admin_defaults_repositories_update', request_method='POST',
233 route_name='admin_defaults_repositories_update', request_method='POST',
205 renderer='rhodecode:templates/admin/defaults/defaults.mako')
234 renderer='rhodecode:templates/admin/defaults/defaults.mako')
206
235
207 # admin settings
236 # admin settings
208
237
209 config.add_route(
238 config.add_route(
210 name='admin_settings',
239 name='admin_settings',
211 pattern='/settings')
240 pattern='/settings')
212 config.add_view(
241 config.add_view(
213 AdminSettingsView,
242 AdminSettingsView,
214 attr='settings_global',
243 attr='settings_global',
215 route_name='admin_settings', request_method='GET',
244 route_name='admin_settings', request_method='GET',
216 renderer='rhodecode:templates/admin/settings/settings.mako')
245 renderer='rhodecode:templates/admin/settings/settings.mako')
217
246
218 config.add_route(
247 config.add_route(
219 name='admin_settings_update',
248 name='admin_settings_update',
220 pattern='/settings/update')
249 pattern='/settings/update')
221 config.add_view(
250 config.add_view(
222 AdminSettingsView,
251 AdminSettingsView,
223 attr='settings_global_update',
252 attr='settings_global_update',
224 route_name='admin_settings_update', request_method='POST',
253 route_name='admin_settings_update', request_method='POST',
225 renderer='rhodecode:templates/admin/settings/settings.mako')
254 renderer='rhodecode:templates/admin/settings/settings.mako')
226
255
227 config.add_route(
256 config.add_route(
228 name='admin_settings_global',
257 name='admin_settings_global',
229 pattern='/settings/global')
258 pattern='/settings/global')
230 config.add_view(
259 config.add_view(
231 AdminSettingsView,
260 AdminSettingsView,
232 attr='settings_global',
261 attr='settings_global',
233 route_name='admin_settings_global', request_method='GET',
262 route_name='admin_settings_global', request_method='GET',
234 renderer='rhodecode:templates/admin/settings/settings.mako')
263 renderer='rhodecode:templates/admin/settings/settings.mako')
235
264
236 config.add_route(
265 config.add_route(
237 name='admin_settings_global_update',
266 name='admin_settings_global_update',
238 pattern='/settings/global/update')
267 pattern='/settings/global/update')
239 config.add_view(
268 config.add_view(
240 AdminSettingsView,
269 AdminSettingsView,
241 attr='settings_global_update',
270 attr='settings_global_update',
242 route_name='admin_settings_global_update', request_method='POST',
271 route_name='admin_settings_global_update', request_method='POST',
243 renderer='rhodecode:templates/admin/settings/settings.mako')
272 renderer='rhodecode:templates/admin/settings/settings.mako')
244
273
245 config.add_route(
274 config.add_route(
246 name='admin_settings_vcs',
275 name='admin_settings_vcs',
247 pattern='/settings/vcs')
276 pattern='/settings/vcs')
248 config.add_view(
277 config.add_view(
249 AdminSettingsView,
278 AdminSettingsView,
250 attr='settings_vcs',
279 attr='settings_vcs',
251 route_name='admin_settings_vcs', request_method='GET',
280 route_name='admin_settings_vcs', request_method='GET',
252 renderer='rhodecode:templates/admin/settings/settings.mako')
281 renderer='rhodecode:templates/admin/settings/settings.mako')
253
282
254 config.add_route(
283 config.add_route(
255 name='admin_settings_vcs_update',
284 name='admin_settings_vcs_update',
256 pattern='/settings/vcs/update')
285 pattern='/settings/vcs/update')
257 config.add_view(
286 config.add_view(
258 AdminSettingsView,
287 AdminSettingsView,
259 attr='settings_vcs_update',
288 attr='settings_vcs_update',
260 route_name='admin_settings_vcs_update', request_method='POST',
289 route_name='admin_settings_vcs_update', request_method='POST',
261 renderer='rhodecode:templates/admin/settings/settings.mako')
290 renderer='rhodecode:templates/admin/settings/settings.mako')
262
291
263 config.add_route(
292 config.add_route(
264 name='admin_settings_vcs_svn_pattern_delete',
293 name='admin_settings_vcs_svn_pattern_delete',
265 pattern='/settings/vcs/svn_pattern_delete')
294 pattern='/settings/vcs/svn_pattern_delete')
266 config.add_view(
295 config.add_view(
267 AdminSettingsView,
296 AdminSettingsView,
268 attr='settings_vcs_delete_svn_pattern',
297 attr='settings_vcs_delete_svn_pattern',
269 route_name='admin_settings_vcs_svn_pattern_delete', request_method='POST',
298 route_name='admin_settings_vcs_svn_pattern_delete', request_method='POST',
270 renderer='json_ext', xhr=True)
299 renderer='json_ext', xhr=True)
271
300
272 config.add_route(
301 config.add_route(
273 name='admin_settings_mapping',
302 name='admin_settings_mapping',
274 pattern='/settings/mapping')
303 pattern='/settings/mapping')
275 config.add_view(
304 config.add_view(
276 AdminSettingsView,
305 AdminSettingsView,
277 attr='settings_mapping',
306 attr='settings_mapping',
278 route_name='admin_settings_mapping', request_method='GET',
307 route_name='admin_settings_mapping', request_method='GET',
279 renderer='rhodecode:templates/admin/settings/settings.mako')
308 renderer='rhodecode:templates/admin/settings/settings.mako')
280
309
281 config.add_route(
310 config.add_route(
282 name='admin_settings_mapping_update',
311 name='admin_settings_mapping_update',
283 pattern='/settings/mapping/update')
312 pattern='/settings/mapping/update')
284 config.add_view(
313 config.add_view(
285 AdminSettingsView,
314 AdminSettingsView,
286 attr='settings_mapping_update',
315 attr='settings_mapping_update',
287 route_name='admin_settings_mapping_update', request_method='POST',
316 route_name='admin_settings_mapping_update', request_method='POST',
288 renderer='rhodecode:templates/admin/settings/settings.mako')
317 renderer='rhodecode:templates/admin/settings/settings.mako')
289
318
290 config.add_route(
319 config.add_route(
291 name='admin_settings_visual',
320 name='admin_settings_visual',
292 pattern='/settings/visual')
321 pattern='/settings/visual')
293 config.add_view(
322 config.add_view(
294 AdminSettingsView,
323 AdminSettingsView,
295 attr='settings_visual',
324 attr='settings_visual',
296 route_name='admin_settings_visual', request_method='GET',
325 route_name='admin_settings_visual', request_method='GET',
297 renderer='rhodecode:templates/admin/settings/settings.mako')
326 renderer='rhodecode:templates/admin/settings/settings.mako')
298
327
299 config.add_route(
328 config.add_route(
300 name='admin_settings_visual_update',
329 name='admin_settings_visual_update',
301 pattern='/settings/visual/update')
330 pattern='/settings/visual/update')
302 config.add_view(
331 config.add_view(
303 AdminSettingsView,
332 AdminSettingsView,
304 attr='settings_visual_update',
333 attr='settings_visual_update',
305 route_name='admin_settings_visual_update', request_method='POST',
334 route_name='admin_settings_visual_update', request_method='POST',
306 renderer='rhodecode:templates/admin/settings/settings.mako')
335 renderer='rhodecode:templates/admin/settings/settings.mako')
307
336
308 config.add_route(
337 config.add_route(
309 name='admin_settings_issuetracker',
338 name='admin_settings_issuetracker',
310 pattern='/settings/issue-tracker')
339 pattern='/settings/issue-tracker')
311 config.add_view(
340 config.add_view(
312 AdminSettingsView,
341 AdminSettingsView,
313 attr='settings_issuetracker',
342 attr='settings_issuetracker',
314 route_name='admin_settings_issuetracker', request_method='GET',
343 route_name='admin_settings_issuetracker', request_method='GET',
315 renderer='rhodecode:templates/admin/settings/settings.mako')
344 renderer='rhodecode:templates/admin/settings/settings.mako')
316
345
317 config.add_route(
346 config.add_route(
318 name='admin_settings_issuetracker_update',
347 name='admin_settings_issuetracker_update',
319 pattern='/settings/issue-tracker/update')
348 pattern='/settings/issue-tracker/update')
320 config.add_view(
349 config.add_view(
321 AdminSettingsView,
350 AdminSettingsView,
322 attr='settings_issuetracker_update',
351 attr='settings_issuetracker_update',
323 route_name='admin_settings_issuetracker_update', request_method='POST',
352 route_name='admin_settings_issuetracker_update', request_method='POST',
324 renderer='rhodecode:templates/admin/settings/settings.mako')
353 renderer='rhodecode:templates/admin/settings/settings.mako')
325
354
326 config.add_route(
355 config.add_route(
327 name='admin_settings_issuetracker_test',
356 name='admin_settings_issuetracker_test',
328 pattern='/settings/issue-tracker/test')
357 pattern='/settings/issue-tracker/test')
329 config.add_view(
358 config.add_view(
330 AdminSettingsView,
359 AdminSettingsView,
331 attr='settings_issuetracker_test',
360 attr='settings_issuetracker_test',
332 route_name='admin_settings_issuetracker_test', request_method='POST',
361 route_name='admin_settings_issuetracker_test', request_method='POST',
333 renderer='string', xhr=True)
362 renderer='string', xhr=True)
334
363
335 config.add_route(
364 config.add_route(
336 name='admin_settings_issuetracker_delete',
365 name='admin_settings_issuetracker_delete',
337 pattern='/settings/issue-tracker/delete')
366 pattern='/settings/issue-tracker/delete')
338 config.add_view(
367 config.add_view(
339 AdminSettingsView,
368 AdminSettingsView,
340 attr='settings_issuetracker_delete',
369 attr='settings_issuetracker_delete',
341 route_name='admin_settings_issuetracker_delete', request_method='POST',
370 route_name='admin_settings_issuetracker_delete', request_method='POST',
342 renderer='json_ext', xhr=True)
371 renderer='json_ext', xhr=True)
343
372
344 config.add_route(
373 config.add_route(
345 name='admin_settings_email',
374 name='admin_settings_email',
346 pattern='/settings/email')
375 pattern='/settings/email')
347 config.add_view(
376 config.add_view(
348 AdminSettingsView,
377 AdminSettingsView,
349 attr='settings_email',
378 attr='settings_email',
350 route_name='admin_settings_email', request_method='GET',
379 route_name='admin_settings_email', request_method='GET',
351 renderer='rhodecode:templates/admin/settings/settings.mako')
380 renderer='rhodecode:templates/admin/settings/settings.mako')
352
381
353 config.add_route(
382 config.add_route(
354 name='admin_settings_email_update',
383 name='admin_settings_email_update',
355 pattern='/settings/email/update')
384 pattern='/settings/email/update')
356 config.add_view(
385 config.add_view(
357 AdminSettingsView,
386 AdminSettingsView,
358 attr='settings_email_update',
387 attr='settings_email_update',
359 route_name='admin_settings_email_update', request_method='POST',
388 route_name='admin_settings_email_update', request_method='POST',
360 renderer='rhodecode:templates/admin/settings/settings.mako')
389 renderer='rhodecode:templates/admin/settings/settings.mako')
361
390
362 config.add_route(
391 config.add_route(
363 name='admin_settings_hooks',
392 name='admin_settings_hooks',
364 pattern='/settings/hooks')
393 pattern='/settings/hooks')
365 config.add_view(
394 config.add_view(
366 AdminSettingsView,
395 AdminSettingsView,
367 attr='settings_hooks',
396 attr='settings_hooks',
368 route_name='admin_settings_hooks', request_method='GET',
397 route_name='admin_settings_hooks', request_method='GET',
369 renderer='rhodecode:templates/admin/settings/settings.mako')
398 renderer='rhodecode:templates/admin/settings/settings.mako')
370
399
371 config.add_route(
400 config.add_route(
372 name='admin_settings_hooks_update',
401 name='admin_settings_hooks_update',
373 pattern='/settings/hooks/update')
402 pattern='/settings/hooks/update')
374 config.add_view(
403 config.add_view(
375 AdminSettingsView,
404 AdminSettingsView,
376 attr='settings_hooks_update',
405 attr='settings_hooks_update',
377 route_name='admin_settings_hooks_update', request_method='POST',
406 route_name='admin_settings_hooks_update', request_method='POST',
378 renderer='rhodecode:templates/admin/settings/settings.mako')
407 renderer='rhodecode:templates/admin/settings/settings.mako')
379
408
380 config.add_route(
409 config.add_route(
381 name='admin_settings_hooks_delete',
410 name='admin_settings_hooks_delete',
382 pattern='/settings/hooks/delete')
411 pattern='/settings/hooks/delete')
383 config.add_view(
412 config.add_view(
384 AdminSettingsView,
413 AdminSettingsView,
385 attr='settings_hooks_update',
414 attr='settings_hooks_update',
386 route_name='admin_settings_hooks_delete', request_method='POST',
415 route_name='admin_settings_hooks_delete', request_method='POST',
387 renderer='rhodecode:templates/admin/settings/settings.mako')
416 renderer='rhodecode:templates/admin/settings/settings.mako')
388
417
389 config.add_route(
418 config.add_route(
390 name='admin_settings_search',
419 name='admin_settings_search',
391 pattern='/settings/search')
420 pattern='/settings/search')
392 config.add_view(
421 config.add_view(
393 AdminSettingsView,
422 AdminSettingsView,
394 attr='settings_search',
423 attr='settings_search',
395 route_name='admin_settings_search', request_method='GET',
424 route_name='admin_settings_search', request_method='GET',
396 renderer='rhodecode:templates/admin/settings/settings.mako')
425 renderer='rhodecode:templates/admin/settings/settings.mako')
397
426
398 config.add_route(
427 config.add_route(
399 name='admin_settings_labs',
428 name='admin_settings_labs',
400 pattern='/settings/labs')
429 pattern='/settings/labs')
401 config.add_view(
430 config.add_view(
402 AdminSettingsView,
431 AdminSettingsView,
403 attr='settings_labs',
432 attr='settings_labs',
404 route_name='admin_settings_labs', request_method='GET',
433 route_name='admin_settings_labs', request_method='GET',
405 renderer='rhodecode:templates/admin/settings/settings.mako')
434 renderer='rhodecode:templates/admin/settings/settings.mako')
406
435
407 config.add_route(
436 config.add_route(
408 name='admin_settings_labs_update',
437 name='admin_settings_labs_update',
409 pattern='/settings/labs/update')
438 pattern='/settings/labs/update')
410 config.add_view(
439 config.add_view(
411 AdminSettingsView,
440 AdminSettingsView,
412 attr='settings_labs_update',
441 attr='settings_labs_update',
413 route_name='admin_settings_labs_update', request_method='POST',
442 route_name='admin_settings_labs_update', request_method='POST',
414 renderer='rhodecode:templates/admin/settings/settings.mako')
443 renderer='rhodecode:templates/admin/settings/settings.mako')
415
444
416 # Automation EE feature
445 # Automation EE feature
417 config.add_route(
446 config.add_route(
418 'admin_settings_automation',
447 'admin_settings_automation',
419 pattern=ADMIN_PREFIX + '/settings/automation')
448 pattern=ADMIN_PREFIX + '/settings/automation')
420 config.add_view(
449 config.add_view(
421 AdminSettingsView,
450 AdminSettingsView,
422 attr='settings_automation',
451 attr='settings_automation',
423 route_name='admin_settings_automation', request_method='GET',
452 route_name='admin_settings_automation', request_method='GET',
424 renderer='rhodecode:templates/admin/settings/settings.mako')
453 renderer='rhodecode:templates/admin/settings/settings.mako')
425
454
426 # global permissions
455 # global permissions
427
456
428 config.add_route(
457 config.add_route(
429 name='admin_permissions_application',
458 name='admin_permissions_application',
430 pattern='/permissions/application')
459 pattern='/permissions/application')
431 config.add_view(
460 config.add_view(
432 AdminPermissionsView,
461 AdminPermissionsView,
433 attr='permissions_application',
462 attr='permissions_application',
434 route_name='admin_permissions_application', request_method='GET',
463 route_name='admin_permissions_application', request_method='GET',
435 renderer='rhodecode:templates/admin/permissions/permissions.mako')
464 renderer='rhodecode:templates/admin/permissions/permissions.mako')
436
465
437 config.add_route(
466 config.add_route(
438 name='admin_permissions_application_update',
467 name='admin_permissions_application_update',
439 pattern='/permissions/application/update')
468 pattern='/permissions/application/update')
440 config.add_view(
469 config.add_view(
441 AdminPermissionsView,
470 AdminPermissionsView,
442 attr='permissions_application_update',
471 attr='permissions_application_update',
443 route_name='admin_permissions_application_update', request_method='POST',
472 route_name='admin_permissions_application_update', request_method='POST',
444 renderer='rhodecode:templates/admin/permissions/permissions.mako')
473 renderer='rhodecode:templates/admin/permissions/permissions.mako')
445
474
446 config.add_route(
475 config.add_route(
447 name='admin_permissions_global',
476 name='admin_permissions_global',
448 pattern='/permissions/global')
477 pattern='/permissions/global')
449 config.add_view(
478 config.add_view(
450 AdminPermissionsView,
479 AdminPermissionsView,
451 attr='permissions_global',
480 attr='permissions_global',
452 route_name='admin_permissions_global', request_method='GET',
481 route_name='admin_permissions_global', request_method='GET',
453 renderer='rhodecode:templates/admin/permissions/permissions.mako')
482 renderer='rhodecode:templates/admin/permissions/permissions.mako')
454
483
455 config.add_route(
484 config.add_route(
456 name='admin_permissions_global_update',
485 name='admin_permissions_global_update',
457 pattern='/permissions/global/update')
486 pattern='/permissions/global/update')
458 config.add_view(
487 config.add_view(
459 AdminPermissionsView,
488 AdminPermissionsView,
460 attr='permissions_global_update',
489 attr='permissions_global_update',
461 route_name='admin_permissions_global_update', request_method='POST',
490 route_name='admin_permissions_global_update', request_method='POST',
462 renderer='rhodecode:templates/admin/permissions/permissions.mako')
491 renderer='rhodecode:templates/admin/permissions/permissions.mako')
463
492
464 config.add_route(
493 config.add_route(
465 name='admin_permissions_object',
494 name='admin_permissions_object',
466 pattern='/permissions/object')
495 pattern='/permissions/object')
467 config.add_view(
496 config.add_view(
468 AdminPermissionsView,
497 AdminPermissionsView,
469 attr='permissions_objects',
498 attr='permissions_objects',
470 route_name='admin_permissions_object', request_method='GET',
499 route_name='admin_permissions_object', request_method='GET',
471 renderer='rhodecode:templates/admin/permissions/permissions.mako')
500 renderer='rhodecode:templates/admin/permissions/permissions.mako')
472
501
473 config.add_route(
502 config.add_route(
474 name='admin_permissions_object_update',
503 name='admin_permissions_object_update',
475 pattern='/permissions/object/update')
504 pattern='/permissions/object/update')
476 config.add_view(
505 config.add_view(
477 AdminPermissionsView,
506 AdminPermissionsView,
478 attr='permissions_objects_update',
507 attr='permissions_objects_update',
479 route_name='admin_permissions_object_update', request_method='POST',
508 route_name='admin_permissions_object_update', request_method='POST',
480 renderer='rhodecode:templates/admin/permissions/permissions.mako')
509 renderer='rhodecode:templates/admin/permissions/permissions.mako')
481
510
482 # Branch perms EE feature
511 # Branch perms EE feature
483 config.add_route(
512 config.add_route(
484 name='admin_permissions_branch',
513 name='admin_permissions_branch',
485 pattern='/permissions/branch')
514 pattern='/permissions/branch')
486 config.add_view(
515 config.add_view(
487 AdminPermissionsView,
516 AdminPermissionsView,
488 attr='permissions_branch',
517 attr='permissions_branch',
489 route_name='admin_permissions_branch', request_method='GET',
518 route_name='admin_permissions_branch', request_method='GET',
490 renderer='rhodecode:templates/admin/permissions/permissions.mako')
519 renderer='rhodecode:templates/admin/permissions/permissions.mako')
491
520
492 config.add_route(
521 config.add_route(
493 name='admin_permissions_ips',
522 name='admin_permissions_ips',
494 pattern='/permissions/ips')
523 pattern='/permissions/ips')
495 config.add_view(
524 config.add_view(
496 AdminPermissionsView,
525 AdminPermissionsView,
497 attr='permissions_ips',
526 attr='permissions_ips',
498 route_name='admin_permissions_ips', request_method='GET',
527 route_name='admin_permissions_ips', request_method='GET',
499 renderer='rhodecode:templates/admin/permissions/permissions.mako')
528 renderer='rhodecode:templates/admin/permissions/permissions.mako')
500
529
501 config.add_route(
530 config.add_route(
502 name='admin_permissions_overview',
531 name='admin_permissions_overview',
503 pattern='/permissions/overview')
532 pattern='/permissions/overview')
504 config.add_view(
533 config.add_view(
505 AdminPermissionsView,
534 AdminPermissionsView,
506 attr='permissions_overview',
535 attr='permissions_overview',
507 route_name='admin_permissions_overview', request_method='GET',
536 route_name='admin_permissions_overview', request_method='GET',
508 renderer='rhodecode:templates/admin/permissions/permissions.mako')
537 renderer='rhodecode:templates/admin/permissions/permissions.mako')
509
538
510 config.add_route(
539 config.add_route(
511 name='admin_permissions_auth_token_access',
540 name='admin_permissions_auth_token_access',
512 pattern='/permissions/auth_token_access')
541 pattern='/permissions/auth_token_access')
513 config.add_view(
542 config.add_view(
514 AdminPermissionsView,
543 AdminPermissionsView,
515 attr='auth_token_access',
544 attr='auth_token_access',
516 route_name='admin_permissions_auth_token_access', request_method='GET',
545 route_name='admin_permissions_auth_token_access', request_method='GET',
517 renderer='rhodecode:templates/admin/permissions/permissions.mako')
546 renderer='rhodecode:templates/admin/permissions/permissions.mako')
518
547
519 config.add_route(
548 config.add_route(
520 name='admin_permissions_ssh_keys',
549 name='admin_permissions_ssh_keys',
521 pattern='/permissions/ssh_keys')
550 pattern='/permissions/ssh_keys')
522 config.add_view(
551 config.add_view(
523 AdminPermissionsView,
552 AdminPermissionsView,
524 attr='ssh_keys',
553 attr='ssh_keys',
525 route_name='admin_permissions_ssh_keys', request_method='GET',
554 route_name='admin_permissions_ssh_keys', request_method='GET',
526 renderer='rhodecode:templates/admin/permissions/permissions.mako')
555 renderer='rhodecode:templates/admin/permissions/permissions.mako')
527
556
528 config.add_route(
557 config.add_route(
529 name='admin_permissions_ssh_keys_data',
558 name='admin_permissions_ssh_keys_data',
530 pattern='/permissions/ssh_keys/data')
559 pattern='/permissions/ssh_keys/data')
531 config.add_view(
560 config.add_view(
532 AdminPermissionsView,
561 AdminPermissionsView,
533 attr='ssh_keys_data',
562 attr='ssh_keys_data',
534 route_name='admin_permissions_ssh_keys_data', request_method='GET',
563 route_name='admin_permissions_ssh_keys_data', request_method='GET',
535 renderer='json_ext', xhr=True)
564 renderer='json_ext', xhr=True)
536
565
537 config.add_route(
566 config.add_route(
538 name='admin_permissions_ssh_keys_update',
567 name='admin_permissions_ssh_keys_update',
539 pattern='/permissions/ssh_keys/update')
568 pattern='/permissions/ssh_keys/update')
540 config.add_view(
569 config.add_view(
541 AdminPermissionsView,
570 AdminPermissionsView,
542 attr='ssh_keys_update',
571 attr='ssh_keys_update',
543 route_name='admin_permissions_ssh_keys_update', request_method='POST',
572 route_name='admin_permissions_ssh_keys_update', request_method='POST',
544 renderer='rhodecode:templates/admin/permissions/permissions.mako')
573 renderer='rhodecode:templates/admin/permissions/permissions.mako')
545
574
546 # users admin
575 # users admin
547 config.add_route(
576 config.add_route(
548 name='users',
577 name='users',
549 pattern='/users')
578 pattern='/users')
550 config.add_view(
579 config.add_view(
551 AdminUsersView,
580 AdminUsersView,
552 attr='users_list',
581 attr='users_list',
553 route_name='users', request_method='GET',
582 route_name='users', request_method='GET',
554 renderer='rhodecode:templates/admin/users/users.mako')
583 renderer='rhodecode:templates/admin/users/users.mako')
555
584
556 config.add_route(
585 config.add_route(
557 name='users_data',
586 name='users_data',
558 pattern='/users_data')
587 pattern='/users_data')
559 config.add_view(
588 config.add_view(
560 AdminUsersView,
589 AdminUsersView,
561 attr='users_list_data',
590 attr='users_list_data',
562 # renderer defined below
591 # renderer defined below
563 route_name='users_data', request_method='GET',
592 route_name='users_data', request_method='GET',
564 renderer='json_ext', xhr=True)
593 renderer='json_ext', xhr=True)
565
594
566 config.add_route(
595 config.add_route(
567 name='users_create',
596 name='users_create',
568 pattern='/users/create')
597 pattern='/users/create')
569 config.add_view(
598 config.add_view(
570 AdminUsersView,
599 AdminUsersView,
571 attr='users_create',
600 attr='users_create',
572 route_name='users_create', request_method='POST',
601 route_name='users_create', request_method='POST',
573 renderer='rhodecode:templates/admin/users/user_add.mako')
602 renderer='rhodecode:templates/admin/users/user_add.mako')
574
603
575 config.add_route(
604 config.add_route(
576 name='users_new',
605 name='users_new',
577 pattern='/users/new')
606 pattern='/users/new')
578 config.add_view(
607 config.add_view(
579 AdminUsersView,
608 AdminUsersView,
580 attr='users_new',
609 attr='users_new',
581 route_name='users_new', request_method='GET',
610 route_name='users_new', request_method='GET',
582 renderer='rhodecode:templates/admin/users/user_add.mako')
611 renderer='rhodecode:templates/admin/users/user_add.mako')
583
612
584 # user management
613 # user management
585 config.add_route(
614 config.add_route(
586 name='user_edit',
615 name='user_edit',
587 pattern='/users/{user_id:\d+}/edit',
616 pattern='/users/{user_id:\d+}/edit',
588 user_route=True)
617 user_route=True)
589 config.add_view(
618 config.add_view(
590 UsersView,
619 UsersView,
591 attr='user_edit',
620 attr='user_edit',
592 route_name='user_edit', request_method='GET',
621 route_name='user_edit', request_method='GET',
593 renderer='rhodecode:templates/admin/users/user_edit.mako')
622 renderer='rhodecode:templates/admin/users/user_edit.mako')
594
623
595 config.add_route(
624 config.add_route(
596 name='user_edit_advanced',
625 name='user_edit_advanced',
597 pattern='/users/{user_id:\d+}/edit/advanced',
626 pattern='/users/{user_id:\d+}/edit/advanced',
598 user_route=True)
627 user_route=True)
599 config.add_view(
628 config.add_view(
600 UsersView,
629 UsersView,
601 attr='user_edit_advanced',
630 attr='user_edit_advanced',
602 route_name='user_edit_advanced', request_method='GET',
631 route_name='user_edit_advanced', request_method='GET',
603 renderer='rhodecode:templates/admin/users/user_edit.mako')
632 renderer='rhodecode:templates/admin/users/user_edit.mako')
604
633
605 config.add_route(
634 config.add_route(
606 name='user_edit_global_perms',
635 name='user_edit_global_perms',
607 pattern='/users/{user_id:\d+}/edit/global_permissions',
636 pattern='/users/{user_id:\d+}/edit/global_permissions',
608 user_route=True)
637 user_route=True)
609 config.add_view(
638 config.add_view(
610 UsersView,
639 UsersView,
611 attr='user_edit_global_perms',
640 attr='user_edit_global_perms',
612 route_name='user_edit_global_perms', request_method='GET',
641 route_name='user_edit_global_perms', request_method='GET',
613 renderer='rhodecode:templates/admin/users/user_edit.mako')
642 renderer='rhodecode:templates/admin/users/user_edit.mako')
614
643
615 config.add_route(
644 config.add_route(
616 name='user_edit_global_perms_update',
645 name='user_edit_global_perms_update',
617 pattern='/users/{user_id:\d+}/edit/global_permissions/update',
646 pattern='/users/{user_id:\d+}/edit/global_permissions/update',
618 user_route=True)
647 user_route=True)
619 config.add_view(
648 config.add_view(
620 UsersView,
649 UsersView,
621 attr='user_edit_global_perms_update',
650 attr='user_edit_global_perms_update',
622 route_name='user_edit_global_perms_update', request_method='POST',
651 route_name='user_edit_global_perms_update', request_method='POST',
623 renderer='rhodecode:templates/admin/users/user_edit.mako')
652 renderer='rhodecode:templates/admin/users/user_edit.mako')
624
653
625 config.add_route(
654 config.add_route(
626 name='user_update',
655 name='user_update',
627 pattern='/users/{user_id:\d+}/update',
656 pattern='/users/{user_id:\d+}/update',
628 user_route=True)
657 user_route=True)
629 config.add_view(
658 config.add_view(
630 UsersView,
659 UsersView,
631 attr='user_update',
660 attr='user_update',
632 route_name='user_update', request_method='POST',
661 route_name='user_update', request_method='POST',
633 renderer='rhodecode:templates/admin/users/user_edit.mako')
662 renderer='rhodecode:templates/admin/users/user_edit.mako')
634
663
635 config.add_route(
664 config.add_route(
636 name='user_delete',
665 name='user_delete',
637 pattern='/users/{user_id:\d+}/delete',
666 pattern='/users/{user_id:\d+}/delete',
638 user_route=True)
667 user_route=True)
639 config.add_view(
668 config.add_view(
640 UsersView,
669 UsersView,
641 attr='user_delete',
670 attr='user_delete',
642 route_name='user_delete', request_method='POST',
671 route_name='user_delete', request_method='POST',
643 renderer='rhodecode:templates/admin/users/user_edit.mako')
672 renderer='rhodecode:templates/admin/users/user_edit.mako')
644
673
645 config.add_route(
674 config.add_route(
646 name='user_enable_force_password_reset',
675 name='user_enable_force_password_reset',
647 pattern='/users/{user_id:\d+}/password_reset_enable',
676 pattern='/users/{user_id:\d+}/password_reset_enable',
648 user_route=True)
677 user_route=True)
649 config.add_view(
678 config.add_view(
650 UsersView,
679 UsersView,
651 attr='user_enable_force_password_reset',
680 attr='user_enable_force_password_reset',
652 route_name='user_enable_force_password_reset', request_method='POST',
681 route_name='user_enable_force_password_reset', request_method='POST',
653 renderer='rhodecode:templates/admin/users/user_edit.mako')
682 renderer='rhodecode:templates/admin/users/user_edit.mako')
654
683
655 config.add_route(
684 config.add_route(
656 name='user_disable_force_password_reset',
685 name='user_disable_force_password_reset',
657 pattern='/users/{user_id:\d+}/password_reset_disable',
686 pattern='/users/{user_id:\d+}/password_reset_disable',
658 user_route=True)
687 user_route=True)
659 config.add_view(
688 config.add_view(
660 UsersView,
689 UsersView,
661 attr='user_disable_force_password_reset',
690 attr='user_disable_force_password_reset',
662 route_name='user_disable_force_password_reset', request_method='POST',
691 route_name='user_disable_force_password_reset', request_method='POST',
663 renderer='rhodecode:templates/admin/users/user_edit.mako')
692 renderer='rhodecode:templates/admin/users/user_edit.mako')
664
693
665 config.add_route(
694 config.add_route(
666 name='user_create_personal_repo_group',
695 name='user_create_personal_repo_group',
667 pattern='/users/{user_id:\d+}/create_repo_group',
696 pattern='/users/{user_id:\d+}/create_repo_group',
668 user_route=True)
697 user_route=True)
669 config.add_view(
698 config.add_view(
670 UsersView,
699 UsersView,
671 attr='user_create_personal_repo_group',
700 attr='user_create_personal_repo_group',
672 route_name='user_create_personal_repo_group', request_method='POST',
701 route_name='user_create_personal_repo_group', request_method='POST',
673 renderer='rhodecode:templates/admin/users/user_edit.mako')
702 renderer='rhodecode:templates/admin/users/user_edit.mako')
674
703
675 # user notice
704 # user notice
676 config.add_route(
705 config.add_route(
677 name='user_notice_dismiss',
706 name='user_notice_dismiss',
678 pattern='/users/{user_id:\d+}/notice_dismiss',
707 pattern='/users/{user_id:\d+}/notice_dismiss',
679 user_route=True)
708 user_route=True)
680 config.add_view(
709 config.add_view(
681 UsersView,
710 UsersView,
682 attr='user_notice_dismiss',
711 attr='user_notice_dismiss',
683 route_name='user_notice_dismiss', request_method='POST',
712 route_name='user_notice_dismiss', request_method='POST',
684 renderer='json_ext', xhr=True)
713 renderer='json_ext', xhr=True)
685
714
686 # user auth tokens
715 # user auth tokens
687 config.add_route(
716 config.add_route(
688 name='edit_user_auth_tokens',
717 name='edit_user_auth_tokens',
689 pattern='/users/{user_id:\d+}/edit/auth_tokens',
718 pattern='/users/{user_id:\d+}/edit/auth_tokens',
690 user_route=True)
719 user_route=True)
691 config.add_view(
720 config.add_view(
692 UsersView,
721 UsersView,
693 attr='auth_tokens',
722 attr='auth_tokens',
694 route_name='edit_user_auth_tokens', request_method='GET',
723 route_name='edit_user_auth_tokens', request_method='GET',
695 renderer='rhodecode:templates/admin/users/user_edit.mako')
724 renderer='rhodecode:templates/admin/users/user_edit.mako')
696
725
697 config.add_route(
726 config.add_route(
698 name='edit_user_auth_tokens_view',
727 name='edit_user_auth_tokens_view',
699 pattern='/users/{user_id:\d+}/edit/auth_tokens/view',
728 pattern='/users/{user_id:\d+}/edit/auth_tokens/view',
700 user_route=True)
729 user_route=True)
701 config.add_view(
730 config.add_view(
702 UsersView,
731 UsersView,
703 attr='auth_tokens_view',
732 attr='auth_tokens_view',
704 route_name='edit_user_auth_tokens_view', request_method='POST',
733 route_name='edit_user_auth_tokens_view', request_method='POST',
705 renderer='json_ext', xhr=True)
734 renderer='json_ext', xhr=True)
706
735
707 config.add_route(
736 config.add_route(
708 name='edit_user_auth_tokens_add',
737 name='edit_user_auth_tokens_add',
709 pattern='/users/{user_id:\d+}/edit/auth_tokens/new',
738 pattern='/users/{user_id:\d+}/edit/auth_tokens/new',
710 user_route=True)
739 user_route=True)
711 config.add_view(
740 config.add_view(
712 UsersView,
741 UsersView,
713 attr='auth_tokens_add',
742 attr='auth_tokens_add',
714 route_name='edit_user_auth_tokens_add', request_method='POST')
743 route_name='edit_user_auth_tokens_add', request_method='POST')
715
744
716 config.add_route(
745 config.add_route(
717 name='edit_user_auth_tokens_delete',
746 name='edit_user_auth_tokens_delete',
718 pattern='/users/{user_id:\d+}/edit/auth_tokens/delete',
747 pattern='/users/{user_id:\d+}/edit/auth_tokens/delete',
719 user_route=True)
748 user_route=True)
720 config.add_view(
749 config.add_view(
721 UsersView,
750 UsersView,
722 attr='auth_tokens_delete',
751 attr='auth_tokens_delete',
723 route_name='edit_user_auth_tokens_delete', request_method='POST')
752 route_name='edit_user_auth_tokens_delete', request_method='POST')
724
753
725 # user ssh keys
754 # user ssh keys
726 config.add_route(
755 config.add_route(
727 name='edit_user_ssh_keys',
756 name='edit_user_ssh_keys',
728 pattern='/users/{user_id:\d+}/edit/ssh_keys',
757 pattern='/users/{user_id:\d+}/edit/ssh_keys',
729 user_route=True)
758 user_route=True)
730 config.add_view(
759 config.add_view(
731 UsersView,
760 UsersView,
732 attr='ssh_keys',
761 attr='ssh_keys',
733 route_name='edit_user_ssh_keys', request_method='GET',
762 route_name='edit_user_ssh_keys', request_method='GET',
734 renderer='rhodecode:templates/admin/users/user_edit.mako')
763 renderer='rhodecode:templates/admin/users/user_edit.mako')
735
764
736 config.add_route(
765 config.add_route(
737 name='edit_user_ssh_keys_generate_keypair',
766 name='edit_user_ssh_keys_generate_keypair',
738 pattern='/users/{user_id:\d+}/edit/ssh_keys/generate',
767 pattern='/users/{user_id:\d+}/edit/ssh_keys/generate',
739 user_route=True)
768 user_route=True)
740 config.add_view(
769 config.add_view(
741 UsersView,
770 UsersView,
742 attr='ssh_keys_generate_keypair',
771 attr='ssh_keys_generate_keypair',
743 route_name='edit_user_ssh_keys_generate_keypair', request_method='GET',
772 route_name='edit_user_ssh_keys_generate_keypair', request_method='GET',
744 renderer='rhodecode:templates/admin/users/user_edit.mako')
773 renderer='rhodecode:templates/admin/users/user_edit.mako')
745
774
746 config.add_route(
775 config.add_route(
747 name='edit_user_ssh_keys_add',
776 name='edit_user_ssh_keys_add',
748 pattern='/users/{user_id:\d+}/edit/ssh_keys/new',
777 pattern='/users/{user_id:\d+}/edit/ssh_keys/new',
749 user_route=True)
778 user_route=True)
750 config.add_view(
779 config.add_view(
751 UsersView,
780 UsersView,
752 attr='ssh_keys_add',
781 attr='ssh_keys_add',
753 route_name='edit_user_ssh_keys_add', request_method='POST')
782 route_name='edit_user_ssh_keys_add', request_method='POST')
754
783
755 config.add_route(
784 config.add_route(
756 name='edit_user_ssh_keys_delete',
785 name='edit_user_ssh_keys_delete',
757 pattern='/users/{user_id:\d+}/edit/ssh_keys/delete',
786 pattern='/users/{user_id:\d+}/edit/ssh_keys/delete',
758 user_route=True)
787 user_route=True)
759 config.add_view(
788 config.add_view(
760 UsersView,
789 UsersView,
761 attr='ssh_keys_delete',
790 attr='ssh_keys_delete',
762 route_name='edit_user_ssh_keys_delete', request_method='POST')
791 route_name='edit_user_ssh_keys_delete', request_method='POST')
763
792
764 # user emails
793 # user emails
765 config.add_route(
794 config.add_route(
766 name='edit_user_emails',
795 name='edit_user_emails',
767 pattern='/users/{user_id:\d+}/edit/emails',
796 pattern='/users/{user_id:\d+}/edit/emails',
768 user_route=True)
797 user_route=True)
769 config.add_view(
798 config.add_view(
770 UsersView,
799 UsersView,
771 attr='emails',
800 attr='emails',
772 route_name='edit_user_emails', request_method='GET',
801 route_name='edit_user_emails', request_method='GET',
773 renderer='rhodecode:templates/admin/users/user_edit.mako')
802 renderer='rhodecode:templates/admin/users/user_edit.mako')
774
803
775 config.add_route(
804 config.add_route(
776 name='edit_user_emails_add',
805 name='edit_user_emails_add',
777 pattern='/users/{user_id:\d+}/edit/emails/new',
806 pattern='/users/{user_id:\d+}/edit/emails/new',
778 user_route=True)
807 user_route=True)
779 config.add_view(
808 config.add_view(
780 UsersView,
809 UsersView,
781 attr='emails_add',
810 attr='emails_add',
782 route_name='edit_user_emails_add', request_method='POST')
811 route_name='edit_user_emails_add', request_method='POST')
783
812
784 config.add_route(
813 config.add_route(
785 name='edit_user_emails_delete',
814 name='edit_user_emails_delete',
786 pattern='/users/{user_id:\d+}/edit/emails/delete',
815 pattern='/users/{user_id:\d+}/edit/emails/delete',
787 user_route=True)
816 user_route=True)
788 config.add_view(
817 config.add_view(
789 UsersView,
818 UsersView,
790 attr='emails_delete',
819 attr='emails_delete',
791 route_name='edit_user_emails_delete', request_method='POST')
820 route_name='edit_user_emails_delete', request_method='POST')
792
821
793 # user IPs
822 # user IPs
794 config.add_route(
823 config.add_route(
795 name='edit_user_ips',
824 name='edit_user_ips',
796 pattern='/users/{user_id:\d+}/edit/ips',
825 pattern='/users/{user_id:\d+}/edit/ips',
797 user_route=True)
826 user_route=True)
798 config.add_view(
827 config.add_view(
799 UsersView,
828 UsersView,
800 attr='ips',
829 attr='ips',
801 route_name='edit_user_ips', request_method='GET',
830 route_name='edit_user_ips', request_method='GET',
802 renderer='rhodecode:templates/admin/users/user_edit.mako')
831 renderer='rhodecode:templates/admin/users/user_edit.mako')
803
832
804 config.add_route(
833 config.add_route(
805 name='edit_user_ips_add',
834 name='edit_user_ips_add',
806 pattern='/users/{user_id:\d+}/edit/ips/new',
835 pattern='/users/{user_id:\d+}/edit/ips/new',
807 user_route_with_default=True) # enabled for default user too
836 user_route_with_default=True) # enabled for default user too
808 config.add_view(
837 config.add_view(
809 UsersView,
838 UsersView,
810 attr='ips_add',
839 attr='ips_add',
811 route_name='edit_user_ips_add', request_method='POST')
840 route_name='edit_user_ips_add', request_method='POST')
812
841
813 config.add_route(
842 config.add_route(
814 name='edit_user_ips_delete',
843 name='edit_user_ips_delete',
815 pattern='/users/{user_id:\d+}/edit/ips/delete',
844 pattern='/users/{user_id:\d+}/edit/ips/delete',
816 user_route_with_default=True) # enabled for default user too
845 user_route_with_default=True) # enabled for default user too
817 config.add_view(
846 config.add_view(
818 UsersView,
847 UsersView,
819 attr='ips_delete',
848 attr='ips_delete',
820 route_name='edit_user_ips_delete', request_method='POST')
849 route_name='edit_user_ips_delete', request_method='POST')
821
850
822 # user perms
851 # user perms
823 config.add_route(
852 config.add_route(
824 name='edit_user_perms_summary',
853 name='edit_user_perms_summary',
825 pattern='/users/{user_id:\d+}/edit/permissions_summary',
854 pattern='/users/{user_id:\d+}/edit/permissions_summary',
826 user_route=True)
855 user_route=True)
827 config.add_view(
856 config.add_view(
828 UsersView,
857 UsersView,
829 attr='user_perms_summary',
858 attr='user_perms_summary',
830 route_name='edit_user_perms_summary', request_method='GET',
859 route_name='edit_user_perms_summary', request_method='GET',
831 renderer='rhodecode:templates/admin/users/user_edit.mako')
860 renderer='rhodecode:templates/admin/users/user_edit.mako')
832
861
833 config.add_route(
862 config.add_route(
834 name='edit_user_perms_summary_json',
863 name='edit_user_perms_summary_json',
835 pattern='/users/{user_id:\d+}/edit/permissions_summary/json',
864 pattern='/users/{user_id:\d+}/edit/permissions_summary/json',
836 user_route=True)
865 user_route=True)
837 config.add_view(
866 config.add_view(
838 UsersView,
867 UsersView,
839 attr='user_perms_summary_json',
868 attr='user_perms_summary_json',
840 route_name='edit_user_perms_summary_json', request_method='GET',
869 route_name='edit_user_perms_summary_json', request_method='GET',
841 renderer='json_ext')
870 renderer='json_ext')
842
871
843 # user user groups management
872 # user user groups management
844 config.add_route(
873 config.add_route(
845 name='edit_user_groups_management',
874 name='edit_user_groups_management',
846 pattern='/users/{user_id:\d+}/edit/groups_management',
875 pattern='/users/{user_id:\d+}/edit/groups_management',
847 user_route=True)
876 user_route=True)
848 config.add_view(
877 config.add_view(
849 UsersView,
878 UsersView,
850 attr='groups_management',
879 attr='groups_management',
851 route_name='edit_user_groups_management', request_method='GET',
880 route_name='edit_user_groups_management', request_method='GET',
852 renderer='rhodecode:templates/admin/users/user_edit.mako')
881 renderer='rhodecode:templates/admin/users/user_edit.mako')
853
882
854 config.add_route(
883 config.add_route(
855 name='edit_user_groups_management_updates',
884 name='edit_user_groups_management_updates',
856 pattern='/users/{user_id:\d+}/edit/edit_user_groups_management/updates',
885 pattern='/users/{user_id:\d+}/edit/edit_user_groups_management/updates',
857 user_route=True)
886 user_route=True)
858 config.add_view(
887 config.add_view(
859 UsersView,
888 UsersView,
860 attr='groups_management_updates',
889 attr='groups_management_updates',
861 route_name='edit_user_groups_management_updates', request_method='POST')
890 route_name='edit_user_groups_management_updates', request_method='POST')
862
891
863 # user audit logs
892 # user audit logs
864 config.add_route(
893 config.add_route(
865 name='edit_user_audit_logs',
894 name='edit_user_audit_logs',
866 pattern='/users/{user_id:\d+}/edit/audit', user_route=True)
895 pattern='/users/{user_id:\d+}/edit/audit', user_route=True)
867 config.add_view(
896 config.add_view(
868 UsersView,
897 UsersView,
869 attr='user_audit_logs',
898 attr='user_audit_logs',
870 route_name='edit_user_audit_logs', request_method='GET',
899 route_name='edit_user_audit_logs', request_method='GET',
871 renderer='rhodecode:templates/admin/users/user_edit.mako')
900 renderer='rhodecode:templates/admin/users/user_edit.mako')
872
901
873 config.add_route(
902 config.add_route(
874 name='edit_user_audit_logs_download',
903 name='edit_user_audit_logs_download',
875 pattern='/users/{user_id:\d+}/edit/audit/download', user_route=True)
904 pattern='/users/{user_id:\d+}/edit/audit/download', user_route=True)
876 config.add_view(
905 config.add_view(
877 UsersView,
906 UsersView,
878 attr='user_audit_logs_download',
907 attr='user_audit_logs_download',
879 route_name='edit_user_audit_logs_download', request_method='GET',
908 route_name='edit_user_audit_logs_download', request_method='GET',
880 renderer='string')
909 renderer='string')
881
910
882 # user caches
911 # user caches
883 config.add_route(
912 config.add_route(
884 name='edit_user_caches',
913 name='edit_user_caches',
885 pattern='/users/{user_id:\d+}/edit/caches',
914 pattern='/users/{user_id:\d+}/edit/caches',
886 user_route=True)
915 user_route=True)
887 config.add_view(
916 config.add_view(
888 UsersView,
917 UsersView,
889 attr='user_caches',
918 attr='user_caches',
890 route_name='edit_user_caches', request_method='GET',
919 route_name='edit_user_caches', request_method='GET',
891 renderer='rhodecode:templates/admin/users/user_edit.mako')
920 renderer='rhodecode:templates/admin/users/user_edit.mako')
892
921
893 config.add_route(
922 config.add_route(
894 name='edit_user_caches_update',
923 name='edit_user_caches_update',
895 pattern='/users/{user_id:\d+}/edit/caches/update',
924 pattern='/users/{user_id:\d+}/edit/caches/update',
896 user_route=True)
925 user_route=True)
897 config.add_view(
926 config.add_view(
898 UsersView,
927 UsersView,
899 attr='user_caches_update',
928 attr='user_caches_update',
900 route_name='edit_user_caches_update', request_method='POST')
929 route_name='edit_user_caches_update', request_method='POST')
901
930
902 # user-groups admin
931 # user-groups admin
903 config.add_route(
932 config.add_route(
904 name='user_groups',
933 name='user_groups',
905 pattern='/user_groups')
934 pattern='/user_groups')
906 config.add_view(
935 config.add_view(
907 AdminUserGroupsView,
936 AdminUserGroupsView,
908 attr='user_groups_list',
937 attr='user_groups_list',
909 route_name='user_groups', request_method='GET',
938 route_name='user_groups', request_method='GET',
910 renderer='rhodecode:templates/admin/user_groups/user_groups.mako')
939 renderer='rhodecode:templates/admin/user_groups/user_groups.mako')
911
940
912 config.add_route(
941 config.add_route(
913 name='user_groups_data',
942 name='user_groups_data',
914 pattern='/user_groups_data')
943 pattern='/user_groups_data')
915 config.add_view(
944 config.add_view(
916 AdminUserGroupsView,
945 AdminUserGroupsView,
917 attr='user_groups_list_data',
946 attr='user_groups_list_data',
918 route_name='user_groups_data', request_method='GET',
947 route_name='user_groups_data', request_method='GET',
919 renderer='json_ext', xhr=True)
948 renderer='json_ext', xhr=True)
920
949
921 config.add_route(
950 config.add_route(
922 name='user_groups_new',
951 name='user_groups_new',
923 pattern='/user_groups/new')
952 pattern='/user_groups/new')
924 config.add_view(
953 config.add_view(
925 AdminUserGroupsView,
954 AdminUserGroupsView,
926 attr='user_groups_new',
955 attr='user_groups_new',
927 route_name='user_groups_new', request_method='GET',
956 route_name='user_groups_new', request_method='GET',
928 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
957 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
929
958
930 config.add_route(
959 config.add_route(
931 name='user_groups_create',
960 name='user_groups_create',
932 pattern='/user_groups/create')
961 pattern='/user_groups/create')
933 config.add_view(
962 config.add_view(
934 AdminUserGroupsView,
963 AdminUserGroupsView,
935 attr='user_groups_create',
964 attr='user_groups_create',
936 route_name='user_groups_create', request_method='POST',
965 route_name='user_groups_create', request_method='POST',
937 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
966 renderer='rhodecode:templates/admin/user_groups/user_group_add.mako')
938
967
939 # repos admin
968 # repos admin
940 config.add_route(
969 config.add_route(
941 name='repos',
970 name='repos',
942 pattern='/repos')
971 pattern='/repos')
943 config.add_view(
972 config.add_view(
944 AdminReposView,
973 AdminReposView,
945 attr='repository_list',
974 attr='repository_list',
946 route_name='repos', request_method='GET',
975 route_name='repos', request_method='GET',
947 renderer='rhodecode:templates/admin/repos/repos.mako')
976 renderer='rhodecode:templates/admin/repos/repos.mako')
948
977
949 config.add_route(
978 config.add_route(
950 name='repos_data',
979 name='repos_data',
951 pattern='/repos_data')
980 pattern='/repos_data')
952 config.add_view(
981 config.add_view(
953 AdminReposView,
982 AdminReposView,
954 attr='repository_list_data',
983 attr='repository_list_data',
955 route_name='repos_data', request_method='GET',
984 route_name='repos_data', request_method='GET',
956 renderer='json_ext', xhr=True)
985 renderer='json_ext', xhr=True)
957
986
958 config.add_route(
987 config.add_route(
959 name='repo_new',
988 name='repo_new',
960 pattern='/repos/new')
989 pattern='/repos/new')
961 config.add_view(
990 config.add_view(
962 AdminReposView,
991 AdminReposView,
963 attr='repository_new',
992 attr='repository_new',
964 route_name='repo_new', request_method='GET',
993 route_name='repo_new', request_method='GET',
965 renderer='rhodecode:templates/admin/repos/repo_add.mako')
994 renderer='rhodecode:templates/admin/repos/repo_add.mako')
966
995
967 config.add_route(
996 config.add_route(
968 name='repo_create',
997 name='repo_create',
969 pattern='/repos/create')
998 pattern='/repos/create')
970 config.add_view(
999 config.add_view(
971 AdminReposView,
1000 AdminReposView,
972 attr='repository_create',
1001 attr='repository_create',
973 route_name='repo_create', request_method='POST',
1002 route_name='repo_create', request_method='POST',
974 renderer='rhodecode:templates/admin/repos/repos.mako')
1003 renderer='rhodecode:templates/admin/repos/repos.mako')
975
1004
976 # repo groups admin
1005 # repo groups admin
977 config.add_route(
1006 config.add_route(
978 name='repo_groups',
1007 name='repo_groups',
979 pattern='/repo_groups')
1008 pattern='/repo_groups')
980 config.add_view(
1009 config.add_view(
981 AdminRepoGroupsView,
1010 AdminRepoGroupsView,
982 attr='repo_group_list',
1011 attr='repo_group_list',
983 route_name='repo_groups', request_method='GET',
1012 route_name='repo_groups', request_method='GET',
984 renderer='rhodecode:templates/admin/repo_groups/repo_groups.mako')
1013 renderer='rhodecode:templates/admin/repo_groups/repo_groups.mako')
985
1014
986 config.add_route(
1015 config.add_route(
987 name='repo_groups_data',
1016 name='repo_groups_data',
988 pattern='/repo_groups_data')
1017 pattern='/repo_groups_data')
989 config.add_view(
1018 config.add_view(
990 AdminRepoGroupsView,
1019 AdminRepoGroupsView,
991 attr='repo_group_list_data',
1020 attr='repo_group_list_data',
992 route_name='repo_groups_data', request_method='GET',
1021 route_name='repo_groups_data', request_method='GET',
993 renderer='json_ext', xhr=True)
1022 renderer='json_ext', xhr=True)
994
1023
995 config.add_route(
1024 config.add_route(
996 name='repo_group_new',
1025 name='repo_group_new',
997 pattern='/repo_group/new')
1026 pattern='/repo_group/new')
998 config.add_view(
1027 config.add_view(
999 AdminRepoGroupsView,
1028 AdminRepoGroupsView,
1000 attr='repo_group_new',
1029 attr='repo_group_new',
1001 route_name='repo_group_new', request_method='GET',
1030 route_name='repo_group_new', request_method='GET',
1002 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
1031 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
1003
1032
1004 config.add_route(
1033 config.add_route(
1005 name='repo_group_create',
1034 name='repo_group_create',
1006 pattern='/repo_group/create')
1035 pattern='/repo_group/create')
1007 config.add_view(
1036 config.add_view(
1008 AdminRepoGroupsView,
1037 AdminRepoGroupsView,
1009 attr='repo_group_create',
1038 attr='repo_group_create',
1010 route_name='repo_group_create', request_method='POST',
1039 route_name='repo_group_create', request_method='POST',
1011 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
1040 renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako')
1012
1041
1013
1042
1014 def includeme(config):
1043 def includeme(config):
1015 from rhodecode.apps._base.navigation import includeme as nav_includeme
1044 from rhodecode.apps._base.navigation import includeme as nav_includeme
1016 from rhodecode.apps.admin.views.main_views import AdminMainView
1045 from rhodecode.apps.admin.views.main_views import AdminMainView
1017
1046
1018 # Create admin navigation registry and add it to the pyramid registry.
1047 # Create admin navigation registry and add it to the pyramid registry.
1019 nav_includeme(config)
1048 nav_includeme(config)
1020
1049
1021 # main admin routes
1050 # main admin routes
1022 config.add_route(
1051 config.add_route(
1023 name='admin_home', pattern=ADMIN_PREFIX)
1052 name='admin_home', pattern=ADMIN_PREFIX)
1024 config.add_view(
1053 config.add_view(
1025 AdminMainView,
1054 AdminMainView,
1026 attr='admin_main',
1055 attr='admin_main',
1027 route_name='admin_home', request_method='GET',
1056 route_name='admin_home', request_method='GET',
1028 renderer='rhodecode:templates/admin/main.mako')
1057 renderer='rhodecode:templates/admin/main.mako')
1029
1058
1030 # pr global redirect
1059 # pr global redirect
1031 config.add_route(
1060 config.add_route(
1032 name='pull_requests_global_0', # backward compat
1061 name='pull_requests_global_0', # backward compat
1033 pattern=ADMIN_PREFIX + '/pull_requests/{pull_request_id:\d+}')
1062 pattern=ADMIN_PREFIX + '/pull_requests/{pull_request_id:\d+}')
1034 config.add_view(
1063 config.add_view(
1035 AdminMainView,
1064 AdminMainView,
1036 attr='pull_requests',
1065 attr='pull_requests',
1037 route_name='pull_requests_global_0', request_method='GET')
1066 route_name='pull_requests_global_0', request_method='GET')
1038
1067
1039 config.add_route(
1068 config.add_route(
1040 name='pull_requests_global_1', # backward compat
1069 name='pull_requests_global_1', # backward compat
1041 pattern=ADMIN_PREFIX + '/pull-requests/{pull_request_id:\d+}')
1070 pattern=ADMIN_PREFIX + '/pull-requests/{pull_request_id:\d+}')
1042 config.add_view(
1071 config.add_view(
1043 AdminMainView,
1072 AdminMainView,
1044 attr='pull_requests',
1073 attr='pull_requests',
1045 route_name='pull_requests_global_1', request_method='GET')
1074 route_name='pull_requests_global_1', request_method='GET')
1046
1075
1047 config.add_route(
1076 config.add_route(
1048 name='pull_requests_global',
1077 name='pull_requests_global',
1049 pattern=ADMIN_PREFIX + '/pull-request/{pull_request_id:\d+}')
1078 pattern=ADMIN_PREFIX + '/pull-request/{pull_request_id:\d+}')
1050 config.add_view(
1079 config.add_view(
1051 AdminMainView,
1080 AdminMainView,
1052 attr='pull_requests',
1081 attr='pull_requests',
1053 route_name='pull_requests_global', request_method='GET')
1082 route_name='pull_requests_global', request_method='GET')
1054
1083
1055 config.include(admin_routes, route_prefix=ADMIN_PREFIX)
1084 config.include(admin_routes, route_prefix=ADMIN_PREFIX)
General Comments 1
Under Review
author

Auto status change to "Under Review"

You need to be logged in to leave comments. Login now