Show More
@@ -1,1082 +1,1082 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 |
|
21 | |||
22 |
|
22 | |||
23 | def admin_routes(config): |
|
23 | def admin_routes(config): | |
24 | """ |
|
24 | """ | |
25 | Admin prefixed routes |
|
25 | Admin prefixed routes | |
26 | """ |
|
26 | """ | |
27 | from rhodecode.apps.admin.views.audit_logs import AdminAuditLogsView |
|
27 | from rhodecode.apps.admin.views.audit_logs import AdminAuditLogsView | |
28 | from rhodecode.apps.admin.views.artifacts import AdminArtifactsView |
|
28 | from rhodecode.apps.admin.views.artifacts import AdminArtifactsView | |
29 | from rhodecode.apps.admin.views.defaults import AdminDefaultSettingsView |
|
29 | from rhodecode.apps.admin.views.defaults import AdminDefaultSettingsView | |
30 | from rhodecode.apps.admin.views.exception_tracker import ExceptionsTrackerView |
|
30 | from rhodecode.apps.admin.views.exception_tracker import ExceptionsTrackerView | |
31 | from rhodecode.apps.admin.views.main_views import AdminMainView |
|
31 | from rhodecode.apps.admin.views.main_views import AdminMainView | |
32 | from rhodecode.apps.admin.views.open_source_licenses import OpenSourceLicensesAdminSettingsView |
|
32 | from rhodecode.apps.admin.views.open_source_licenses import OpenSourceLicensesAdminSettingsView | |
33 | from rhodecode.apps.admin.views.permissions import AdminPermissionsView |
|
33 | from rhodecode.apps.admin.views.permissions import AdminPermissionsView | |
34 | from rhodecode.apps.admin.views.process_management import AdminProcessManagementView |
|
34 | from rhodecode.apps.admin.views.process_management import AdminProcessManagementView | |
35 | from rhodecode.apps.admin.views.repo_groups import AdminRepoGroupsView |
|
35 | from rhodecode.apps.admin.views.repo_groups import AdminRepoGroupsView | |
36 | from rhodecode.apps.admin.views.repositories import AdminReposView |
|
36 | from rhodecode.apps.admin.views.repositories import AdminReposView | |
37 | from rhodecode.apps.admin.views.sessions import AdminSessionSettingsView |
|
37 | from rhodecode.apps.admin.views.sessions import AdminSessionSettingsView | |
38 | from rhodecode.apps.admin.views.settings import AdminSettingsView |
|
38 | from rhodecode.apps.admin.views.settings import AdminSettingsView | |
39 | from rhodecode.apps.admin.views.svn_config import AdminSvnConfigView |
|
39 | from rhodecode.apps.admin.views.svn_config import AdminSvnConfigView | |
40 | from rhodecode.apps.admin.views.system_info import AdminSystemInfoSettingsView |
|
40 | from rhodecode.apps.admin.views.system_info import AdminSystemInfoSettingsView | |
41 | from rhodecode.apps.admin.views.user_groups import AdminUserGroupsView |
|
41 | from rhodecode.apps.admin.views.user_groups import AdminUserGroupsView | |
42 | from rhodecode.apps.admin.views.users import AdminUsersView, UsersView |
|
42 | from rhodecode.apps.admin.views.users import AdminUsersView, UsersView | |
43 |
|
43 | |||
44 | config.add_route( |
|
44 | config.add_route( | |
45 | name='admin_audit_logs', |
|
45 | name='admin_audit_logs', | |
46 | pattern='/audit_logs') |
|
46 | pattern='/audit_logs') | |
47 | config.add_view( |
|
47 | config.add_view( | |
48 | AdminAuditLogsView, |
|
48 | AdminAuditLogsView, | |
49 | attr='admin_audit_logs', |
|
49 | attr='admin_audit_logs', | |
50 | route_name='admin_audit_logs', request_method='GET', |
|
50 | route_name='admin_audit_logs', request_method='GET', | |
51 | renderer='rhodecode:templates/admin/admin_audit_logs.mako') |
|
51 | renderer='rhodecode:templates/admin/admin_audit_logs.mako') | |
52 |
|
52 | |||
53 | config.add_route( |
|
53 | config.add_route( | |
54 | name='admin_audit_log_entry', |
|
54 | name='admin_audit_log_entry', | |
55 | pattern='/audit_logs/{audit_log_id}') |
|
55 | pattern='/audit_logs/{audit_log_id}') | |
56 | config.add_view( |
|
56 | config.add_view( | |
57 | AdminAuditLogsView, |
|
57 | AdminAuditLogsView, | |
58 | attr='admin_audit_log_entry', |
|
58 | attr='admin_audit_log_entry', | |
59 | route_name='admin_audit_log_entry', request_method='GET', |
|
59 | route_name='admin_audit_log_entry', request_method='GET', | |
60 | renderer='rhodecode:templates/admin/admin_audit_log_entry.mako') |
|
60 | renderer='rhodecode:templates/admin/admin_audit_log_entry.mako') | |
61 |
|
61 | |||
62 | # Artifacts EE feature |
|
62 | # Artifacts EE feature | |
63 | config.add_route( |
|
63 | config.add_route( | |
64 | 'admin_artifacts', |
|
64 | 'admin_artifacts', | |
65 | pattern=ADMIN_PREFIX + '/artifacts') |
|
65 | pattern=ADMIN_PREFIX + '/artifacts') | |
66 | config.add_route( |
|
66 | config.add_route( | |
67 | 'admin_artifacts_show_all', |
|
67 | 'admin_artifacts_show_all', | |
68 | pattern=ADMIN_PREFIX + '/artifacts') |
|
68 | pattern=ADMIN_PREFIX + '/artifacts') | |
69 | config.add_view( |
|
69 | config.add_view( | |
70 | AdminArtifactsView, |
|
70 | AdminArtifactsView, | |
71 | attr='artifacts', |
|
71 | attr='artifacts', | |
72 | route_name='admin_artifacts', request_method='GET', |
|
72 | route_name='admin_artifacts', request_method='GET', | |
73 | renderer='rhodecode:templates/admin/artifacts/artifacts.mako') |
|
73 | renderer='rhodecode:templates/admin/artifacts/artifacts.mako') | |
74 | config.add_view( |
|
74 | config.add_view( | |
75 | AdminArtifactsView, |
|
75 | AdminArtifactsView, | |
76 | attr='artifacts', |
|
76 | attr='artifacts', | |
77 | route_name='admin_artifacts_show_all', request_method='GET', |
|
77 | route_name='admin_artifacts_show_all', request_method='GET', | |
78 | renderer='rhodecode:templates/admin/artifacts/artifacts.mako') |
|
78 | renderer='rhodecode:templates/admin/artifacts/artifacts.mako') | |
79 | # EE views |
|
79 | # EE views | |
80 | config.add_route( |
|
80 | config.add_route( | |
81 | name='admin_artifacts_show_info', |
|
81 | name='admin_artifacts_show_info', | |
82 | pattern=ADMIN_PREFIX + '/artifacts/{uid}') |
|
82 | pattern=ADMIN_PREFIX + '/artifacts/{uid}') | |
83 | config.add_route( |
|
83 | config.add_route( | |
84 | name='admin_artifacts_delete', |
|
84 | name='admin_artifacts_delete', | |
85 | pattern=ADMIN_PREFIX + '/artifacts/{uid}/delete') |
|
85 | pattern=ADMIN_PREFIX + '/artifacts/{uid}/delete') | |
86 | config.add_route( |
|
86 | config.add_route( | |
87 | name='admin_artifacts_update', |
|
87 | name='admin_artifacts_update', | |
88 | pattern=ADMIN_PREFIX + '/artifacts/{uid}/update') |
|
88 | pattern=ADMIN_PREFIX + '/artifacts/{uid}/update') | |
89 |
|
89 | |||
90 | config.add_route( |
|
90 | config.add_route( | |
91 | name='admin_settings_open_source', |
|
91 | name='admin_settings_open_source', | |
92 | pattern='/settings/open_source') |
|
92 | pattern='/settings/open_source') | |
93 | config.add_view( |
|
93 | config.add_view( | |
94 | OpenSourceLicensesAdminSettingsView, |
|
94 | OpenSourceLicensesAdminSettingsView, | |
95 | attr='open_source_licenses', |
|
95 | attr='open_source_licenses', | |
96 | route_name='admin_settings_open_source', request_method='GET', |
|
96 | route_name='admin_settings_open_source', request_method='GET', | |
97 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
97 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
98 |
|
98 | |||
99 | config.add_route( |
|
99 | config.add_route( | |
100 | name='admin_settings_vcs_svn_generate_cfg', |
|
100 | name='admin_settings_vcs_svn_generate_cfg', | |
101 | pattern='/settings/vcs/svn_generate_cfg') |
|
101 | pattern='/settings/vcs/svn_generate_cfg') | |
102 | config.add_view( |
|
102 | config.add_view( | |
103 | AdminSvnConfigView, |
|
103 | AdminSvnConfigView, | |
104 | attr='vcs_svn_generate_config', |
|
104 | attr='vcs_svn_generate_config', | |
105 | route_name='admin_settings_vcs_svn_generate_cfg', |
|
105 | route_name='admin_settings_vcs_svn_generate_cfg', | |
106 | request_method='POST', renderer='json') |
|
106 | request_method='POST', renderer='json') | |
107 |
|
107 | |||
108 | config.add_route( |
|
108 | config.add_route( | |
109 | name='admin_settings_system', |
|
109 | name='admin_settings_system', | |
110 | pattern='/settings/system') |
|
110 | pattern='/settings/system') | |
111 | config.add_view( |
|
111 | config.add_view( | |
112 | AdminSystemInfoSettingsView, |
|
112 | AdminSystemInfoSettingsView, | |
113 | attr='settings_system_info', |
|
113 | attr='settings_system_info', | |
114 | route_name='admin_settings_system', request_method='GET', |
|
114 | route_name='admin_settings_system', request_method='GET', | |
115 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
115 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
116 |
|
116 | |||
117 | config.add_route( |
|
117 | config.add_route( | |
118 | name='admin_settings_system_update', |
|
118 | name='admin_settings_system_update', | |
119 | pattern='/settings/system/updates') |
|
119 | pattern='/settings/system/updates') | |
120 | config.add_view( |
|
120 | config.add_view( | |
121 | AdminSystemInfoSettingsView, |
|
121 | AdminSystemInfoSettingsView, | |
122 | attr='settings_system_info_check_update', |
|
122 | attr='settings_system_info_check_update', | |
123 | route_name='admin_settings_system_update', request_method='GET', |
|
123 | route_name='admin_settings_system_update', request_method='GET', | |
124 | renderer='rhodecode:templates/admin/settings/settings_system_update.mako') |
|
124 | renderer='rhodecode:templates/admin/settings/settings_system_update.mako') | |
125 |
|
125 | |||
126 | config.add_route( |
|
126 | config.add_route( | |
127 | name='admin_settings_exception_tracker', |
|
127 | name='admin_settings_exception_tracker', | |
128 | pattern='/settings/exceptions') |
|
128 | pattern='/settings/exceptions') | |
129 | config.add_view( |
|
129 | config.add_view( | |
130 | ExceptionsTrackerView, |
|
130 | ExceptionsTrackerView, | |
131 | attr='browse_exceptions', |
|
131 | attr='browse_exceptions', | |
132 | route_name='admin_settings_exception_tracker', request_method='GET', |
|
132 | route_name='admin_settings_exception_tracker', request_method='GET', | |
133 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
133 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
134 |
|
134 | |||
135 | config.add_route( |
|
135 | config.add_route( | |
136 | name='admin_settings_exception_tracker_delete_all', |
|
136 | name='admin_settings_exception_tracker_delete_all', | |
137 | pattern='/settings/exceptions_delete_all') |
|
137 | pattern='/settings/exceptions_delete_all') | |
138 | config.add_view( |
|
138 | config.add_view( | |
139 | ExceptionsTrackerView, |
|
139 | ExceptionsTrackerView, | |
140 | attr='exception_delete_all', |
|
140 | attr='exception_delete_all', | |
141 | route_name='admin_settings_exception_tracker_delete_all', request_method='POST', |
|
141 | route_name='admin_settings_exception_tracker_delete_all', request_method='POST', | |
142 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
142 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
143 |
|
143 | |||
144 | config.add_route( |
|
144 | config.add_route( | |
145 | name='admin_settings_exception_tracker_show', |
|
145 | name='admin_settings_exception_tracker_show', | |
146 | pattern='/settings/exceptions/{exception_id}') |
|
146 | pattern='/settings/exceptions/{exception_id}') | |
147 | config.add_view( |
|
147 | config.add_view( | |
148 | ExceptionsTrackerView, |
|
148 | ExceptionsTrackerView, | |
149 | attr='exception_show', |
|
149 | attr='exception_show', | |
150 | route_name='admin_settings_exception_tracker_show', request_method='GET', |
|
150 | route_name='admin_settings_exception_tracker_show', request_method='GET', | |
151 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
151 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
152 |
|
152 | |||
153 | config.add_route( |
|
153 | config.add_route( | |
154 | name='admin_settings_exception_tracker_delete', |
|
154 | name='admin_settings_exception_tracker_delete', | |
155 | pattern='/settings/exceptions/{exception_id}/delete') |
|
155 | pattern='/settings/exceptions/{exception_id}/delete') | |
156 | config.add_view( |
|
156 | config.add_view( | |
157 | ExceptionsTrackerView, |
|
157 | ExceptionsTrackerView, | |
158 | attr='exception_delete', |
|
158 | attr='exception_delete', | |
159 | route_name='admin_settings_exception_tracker_delete', request_method='POST', |
|
159 | route_name='admin_settings_exception_tracker_delete', request_method='POST', | |
160 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
160 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
161 |
|
161 | |||
162 | config.add_route( |
|
162 | config.add_route( | |
163 | name='admin_settings_sessions', |
|
163 | name='admin_settings_sessions', | |
164 | pattern='/settings/sessions') |
|
164 | pattern='/settings/sessions') | |
165 | config.add_view( |
|
165 | config.add_view( | |
166 | AdminSessionSettingsView, |
|
166 | AdminSessionSettingsView, | |
167 | attr='settings_sessions', |
|
167 | attr='settings_sessions', | |
168 | route_name='admin_settings_sessions', request_method='GET', |
|
168 | route_name='admin_settings_sessions', request_method='GET', | |
169 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
169 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
170 |
|
170 | |||
171 | config.add_route( |
|
171 | config.add_route( | |
172 | name='admin_settings_sessions_cleanup', |
|
172 | name='admin_settings_sessions_cleanup', | |
173 | pattern='/settings/sessions/cleanup') |
|
173 | pattern='/settings/sessions/cleanup') | |
174 | config.add_view( |
|
174 | config.add_view( | |
175 | AdminSessionSettingsView, |
|
175 | AdminSessionSettingsView, | |
176 | attr='settings_sessions_cleanup', |
|
176 | attr='settings_sessions_cleanup', | |
177 | route_name='admin_settings_sessions_cleanup', request_method='POST') |
|
177 | route_name='admin_settings_sessions_cleanup', request_method='POST') | |
178 |
|
178 | |||
179 | config.add_route( |
|
179 | config.add_route( | |
180 | name='admin_settings_process_management', |
|
180 | name='admin_settings_process_management', | |
181 | pattern='/settings/process_management') |
|
181 | pattern='/settings/process_management') | |
182 | config.add_view( |
|
182 | config.add_view( | |
183 | AdminProcessManagementView, |
|
183 | AdminProcessManagementView, | |
184 | attr='process_management', |
|
184 | attr='process_management', | |
185 | route_name='admin_settings_process_management', request_method='GET', |
|
185 | route_name='admin_settings_process_management', request_method='GET', | |
186 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
186 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
187 |
|
187 | |||
188 | config.add_route( |
|
188 | config.add_route( | |
189 | name='admin_settings_process_management_data', |
|
189 | name='admin_settings_process_management_data', | |
190 | pattern='/settings/process_management/data') |
|
190 | pattern='/settings/process_management/data') | |
191 | config.add_view( |
|
191 | config.add_view( | |
192 | AdminProcessManagementView, |
|
192 | AdminProcessManagementView, | |
193 | attr='process_management_data', |
|
193 | attr='process_management_data', | |
194 | route_name='admin_settings_process_management_data', request_method='GET', |
|
194 | route_name='admin_settings_process_management_data', request_method='GET', | |
195 | renderer='rhodecode:templates/admin/settings/settings_process_management_data.mako') |
|
195 | renderer='rhodecode:templates/admin/settings/settings_process_management_data.mako') | |
196 |
|
196 | |||
197 | config.add_route( |
|
197 | config.add_route( | |
198 | name='admin_settings_process_management_signal', |
|
198 | name='admin_settings_process_management_signal', | |
199 | pattern='/settings/process_management/signal') |
|
199 | pattern='/settings/process_management/signal') | |
200 | config.add_view( |
|
200 | config.add_view( | |
201 | AdminProcessManagementView, |
|
201 | AdminProcessManagementView, | |
202 | attr='process_management_signal', |
|
202 | attr='process_management_signal', | |
203 | route_name='admin_settings_process_management_signal', |
|
203 | route_name='admin_settings_process_management_signal', | |
204 | request_method='POST', renderer='json_ext') |
|
204 | request_method='POST', renderer='json_ext') | |
205 |
|
205 | |||
206 | config.add_route( |
|
206 | config.add_route( | |
207 | name='admin_settings_process_management_master_signal', |
|
207 | name='admin_settings_process_management_master_signal', | |
208 | pattern='/settings/process_management/master_signal') |
|
208 | pattern='/settings/process_management/master_signal') | |
209 | config.add_view( |
|
209 | config.add_view( | |
210 | AdminProcessManagementView, |
|
210 | AdminProcessManagementView, | |
211 | attr='process_management_master_signal', |
|
211 | attr='process_management_master_signal', | |
212 | route_name='admin_settings_process_management_master_signal', |
|
212 | route_name='admin_settings_process_management_master_signal', | |
213 | request_method='POST', renderer='json_ext') |
|
213 | request_method='POST', renderer='json_ext') | |
214 |
|
214 | |||
215 | # default settings |
|
215 | # default settings | |
216 | config.add_route( |
|
216 | config.add_route( | |
217 | name='admin_defaults_repositories', |
|
217 | name='admin_defaults_repositories', | |
218 | pattern='/defaults/repositories') |
|
218 | pattern='/defaults/repositories') | |
219 | config.add_view( |
|
219 | config.add_view( | |
220 | AdminDefaultSettingsView, |
|
220 | AdminDefaultSettingsView, | |
221 | attr='defaults_repository_show', |
|
221 | attr='defaults_repository_show', | |
222 | route_name='admin_defaults_repositories', request_method='GET', |
|
222 | route_name='admin_defaults_repositories', request_method='GET', | |
223 | renderer='rhodecode:templates/admin/defaults/defaults.mako') |
|
223 | renderer='rhodecode:templates/admin/defaults/defaults.mako') | |
224 |
|
224 | |||
225 | config.add_route( |
|
225 | config.add_route( | |
226 | name='admin_defaults_repositories_update', |
|
226 | name='admin_defaults_repositories_update', | |
227 | pattern='/defaults/repositories/update') |
|
227 | pattern='/defaults/repositories/update') | |
228 | config.add_view( |
|
228 | config.add_view( | |
229 | AdminDefaultSettingsView, |
|
229 | AdminDefaultSettingsView, | |
230 | attr='defaults_repository_update', |
|
230 | attr='defaults_repository_update', | |
231 | route_name='admin_defaults_repositories_update', request_method='POST', |
|
231 | route_name='admin_defaults_repositories_update', request_method='POST', | |
232 | renderer='rhodecode:templates/admin/defaults/defaults.mako') |
|
232 | renderer='rhodecode:templates/admin/defaults/defaults.mako') | |
233 |
|
233 | |||
234 | # admin settings |
|
234 | # admin settings | |
235 |
|
235 | |||
236 | config.add_route( |
|
236 | config.add_route( | |
237 | name='admin_settings', |
|
237 | name='admin_settings', | |
238 | pattern='/settings') |
|
238 | pattern='/settings') | |
239 | config.add_view( |
|
239 | config.add_view( | |
240 | AdminSettingsView, |
|
240 | AdminSettingsView, | |
241 | attr='settings_global', |
|
241 | attr='settings_global', | |
242 | route_name='admin_settings', request_method='GET', |
|
242 | route_name='admin_settings', request_method='GET', | |
243 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
243 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
244 |
|
244 | |||
245 | config.add_route( |
|
245 | config.add_route( | |
246 | name='admin_settings_update', |
|
246 | name='admin_settings_update', | |
247 | pattern='/settings/update') |
|
247 | pattern='/settings/update') | |
248 | config.add_view( |
|
248 | config.add_view( | |
249 | AdminSettingsView, |
|
249 | AdminSettingsView, | |
250 | attr='settings_global_update', |
|
250 | attr='settings_global_update', | |
251 | route_name='admin_settings_update', request_method='POST', |
|
251 | route_name='admin_settings_update', request_method='POST', | |
252 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
252 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
253 |
|
253 | |||
254 | config.add_route( |
|
254 | config.add_route( | |
255 | name='admin_settings_global', |
|
255 | name='admin_settings_global', | |
256 | pattern='/settings/global') |
|
256 | pattern='/settings/global') | |
257 | config.add_view( |
|
257 | config.add_view( | |
258 | AdminSettingsView, |
|
258 | AdminSettingsView, | |
259 | attr='settings_global', |
|
259 | attr='settings_global', | |
260 | route_name='admin_settings_global', request_method='GET', |
|
260 | route_name='admin_settings_global', request_method='GET', | |
261 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
261 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
262 |
|
262 | |||
263 | config.add_route( |
|
263 | config.add_route( | |
264 | name='admin_settings_global_update', |
|
264 | name='admin_settings_global_update', | |
265 | pattern='/settings/global/update') |
|
265 | pattern='/settings/global/update') | |
266 | config.add_view( |
|
266 | config.add_view( | |
267 | AdminSettingsView, |
|
267 | AdminSettingsView, | |
268 | attr='settings_global_update', |
|
268 | attr='settings_global_update', | |
269 | route_name='admin_settings_global_update', request_method='POST', |
|
269 | route_name='admin_settings_global_update', request_method='POST', | |
270 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
270 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
271 |
|
271 | |||
272 | config.add_route( |
|
272 | config.add_route( | |
273 | name='admin_settings_vcs', |
|
273 | name='admin_settings_vcs', | |
274 | pattern='/settings/vcs') |
|
274 | pattern='/settings/vcs') | |
275 | config.add_view( |
|
275 | config.add_view( | |
276 | AdminSettingsView, |
|
276 | AdminSettingsView, | |
277 | attr='settings_vcs', |
|
277 | attr='settings_vcs', | |
278 | route_name='admin_settings_vcs', request_method='GET', |
|
278 | route_name='admin_settings_vcs', request_method='GET', | |
279 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
279 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
280 |
|
280 | |||
281 | config.add_route( |
|
281 | config.add_route( | |
282 | name='admin_settings_vcs_update', |
|
282 | name='admin_settings_vcs_update', | |
283 | pattern='/settings/vcs/update') |
|
283 | pattern='/settings/vcs/update') | |
284 | config.add_view( |
|
284 | config.add_view( | |
285 | AdminSettingsView, |
|
285 | AdminSettingsView, | |
286 | attr='settings_vcs_update', |
|
286 | attr='settings_vcs_update', | |
287 | route_name='admin_settings_vcs_update', request_method='POST', |
|
287 | route_name='admin_settings_vcs_update', request_method='POST', | |
288 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
288 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
289 |
|
289 | |||
290 | config.add_route( |
|
290 | config.add_route( | |
291 | name='admin_settings_vcs_svn_pattern_delete', |
|
291 | name='admin_settings_vcs_svn_pattern_delete', | |
292 | pattern='/settings/vcs/svn_pattern_delete') |
|
292 | pattern='/settings/vcs/svn_pattern_delete') | |
293 | config.add_view( |
|
293 | config.add_view( | |
294 | AdminSettingsView, |
|
294 | AdminSettingsView, | |
295 | attr='settings_vcs_delete_svn_pattern', |
|
295 | attr='settings_vcs_delete_svn_pattern', | |
296 | route_name='admin_settings_vcs_svn_pattern_delete', request_method='POST', |
|
296 | route_name='admin_settings_vcs_svn_pattern_delete', request_method='POST', | |
297 | renderer='json_ext', xhr=True) |
|
297 | renderer='json_ext', xhr=True) | |
298 |
|
298 | |||
299 | config.add_route( |
|
299 | config.add_route( | |
300 | name='admin_settings_mapping', |
|
300 | name='admin_settings_mapping', | |
301 | pattern='/settings/mapping') |
|
301 | pattern='/settings/mapping') | |
302 | config.add_view( |
|
302 | config.add_view( | |
303 | AdminSettingsView, |
|
303 | AdminSettingsView, | |
304 | attr='settings_mapping', |
|
304 | attr='settings_mapping', | |
305 | route_name='admin_settings_mapping', request_method='GET', |
|
305 | route_name='admin_settings_mapping', request_method='GET', | |
306 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
306 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
307 |
|
307 | |||
308 | config.add_route( |
|
308 | config.add_route( | |
309 | name='admin_settings_mapping_update', |
|
309 | name='admin_settings_mapping_update', | |
310 | pattern='/settings/mapping/update') |
|
310 | pattern='/settings/mapping/update') | |
311 | config.add_view( |
|
311 | config.add_view( | |
312 | AdminSettingsView, |
|
312 | AdminSettingsView, | |
313 | attr='settings_mapping_update', |
|
313 | attr='settings_mapping_update', | |
314 | route_name='admin_settings_mapping_update', request_method='POST', |
|
314 | route_name='admin_settings_mapping_update', request_method='POST', | |
315 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
315 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
316 |
|
316 | |||
317 | config.add_route( |
|
317 | config.add_route( | |
318 | name='admin_settings_visual', |
|
318 | name='admin_settings_visual', | |
319 | pattern='/settings/visual') |
|
319 | pattern='/settings/visual') | |
320 | config.add_view( |
|
320 | config.add_view( | |
321 | AdminSettingsView, |
|
321 | AdminSettingsView, | |
322 | attr='settings_visual', |
|
322 | attr='settings_visual', | |
323 | route_name='admin_settings_visual', request_method='GET', |
|
323 | route_name='admin_settings_visual', request_method='GET', | |
324 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
324 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
325 |
|
325 | |||
326 | config.add_route( |
|
326 | config.add_route( | |
327 | name='admin_settings_visual_update', |
|
327 | name='admin_settings_visual_update', | |
328 | pattern='/settings/visual/update') |
|
328 | pattern='/settings/visual/update') | |
329 | config.add_view( |
|
329 | config.add_view( | |
330 | AdminSettingsView, |
|
330 | AdminSettingsView, | |
331 | attr='settings_visual_update', |
|
331 | attr='settings_visual_update', | |
332 | route_name='admin_settings_visual_update', request_method='POST', |
|
332 | route_name='admin_settings_visual_update', request_method='POST', | |
333 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
333 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
334 |
|
334 | |||
335 | config.add_route( |
|
335 | config.add_route( | |
336 | name='admin_settings_issuetracker', |
|
336 | name='admin_settings_issuetracker', | |
337 | pattern='/settings/issue-tracker') |
|
337 | pattern='/settings/issue-tracker') | |
338 | config.add_view( |
|
338 | config.add_view( | |
339 | AdminSettingsView, |
|
339 | AdminSettingsView, | |
340 | attr='settings_issuetracker', |
|
340 | attr='settings_issuetracker', | |
341 | route_name='admin_settings_issuetracker', request_method='GET', |
|
341 | route_name='admin_settings_issuetracker', request_method='GET', | |
342 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
342 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
343 |
|
343 | |||
344 | config.add_route( |
|
344 | config.add_route( | |
345 | name='admin_settings_issuetracker_update', |
|
345 | name='admin_settings_issuetracker_update', | |
346 | pattern='/settings/issue-tracker/update') |
|
346 | pattern='/settings/issue-tracker/update') | |
347 | config.add_view( |
|
347 | config.add_view( | |
348 | AdminSettingsView, |
|
348 | AdminSettingsView, | |
349 | attr='settings_issuetracker_update', |
|
349 | attr='settings_issuetracker_update', | |
350 | route_name='admin_settings_issuetracker_update', request_method='POST', |
|
350 | route_name='admin_settings_issuetracker_update', request_method='POST', | |
351 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
351 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
352 |
|
352 | |||
353 | config.add_route( |
|
353 | config.add_route( | |
354 | name='admin_settings_issuetracker_test', |
|
354 | name='admin_settings_issuetracker_test', | |
355 | pattern='/settings/issue-tracker/test') |
|
355 | pattern='/settings/issue-tracker/test') | |
356 | config.add_view( |
|
356 | config.add_view( | |
357 | AdminSettingsView, |
|
357 | AdminSettingsView, | |
358 | attr='settings_issuetracker_test', |
|
358 | attr='settings_issuetracker_test', | |
359 | route_name='admin_settings_issuetracker_test', request_method='POST', |
|
359 | route_name='admin_settings_issuetracker_test', request_method='POST', | |
360 | renderer='string', xhr=True) |
|
360 | renderer='string', xhr=True) | |
361 |
|
361 | |||
362 | config.add_route( |
|
362 | config.add_route( | |
363 | name='admin_settings_issuetracker_delete', |
|
363 | name='admin_settings_issuetracker_delete', | |
364 | pattern='/settings/issue-tracker/delete') |
|
364 | pattern='/settings/issue-tracker/delete') | |
365 | config.add_view( |
|
365 | config.add_view( | |
366 | AdminSettingsView, |
|
366 | AdminSettingsView, | |
367 | attr='settings_issuetracker_delete', |
|
367 | attr='settings_issuetracker_delete', | |
368 | route_name='admin_settings_issuetracker_delete', request_method='POST', |
|
368 | route_name='admin_settings_issuetracker_delete', request_method='POST', | |
369 | renderer='json_ext', xhr=True) |
|
369 | renderer='json_ext', xhr=True) | |
370 |
|
370 | |||
371 | config.add_route( |
|
371 | config.add_route( | |
372 | name='admin_settings_email', |
|
372 | name='admin_settings_email', | |
373 | pattern='/settings/email') |
|
373 | pattern='/settings/email') | |
374 | config.add_view( |
|
374 | config.add_view( | |
375 | AdminSettingsView, |
|
375 | AdminSettingsView, | |
376 | attr='settings_email', |
|
376 | attr='settings_email', | |
377 | route_name='admin_settings_email', request_method='GET', |
|
377 | route_name='admin_settings_email', request_method='GET', | |
378 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
378 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
379 |
|
379 | |||
380 | config.add_route( |
|
380 | config.add_route( | |
381 | name='admin_settings_email_update', |
|
381 | name='admin_settings_email_update', | |
382 | pattern='/settings/email/update') |
|
382 | pattern='/settings/email/update') | |
383 | config.add_view( |
|
383 | config.add_view( | |
384 | AdminSettingsView, |
|
384 | AdminSettingsView, | |
385 | attr='settings_email_update', |
|
385 | attr='settings_email_update', | |
386 | route_name='admin_settings_email_update', request_method='POST', |
|
386 | route_name='admin_settings_email_update', request_method='POST', | |
387 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
387 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
388 |
|
388 | |||
389 | config.add_route( |
|
389 | config.add_route( | |
390 | name='admin_settings_hooks', |
|
390 | name='admin_settings_hooks', | |
391 | pattern='/settings/hooks') |
|
391 | pattern='/settings/hooks') | |
392 | config.add_view( |
|
392 | config.add_view( | |
393 | AdminSettingsView, |
|
393 | AdminSettingsView, | |
394 | attr='settings_hooks', |
|
394 | attr='settings_hooks', | |
395 | route_name='admin_settings_hooks', request_method='GET', |
|
395 | route_name='admin_settings_hooks', request_method='GET', | |
396 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
396 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
397 |
|
397 | |||
398 | config.add_route( |
|
398 | config.add_route( | |
399 | name='admin_settings_hooks_update', |
|
399 | name='admin_settings_hooks_update', | |
400 | pattern='/settings/hooks/update') |
|
400 | pattern='/settings/hooks/update') | |
401 | config.add_view( |
|
401 | config.add_view( | |
402 | AdminSettingsView, |
|
402 | AdminSettingsView, | |
403 | attr='settings_hooks_update', |
|
403 | attr='settings_hooks_update', | |
404 | route_name='admin_settings_hooks_update', request_method='POST', |
|
404 | route_name='admin_settings_hooks_update', request_method='POST', | |
405 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
405 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
406 |
|
406 | |||
407 | config.add_route( |
|
407 | config.add_route( | |
408 | name='admin_settings_hooks_delete', |
|
408 | name='admin_settings_hooks_delete', | |
409 | pattern='/settings/hooks/delete') |
|
409 | pattern='/settings/hooks/delete') | |
410 | config.add_view( |
|
410 | config.add_view( | |
411 | AdminSettingsView, |
|
411 | AdminSettingsView, | |
412 | attr='settings_hooks_update', |
|
412 | attr='settings_hooks_update', | |
413 | route_name='admin_settings_hooks_delete', request_method='POST', |
|
413 | route_name='admin_settings_hooks_delete', request_method='POST', | |
414 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
414 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
415 |
|
415 | |||
416 | config.add_route( |
|
416 | config.add_route( | |
417 | name='admin_settings_search', |
|
417 | name='admin_settings_search', | |
418 | pattern='/settings/search') |
|
418 | pattern='/settings/search') | |
419 | config.add_view( |
|
419 | config.add_view( | |
420 | AdminSettingsView, |
|
420 | AdminSettingsView, | |
421 | attr='settings_search', |
|
421 | attr='settings_search', | |
422 | route_name='admin_settings_search', request_method='GET', |
|
422 | route_name='admin_settings_search', request_method='GET', | |
423 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
423 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
424 |
|
424 | |||
425 | config.add_route( |
|
425 | config.add_route( | |
426 | name='admin_settings_labs', |
|
426 | name='admin_settings_labs', | |
427 | pattern='/settings/labs') |
|
427 | pattern='/settings/labs') | |
428 | config.add_view( |
|
428 | config.add_view( | |
429 | AdminSettingsView, |
|
429 | AdminSettingsView, | |
430 | attr='settings_labs', |
|
430 | attr='settings_labs', | |
431 | route_name='admin_settings_labs', request_method='GET', |
|
431 | route_name='admin_settings_labs', request_method='GET', | |
432 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
432 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
433 |
|
433 | |||
434 | config.add_route( |
|
434 | config.add_route( | |
435 | name='admin_settings_labs_update', |
|
435 | name='admin_settings_labs_update', | |
436 | pattern='/settings/labs/update') |
|
436 | pattern='/settings/labs/update') | |
437 | config.add_view( |
|
437 | config.add_view( | |
438 | AdminSettingsView, |
|
438 | AdminSettingsView, | |
439 | attr='settings_labs_update', |
|
439 | attr='settings_labs_update', | |
440 | route_name='admin_settings_labs_update', request_method='POST', |
|
440 | route_name='admin_settings_labs_update', request_method='POST', | |
441 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
441 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
442 |
|
442 | |||
443 | # Automation EE feature |
|
443 | # Automation EE feature | |
444 | config.add_route( |
|
444 | config.add_route( | |
445 | 'admin_settings_automation', |
|
445 | 'admin_settings_automation', | |
446 | pattern=ADMIN_PREFIX + '/settings/automation') |
|
446 | pattern=ADMIN_PREFIX + '/settings/automation') | |
447 | config.add_view( |
|
447 | config.add_view( | |
448 | AdminSettingsView, |
|
448 | AdminSettingsView, | |
449 | attr='settings_automation', |
|
449 | attr='settings_automation', | |
450 | route_name='admin_settings_automation', request_method='GET', |
|
450 | route_name='admin_settings_automation', request_method='GET', | |
451 | renderer='rhodecode:templates/admin/settings/settings.mako') |
|
451 | renderer='rhodecode:templates/admin/settings/settings.mako') | |
452 |
|
452 | |||
453 | # global permissions |
|
453 | # global permissions | |
454 |
|
454 | |||
455 | config.add_route( |
|
455 | config.add_route( | |
456 | name='admin_permissions_application', |
|
456 | name='admin_permissions_application', | |
457 | pattern='/permissions/application') |
|
457 | pattern='/permissions/application') | |
458 | config.add_view( |
|
458 | config.add_view( | |
459 | AdminPermissionsView, |
|
459 | AdminPermissionsView, | |
460 | attr='permissions_application', |
|
460 | attr='permissions_application', | |
461 | route_name='admin_permissions_application', request_method='GET', |
|
461 | route_name='admin_permissions_application', request_method='GET', | |
462 | renderer='rhodecode:templates/admin/permissions/permissions.mako') |
|
462 | renderer='rhodecode:templates/admin/permissions/permissions.mako') | |
463 |
|
463 | |||
464 | config.add_route( |
|
464 | config.add_route( | |
465 | name='admin_permissions_application_update', |
|
465 | name='admin_permissions_application_update', | |
466 | pattern='/permissions/application/update') |
|
466 | pattern='/permissions/application/update') | |
467 | config.add_view( |
|
467 | config.add_view( | |
468 | AdminPermissionsView, |
|
468 | AdminPermissionsView, | |
469 | attr='permissions_application_update', |
|
469 | attr='permissions_application_update', | |
470 | route_name='admin_permissions_application_update', request_method='POST', |
|
470 | route_name='admin_permissions_application_update', request_method='POST', | |
471 | renderer='rhodecode:templates/admin/permissions/permissions.mako') |
|
471 | renderer='rhodecode:templates/admin/permissions/permissions.mako') | |
472 |
|
472 | |||
473 | config.add_route( |
|
473 | config.add_route( | |
474 | name='admin_permissions_global', |
|
474 | name='admin_permissions_global', | |
475 | pattern='/permissions/global') |
|
475 | pattern='/permissions/global') | |
476 | config.add_view( |
|
476 | config.add_view( | |
477 | AdminPermissionsView, |
|
477 | AdminPermissionsView, | |
478 | attr='permissions_global', |
|
478 | attr='permissions_global', | |
479 | route_name='admin_permissions_global', request_method='GET', |
|
479 | route_name='admin_permissions_global', request_method='GET', | |
480 | renderer='rhodecode:templates/admin/permissions/permissions.mako') |
|
480 | renderer='rhodecode:templates/admin/permissions/permissions.mako') | |
481 |
|
481 | |||
482 | config.add_route( |
|
482 | config.add_route( | |
483 | name='admin_permissions_global_update', |
|
483 | name='admin_permissions_global_update', | |
484 | pattern='/permissions/global/update') |
|
484 | pattern='/permissions/global/update') | |
485 | config.add_view( |
|
485 | config.add_view( | |
486 | AdminPermissionsView, |
|
486 | AdminPermissionsView, | |
487 | attr='permissions_global_update', |
|
487 | attr='permissions_global_update', | |
488 | route_name='admin_permissions_global_update', request_method='POST', |
|
488 | route_name='admin_permissions_global_update', request_method='POST', | |
489 | renderer='rhodecode:templates/admin/permissions/permissions.mako') |
|
489 | renderer='rhodecode:templates/admin/permissions/permissions.mako') | |
490 |
|
490 | |||
491 | config.add_route( |
|
491 | config.add_route( | |
492 | name='admin_permissions_object', |
|
492 | name='admin_permissions_object', | |
493 | pattern='/permissions/object') |
|
493 | pattern='/permissions/object') | |
494 | config.add_view( |
|
494 | config.add_view( | |
495 | AdminPermissionsView, |
|
495 | AdminPermissionsView, | |
496 | attr='permissions_objects', |
|
496 | attr='permissions_objects', | |
497 | route_name='admin_permissions_object', request_method='GET', |
|
497 | route_name='admin_permissions_object', request_method='GET', | |
498 | renderer='rhodecode:templates/admin/permissions/permissions.mako') |
|
498 | renderer='rhodecode:templates/admin/permissions/permissions.mako') | |
499 |
|
499 | |||
500 | config.add_route( |
|
500 | config.add_route( | |
501 | name='admin_permissions_object_update', |
|
501 | name='admin_permissions_object_update', | |
502 | pattern='/permissions/object/update') |
|
502 | pattern='/permissions/object/update') | |
503 | config.add_view( |
|
503 | config.add_view( | |
504 | AdminPermissionsView, |
|
504 | AdminPermissionsView, | |
505 | attr='permissions_objects_update', |
|
505 | attr='permissions_objects_update', | |
506 | route_name='admin_permissions_object_update', request_method='POST', |
|
506 | route_name='admin_permissions_object_update', request_method='POST', | |
507 | renderer='rhodecode:templates/admin/permissions/permissions.mako') |
|
507 | renderer='rhodecode:templates/admin/permissions/permissions.mako') | |
508 |
|
508 | |||
509 | # Branch perms EE feature |
|
509 | # Branch perms EE feature | |
510 | config.add_route( |
|
510 | config.add_route( | |
511 | name='admin_permissions_branch', |
|
511 | name='admin_permissions_branch', | |
512 | pattern='/permissions/branch') |
|
512 | pattern='/permissions/branch') | |
513 | config.add_view( |
|
513 | config.add_view( | |
514 | AdminPermissionsView, |
|
514 | AdminPermissionsView, | |
515 | attr='permissions_branch', |
|
515 | attr='permissions_branch', | |
516 | route_name='admin_permissions_branch', request_method='GET', |
|
516 | route_name='admin_permissions_branch', request_method='GET', | |
517 | renderer='rhodecode:templates/admin/permissions/permissions.mako') |
|
517 | renderer='rhodecode:templates/admin/permissions/permissions.mako') | |
518 |
|
518 | |||
519 | config.add_route( |
|
519 | config.add_route( | |
520 | name='admin_permissions_ips', |
|
520 | name='admin_permissions_ips', | |
521 | pattern='/permissions/ips') |
|
521 | pattern='/permissions/ips') | |
522 | config.add_view( |
|
522 | config.add_view( | |
523 | AdminPermissionsView, |
|
523 | AdminPermissionsView, | |
524 | attr='permissions_ips', |
|
524 | attr='permissions_ips', | |
525 | route_name='admin_permissions_ips', request_method='GET', |
|
525 | route_name='admin_permissions_ips', request_method='GET', | |
526 | renderer='rhodecode:templates/admin/permissions/permissions.mako') |
|
526 | renderer='rhodecode:templates/admin/permissions/permissions.mako') | |
527 |
|
527 | |||
528 | config.add_route( |
|
528 | config.add_route( | |
529 | name='admin_permissions_overview', |
|
529 | name='admin_permissions_overview', | |
530 | pattern='/permissions/overview') |
|
530 | pattern='/permissions/overview') | |
531 | config.add_view( |
|
531 | config.add_view( | |
532 | AdminPermissionsView, |
|
532 | AdminPermissionsView, | |
533 | attr='permissions_overview', |
|
533 | attr='permissions_overview', | |
534 | route_name='admin_permissions_overview', request_method='GET', |
|
534 | route_name='admin_permissions_overview', request_method='GET', | |
535 | renderer='rhodecode:templates/admin/permissions/permissions.mako') |
|
535 | renderer='rhodecode:templates/admin/permissions/permissions.mako') | |
536 |
|
536 | |||
537 | config.add_route( |
|
537 | config.add_route( | |
538 | name='admin_permissions_auth_token_access', |
|
538 | name='admin_permissions_auth_token_access', | |
539 | pattern='/permissions/auth_token_access') |
|
539 | pattern='/permissions/auth_token_access') | |
540 | config.add_view( |
|
540 | config.add_view( | |
541 | AdminPermissionsView, |
|
541 | AdminPermissionsView, | |
542 | attr='auth_token_access', |
|
542 | attr='auth_token_access', | |
543 | route_name='admin_permissions_auth_token_access', request_method='GET', |
|
543 | route_name='admin_permissions_auth_token_access', request_method='GET', | |
544 | renderer='rhodecode:templates/admin/permissions/permissions.mako') |
|
544 | renderer='rhodecode:templates/admin/permissions/permissions.mako') | |
545 |
|
545 | |||
546 | config.add_route( |
|
546 | config.add_route( | |
547 | name='admin_permissions_ssh_keys', |
|
547 | name='admin_permissions_ssh_keys', | |
548 | pattern='/permissions/ssh_keys') |
|
548 | pattern='/permissions/ssh_keys') | |
549 | config.add_view( |
|
549 | config.add_view( | |
550 | AdminPermissionsView, |
|
550 | AdminPermissionsView, | |
551 | attr='ssh_keys', |
|
551 | attr='ssh_keys', | |
552 | route_name='admin_permissions_ssh_keys', request_method='GET', |
|
552 | route_name='admin_permissions_ssh_keys', request_method='GET', | |
553 | renderer='rhodecode:templates/admin/permissions/permissions.mako') |
|
553 | renderer='rhodecode:templates/admin/permissions/permissions.mako') | |
554 |
|
554 | |||
555 | config.add_route( |
|
555 | config.add_route( | |
556 | name='admin_permissions_ssh_keys_data', |
|
556 | name='admin_permissions_ssh_keys_data', | |
557 | pattern='/permissions/ssh_keys/data') |
|
557 | pattern='/permissions/ssh_keys/data') | |
558 | config.add_view( |
|
558 | config.add_view( | |
559 | AdminPermissionsView, |
|
559 | AdminPermissionsView, | |
560 | attr='ssh_keys_data', |
|
560 | attr='ssh_keys_data', | |
561 | route_name='admin_permissions_ssh_keys_data', request_method='GET', |
|
561 | route_name='admin_permissions_ssh_keys_data', request_method='GET', | |
562 | renderer='json_ext', xhr=True) |
|
562 | renderer='json_ext', xhr=True) | |
563 |
|
563 | |||
564 | config.add_route( |
|
564 | config.add_route( | |
565 | name='admin_permissions_ssh_keys_update', |
|
565 | name='admin_permissions_ssh_keys_update', | |
566 | pattern='/permissions/ssh_keys/update') |
|
566 | pattern='/permissions/ssh_keys/update') | |
567 | config.add_view( |
|
567 | config.add_view( | |
568 | AdminPermissionsView, |
|
568 | AdminPermissionsView, | |
569 | attr='ssh_keys_update', |
|
569 | attr='ssh_keys_update', | |
570 | route_name='admin_permissions_ssh_keys_update', request_method='POST', |
|
570 | route_name='admin_permissions_ssh_keys_update', request_method='POST', | |
571 | renderer='rhodecode:templates/admin/permissions/permissions.mako') |
|
571 | renderer='rhodecode:templates/admin/permissions/permissions.mako') | |
572 |
|
572 | |||
573 | # users admin |
|
573 | # users admin | |
574 | config.add_route( |
|
574 | config.add_route( | |
575 | name='users', |
|
575 | name='users', | |
576 | pattern='/users') |
|
576 | pattern='/users') | |
577 | config.add_view( |
|
577 | config.add_view( | |
578 | AdminUsersView, |
|
578 | AdminUsersView, | |
579 | attr='users_list', |
|
579 | attr='users_list', | |
580 | route_name='users', request_method='GET', |
|
580 | route_name='users', request_method='GET', | |
581 | renderer='rhodecode:templates/admin/users/users.mako') |
|
581 | renderer='rhodecode:templates/admin/users/users.mako') | |
582 |
|
582 | |||
583 | config.add_route( |
|
583 | config.add_route( | |
584 | name='users_data', |
|
584 | name='users_data', | |
585 | pattern='/users_data') |
|
585 | pattern='/users_data') | |
586 | config.add_view( |
|
586 | config.add_view( | |
587 | AdminUsersView, |
|
587 | AdminUsersView, | |
588 | attr='users_list_data', |
|
588 | attr='users_list_data', | |
589 | # renderer defined below |
|
589 | # renderer defined below | |
590 | route_name='users_data', request_method='GET', |
|
590 | route_name='users_data', request_method='GET', | |
591 | renderer='json_ext', xhr=True) |
|
591 | renderer='json_ext', xhr=True) | |
592 |
|
592 | |||
593 | config.add_route( |
|
593 | config.add_route( | |
594 | name='users_create', |
|
594 | name='users_create', | |
595 | pattern='/users/create') |
|
595 | pattern='/users/create') | |
596 | config.add_view( |
|
596 | config.add_view( | |
597 | AdminUsersView, |
|
597 | AdminUsersView, | |
598 | attr='users_create', |
|
598 | attr='users_create', | |
599 | route_name='users_create', request_method='POST', |
|
599 | route_name='users_create', request_method='POST', | |
600 | renderer='rhodecode:templates/admin/users/user_add.mako') |
|
600 | renderer='rhodecode:templates/admin/users/user_add.mako') | |
601 |
|
601 | |||
602 | config.add_route( |
|
602 | config.add_route( | |
603 | name='users_new', |
|
603 | name='users_new', | |
604 | pattern='/users/new') |
|
604 | pattern='/users/new') | |
605 | config.add_view( |
|
605 | config.add_view( | |
606 | AdminUsersView, |
|
606 | AdminUsersView, | |
607 | attr='users_new', |
|
607 | attr='users_new', | |
608 | route_name='users_new', request_method='GET', |
|
608 | route_name='users_new', request_method='GET', | |
609 | renderer='rhodecode:templates/admin/users/user_add.mako') |
|
609 | renderer='rhodecode:templates/admin/users/user_add.mako') | |
610 |
|
610 | |||
611 | # user management |
|
611 | # user management | |
612 | config.add_route( |
|
612 | config.add_route( | |
613 | name='user_edit', |
|
613 | name='user_edit', | |
614 | pattern='/users/{user_id:\d+}/edit', |
|
614 | pattern=r'/users/{user_id:\d+}/edit', | |
615 | user_route=True) |
|
615 | user_route=True) | |
616 | config.add_view( |
|
616 | config.add_view( | |
617 | UsersView, |
|
617 | UsersView, | |
618 | attr='user_edit', |
|
618 | attr='user_edit', | |
619 | route_name='user_edit', request_method='GET', |
|
619 | route_name='user_edit', request_method='GET', | |
620 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
620 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
621 |
|
621 | |||
622 | config.add_route( |
|
622 | config.add_route( | |
623 | name='user_edit_advanced', |
|
623 | name='user_edit_advanced', | |
624 | pattern='/users/{user_id:\d+}/edit/advanced', |
|
624 | pattern=r'/users/{user_id:\d+}/edit/advanced', | |
625 | user_route=True) |
|
625 | user_route=True) | |
626 | config.add_view( |
|
626 | config.add_view( | |
627 | UsersView, |
|
627 | UsersView, | |
628 | attr='user_edit_advanced', |
|
628 | attr='user_edit_advanced', | |
629 | route_name='user_edit_advanced', request_method='GET', |
|
629 | route_name='user_edit_advanced', request_method='GET', | |
630 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
630 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
631 |
|
631 | |||
632 | config.add_route( |
|
632 | config.add_route( | |
633 | name='user_edit_global_perms', |
|
633 | name='user_edit_global_perms', | |
634 | pattern='/users/{user_id:\d+}/edit/global_permissions', |
|
634 | pattern=r'/users/{user_id:\d+}/edit/global_permissions', | |
635 | user_route=True) |
|
635 | user_route=True) | |
636 | config.add_view( |
|
636 | config.add_view( | |
637 | UsersView, |
|
637 | UsersView, | |
638 | attr='user_edit_global_perms', |
|
638 | attr='user_edit_global_perms', | |
639 | route_name='user_edit_global_perms', request_method='GET', |
|
639 | route_name='user_edit_global_perms', request_method='GET', | |
640 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
640 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
641 |
|
641 | |||
642 | config.add_route( |
|
642 | config.add_route( | |
643 | name='user_edit_global_perms_update', |
|
643 | name='user_edit_global_perms_update', | |
644 | pattern='/users/{user_id:\d+}/edit/global_permissions/update', |
|
644 | pattern=r'/users/{user_id:\d+}/edit/global_permissions/update', | |
645 | user_route=True) |
|
645 | user_route=True) | |
646 | config.add_view( |
|
646 | config.add_view( | |
647 | UsersView, |
|
647 | UsersView, | |
648 | attr='user_edit_global_perms_update', |
|
648 | attr='user_edit_global_perms_update', | |
649 | route_name='user_edit_global_perms_update', request_method='POST', |
|
649 | route_name='user_edit_global_perms_update', request_method='POST', | |
650 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
650 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
651 |
|
651 | |||
652 | config.add_route( |
|
652 | config.add_route( | |
653 | name='user_update', |
|
653 | name='user_update', | |
654 | pattern='/users/{user_id:\d+}/update', |
|
654 | pattern=r'/users/{user_id:\d+}/update', | |
655 | user_route=True) |
|
655 | user_route=True) | |
656 | config.add_view( |
|
656 | config.add_view( | |
657 | UsersView, |
|
657 | UsersView, | |
658 | attr='user_update', |
|
658 | attr='user_update', | |
659 | route_name='user_update', request_method='POST', |
|
659 | route_name='user_update', request_method='POST', | |
660 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
660 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
661 |
|
661 | |||
662 | config.add_route( |
|
662 | config.add_route( | |
663 | name='user_delete', |
|
663 | name='user_delete', | |
664 | pattern='/users/{user_id:\d+}/delete', |
|
664 | pattern=r'/users/{user_id:\d+}/delete', | |
665 | user_route=True) |
|
665 | user_route=True) | |
666 | config.add_view( |
|
666 | config.add_view( | |
667 | UsersView, |
|
667 | UsersView, | |
668 | attr='user_delete', |
|
668 | attr='user_delete', | |
669 | route_name='user_delete', request_method='POST', |
|
669 | route_name='user_delete', request_method='POST', | |
670 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
670 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
671 |
|
671 | |||
672 | config.add_route( |
|
672 | config.add_route( | |
673 | name='user_enable_force_password_reset', |
|
673 | name='user_enable_force_password_reset', | |
674 | pattern='/users/{user_id:\d+}/password_reset_enable', |
|
674 | pattern=r'/users/{user_id:\d+}/password_reset_enable', | |
675 | user_route=True) |
|
675 | user_route=True) | |
676 | config.add_view( |
|
676 | config.add_view( | |
677 | UsersView, |
|
677 | UsersView, | |
678 | attr='user_enable_force_password_reset', |
|
678 | attr='user_enable_force_password_reset', | |
679 | route_name='user_enable_force_password_reset', request_method='POST', |
|
679 | route_name='user_enable_force_password_reset', request_method='POST', | |
680 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
680 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
681 |
|
681 | |||
682 | config.add_route( |
|
682 | config.add_route( | |
683 | name='user_disable_force_password_reset', |
|
683 | name='user_disable_force_password_reset', | |
684 | pattern='/users/{user_id:\d+}/password_reset_disable', |
|
684 | pattern=r'/users/{user_id:\d+}/password_reset_disable', | |
685 | user_route=True) |
|
685 | user_route=True) | |
686 | config.add_view( |
|
686 | config.add_view( | |
687 | UsersView, |
|
687 | UsersView, | |
688 | attr='user_disable_force_password_reset', |
|
688 | attr='user_disable_force_password_reset', | |
689 | route_name='user_disable_force_password_reset', request_method='POST', |
|
689 | route_name='user_disable_force_password_reset', request_method='POST', | |
690 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
690 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
691 |
|
691 | |||
692 | config.add_route( |
|
692 | config.add_route( | |
693 | name='user_create_personal_repo_group', |
|
693 | name='user_create_personal_repo_group', | |
694 | pattern='/users/{user_id:\d+}/create_repo_group', |
|
694 | pattern=r'/users/{user_id:\d+}/create_repo_group', | |
695 | user_route=True) |
|
695 | user_route=True) | |
696 | config.add_view( |
|
696 | config.add_view( | |
697 | UsersView, |
|
697 | UsersView, | |
698 | attr='user_create_personal_repo_group', |
|
698 | attr='user_create_personal_repo_group', | |
699 | route_name='user_create_personal_repo_group', request_method='POST', |
|
699 | route_name='user_create_personal_repo_group', request_method='POST', | |
700 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
700 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
701 |
|
701 | |||
702 | # user notice |
|
702 | # user notice | |
703 | config.add_route( |
|
703 | config.add_route( | |
704 | name='user_notice_dismiss', |
|
704 | name='user_notice_dismiss', | |
705 | pattern='/users/{user_id:\d+}/notice_dismiss', |
|
705 | pattern=r'/users/{user_id:\d+}/notice_dismiss', | |
706 | user_route=True) |
|
706 | user_route=True) | |
707 | config.add_view( |
|
707 | config.add_view( | |
708 | UsersView, |
|
708 | UsersView, | |
709 | attr='user_notice_dismiss', |
|
709 | attr='user_notice_dismiss', | |
710 | route_name='user_notice_dismiss', request_method='POST', |
|
710 | route_name='user_notice_dismiss', request_method='POST', | |
711 | renderer='json_ext', xhr=True) |
|
711 | renderer='json_ext', xhr=True) | |
712 |
|
712 | |||
713 | # user auth tokens |
|
713 | # user auth tokens | |
714 | config.add_route( |
|
714 | config.add_route( | |
715 | name='edit_user_auth_tokens', |
|
715 | name='edit_user_auth_tokens', | |
716 | pattern='/users/{user_id:\d+}/edit/auth_tokens', |
|
716 | pattern=r'/users/{user_id:\d+}/edit/auth_tokens', | |
717 | user_route=True) |
|
717 | user_route=True) | |
718 | config.add_view( |
|
718 | config.add_view( | |
719 | UsersView, |
|
719 | UsersView, | |
720 | attr='auth_tokens', |
|
720 | attr='auth_tokens', | |
721 | route_name='edit_user_auth_tokens', request_method='GET', |
|
721 | route_name='edit_user_auth_tokens', request_method='GET', | |
722 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
722 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
723 |
|
723 | |||
724 | config.add_route( |
|
724 | config.add_route( | |
725 | name='edit_user_auth_tokens_view', |
|
725 | name='edit_user_auth_tokens_view', | |
726 | pattern='/users/{user_id:\d+}/edit/auth_tokens/view', |
|
726 | pattern=r'/users/{user_id:\d+}/edit/auth_tokens/view', | |
727 | user_route=True) |
|
727 | user_route=True) | |
728 | config.add_view( |
|
728 | config.add_view( | |
729 | UsersView, |
|
729 | UsersView, | |
730 | attr='auth_tokens_view', |
|
730 | attr='auth_tokens_view', | |
731 | route_name='edit_user_auth_tokens_view', request_method='POST', |
|
731 | route_name='edit_user_auth_tokens_view', request_method='POST', | |
732 | renderer='json_ext', xhr=True) |
|
732 | renderer='json_ext', xhr=True) | |
733 |
|
733 | |||
734 | config.add_route( |
|
734 | config.add_route( | |
735 | name='edit_user_auth_tokens_add', |
|
735 | name='edit_user_auth_tokens_add', | |
736 | pattern='/users/{user_id:\d+}/edit/auth_tokens/new', |
|
736 | pattern=r'/users/{user_id:\d+}/edit/auth_tokens/new', | |
737 | user_route=True) |
|
737 | user_route=True) | |
738 | config.add_view( |
|
738 | config.add_view( | |
739 | UsersView, |
|
739 | UsersView, | |
740 | attr='auth_tokens_add', |
|
740 | attr='auth_tokens_add', | |
741 | route_name='edit_user_auth_tokens_add', request_method='POST') |
|
741 | route_name='edit_user_auth_tokens_add', request_method='POST') | |
742 |
|
742 | |||
743 | config.add_route( |
|
743 | config.add_route( | |
744 | name='edit_user_auth_tokens_delete', |
|
744 | name='edit_user_auth_tokens_delete', | |
745 | pattern='/users/{user_id:\d+}/edit/auth_tokens/delete', |
|
745 | pattern=r'/users/{user_id:\d+}/edit/auth_tokens/delete', | |
746 | user_route=True) |
|
746 | user_route=True) | |
747 | config.add_view( |
|
747 | config.add_view( | |
748 | UsersView, |
|
748 | UsersView, | |
749 | attr='auth_tokens_delete', |
|
749 | attr='auth_tokens_delete', | |
750 | route_name='edit_user_auth_tokens_delete', request_method='POST') |
|
750 | route_name='edit_user_auth_tokens_delete', request_method='POST') | |
751 |
|
751 | |||
752 | # user ssh keys |
|
752 | # user ssh keys | |
753 | config.add_route( |
|
753 | config.add_route( | |
754 | name='edit_user_ssh_keys', |
|
754 | name='edit_user_ssh_keys', | |
755 | pattern='/users/{user_id:\d+}/edit/ssh_keys', |
|
755 | pattern=r'/users/{user_id:\d+}/edit/ssh_keys', | |
756 | user_route=True) |
|
756 | user_route=True) | |
757 | config.add_view( |
|
757 | config.add_view( | |
758 | UsersView, |
|
758 | UsersView, | |
759 | attr='ssh_keys', |
|
759 | attr='ssh_keys', | |
760 | route_name='edit_user_ssh_keys', request_method='GET', |
|
760 | route_name='edit_user_ssh_keys', request_method='GET', | |
761 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
761 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
762 |
|
762 | |||
763 | config.add_route( |
|
763 | config.add_route( | |
764 | name='edit_user_ssh_keys_generate_keypair', |
|
764 | name='edit_user_ssh_keys_generate_keypair', | |
765 | pattern='/users/{user_id:\d+}/edit/ssh_keys/generate', |
|
765 | pattern=r'/users/{user_id:\d+}/edit/ssh_keys/generate', | |
766 | user_route=True) |
|
766 | user_route=True) | |
767 | config.add_view( |
|
767 | config.add_view( | |
768 | UsersView, |
|
768 | UsersView, | |
769 | attr='ssh_keys_generate_keypair', |
|
769 | attr='ssh_keys_generate_keypair', | |
770 | route_name='edit_user_ssh_keys_generate_keypair', request_method='GET', |
|
770 | route_name='edit_user_ssh_keys_generate_keypair', request_method='GET', | |
771 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
771 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
772 |
|
772 | |||
773 | config.add_route( |
|
773 | config.add_route( | |
774 | name='edit_user_ssh_keys_add', |
|
774 | name='edit_user_ssh_keys_add', | |
775 | pattern='/users/{user_id:\d+}/edit/ssh_keys/new', |
|
775 | pattern=r'/users/{user_id:\d+}/edit/ssh_keys/new', | |
776 | user_route=True) |
|
776 | user_route=True) | |
777 | config.add_view( |
|
777 | config.add_view( | |
778 | UsersView, |
|
778 | UsersView, | |
779 | attr='ssh_keys_add', |
|
779 | attr='ssh_keys_add', | |
780 | route_name='edit_user_ssh_keys_add', request_method='POST') |
|
780 | route_name='edit_user_ssh_keys_add', request_method='POST') | |
781 |
|
781 | |||
782 | config.add_route( |
|
782 | config.add_route( | |
783 | name='edit_user_ssh_keys_delete', |
|
783 | name='edit_user_ssh_keys_delete', | |
784 | pattern='/users/{user_id:\d+}/edit/ssh_keys/delete', |
|
784 | pattern=r'/users/{user_id:\d+}/edit/ssh_keys/delete', | |
785 | user_route=True) |
|
785 | user_route=True) | |
786 | config.add_view( |
|
786 | config.add_view( | |
787 | UsersView, |
|
787 | UsersView, | |
788 | attr='ssh_keys_delete', |
|
788 | attr='ssh_keys_delete', | |
789 | route_name='edit_user_ssh_keys_delete', request_method='POST') |
|
789 | route_name='edit_user_ssh_keys_delete', request_method='POST') | |
790 |
|
790 | |||
791 | # user emails |
|
791 | # user emails | |
792 | config.add_route( |
|
792 | config.add_route( | |
793 | name='edit_user_emails', |
|
793 | name='edit_user_emails', | |
794 | pattern='/users/{user_id:\d+}/edit/emails', |
|
794 | pattern=r'/users/{user_id:\d+}/edit/emails', | |
795 | user_route=True) |
|
795 | user_route=True) | |
796 | config.add_view( |
|
796 | config.add_view( | |
797 | UsersView, |
|
797 | UsersView, | |
798 | attr='emails', |
|
798 | attr='emails', | |
799 | route_name='edit_user_emails', request_method='GET', |
|
799 | route_name='edit_user_emails', request_method='GET', | |
800 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
800 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
801 |
|
801 | |||
802 | config.add_route( |
|
802 | config.add_route( | |
803 | name='edit_user_emails_add', |
|
803 | name='edit_user_emails_add', | |
804 | pattern='/users/{user_id:\d+}/edit/emails/new', |
|
804 | pattern=r'/users/{user_id:\d+}/edit/emails/new', | |
805 | user_route=True) |
|
805 | user_route=True) | |
806 | config.add_view( |
|
806 | config.add_view( | |
807 | UsersView, |
|
807 | UsersView, | |
808 | attr='emails_add', |
|
808 | attr='emails_add', | |
809 | route_name='edit_user_emails_add', request_method='POST') |
|
809 | route_name='edit_user_emails_add', request_method='POST') | |
810 |
|
810 | |||
811 | config.add_route( |
|
811 | config.add_route( | |
812 | name='edit_user_emails_delete', |
|
812 | name='edit_user_emails_delete', | |
813 | pattern='/users/{user_id:\d+}/edit/emails/delete', |
|
813 | pattern=r'/users/{user_id:\d+}/edit/emails/delete', | |
814 | user_route=True) |
|
814 | user_route=True) | |
815 | config.add_view( |
|
815 | config.add_view( | |
816 | UsersView, |
|
816 | UsersView, | |
817 | attr='emails_delete', |
|
817 | attr='emails_delete', | |
818 | route_name='edit_user_emails_delete', request_method='POST') |
|
818 | route_name='edit_user_emails_delete', request_method='POST') | |
819 |
|
819 | |||
820 | # user IPs |
|
820 | # user IPs | |
821 | config.add_route( |
|
821 | config.add_route( | |
822 | name='edit_user_ips', |
|
822 | name='edit_user_ips', | |
823 | pattern='/users/{user_id:\d+}/edit/ips', |
|
823 | pattern=r'/users/{user_id:\d+}/edit/ips', | |
824 | user_route=True) |
|
824 | user_route=True) | |
825 | config.add_view( |
|
825 | config.add_view( | |
826 | UsersView, |
|
826 | UsersView, | |
827 | attr='ips', |
|
827 | attr='ips', | |
828 | route_name='edit_user_ips', request_method='GET', |
|
828 | route_name='edit_user_ips', request_method='GET', | |
829 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
829 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
830 |
|
830 | |||
831 | config.add_route( |
|
831 | config.add_route( | |
832 | name='edit_user_ips_add', |
|
832 | name='edit_user_ips_add', | |
833 | pattern='/users/{user_id:\d+}/edit/ips/new', |
|
833 | pattern=r'/users/{user_id:\d+}/edit/ips/new', | |
834 | user_route_with_default=True) # enabled for default user too |
|
834 | user_route_with_default=True) # enabled for default user too | |
835 | config.add_view( |
|
835 | config.add_view( | |
836 | UsersView, |
|
836 | UsersView, | |
837 | attr='ips_add', |
|
837 | attr='ips_add', | |
838 | route_name='edit_user_ips_add', request_method='POST') |
|
838 | route_name='edit_user_ips_add', request_method='POST') | |
839 |
|
839 | |||
840 | config.add_route( |
|
840 | config.add_route( | |
841 | name='edit_user_ips_delete', |
|
841 | name='edit_user_ips_delete', | |
842 | pattern='/users/{user_id:\d+}/edit/ips/delete', |
|
842 | pattern=r'/users/{user_id:\d+}/edit/ips/delete', | |
843 | user_route_with_default=True) # enabled for default user too |
|
843 | user_route_with_default=True) # enabled for default user too | |
844 | config.add_view( |
|
844 | config.add_view( | |
845 | UsersView, |
|
845 | UsersView, | |
846 | attr='ips_delete', |
|
846 | attr='ips_delete', | |
847 | route_name='edit_user_ips_delete', request_method='POST') |
|
847 | route_name='edit_user_ips_delete', request_method='POST') | |
848 |
|
848 | |||
849 | # user perms |
|
849 | # user perms | |
850 | config.add_route( |
|
850 | config.add_route( | |
851 | name='edit_user_perms_summary', |
|
851 | name='edit_user_perms_summary', | |
852 | pattern='/users/{user_id:\d+}/edit/permissions_summary', |
|
852 | pattern=r'/users/{user_id:\d+}/edit/permissions_summary', | |
853 | user_route=True) |
|
853 | user_route=True) | |
854 | config.add_view( |
|
854 | config.add_view( | |
855 | UsersView, |
|
855 | UsersView, | |
856 | attr='user_perms_summary', |
|
856 | attr='user_perms_summary', | |
857 | route_name='edit_user_perms_summary', request_method='GET', |
|
857 | route_name='edit_user_perms_summary', request_method='GET', | |
858 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
858 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
859 |
|
859 | |||
860 | config.add_route( |
|
860 | config.add_route( | |
861 | name='edit_user_perms_summary_json', |
|
861 | name='edit_user_perms_summary_json', | |
862 | pattern='/users/{user_id:\d+}/edit/permissions_summary/json', |
|
862 | pattern=r'/users/{user_id:\d+}/edit/permissions_summary/json', | |
863 | user_route=True) |
|
863 | user_route=True) | |
864 | config.add_view( |
|
864 | config.add_view( | |
865 | UsersView, |
|
865 | UsersView, | |
866 | attr='user_perms_summary_json', |
|
866 | attr='user_perms_summary_json', | |
867 | route_name='edit_user_perms_summary_json', request_method='GET', |
|
867 | route_name='edit_user_perms_summary_json', request_method='GET', | |
868 | renderer='json_ext') |
|
868 | renderer='json_ext') | |
869 |
|
869 | |||
870 | # user user groups management |
|
870 | # user user groups management | |
871 | config.add_route( |
|
871 | config.add_route( | |
872 | name='edit_user_groups_management', |
|
872 | name='edit_user_groups_management', | |
873 | pattern='/users/{user_id:\d+}/edit/groups_management', |
|
873 | pattern=r'/users/{user_id:\d+}/edit/groups_management', | |
874 | user_route=True) |
|
874 | user_route=True) | |
875 | config.add_view( |
|
875 | config.add_view( | |
876 | UsersView, |
|
876 | UsersView, | |
877 | attr='groups_management', |
|
877 | attr='groups_management', | |
878 | route_name='edit_user_groups_management', request_method='GET', |
|
878 | route_name='edit_user_groups_management', request_method='GET', | |
879 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
879 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
880 |
|
880 | |||
881 | config.add_route( |
|
881 | config.add_route( | |
882 | name='edit_user_groups_management_updates', |
|
882 | name='edit_user_groups_management_updates', | |
883 | pattern='/users/{user_id:\d+}/edit/edit_user_groups_management/updates', |
|
883 | pattern=r'/users/{user_id:\d+}/edit/edit_user_groups_management/updates', | |
884 | user_route=True) |
|
884 | user_route=True) | |
885 | config.add_view( |
|
885 | config.add_view( | |
886 | UsersView, |
|
886 | UsersView, | |
887 | attr='groups_management_updates', |
|
887 | attr='groups_management_updates', | |
888 | route_name='edit_user_groups_management_updates', request_method='POST') |
|
888 | route_name='edit_user_groups_management_updates', request_method='POST') | |
889 |
|
889 | |||
890 | # user audit logs |
|
890 | # user audit logs | |
891 | config.add_route( |
|
891 | config.add_route( | |
892 | name='edit_user_audit_logs', |
|
892 | name='edit_user_audit_logs', | |
893 | pattern='/users/{user_id:\d+}/edit/audit', user_route=True) |
|
893 | pattern=r'/users/{user_id:\d+}/edit/audit', user_route=True) | |
894 | config.add_view( |
|
894 | config.add_view( | |
895 | UsersView, |
|
895 | UsersView, | |
896 | attr='user_audit_logs', |
|
896 | attr='user_audit_logs', | |
897 | route_name='edit_user_audit_logs', request_method='GET', |
|
897 | route_name='edit_user_audit_logs', request_method='GET', | |
898 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
898 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
899 |
|
899 | |||
900 | config.add_route( |
|
900 | config.add_route( | |
901 | name='edit_user_audit_logs_download', |
|
901 | name='edit_user_audit_logs_download', | |
902 | pattern='/users/{user_id:\d+}/edit/audit/download', user_route=True) |
|
902 | pattern=r'/users/{user_id:\d+}/edit/audit/download', user_route=True) | |
903 | config.add_view( |
|
903 | config.add_view( | |
904 | UsersView, |
|
904 | UsersView, | |
905 | attr='user_audit_logs_download', |
|
905 | attr='user_audit_logs_download', | |
906 | route_name='edit_user_audit_logs_download', request_method='GET', |
|
906 | route_name='edit_user_audit_logs_download', request_method='GET', | |
907 | renderer='string') |
|
907 | renderer='string') | |
908 |
|
908 | |||
909 | # user caches |
|
909 | # user caches | |
910 | config.add_route( |
|
910 | config.add_route( | |
911 | name='edit_user_caches', |
|
911 | name='edit_user_caches', | |
912 | pattern='/users/{user_id:\d+}/edit/caches', |
|
912 | pattern=r'/users/{user_id:\d+}/edit/caches', | |
913 | user_route=True) |
|
913 | user_route=True) | |
914 | config.add_view( |
|
914 | config.add_view( | |
915 | UsersView, |
|
915 | UsersView, | |
916 | attr='user_caches', |
|
916 | attr='user_caches', | |
917 | route_name='edit_user_caches', request_method='GET', |
|
917 | route_name='edit_user_caches', request_method='GET', | |
918 | renderer='rhodecode:templates/admin/users/user_edit.mako') |
|
918 | renderer='rhodecode:templates/admin/users/user_edit.mako') | |
919 |
|
919 | |||
920 | config.add_route( |
|
920 | config.add_route( | |
921 | name='edit_user_caches_update', |
|
921 | name='edit_user_caches_update', | |
922 | pattern='/users/{user_id:\d+}/edit/caches/update', |
|
922 | pattern=r'/users/{user_id:\d+}/edit/caches/update', | |
923 | user_route=True) |
|
923 | user_route=True) | |
924 | config.add_view( |
|
924 | config.add_view( | |
925 | UsersView, |
|
925 | UsersView, | |
926 | attr='user_caches_update', |
|
926 | attr='user_caches_update', | |
927 | route_name='edit_user_caches_update', request_method='POST') |
|
927 | route_name='edit_user_caches_update', request_method='POST') | |
928 |
|
928 | |||
929 | # user-groups admin |
|
929 | # user-groups admin | |
930 | config.add_route( |
|
930 | config.add_route( | |
931 | name='user_groups', |
|
931 | name='user_groups', | |
932 | pattern='/user_groups') |
|
932 | pattern='/user_groups') | |
933 | config.add_view( |
|
933 | config.add_view( | |
934 | AdminUserGroupsView, |
|
934 | AdminUserGroupsView, | |
935 | attr='user_groups_list', |
|
935 | attr='user_groups_list', | |
936 | route_name='user_groups', request_method='GET', |
|
936 | route_name='user_groups', request_method='GET', | |
937 | renderer='rhodecode:templates/admin/user_groups/user_groups.mako') |
|
937 | renderer='rhodecode:templates/admin/user_groups/user_groups.mako') | |
938 |
|
938 | |||
939 | config.add_route( |
|
939 | config.add_route( | |
940 | name='user_groups_data', |
|
940 | name='user_groups_data', | |
941 | pattern='/user_groups_data') |
|
941 | pattern='/user_groups_data') | |
942 | config.add_view( |
|
942 | config.add_view( | |
943 | AdminUserGroupsView, |
|
943 | AdminUserGroupsView, | |
944 | attr='user_groups_list_data', |
|
944 | attr='user_groups_list_data', | |
945 | route_name='user_groups_data', request_method='GET', |
|
945 | route_name='user_groups_data', request_method='GET', | |
946 | renderer='json_ext', xhr=True) |
|
946 | renderer='json_ext', xhr=True) | |
947 |
|
947 | |||
948 | config.add_route( |
|
948 | config.add_route( | |
949 | name='user_groups_new', |
|
949 | name='user_groups_new', | |
950 | pattern='/user_groups/new') |
|
950 | pattern='/user_groups/new') | |
951 | config.add_view( |
|
951 | config.add_view( | |
952 | AdminUserGroupsView, |
|
952 | AdminUserGroupsView, | |
953 | attr='user_groups_new', |
|
953 | attr='user_groups_new', | |
954 | route_name='user_groups_new', request_method='GET', |
|
954 | route_name='user_groups_new', request_method='GET', | |
955 | renderer='rhodecode:templates/admin/user_groups/user_group_add.mako') |
|
955 | renderer='rhodecode:templates/admin/user_groups/user_group_add.mako') | |
956 |
|
956 | |||
957 | config.add_route( |
|
957 | config.add_route( | |
958 | name='user_groups_create', |
|
958 | name='user_groups_create', | |
959 | pattern='/user_groups/create') |
|
959 | pattern='/user_groups/create') | |
960 | config.add_view( |
|
960 | config.add_view( | |
961 | AdminUserGroupsView, |
|
961 | AdminUserGroupsView, | |
962 | attr='user_groups_create', |
|
962 | attr='user_groups_create', | |
963 | route_name='user_groups_create', request_method='POST', |
|
963 | route_name='user_groups_create', request_method='POST', | |
964 | renderer='rhodecode:templates/admin/user_groups/user_group_add.mako') |
|
964 | renderer='rhodecode:templates/admin/user_groups/user_group_add.mako') | |
965 |
|
965 | |||
966 | # repos admin |
|
966 | # repos admin | |
967 | config.add_route( |
|
967 | config.add_route( | |
968 | name='repos', |
|
968 | name='repos', | |
969 | pattern='/repos') |
|
969 | pattern='/repos') | |
970 | config.add_view( |
|
970 | config.add_view( | |
971 | AdminReposView, |
|
971 | AdminReposView, | |
972 | attr='repository_list', |
|
972 | attr='repository_list', | |
973 | route_name='repos', request_method='GET', |
|
973 | route_name='repos', request_method='GET', | |
974 | renderer='rhodecode:templates/admin/repos/repos.mako') |
|
974 | renderer='rhodecode:templates/admin/repos/repos.mako') | |
975 |
|
975 | |||
976 | config.add_route( |
|
976 | config.add_route( | |
977 | name='repos_data', |
|
977 | name='repos_data', | |
978 | pattern='/repos_data') |
|
978 | pattern='/repos_data') | |
979 | config.add_view( |
|
979 | config.add_view( | |
980 | AdminReposView, |
|
980 | AdminReposView, | |
981 | attr='repository_list_data', |
|
981 | attr='repository_list_data', | |
982 | route_name='repos_data', request_method='GET', |
|
982 | route_name='repos_data', request_method='GET', | |
983 | renderer='json_ext', xhr=True) |
|
983 | renderer='json_ext', xhr=True) | |
984 |
|
984 | |||
985 | config.add_route( |
|
985 | config.add_route( | |
986 | name='repo_new', |
|
986 | name='repo_new', | |
987 | pattern='/repos/new') |
|
987 | pattern='/repos/new') | |
988 | config.add_view( |
|
988 | config.add_view( | |
989 | AdminReposView, |
|
989 | AdminReposView, | |
990 | attr='repository_new', |
|
990 | attr='repository_new', | |
991 | route_name='repo_new', request_method='GET', |
|
991 | route_name='repo_new', request_method='GET', | |
992 | renderer='rhodecode:templates/admin/repos/repo_add.mako') |
|
992 | renderer='rhodecode:templates/admin/repos/repo_add.mako') | |
993 |
|
993 | |||
994 | config.add_route( |
|
994 | config.add_route( | |
995 | name='repo_create', |
|
995 | name='repo_create', | |
996 | pattern='/repos/create') |
|
996 | pattern='/repos/create') | |
997 | config.add_view( |
|
997 | config.add_view( | |
998 | AdminReposView, |
|
998 | AdminReposView, | |
999 | attr='repository_create', |
|
999 | attr='repository_create', | |
1000 | route_name='repo_create', request_method='POST', |
|
1000 | route_name='repo_create', request_method='POST', | |
1001 | renderer='rhodecode:templates/admin/repos/repos.mako') |
|
1001 | renderer='rhodecode:templates/admin/repos/repos.mako') | |
1002 |
|
1002 | |||
1003 | # repo groups admin |
|
1003 | # repo groups admin | |
1004 | config.add_route( |
|
1004 | config.add_route( | |
1005 | name='repo_groups', |
|
1005 | name='repo_groups', | |
1006 | pattern='/repo_groups') |
|
1006 | pattern='/repo_groups') | |
1007 | config.add_view( |
|
1007 | config.add_view( | |
1008 | AdminRepoGroupsView, |
|
1008 | AdminRepoGroupsView, | |
1009 | attr='repo_group_list', |
|
1009 | attr='repo_group_list', | |
1010 | route_name='repo_groups', request_method='GET', |
|
1010 | route_name='repo_groups', request_method='GET', | |
1011 | renderer='rhodecode:templates/admin/repo_groups/repo_groups.mako') |
|
1011 | renderer='rhodecode:templates/admin/repo_groups/repo_groups.mako') | |
1012 |
|
1012 | |||
1013 | config.add_route( |
|
1013 | config.add_route( | |
1014 | name='repo_groups_data', |
|
1014 | name='repo_groups_data', | |
1015 | pattern='/repo_groups_data') |
|
1015 | pattern='/repo_groups_data') | |
1016 | config.add_view( |
|
1016 | config.add_view( | |
1017 | AdminRepoGroupsView, |
|
1017 | AdminRepoGroupsView, | |
1018 | attr='repo_group_list_data', |
|
1018 | attr='repo_group_list_data', | |
1019 | route_name='repo_groups_data', request_method='GET', |
|
1019 | route_name='repo_groups_data', request_method='GET', | |
1020 | renderer='json_ext', xhr=True) |
|
1020 | renderer='json_ext', xhr=True) | |
1021 |
|
1021 | |||
1022 | config.add_route( |
|
1022 | config.add_route( | |
1023 | name='repo_group_new', |
|
1023 | name='repo_group_new', | |
1024 | pattern='/repo_group/new') |
|
1024 | pattern='/repo_group/new') | |
1025 | config.add_view( |
|
1025 | config.add_view( | |
1026 | AdminRepoGroupsView, |
|
1026 | AdminRepoGroupsView, | |
1027 | attr='repo_group_new', |
|
1027 | attr='repo_group_new', | |
1028 | route_name='repo_group_new', request_method='GET', |
|
1028 | route_name='repo_group_new', request_method='GET', | |
1029 | renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako') |
|
1029 | renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako') | |
1030 |
|
1030 | |||
1031 | config.add_route( |
|
1031 | config.add_route( | |
1032 | name='repo_group_create', |
|
1032 | name='repo_group_create', | |
1033 | pattern='/repo_group/create') |
|
1033 | pattern='/repo_group/create') | |
1034 | config.add_view( |
|
1034 | config.add_view( | |
1035 | AdminRepoGroupsView, |
|
1035 | AdminRepoGroupsView, | |
1036 | attr='repo_group_create', |
|
1036 | attr='repo_group_create', | |
1037 | route_name='repo_group_create', request_method='POST', |
|
1037 | route_name='repo_group_create', request_method='POST', | |
1038 | renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako') |
|
1038 | renderer='rhodecode:templates/admin/repo_groups/repo_group_add.mako') | |
1039 |
|
1039 | |||
1040 |
|
1040 | |||
1041 | def includeme(config): |
|
1041 | def includeme(config): | |
1042 | from rhodecode.apps._base.navigation import includeme as nav_includeme |
|
1042 | from rhodecode.apps._base.navigation import includeme as nav_includeme | |
1043 | from rhodecode.apps.admin.views.main_views import AdminMainView |
|
1043 | from rhodecode.apps.admin.views.main_views import AdminMainView | |
1044 |
|
1044 | |||
1045 | # Create admin navigation registry and add it to the pyramid registry. |
|
1045 | # Create admin navigation registry and add it to the pyramid registry. | |
1046 | nav_includeme(config) |
|
1046 | nav_includeme(config) | |
1047 |
|
1047 | |||
1048 | # main admin routes |
|
1048 | # main admin routes | |
1049 | config.add_route( |
|
1049 | config.add_route( | |
1050 | name='admin_home', pattern=ADMIN_PREFIX) |
|
1050 | name='admin_home', pattern=ADMIN_PREFIX) | |
1051 | config.add_view( |
|
1051 | config.add_view( | |
1052 | AdminMainView, |
|
1052 | AdminMainView, | |
1053 | attr='admin_main', |
|
1053 | attr='admin_main', | |
1054 | route_name='admin_home', request_method='GET', |
|
1054 | route_name='admin_home', request_method='GET', | |
1055 | renderer='rhodecode:templates/admin/main.mako') |
|
1055 | renderer='rhodecode:templates/admin/main.mako') | |
1056 |
|
1056 | |||
1057 | # pr global redirect |
|
1057 | # pr global redirect | |
1058 | config.add_route( |
|
1058 | config.add_route( | |
1059 | name='pull_requests_global_0', # backward compat |
|
1059 | name='pull_requests_global_0', # backward compat | |
1060 | pattern=ADMIN_PREFIX + '/pull_requests/{pull_request_id:\d+}') |
|
1060 | pattern=ADMIN_PREFIX + r'/pull_requests/{pull_request_id:\d+}') | |
1061 | config.add_view( |
|
1061 | config.add_view( | |
1062 | AdminMainView, |
|
1062 | AdminMainView, | |
1063 | attr='pull_requests', |
|
1063 | attr='pull_requests', | |
1064 | route_name='pull_requests_global_0', request_method='GET') |
|
1064 | route_name='pull_requests_global_0', request_method='GET') | |
1065 |
|
1065 | |||
1066 | config.add_route( |
|
1066 | config.add_route( | |
1067 | name='pull_requests_global_1', # backward compat |
|
1067 | name='pull_requests_global_1', # backward compat | |
1068 | pattern=ADMIN_PREFIX + '/pull-requests/{pull_request_id:\d+}') |
|
1068 | pattern=ADMIN_PREFIX + r'/pull-requests/{pull_request_id:\d+}') | |
1069 | config.add_view( |
|
1069 | config.add_view( | |
1070 | AdminMainView, |
|
1070 | AdminMainView, | |
1071 | attr='pull_requests', |
|
1071 | attr='pull_requests', | |
1072 | route_name='pull_requests_global_1', request_method='GET') |
|
1072 | route_name='pull_requests_global_1', request_method='GET') | |
1073 |
|
1073 | |||
1074 | config.add_route( |
|
1074 | config.add_route( | |
1075 | name='pull_requests_global', |
|
1075 | name='pull_requests_global', | |
1076 | pattern=ADMIN_PREFIX + '/pull-request/{pull_request_id:\d+}') |
|
1076 | pattern=ADMIN_PREFIX + r'/pull-request/{pull_request_id:\d+}') | |
1077 | config.add_view( |
|
1077 | config.add_view( | |
1078 | AdminMainView, |
|
1078 | AdminMainView, | |
1079 | attr='pull_requests', |
|
1079 | attr='pull_requests', | |
1080 | route_name='pull_requests_global', request_method='GET') |
|
1080 | route_name='pull_requests_global', request_method='GET') | |
1081 |
|
1081 | |||
1082 | config.include(admin_routes, route_prefix=ADMIN_PREFIX) |
|
1082 | config.include(admin_routes, route_prefix=ADMIN_PREFIX) |
@@ -1,1225 +1,1225 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 | from rhodecode.apps._base import add_route_with_slash |
|
18 | from rhodecode.apps._base import add_route_with_slash | |
19 |
|
19 | |||
20 |
|
20 | |||
21 | def includeme(config): |
|
21 | def includeme(config): | |
22 | from rhodecode.apps.repository.views.repo_artifacts import RepoArtifactsView |
|
22 | from rhodecode.apps.repository.views.repo_artifacts import RepoArtifactsView | |
23 | from rhodecode.apps.repository.views.repo_audit_logs import AuditLogsView |
|
23 | from rhodecode.apps.repository.views.repo_audit_logs import AuditLogsView | |
24 | from rhodecode.apps.repository.views.repo_automation import RepoAutomationView |
|
24 | from rhodecode.apps.repository.views.repo_automation import RepoAutomationView | |
25 | from rhodecode.apps.repository.views.repo_bookmarks import RepoBookmarksView |
|
25 | from rhodecode.apps.repository.views.repo_bookmarks import RepoBookmarksView | |
26 | from rhodecode.apps.repository.views.repo_branch_permissions import RepoSettingsBranchPermissionsView |
|
26 | from rhodecode.apps.repository.views.repo_branch_permissions import RepoSettingsBranchPermissionsView | |
27 | from rhodecode.apps.repository.views.repo_branches import RepoBranchesView |
|
27 | from rhodecode.apps.repository.views.repo_branches import RepoBranchesView | |
28 | from rhodecode.apps.repository.views.repo_caches import RepoCachesView |
|
28 | from rhodecode.apps.repository.views.repo_caches import RepoCachesView | |
29 | from rhodecode.apps.repository.views.repo_changelog import RepoChangelogView |
|
29 | from rhodecode.apps.repository.views.repo_changelog import RepoChangelogView | |
30 | from rhodecode.apps.repository.views.repo_checks import RepoChecksView |
|
30 | from rhodecode.apps.repository.views.repo_checks import RepoChecksView | |
31 | from rhodecode.apps.repository.views.repo_commits import RepoCommitsView |
|
31 | from rhodecode.apps.repository.views.repo_commits import RepoCommitsView | |
32 | from rhodecode.apps.repository.views.repo_compare import RepoCompareView |
|
32 | from rhodecode.apps.repository.views.repo_compare import RepoCompareView | |
33 | from rhodecode.apps.repository.views.repo_feed import RepoFeedView |
|
33 | from rhodecode.apps.repository.views.repo_feed import RepoFeedView | |
34 | from rhodecode.apps.repository.views.repo_files import RepoFilesView |
|
34 | from rhodecode.apps.repository.views.repo_files import RepoFilesView | |
35 | from rhodecode.apps.repository.views.repo_forks import RepoForksView |
|
35 | from rhodecode.apps.repository.views.repo_forks import RepoForksView | |
36 | from rhodecode.apps.repository.views.repo_maintainance import RepoMaintenanceView |
|
36 | from rhodecode.apps.repository.views.repo_maintainance import RepoMaintenanceView | |
37 | from rhodecode.apps.repository.views.repo_permissions import RepoSettingsPermissionsView |
|
37 | from rhodecode.apps.repository.views.repo_permissions import RepoSettingsPermissionsView | |
38 | from rhodecode.apps.repository.views.repo_pull_requests import RepoPullRequestsView |
|
38 | from rhodecode.apps.repository.views.repo_pull_requests import RepoPullRequestsView | |
39 | from rhodecode.apps.repository.views.repo_review_rules import RepoReviewRulesView |
|
39 | from rhodecode.apps.repository.views.repo_review_rules import RepoReviewRulesView | |
40 | from rhodecode.apps.repository.views.repo_settings import RepoSettingsView |
|
40 | from rhodecode.apps.repository.views.repo_settings import RepoSettingsView | |
41 | from rhodecode.apps.repository.views.repo_settings_advanced import RepoSettingsAdvancedView |
|
41 | from rhodecode.apps.repository.views.repo_settings_advanced import RepoSettingsAdvancedView | |
42 | from rhodecode.apps.repository.views.repo_settings_fields import RepoSettingsFieldsView |
|
42 | from rhodecode.apps.repository.views.repo_settings_fields import RepoSettingsFieldsView | |
43 | from rhodecode.apps.repository.views.repo_settings_issue_trackers import RepoSettingsIssueTrackersView |
|
43 | from rhodecode.apps.repository.views.repo_settings_issue_trackers import RepoSettingsIssueTrackersView | |
44 | from rhodecode.apps.repository.views.repo_settings_remote import RepoSettingsRemoteView |
|
44 | from rhodecode.apps.repository.views.repo_settings_remote import RepoSettingsRemoteView | |
45 | from rhodecode.apps.repository.views.repo_settings_vcs import RepoSettingsVcsView |
|
45 | from rhodecode.apps.repository.views.repo_settings_vcs import RepoSettingsVcsView | |
46 | from rhodecode.apps.repository.views.repo_strip import RepoStripView |
|
46 | from rhodecode.apps.repository.views.repo_strip import RepoStripView | |
47 | from rhodecode.apps.repository.views.repo_summary import RepoSummaryView |
|
47 | from rhodecode.apps.repository.views.repo_summary import RepoSummaryView | |
48 | from rhodecode.apps.repository.views.repo_tags import RepoTagsView |
|
48 | from rhodecode.apps.repository.views.repo_tags import RepoTagsView | |
49 |
|
49 | |||
50 | # repo creating checks, special cases that aren't repo routes |
|
50 | # repo creating checks, special cases that aren't repo routes | |
51 | config.add_route( |
|
51 | config.add_route( | |
52 | name='repo_creating', |
|
52 | name='repo_creating', | |
53 | pattern='/{repo_name:.*?[^/]}/repo_creating') |
|
53 | pattern='/{repo_name:.*?[^/]}/repo_creating') | |
54 | config.add_view( |
|
54 | config.add_view( | |
55 | RepoChecksView, |
|
55 | RepoChecksView, | |
56 | attr='repo_creating', |
|
56 | attr='repo_creating', | |
57 | route_name='repo_creating', request_method='GET', |
|
57 | route_name='repo_creating', request_method='GET', | |
58 | renderer='rhodecode:templates/admin/repos/repo_creating.mako') |
|
58 | renderer='rhodecode:templates/admin/repos/repo_creating.mako') | |
59 |
|
59 | |||
60 | config.add_route( |
|
60 | config.add_route( | |
61 | name='repo_creating_check', |
|
61 | name='repo_creating_check', | |
62 | pattern='/{repo_name:.*?[^/]}/repo_creating_check') |
|
62 | pattern='/{repo_name:.*?[^/]}/repo_creating_check') | |
63 | config.add_view( |
|
63 | config.add_view( | |
64 | RepoChecksView, |
|
64 | RepoChecksView, | |
65 | attr='repo_creating_check', |
|
65 | attr='repo_creating_check', | |
66 | route_name='repo_creating_check', request_method='GET', |
|
66 | route_name='repo_creating_check', request_method='GET', | |
67 | renderer='json_ext') |
|
67 | renderer='json_ext') | |
68 |
|
68 | |||
69 | # Summary |
|
69 | # Summary | |
70 | # NOTE(marcink): one additional route is defined in very bottom, catch |
|
70 | # NOTE(marcink): one additional route is defined in very bottom, catch | |
71 | # all pattern |
|
71 | # all pattern | |
72 | config.add_route( |
|
72 | config.add_route( | |
73 | name='repo_summary_explicit', |
|
73 | name='repo_summary_explicit', | |
74 | pattern='/{repo_name:.*?[^/]}/summary', repo_route=True) |
|
74 | pattern='/{repo_name:.*?[^/]}/summary', repo_route=True) | |
75 | config.add_view( |
|
75 | config.add_view( | |
76 | RepoSummaryView, |
|
76 | RepoSummaryView, | |
77 | attr='summary', |
|
77 | attr='summary', | |
78 | route_name='repo_summary_explicit', request_method='GET', |
|
78 | route_name='repo_summary_explicit', request_method='GET', | |
79 | renderer='rhodecode:templates/summary/summary.mako') |
|
79 | renderer='rhodecode:templates/summary/summary.mako') | |
80 |
|
80 | |||
81 | config.add_route( |
|
81 | config.add_route( | |
82 | name='repo_summary_commits', |
|
82 | name='repo_summary_commits', | |
83 | pattern='/{repo_name:.*?[^/]}/summary-commits', repo_route=True) |
|
83 | pattern='/{repo_name:.*?[^/]}/summary-commits', repo_route=True) | |
84 | config.add_view( |
|
84 | config.add_view( | |
85 | RepoSummaryView, |
|
85 | RepoSummaryView, | |
86 | attr='summary_commits', |
|
86 | attr='summary_commits', | |
87 | route_name='repo_summary_commits', request_method='GET', |
|
87 | route_name='repo_summary_commits', request_method='GET', | |
88 | renderer='rhodecode:templates/summary/summary_commits.mako') |
|
88 | renderer='rhodecode:templates/summary/summary_commits.mako') | |
89 |
|
89 | |||
90 | # Commits |
|
90 | # Commits | |
91 | config.add_route( |
|
91 | config.add_route( | |
92 | name='repo_commit', |
|
92 | name='repo_commit', | |
93 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}', repo_route=True) |
|
93 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}', repo_route=True) | |
94 | config.add_view( |
|
94 | config.add_view( | |
95 | RepoCommitsView, |
|
95 | RepoCommitsView, | |
96 | attr='repo_commit_show', |
|
96 | attr='repo_commit_show', | |
97 | route_name='repo_commit', request_method='GET', |
|
97 | route_name='repo_commit', request_method='GET', | |
98 | renderer=None) |
|
98 | renderer=None) | |
99 |
|
99 | |||
100 | config.add_route( |
|
100 | config.add_route( | |
101 | name='repo_commit_children', |
|
101 | name='repo_commit_children', | |
102 | pattern='/{repo_name:.*?[^/]}/changeset_children/{commit_id}', repo_route=True) |
|
102 | pattern='/{repo_name:.*?[^/]}/changeset_children/{commit_id}', repo_route=True) | |
103 | config.add_view( |
|
103 | config.add_view( | |
104 | RepoCommitsView, |
|
104 | RepoCommitsView, | |
105 | attr='repo_commit_children', |
|
105 | attr='repo_commit_children', | |
106 | route_name='repo_commit_children', request_method='GET', |
|
106 | route_name='repo_commit_children', request_method='GET', | |
107 | renderer='json_ext', xhr=True) |
|
107 | renderer='json_ext', xhr=True) | |
108 |
|
108 | |||
109 | config.add_route( |
|
109 | config.add_route( | |
110 | name='repo_commit_parents', |
|
110 | name='repo_commit_parents', | |
111 | pattern='/{repo_name:.*?[^/]}/changeset_parents/{commit_id}', repo_route=True) |
|
111 | pattern='/{repo_name:.*?[^/]}/changeset_parents/{commit_id}', repo_route=True) | |
112 | config.add_view( |
|
112 | config.add_view( | |
113 | RepoCommitsView, |
|
113 | RepoCommitsView, | |
114 | attr='repo_commit_parents', |
|
114 | attr='repo_commit_parents', | |
115 | route_name='repo_commit_parents', request_method='GET', |
|
115 | route_name='repo_commit_parents', request_method='GET', | |
116 | renderer='json_ext') |
|
116 | renderer='json_ext') | |
117 |
|
117 | |||
118 | config.add_route( |
|
118 | config.add_route( | |
119 | name='repo_commit_raw', |
|
119 | name='repo_commit_raw', | |
120 | pattern='/{repo_name:.*?[^/]}/changeset-diff/{commit_id}', repo_route=True) |
|
120 | pattern='/{repo_name:.*?[^/]}/changeset-diff/{commit_id}', repo_route=True) | |
121 | config.add_view( |
|
121 | config.add_view( | |
122 | RepoCommitsView, |
|
122 | RepoCommitsView, | |
123 | attr='repo_commit_raw', |
|
123 | attr='repo_commit_raw', | |
124 | route_name='repo_commit_raw', request_method='GET', |
|
124 | route_name='repo_commit_raw', request_method='GET', | |
125 | renderer=None) |
|
125 | renderer=None) | |
126 |
|
126 | |||
127 | config.add_route( |
|
127 | config.add_route( | |
128 | name='repo_commit_patch', |
|
128 | name='repo_commit_patch', | |
129 | pattern='/{repo_name:.*?[^/]}/changeset-patch/{commit_id}', repo_route=True) |
|
129 | pattern='/{repo_name:.*?[^/]}/changeset-patch/{commit_id}', repo_route=True) | |
130 | config.add_view( |
|
130 | config.add_view( | |
131 | RepoCommitsView, |
|
131 | RepoCommitsView, | |
132 | attr='repo_commit_patch', |
|
132 | attr='repo_commit_patch', | |
133 | route_name='repo_commit_patch', request_method='GET', |
|
133 | route_name='repo_commit_patch', request_method='GET', | |
134 | renderer=None) |
|
134 | renderer=None) | |
135 |
|
135 | |||
136 | config.add_route( |
|
136 | config.add_route( | |
137 | name='repo_commit_download', |
|
137 | name='repo_commit_download', | |
138 | pattern='/{repo_name:.*?[^/]}/changeset-download/{commit_id}', repo_route=True) |
|
138 | pattern='/{repo_name:.*?[^/]}/changeset-download/{commit_id}', repo_route=True) | |
139 | config.add_view( |
|
139 | config.add_view( | |
140 | RepoCommitsView, |
|
140 | RepoCommitsView, | |
141 | attr='repo_commit_download', |
|
141 | attr='repo_commit_download', | |
142 | route_name='repo_commit_download', request_method='GET', |
|
142 | route_name='repo_commit_download', request_method='GET', | |
143 | renderer=None) |
|
143 | renderer=None) | |
144 |
|
144 | |||
145 | config.add_route( |
|
145 | config.add_route( | |
146 | name='repo_commit_data', |
|
146 | name='repo_commit_data', | |
147 | pattern='/{repo_name:.*?[^/]}/changeset-data/{commit_id}', repo_route=True) |
|
147 | pattern='/{repo_name:.*?[^/]}/changeset-data/{commit_id}', repo_route=True) | |
148 | config.add_view( |
|
148 | config.add_view( | |
149 | RepoCommitsView, |
|
149 | RepoCommitsView, | |
150 | attr='repo_commit_data', |
|
150 | attr='repo_commit_data', | |
151 | route_name='repo_commit_data', request_method='GET', |
|
151 | route_name='repo_commit_data', request_method='GET', | |
152 | renderer='json_ext', xhr=True) |
|
152 | renderer='json_ext', xhr=True) | |
153 |
|
153 | |||
154 | config.add_route( |
|
154 | config.add_route( | |
155 | name='repo_commit_comment_create', |
|
155 | name='repo_commit_comment_create', | |
156 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/create', repo_route=True) |
|
156 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/create', repo_route=True) | |
157 | config.add_view( |
|
157 | config.add_view( | |
158 | RepoCommitsView, |
|
158 | RepoCommitsView, | |
159 | attr='repo_commit_comment_create', |
|
159 | attr='repo_commit_comment_create', | |
160 | route_name='repo_commit_comment_create', request_method='POST', |
|
160 | route_name='repo_commit_comment_create', request_method='POST', | |
161 | renderer='json_ext') |
|
161 | renderer='json_ext') | |
162 |
|
162 | |||
163 | config.add_route( |
|
163 | config.add_route( | |
164 | name='repo_commit_comment_preview', |
|
164 | name='repo_commit_comment_preview', | |
165 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/preview', repo_route=True) |
|
165 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/preview', repo_route=True) | |
166 | config.add_view( |
|
166 | config.add_view( | |
167 | RepoCommitsView, |
|
167 | RepoCommitsView, | |
168 | attr='repo_commit_comment_preview', |
|
168 | attr='repo_commit_comment_preview', | |
169 | route_name='repo_commit_comment_preview', request_method='POST', |
|
169 | route_name='repo_commit_comment_preview', request_method='POST', | |
170 | renderer='string', xhr=True) |
|
170 | renderer='string', xhr=True) | |
171 |
|
171 | |||
172 | config.add_route( |
|
172 | config.add_route( | |
173 | name='repo_commit_comment_history_view', |
|
173 | name='repo_commit_comment_history_view', | |
174 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/history_view/{comment_history_id}', repo_route=True) |
|
174 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/history_view/{comment_history_id}', repo_route=True) | |
175 | config.add_view( |
|
175 | config.add_view( | |
176 | RepoCommitsView, |
|
176 | RepoCommitsView, | |
177 | attr='repo_commit_comment_history_view', |
|
177 | attr='repo_commit_comment_history_view', | |
178 | route_name='repo_commit_comment_history_view', request_method='POST', |
|
178 | route_name='repo_commit_comment_history_view', request_method='POST', | |
179 | renderer='string', xhr=True) |
|
179 | renderer='string', xhr=True) | |
180 |
|
180 | |||
181 | config.add_route( |
|
181 | config.add_route( | |
182 | name='repo_commit_comment_attachment_upload', |
|
182 | name='repo_commit_comment_attachment_upload', | |
183 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/attachment_upload', repo_route=True) |
|
183 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/attachment_upload', repo_route=True) | |
184 | config.add_view( |
|
184 | config.add_view( | |
185 | RepoCommitsView, |
|
185 | RepoCommitsView, | |
186 | attr='repo_commit_comment_attachment_upload', |
|
186 | attr='repo_commit_comment_attachment_upload', | |
187 | route_name='repo_commit_comment_attachment_upload', request_method='POST', |
|
187 | route_name='repo_commit_comment_attachment_upload', request_method='POST', | |
188 | renderer='json_ext', xhr=True) |
|
188 | renderer='json_ext', xhr=True) | |
189 |
|
189 | |||
190 | config.add_route( |
|
190 | config.add_route( | |
191 | name='repo_commit_comment_delete', |
|
191 | name='repo_commit_comment_delete', | |
192 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/delete', repo_route=True) |
|
192 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/delete', repo_route=True) | |
193 | config.add_view( |
|
193 | config.add_view( | |
194 | RepoCommitsView, |
|
194 | RepoCommitsView, | |
195 | attr='repo_commit_comment_delete', |
|
195 | attr='repo_commit_comment_delete', | |
196 | route_name='repo_commit_comment_delete', request_method='POST', |
|
196 | route_name='repo_commit_comment_delete', request_method='POST', | |
197 | renderer='json_ext') |
|
197 | renderer='json_ext') | |
198 |
|
198 | |||
199 | config.add_route( |
|
199 | config.add_route( | |
200 | name='repo_commit_comment_edit', |
|
200 | name='repo_commit_comment_edit', | |
201 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/edit', repo_route=True) |
|
201 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/edit', repo_route=True) | |
202 | config.add_view( |
|
202 | config.add_view( | |
203 | RepoCommitsView, |
|
203 | RepoCommitsView, | |
204 | attr='repo_commit_comment_edit', |
|
204 | attr='repo_commit_comment_edit', | |
205 | route_name='repo_commit_comment_edit', request_method='POST', |
|
205 | route_name='repo_commit_comment_edit', request_method='POST', | |
206 | renderer='json_ext') |
|
206 | renderer='json_ext') | |
207 |
|
207 | |||
208 | # still working url for backward compat. |
|
208 | # still working url for backward compat. | |
209 | config.add_route( |
|
209 | config.add_route( | |
210 | name='repo_commit_raw_deprecated', |
|
210 | name='repo_commit_raw_deprecated', | |
211 | pattern='/{repo_name:.*?[^/]}/raw-changeset/{commit_id}', repo_route=True) |
|
211 | pattern='/{repo_name:.*?[^/]}/raw-changeset/{commit_id}', repo_route=True) | |
212 | config.add_view( |
|
212 | config.add_view( | |
213 | RepoCommitsView, |
|
213 | RepoCommitsView, | |
214 | attr='repo_commit_raw', |
|
214 | attr='repo_commit_raw', | |
215 | route_name='repo_commit_raw_deprecated', request_method='GET', |
|
215 | route_name='repo_commit_raw_deprecated', request_method='GET', | |
216 | renderer=None) |
|
216 | renderer=None) | |
217 |
|
217 | |||
218 | # Files |
|
218 | # Files | |
219 | config.add_route( |
|
219 | config.add_route( | |
220 | name='repo_archivefile', |
|
220 | name='repo_archivefile', | |
221 | pattern='/{repo_name:.*?[^/]}/archive/{fname:.*}', repo_route=True) |
|
221 | pattern='/{repo_name:.*?[^/]}/archive/{fname:.*}', repo_route=True) | |
222 | config.add_view( |
|
222 | config.add_view( | |
223 | RepoFilesView, |
|
223 | RepoFilesView, | |
224 | attr='repo_archivefile', |
|
224 | attr='repo_archivefile', | |
225 | route_name='repo_archivefile', request_method='GET', |
|
225 | route_name='repo_archivefile', request_method='GET', | |
226 | renderer=None) |
|
226 | renderer=None) | |
227 |
|
227 | |||
228 | config.add_route( |
|
228 | config.add_route( | |
229 | name='repo_files_diff', |
|
229 | name='repo_files_diff', | |
230 | pattern='/{repo_name:.*?[^/]}/diff/{f_path:.*}', repo_route=True) |
|
230 | pattern='/{repo_name:.*?[^/]}/diff/{f_path:.*}', repo_route=True) | |
231 | config.add_view( |
|
231 | config.add_view( | |
232 | RepoFilesView, |
|
232 | RepoFilesView, | |
233 | attr='repo_files_diff', |
|
233 | attr='repo_files_diff', | |
234 | route_name='repo_files_diff', request_method='GET', |
|
234 | route_name='repo_files_diff', request_method='GET', | |
235 | renderer=None) |
|
235 | renderer=None) | |
236 |
|
236 | |||
237 | config.add_route( # legacy route to make old links work |
|
237 | config.add_route( # legacy route to make old links work | |
238 | name='repo_files_diff_2way_redirect', |
|
238 | name='repo_files_diff_2way_redirect', | |
239 | pattern='/{repo_name:.*?[^/]}/diff-2way/{f_path:.*}', repo_route=True) |
|
239 | pattern='/{repo_name:.*?[^/]}/diff-2way/{f_path:.*}', repo_route=True) | |
240 | config.add_view( |
|
240 | config.add_view( | |
241 | RepoFilesView, |
|
241 | RepoFilesView, | |
242 | attr='repo_files_diff_2way_redirect', |
|
242 | attr='repo_files_diff_2way_redirect', | |
243 | route_name='repo_files_diff_2way_redirect', request_method='GET', |
|
243 | route_name='repo_files_diff_2way_redirect', request_method='GET', | |
244 | renderer=None) |
|
244 | renderer=None) | |
245 |
|
245 | |||
246 | config.add_route( |
|
246 | config.add_route( | |
247 | name='repo_files', |
|
247 | name='repo_files', | |
248 | pattern='/{repo_name:.*?[^/]}/files/{commit_id}/{f_path:.*}', repo_route=True) |
|
248 | pattern='/{repo_name:.*?[^/]}/files/{commit_id}/{f_path:.*}', repo_route=True) | |
249 | config.add_view( |
|
249 | config.add_view( | |
250 | RepoFilesView, |
|
250 | RepoFilesView, | |
251 | attr='repo_files', |
|
251 | attr='repo_files', | |
252 | route_name='repo_files', request_method='GET', |
|
252 | route_name='repo_files', request_method='GET', | |
253 | renderer=None) |
|
253 | renderer=None) | |
254 |
|
254 | |||
255 | config.add_route( |
|
255 | config.add_route( | |
256 | name='repo_files:default_path', |
|
256 | name='repo_files:default_path', | |
257 | pattern='/{repo_name:.*?[^/]}/files/{commit_id}/', repo_route=True) |
|
257 | pattern='/{repo_name:.*?[^/]}/files/{commit_id}/', repo_route=True) | |
258 | config.add_view( |
|
258 | config.add_view( | |
259 | RepoFilesView, |
|
259 | RepoFilesView, | |
260 | attr='repo_files', |
|
260 | attr='repo_files', | |
261 | route_name='repo_files:default_path', request_method='GET', |
|
261 | route_name='repo_files:default_path', request_method='GET', | |
262 | renderer=None) |
|
262 | renderer=None) | |
263 |
|
263 | |||
264 | config.add_route( |
|
264 | config.add_route( | |
265 | name='repo_files:default_commit', |
|
265 | name='repo_files:default_commit', | |
266 | pattern='/{repo_name:.*?[^/]}/files', repo_route=True) |
|
266 | pattern='/{repo_name:.*?[^/]}/files', repo_route=True) | |
267 | config.add_view( |
|
267 | config.add_view( | |
268 | RepoFilesView, |
|
268 | RepoFilesView, | |
269 | attr='repo_files', |
|
269 | attr='repo_files', | |
270 | route_name='repo_files:default_commit', request_method='GET', |
|
270 | route_name='repo_files:default_commit', request_method='GET', | |
271 | renderer=None) |
|
271 | renderer=None) | |
272 |
|
272 | |||
273 | config.add_route( |
|
273 | config.add_route( | |
274 | name='repo_files:rendered', |
|
274 | name='repo_files:rendered', | |
275 | pattern='/{repo_name:.*?[^/]}/render/{commit_id}/{f_path:.*}', repo_route=True) |
|
275 | pattern='/{repo_name:.*?[^/]}/render/{commit_id}/{f_path:.*}', repo_route=True) | |
276 | config.add_view( |
|
276 | config.add_view( | |
277 | RepoFilesView, |
|
277 | RepoFilesView, | |
278 | attr='repo_files', |
|
278 | attr='repo_files', | |
279 | route_name='repo_files:rendered', request_method='GET', |
|
279 | route_name='repo_files:rendered', request_method='GET', | |
280 | renderer=None) |
|
280 | renderer=None) | |
281 |
|
281 | |||
282 | config.add_route( |
|
282 | config.add_route( | |
283 | name='repo_files:annotated', |
|
283 | name='repo_files:annotated', | |
284 | pattern='/{repo_name:.*?[^/]}/annotate/{commit_id}/{f_path:.*}', repo_route=True) |
|
284 | pattern='/{repo_name:.*?[^/]}/annotate/{commit_id}/{f_path:.*}', repo_route=True) | |
285 | config.add_view( |
|
285 | config.add_view( | |
286 | RepoFilesView, |
|
286 | RepoFilesView, | |
287 | attr='repo_files', |
|
287 | attr='repo_files', | |
288 | route_name='repo_files:annotated', request_method='GET', |
|
288 | route_name='repo_files:annotated', request_method='GET', | |
289 | renderer=None) |
|
289 | renderer=None) | |
290 |
|
290 | |||
291 | config.add_route( |
|
291 | config.add_route( | |
292 | name='repo_files:annotated_previous', |
|
292 | name='repo_files:annotated_previous', | |
293 | pattern='/{repo_name:.*?[^/]}/annotate-previous/{commit_id}/{f_path:.*}', repo_route=True) |
|
293 | pattern='/{repo_name:.*?[^/]}/annotate-previous/{commit_id}/{f_path:.*}', repo_route=True) | |
294 | config.add_view( |
|
294 | config.add_view( | |
295 | RepoFilesView, |
|
295 | RepoFilesView, | |
296 | attr='repo_files_annotated_previous', |
|
296 | attr='repo_files_annotated_previous', | |
297 | route_name='repo_files:annotated_previous', request_method='GET', |
|
297 | route_name='repo_files:annotated_previous', request_method='GET', | |
298 | renderer=None) |
|
298 | renderer=None) | |
299 |
|
299 | |||
300 | config.add_route( |
|
300 | config.add_route( | |
301 | name='repo_nodetree_full', |
|
301 | name='repo_nodetree_full', | |
302 | pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/{f_path:.*}', repo_route=True) |
|
302 | pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/{f_path:.*}', repo_route=True) | |
303 | config.add_view( |
|
303 | config.add_view( | |
304 | RepoFilesView, |
|
304 | RepoFilesView, | |
305 | attr='repo_nodetree_full', |
|
305 | attr='repo_nodetree_full', | |
306 | route_name='repo_nodetree_full', request_method='GET', |
|
306 | route_name='repo_nodetree_full', request_method='GET', | |
307 | renderer=None, xhr=True) |
|
307 | renderer=None, xhr=True) | |
308 |
|
308 | |||
309 | config.add_route( |
|
309 | config.add_route( | |
310 | name='repo_nodetree_full:default_path', |
|
310 | name='repo_nodetree_full:default_path', | |
311 | pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/', repo_route=True) |
|
311 | pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/', repo_route=True) | |
312 | config.add_view( |
|
312 | config.add_view( | |
313 | RepoFilesView, |
|
313 | RepoFilesView, | |
314 | attr='repo_nodetree_full', |
|
314 | attr='repo_nodetree_full', | |
315 | route_name='repo_nodetree_full:default_path', request_method='GET', |
|
315 | route_name='repo_nodetree_full:default_path', request_method='GET', | |
316 | renderer=None, xhr=True) |
|
316 | renderer=None, xhr=True) | |
317 |
|
317 | |||
318 | config.add_route( |
|
318 | config.add_route( | |
319 | name='repo_files_nodelist', |
|
319 | name='repo_files_nodelist', | |
320 | pattern='/{repo_name:.*?[^/]}/nodelist/{commit_id}/{f_path:.*}', repo_route=True) |
|
320 | pattern='/{repo_name:.*?[^/]}/nodelist/{commit_id}/{f_path:.*}', repo_route=True) | |
321 | config.add_view( |
|
321 | config.add_view( | |
322 | RepoFilesView, |
|
322 | RepoFilesView, | |
323 | attr='repo_nodelist', |
|
323 | attr='repo_nodelist', | |
324 | route_name='repo_files_nodelist', request_method='GET', |
|
324 | route_name='repo_files_nodelist', request_method='GET', | |
325 | renderer='json_ext', xhr=True) |
|
325 | renderer='json_ext', xhr=True) | |
326 |
|
326 | |||
327 | config.add_route( |
|
327 | config.add_route( | |
328 | name='repo_file_raw', |
|
328 | name='repo_file_raw', | |
329 | pattern='/{repo_name:.*?[^/]}/raw/{commit_id}/{f_path:.*}', repo_route=True) |
|
329 | pattern='/{repo_name:.*?[^/]}/raw/{commit_id}/{f_path:.*}', repo_route=True) | |
330 | config.add_view( |
|
330 | config.add_view( | |
331 | RepoFilesView, |
|
331 | RepoFilesView, | |
332 | attr='repo_file_raw', |
|
332 | attr='repo_file_raw', | |
333 | route_name='repo_file_raw', request_method='GET', |
|
333 | route_name='repo_file_raw', request_method='GET', | |
334 | renderer=None) |
|
334 | renderer=None) | |
335 |
|
335 | |||
336 | config.add_route( |
|
336 | config.add_route( | |
337 | name='repo_file_download', |
|
337 | name='repo_file_download', | |
338 | pattern='/{repo_name:.*?[^/]}/download/{commit_id}/{f_path:.*}', repo_route=True) |
|
338 | pattern='/{repo_name:.*?[^/]}/download/{commit_id}/{f_path:.*}', repo_route=True) | |
339 | config.add_view( |
|
339 | config.add_view( | |
340 | RepoFilesView, |
|
340 | RepoFilesView, | |
341 | attr='repo_file_download', |
|
341 | attr='repo_file_download', | |
342 | route_name='repo_file_download', request_method='GET', |
|
342 | route_name='repo_file_download', request_method='GET', | |
343 | renderer=None) |
|
343 | renderer=None) | |
344 |
|
344 | |||
345 | config.add_route( # backward compat to keep old links working |
|
345 | config.add_route( # backward compat to keep old links working | |
346 | name='repo_file_download:legacy', |
|
346 | name='repo_file_download:legacy', | |
347 | pattern='/{repo_name:.*?[^/]}/rawfile/{commit_id}/{f_path:.*}', |
|
347 | pattern='/{repo_name:.*?[^/]}/rawfile/{commit_id}/{f_path:.*}', | |
348 | repo_route=True) |
|
348 | repo_route=True) | |
349 | config.add_view( |
|
349 | config.add_view( | |
350 | RepoFilesView, |
|
350 | RepoFilesView, | |
351 | attr='repo_file_download', |
|
351 | attr='repo_file_download', | |
352 | route_name='repo_file_download:legacy', request_method='GET', |
|
352 | route_name='repo_file_download:legacy', request_method='GET', | |
353 | renderer=None) |
|
353 | renderer=None) | |
354 |
|
354 | |||
355 | config.add_route( |
|
355 | config.add_route( | |
356 | name='repo_file_history', |
|
356 | name='repo_file_history', | |
357 | pattern='/{repo_name:.*?[^/]}/history/{commit_id}/{f_path:.*}', repo_route=True) |
|
357 | pattern='/{repo_name:.*?[^/]}/history/{commit_id}/{f_path:.*}', repo_route=True) | |
358 | config.add_view( |
|
358 | config.add_view( | |
359 | RepoFilesView, |
|
359 | RepoFilesView, | |
360 | attr='repo_file_history', |
|
360 | attr='repo_file_history', | |
361 | route_name='repo_file_history', request_method='GET', |
|
361 | route_name='repo_file_history', request_method='GET', | |
362 | renderer='json_ext') |
|
362 | renderer='json_ext') | |
363 |
|
363 | |||
364 | config.add_route( |
|
364 | config.add_route( | |
365 | name='repo_file_authors', |
|
365 | name='repo_file_authors', | |
366 | pattern='/{repo_name:.*?[^/]}/authors/{commit_id}/{f_path:.*}', repo_route=True) |
|
366 | pattern='/{repo_name:.*?[^/]}/authors/{commit_id}/{f_path:.*}', repo_route=True) | |
367 | config.add_view( |
|
367 | config.add_view( | |
368 | RepoFilesView, |
|
368 | RepoFilesView, | |
369 | attr='repo_file_authors', |
|
369 | attr='repo_file_authors', | |
370 | route_name='repo_file_authors', request_method='GET', |
|
370 | route_name='repo_file_authors', request_method='GET', | |
371 | renderer='rhodecode:templates/files/file_authors_box.mako') |
|
371 | renderer='rhodecode:templates/files/file_authors_box.mako') | |
372 |
|
372 | |||
373 | config.add_route( |
|
373 | config.add_route( | |
374 | name='repo_files_check_head', |
|
374 | name='repo_files_check_head', | |
375 | pattern='/{repo_name:.*?[^/]}/check_head/{commit_id}/{f_path:.*}', |
|
375 | pattern='/{repo_name:.*?[^/]}/check_head/{commit_id}/{f_path:.*}', | |
376 | repo_route=True) |
|
376 | repo_route=True) | |
377 | config.add_view( |
|
377 | config.add_view( | |
378 | RepoFilesView, |
|
378 | RepoFilesView, | |
379 | attr='repo_files_check_head', |
|
379 | attr='repo_files_check_head', | |
380 | route_name='repo_files_check_head', request_method='POST', |
|
380 | route_name='repo_files_check_head', request_method='POST', | |
381 | renderer='json_ext', xhr=True) |
|
381 | renderer='json_ext', xhr=True) | |
382 |
|
382 | |||
383 | config.add_route( |
|
383 | config.add_route( | |
384 | name='repo_files_remove_file', |
|
384 | name='repo_files_remove_file', | |
385 | pattern='/{repo_name:.*?[^/]}/remove_file/{commit_id}/{f_path:.*}', |
|
385 | pattern='/{repo_name:.*?[^/]}/remove_file/{commit_id}/{f_path:.*}', | |
386 | repo_route=True) |
|
386 | repo_route=True) | |
387 | config.add_view( |
|
387 | config.add_view( | |
388 | RepoFilesView, |
|
388 | RepoFilesView, | |
389 | attr='repo_files_remove_file', |
|
389 | attr='repo_files_remove_file', | |
390 | route_name='repo_files_remove_file', request_method='GET', |
|
390 | route_name='repo_files_remove_file', request_method='GET', | |
391 | renderer='rhodecode:templates/files/files_delete.mako') |
|
391 | renderer='rhodecode:templates/files/files_delete.mako') | |
392 |
|
392 | |||
393 | config.add_route( |
|
393 | config.add_route( | |
394 | name='repo_files_delete_file', |
|
394 | name='repo_files_delete_file', | |
395 | pattern='/{repo_name:.*?[^/]}/delete_file/{commit_id}/{f_path:.*}', |
|
395 | pattern='/{repo_name:.*?[^/]}/delete_file/{commit_id}/{f_path:.*}', | |
396 | repo_route=True) |
|
396 | repo_route=True) | |
397 | config.add_view( |
|
397 | config.add_view( | |
398 | RepoFilesView, |
|
398 | RepoFilesView, | |
399 | attr='repo_files_delete_file', |
|
399 | attr='repo_files_delete_file', | |
400 | route_name='repo_files_delete_file', request_method='POST', |
|
400 | route_name='repo_files_delete_file', request_method='POST', | |
401 | renderer=None) |
|
401 | renderer=None) | |
402 |
|
402 | |||
403 | config.add_route( |
|
403 | config.add_route( | |
404 | name='repo_files_edit_file', |
|
404 | name='repo_files_edit_file', | |
405 | pattern='/{repo_name:.*?[^/]}/edit_file/{commit_id}/{f_path:.*}', |
|
405 | pattern='/{repo_name:.*?[^/]}/edit_file/{commit_id}/{f_path:.*}', | |
406 | repo_route=True) |
|
406 | repo_route=True) | |
407 | config.add_view( |
|
407 | config.add_view( | |
408 | RepoFilesView, |
|
408 | RepoFilesView, | |
409 | attr='repo_files_edit_file', |
|
409 | attr='repo_files_edit_file', | |
410 | route_name='repo_files_edit_file', request_method='GET', |
|
410 | route_name='repo_files_edit_file', request_method='GET', | |
411 | renderer='rhodecode:templates/files/files_edit.mako') |
|
411 | renderer='rhodecode:templates/files/files_edit.mako') | |
412 |
|
412 | |||
413 | config.add_route( |
|
413 | config.add_route( | |
414 | name='repo_files_update_file', |
|
414 | name='repo_files_update_file', | |
415 | pattern='/{repo_name:.*?[^/]}/update_file/{commit_id}/{f_path:.*}', |
|
415 | pattern='/{repo_name:.*?[^/]}/update_file/{commit_id}/{f_path:.*}', | |
416 | repo_route=True) |
|
416 | repo_route=True) | |
417 | config.add_view( |
|
417 | config.add_view( | |
418 | RepoFilesView, |
|
418 | RepoFilesView, | |
419 | attr='repo_files_update_file', |
|
419 | attr='repo_files_update_file', | |
420 | route_name='repo_files_update_file', request_method='POST', |
|
420 | route_name='repo_files_update_file', request_method='POST', | |
421 | renderer=None) |
|
421 | renderer=None) | |
422 |
|
422 | |||
423 | config.add_route( |
|
423 | config.add_route( | |
424 | name='repo_files_add_file', |
|
424 | name='repo_files_add_file', | |
425 | pattern='/{repo_name:.*?[^/]}/add_file/{commit_id}/{f_path:.*}', |
|
425 | pattern='/{repo_name:.*?[^/]}/add_file/{commit_id}/{f_path:.*}', | |
426 | repo_route=True) |
|
426 | repo_route=True) | |
427 | config.add_view( |
|
427 | config.add_view( | |
428 | RepoFilesView, |
|
428 | RepoFilesView, | |
429 | attr='repo_files_add_file', |
|
429 | attr='repo_files_add_file', | |
430 | route_name='repo_files_add_file', request_method='GET', |
|
430 | route_name='repo_files_add_file', request_method='GET', | |
431 | renderer='rhodecode:templates/files/files_add.mako') |
|
431 | renderer='rhodecode:templates/files/files_add.mako') | |
432 |
|
432 | |||
433 | config.add_route( |
|
433 | config.add_route( | |
434 | name='repo_files_upload_file', |
|
434 | name='repo_files_upload_file', | |
435 | pattern='/{repo_name:.*?[^/]}/upload_file/{commit_id}/{f_path:.*}', |
|
435 | pattern='/{repo_name:.*?[^/]}/upload_file/{commit_id}/{f_path:.*}', | |
436 | repo_route=True) |
|
436 | repo_route=True) | |
437 | config.add_view( |
|
437 | config.add_view( | |
438 | RepoFilesView, |
|
438 | RepoFilesView, | |
439 | attr='repo_files_add_file', |
|
439 | attr='repo_files_add_file', | |
440 | route_name='repo_files_upload_file', request_method='GET', |
|
440 | route_name='repo_files_upload_file', request_method='GET', | |
441 | renderer='rhodecode:templates/files/files_upload.mako') |
|
441 | renderer='rhodecode:templates/files/files_upload.mako') | |
442 | config.add_view( # POST creates |
|
442 | config.add_view( # POST creates | |
443 | RepoFilesView, |
|
443 | RepoFilesView, | |
444 | attr='repo_files_upload_file', |
|
444 | attr='repo_files_upload_file', | |
445 | route_name='repo_files_upload_file', request_method='POST', |
|
445 | route_name='repo_files_upload_file', request_method='POST', | |
446 | renderer='json_ext') |
|
446 | renderer='json_ext') | |
447 |
|
447 | |||
448 | config.add_route( |
|
448 | config.add_route( | |
449 | name='repo_files_create_file', |
|
449 | name='repo_files_create_file', | |
450 | pattern='/{repo_name:.*?[^/]}/create_file/{commit_id}/{f_path:.*}', |
|
450 | pattern='/{repo_name:.*?[^/]}/create_file/{commit_id}/{f_path:.*}', | |
451 | repo_route=True) |
|
451 | repo_route=True) | |
452 | config.add_view( # POST creates |
|
452 | config.add_view( # POST creates | |
453 | RepoFilesView, |
|
453 | RepoFilesView, | |
454 | attr='repo_files_create_file', |
|
454 | attr='repo_files_create_file', | |
455 | route_name='repo_files_create_file', request_method='POST', |
|
455 | route_name='repo_files_create_file', request_method='POST', | |
456 | renderer=None) |
|
456 | renderer=None) | |
457 |
|
457 | |||
458 | # Refs data |
|
458 | # Refs data | |
459 | config.add_route( |
|
459 | config.add_route( | |
460 | name='repo_refs_data', |
|
460 | name='repo_refs_data', | |
461 | pattern='/{repo_name:.*?[^/]}/refs-data', repo_route=True) |
|
461 | pattern='/{repo_name:.*?[^/]}/refs-data', repo_route=True) | |
462 | config.add_view( |
|
462 | config.add_view( | |
463 | RepoSummaryView, |
|
463 | RepoSummaryView, | |
464 | attr='repo_refs_data', |
|
464 | attr='repo_refs_data', | |
465 | route_name='repo_refs_data', request_method='GET', |
|
465 | route_name='repo_refs_data', request_method='GET', | |
466 | renderer='json_ext') |
|
466 | renderer='json_ext') | |
467 |
|
467 | |||
468 | config.add_route( |
|
468 | config.add_route( | |
469 | name='repo_refs_changelog_data', |
|
469 | name='repo_refs_changelog_data', | |
470 | pattern='/{repo_name:.*?[^/]}/refs-data-changelog', repo_route=True) |
|
470 | pattern='/{repo_name:.*?[^/]}/refs-data-changelog', repo_route=True) | |
471 | config.add_view( |
|
471 | config.add_view( | |
472 | RepoSummaryView, |
|
472 | RepoSummaryView, | |
473 | attr='repo_refs_changelog_data', |
|
473 | attr='repo_refs_changelog_data', | |
474 | route_name='repo_refs_changelog_data', request_method='GET', |
|
474 | route_name='repo_refs_changelog_data', request_method='GET', | |
475 | renderer='json_ext') |
|
475 | renderer='json_ext') | |
476 |
|
476 | |||
477 | config.add_route( |
|
477 | config.add_route( | |
478 | name='repo_stats', |
|
478 | name='repo_stats', | |
479 | pattern='/{repo_name:.*?[^/]}/repo_stats/{commit_id}', repo_route=True) |
|
479 | pattern='/{repo_name:.*?[^/]}/repo_stats/{commit_id}', repo_route=True) | |
480 | config.add_view( |
|
480 | config.add_view( | |
481 | RepoSummaryView, |
|
481 | RepoSummaryView, | |
482 | attr='repo_stats', |
|
482 | attr='repo_stats', | |
483 | route_name='repo_stats', request_method='GET', |
|
483 | route_name='repo_stats', request_method='GET', | |
484 | renderer='json_ext') |
|
484 | renderer='json_ext') | |
485 |
|
485 | |||
486 | # Commits |
|
486 | # Commits | |
487 | config.add_route( |
|
487 | config.add_route( | |
488 | name='repo_commits', |
|
488 | name='repo_commits', | |
489 | pattern='/{repo_name:.*?[^/]}/commits', repo_route=True) |
|
489 | pattern='/{repo_name:.*?[^/]}/commits', repo_route=True) | |
490 | config.add_view( |
|
490 | config.add_view( | |
491 | RepoChangelogView, |
|
491 | RepoChangelogView, | |
492 | attr='repo_changelog', |
|
492 | attr='repo_changelog', | |
493 | route_name='repo_commits', request_method='GET', |
|
493 | route_name='repo_commits', request_method='GET', | |
494 | renderer='rhodecode:templates/commits/changelog.mako') |
|
494 | renderer='rhodecode:templates/commits/changelog.mako') | |
495 | # old routes for backward compat |
|
495 | # old routes for backward compat | |
496 | config.add_view( |
|
496 | config.add_view( | |
497 | RepoChangelogView, |
|
497 | RepoChangelogView, | |
498 | attr='repo_changelog', |
|
498 | attr='repo_changelog', | |
499 | route_name='repo_changelog', request_method='GET', |
|
499 | route_name='repo_changelog', request_method='GET', | |
500 | renderer='rhodecode:templates/commits/changelog.mako') |
|
500 | renderer='rhodecode:templates/commits/changelog.mako') | |
501 |
|
501 | |||
502 | config.add_route( |
|
502 | config.add_route( | |
503 | name='repo_commits_elements', |
|
503 | name='repo_commits_elements', | |
504 | pattern='/{repo_name:.*?[^/]}/commits_elements', repo_route=True) |
|
504 | pattern='/{repo_name:.*?[^/]}/commits_elements', repo_route=True) | |
505 | config.add_view( |
|
505 | config.add_view( | |
506 | RepoChangelogView, |
|
506 | RepoChangelogView, | |
507 | attr='repo_commits_elements', |
|
507 | attr='repo_commits_elements', | |
508 | route_name='repo_commits_elements', request_method=('GET', 'POST'), |
|
508 | route_name='repo_commits_elements', request_method=('GET', 'POST'), | |
509 | renderer='rhodecode:templates/commits/changelog_elements.mako', |
|
509 | renderer='rhodecode:templates/commits/changelog_elements.mako', | |
510 | xhr=True) |
|
510 | xhr=True) | |
511 |
|
511 | |||
512 | config.add_route( |
|
512 | config.add_route( | |
513 | name='repo_commits_elements_file', |
|
513 | name='repo_commits_elements_file', | |
514 | pattern='/{repo_name:.*?[^/]}/commits_elements/{commit_id}/{f_path:.*}', repo_route=True) |
|
514 | pattern='/{repo_name:.*?[^/]}/commits_elements/{commit_id}/{f_path:.*}', repo_route=True) | |
515 | config.add_view( |
|
515 | config.add_view( | |
516 | RepoChangelogView, |
|
516 | RepoChangelogView, | |
517 | attr='repo_commits_elements', |
|
517 | attr='repo_commits_elements', | |
518 | route_name='repo_commits_elements_file', request_method=('GET', 'POST'), |
|
518 | route_name='repo_commits_elements_file', request_method=('GET', 'POST'), | |
519 | renderer='rhodecode:templates/commits/changelog_elements.mako', |
|
519 | renderer='rhodecode:templates/commits/changelog_elements.mako', | |
520 | xhr=True) |
|
520 | xhr=True) | |
521 |
|
521 | |||
522 | config.add_route( |
|
522 | config.add_route( | |
523 | name='repo_commits_file', |
|
523 | name='repo_commits_file', | |
524 | pattern='/{repo_name:.*?[^/]}/commits/{commit_id}/{f_path:.*}', repo_route=True) |
|
524 | pattern='/{repo_name:.*?[^/]}/commits/{commit_id}/{f_path:.*}', repo_route=True) | |
525 | config.add_view( |
|
525 | config.add_view( | |
526 | RepoChangelogView, |
|
526 | RepoChangelogView, | |
527 | attr='repo_changelog', |
|
527 | attr='repo_changelog', | |
528 | route_name='repo_commits_file', request_method='GET', |
|
528 | route_name='repo_commits_file', request_method='GET', | |
529 | renderer='rhodecode:templates/commits/changelog.mako') |
|
529 | renderer='rhodecode:templates/commits/changelog.mako') | |
530 | # old routes for backward compat |
|
530 | # old routes for backward compat | |
531 | config.add_view( |
|
531 | config.add_view( | |
532 | RepoChangelogView, |
|
532 | RepoChangelogView, | |
533 | attr='repo_changelog', |
|
533 | attr='repo_changelog', | |
534 | route_name='repo_changelog_file', request_method='GET', |
|
534 | route_name='repo_changelog_file', request_method='GET', | |
535 | renderer='rhodecode:templates/commits/changelog.mako') |
|
535 | renderer='rhodecode:templates/commits/changelog.mako') | |
536 |
|
536 | |||
537 | # Changelog (old deprecated name for commits page) |
|
537 | # Changelog (old deprecated name for commits page) | |
538 | config.add_route( |
|
538 | config.add_route( | |
539 | name='repo_changelog', |
|
539 | name='repo_changelog', | |
540 | pattern='/{repo_name:.*?[^/]}/changelog', repo_route=True) |
|
540 | pattern='/{repo_name:.*?[^/]}/changelog', repo_route=True) | |
541 | config.add_route( |
|
541 | config.add_route( | |
542 | name='repo_changelog_file', |
|
542 | name='repo_changelog_file', | |
543 | pattern='/{repo_name:.*?[^/]}/changelog/{commit_id}/{f_path:.*}', repo_route=True) |
|
543 | pattern='/{repo_name:.*?[^/]}/changelog/{commit_id}/{f_path:.*}', repo_route=True) | |
544 |
|
544 | |||
545 | # Compare |
|
545 | # Compare | |
546 | config.add_route( |
|
546 | config.add_route( | |
547 | name='repo_compare_select', |
|
547 | name='repo_compare_select', | |
548 | pattern='/{repo_name:.*?[^/]}/compare', repo_route=True) |
|
548 | pattern='/{repo_name:.*?[^/]}/compare', repo_route=True) | |
549 | config.add_view( |
|
549 | config.add_view( | |
550 | RepoCompareView, |
|
550 | RepoCompareView, | |
551 | attr='compare_select', |
|
551 | attr='compare_select', | |
552 | route_name='repo_compare_select', request_method='GET', |
|
552 | route_name='repo_compare_select', request_method='GET', | |
553 | renderer='rhodecode:templates/compare/compare_diff.mako') |
|
553 | renderer='rhodecode:templates/compare/compare_diff.mako') | |
554 |
|
554 | |||
555 | config.add_route( |
|
555 | config.add_route( | |
556 | name='repo_compare', |
|
556 | name='repo_compare', | |
557 | pattern='/{repo_name:.*?[^/]}/compare/{source_ref_type}@{source_ref:.*?}...{target_ref_type}@{target_ref:.*?}', repo_route=True) |
|
557 | pattern='/{repo_name:.*?[^/]}/compare/{source_ref_type}@{source_ref:.*?}...{target_ref_type}@{target_ref:.*?}', repo_route=True) | |
558 | config.add_view( |
|
558 | config.add_view( | |
559 | RepoCompareView, |
|
559 | RepoCompareView, | |
560 | attr='compare', |
|
560 | attr='compare', | |
561 | route_name='repo_compare', request_method='GET', |
|
561 | route_name='repo_compare', request_method='GET', | |
562 | renderer=None) |
|
562 | renderer=None) | |
563 |
|
563 | |||
564 | # Tags |
|
564 | # Tags | |
565 | config.add_route( |
|
565 | config.add_route( | |
566 | name='tags_home', |
|
566 | name='tags_home', | |
567 | pattern='/{repo_name:.*?[^/]}/tags', repo_route=True) |
|
567 | pattern='/{repo_name:.*?[^/]}/tags', repo_route=True) | |
568 | config.add_view( |
|
568 | config.add_view( | |
569 | RepoTagsView, |
|
569 | RepoTagsView, | |
570 | attr='tags', |
|
570 | attr='tags', | |
571 | route_name='tags_home', request_method='GET', |
|
571 | route_name='tags_home', request_method='GET', | |
572 | renderer='rhodecode:templates/tags/tags.mako') |
|
572 | renderer='rhodecode:templates/tags/tags.mako') | |
573 |
|
573 | |||
574 | # Branches |
|
574 | # Branches | |
575 | config.add_route( |
|
575 | config.add_route( | |
576 | name='branches_home', |
|
576 | name='branches_home', | |
577 | pattern='/{repo_name:.*?[^/]}/branches', repo_route=True) |
|
577 | pattern='/{repo_name:.*?[^/]}/branches', repo_route=True) | |
578 | config.add_view( |
|
578 | config.add_view( | |
579 | RepoBranchesView, |
|
579 | RepoBranchesView, | |
580 | attr='branches', |
|
580 | attr='branches', | |
581 | route_name='branches_home', request_method='GET', |
|
581 | route_name='branches_home', request_method='GET', | |
582 | renderer='rhodecode:templates/branches/branches.mako') |
|
582 | renderer='rhodecode:templates/branches/branches.mako') | |
583 |
|
583 | |||
584 | # Bookmarks |
|
584 | # Bookmarks | |
585 | config.add_route( |
|
585 | config.add_route( | |
586 | name='bookmarks_home', |
|
586 | name='bookmarks_home', | |
587 | pattern='/{repo_name:.*?[^/]}/bookmarks', repo_route=True) |
|
587 | pattern='/{repo_name:.*?[^/]}/bookmarks', repo_route=True) | |
588 | config.add_view( |
|
588 | config.add_view( | |
589 | RepoBookmarksView, |
|
589 | RepoBookmarksView, | |
590 | attr='bookmarks', |
|
590 | attr='bookmarks', | |
591 | route_name='bookmarks_home', request_method='GET', |
|
591 | route_name='bookmarks_home', request_method='GET', | |
592 | renderer='rhodecode:templates/bookmarks/bookmarks.mako') |
|
592 | renderer='rhodecode:templates/bookmarks/bookmarks.mako') | |
593 |
|
593 | |||
594 | # Forks |
|
594 | # Forks | |
595 | config.add_route( |
|
595 | config.add_route( | |
596 | name='repo_fork_new', |
|
596 | name='repo_fork_new', | |
597 | pattern='/{repo_name:.*?[^/]}/fork', repo_route=True, |
|
597 | pattern='/{repo_name:.*?[^/]}/fork', repo_route=True, | |
598 | repo_forbid_when_archived=True, |
|
598 | repo_forbid_when_archived=True, | |
599 | repo_accepted_types=['hg', 'git']) |
|
599 | repo_accepted_types=['hg', 'git']) | |
600 | config.add_view( |
|
600 | config.add_view( | |
601 | RepoForksView, |
|
601 | RepoForksView, | |
602 | attr='repo_fork_new', |
|
602 | attr='repo_fork_new', | |
603 | route_name='repo_fork_new', request_method='GET', |
|
603 | route_name='repo_fork_new', request_method='GET', | |
604 | renderer='rhodecode:templates/forks/forks.mako') |
|
604 | renderer='rhodecode:templates/forks/forks.mako') | |
605 |
|
605 | |||
606 | config.add_route( |
|
606 | config.add_route( | |
607 | name='repo_fork_create', |
|
607 | name='repo_fork_create', | |
608 | pattern='/{repo_name:.*?[^/]}/fork/create', repo_route=True, |
|
608 | pattern='/{repo_name:.*?[^/]}/fork/create', repo_route=True, | |
609 | repo_forbid_when_archived=True, |
|
609 | repo_forbid_when_archived=True, | |
610 | repo_accepted_types=['hg', 'git']) |
|
610 | repo_accepted_types=['hg', 'git']) | |
611 | config.add_view( |
|
611 | config.add_view( | |
612 | RepoForksView, |
|
612 | RepoForksView, | |
613 | attr='repo_fork_create', |
|
613 | attr='repo_fork_create', | |
614 | route_name='repo_fork_create', request_method='POST', |
|
614 | route_name='repo_fork_create', request_method='POST', | |
615 | renderer='rhodecode:templates/forks/fork.mako') |
|
615 | renderer='rhodecode:templates/forks/fork.mako') | |
616 |
|
616 | |||
617 | config.add_route( |
|
617 | config.add_route( | |
618 | name='repo_forks_show_all', |
|
618 | name='repo_forks_show_all', | |
619 | pattern='/{repo_name:.*?[^/]}/forks', repo_route=True, |
|
619 | pattern='/{repo_name:.*?[^/]}/forks', repo_route=True, | |
620 | repo_accepted_types=['hg', 'git']) |
|
620 | repo_accepted_types=['hg', 'git']) | |
621 | config.add_view( |
|
621 | config.add_view( | |
622 | RepoForksView, |
|
622 | RepoForksView, | |
623 | attr='repo_forks_show_all', |
|
623 | attr='repo_forks_show_all', | |
624 | route_name='repo_forks_show_all', request_method='GET', |
|
624 | route_name='repo_forks_show_all', request_method='GET', | |
625 | renderer='rhodecode:templates/forks/forks.mako') |
|
625 | renderer='rhodecode:templates/forks/forks.mako') | |
626 |
|
626 | |||
627 | config.add_route( |
|
627 | config.add_route( | |
628 | name='repo_forks_data', |
|
628 | name='repo_forks_data', | |
629 | pattern='/{repo_name:.*?[^/]}/forks/data', repo_route=True, |
|
629 | pattern='/{repo_name:.*?[^/]}/forks/data', repo_route=True, | |
630 | repo_accepted_types=['hg', 'git']) |
|
630 | repo_accepted_types=['hg', 'git']) | |
631 | config.add_view( |
|
631 | config.add_view( | |
632 | RepoForksView, |
|
632 | RepoForksView, | |
633 | attr='repo_forks_data', |
|
633 | attr='repo_forks_data', | |
634 | route_name='repo_forks_data', request_method='GET', |
|
634 | route_name='repo_forks_data', request_method='GET', | |
635 | renderer='json_ext', xhr=True) |
|
635 | renderer='json_ext', xhr=True) | |
636 |
|
636 | |||
637 | # Pull Requests |
|
637 | # Pull Requests | |
638 | config.add_route( |
|
638 | config.add_route( | |
639 | name='pullrequest_show', |
|
639 | name='pullrequest_show', | |
640 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}', |
|
640 | pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}', | |
641 | repo_route=True) |
|
641 | repo_route=True) | |
642 | config.add_view( |
|
642 | config.add_view( | |
643 | RepoPullRequestsView, |
|
643 | RepoPullRequestsView, | |
644 | attr='pull_request_show', |
|
644 | attr='pull_request_show', | |
645 | route_name='pullrequest_show', request_method='GET', |
|
645 | route_name='pullrequest_show', request_method='GET', | |
646 | renderer='rhodecode:templates/pullrequests/pullrequest_show.mako') |
|
646 | renderer='rhodecode:templates/pullrequests/pullrequest_show.mako') | |
647 |
|
647 | |||
648 | config.add_route( |
|
648 | config.add_route( | |
649 | name='pullrequest_show_all', |
|
649 | name='pullrequest_show_all', | |
650 | pattern='/{repo_name:.*?[^/]}/pull-request', |
|
650 | pattern='/{repo_name:.*?[^/]}/pull-request', | |
651 | repo_route=True, repo_accepted_types=['hg', 'git']) |
|
651 | repo_route=True, repo_accepted_types=['hg', 'git']) | |
652 | config.add_view( |
|
652 | config.add_view( | |
653 | RepoPullRequestsView, |
|
653 | RepoPullRequestsView, | |
654 | attr='pull_request_list', |
|
654 | attr='pull_request_list', | |
655 | route_name='pullrequest_show_all', request_method='GET', |
|
655 | route_name='pullrequest_show_all', request_method='GET', | |
656 | renderer='rhodecode:templates/pullrequests/pullrequests.mako') |
|
656 | renderer='rhodecode:templates/pullrequests/pullrequests.mako') | |
657 |
|
657 | |||
658 | config.add_route( |
|
658 | config.add_route( | |
659 | name='pullrequest_show_all_data', |
|
659 | name='pullrequest_show_all_data', | |
660 | pattern='/{repo_name:.*?[^/]}/pull-request-data', |
|
660 | pattern='/{repo_name:.*?[^/]}/pull-request-data', | |
661 | repo_route=True, repo_accepted_types=['hg', 'git']) |
|
661 | repo_route=True, repo_accepted_types=['hg', 'git']) | |
662 | config.add_view( |
|
662 | config.add_view( | |
663 | RepoPullRequestsView, |
|
663 | RepoPullRequestsView, | |
664 | attr='pull_request_list_data', |
|
664 | attr='pull_request_list_data', | |
665 | route_name='pullrequest_show_all_data', request_method='GET', |
|
665 | route_name='pullrequest_show_all_data', request_method='GET', | |
666 | renderer='json_ext', xhr=True) |
|
666 | renderer='json_ext', xhr=True) | |
667 |
|
667 | |||
668 | config.add_route( |
|
668 | config.add_route( | |
669 | name='pullrequest_repo_refs', |
|
669 | name='pullrequest_repo_refs', | |
670 | pattern='/{repo_name:.*?[^/]}/pull-request/refs/{target_repo_name:.*?[^/]}', |
|
670 | pattern='/{repo_name:.*?[^/]}/pull-request/refs/{target_repo_name:.*?[^/]}', | |
671 | repo_route=True) |
|
671 | repo_route=True) | |
672 | config.add_view( |
|
672 | config.add_view( | |
673 | RepoPullRequestsView, |
|
673 | RepoPullRequestsView, | |
674 | attr='pull_request_repo_refs', |
|
674 | attr='pull_request_repo_refs', | |
675 | route_name='pullrequest_repo_refs', request_method='GET', |
|
675 | route_name='pullrequest_repo_refs', request_method='GET', | |
676 | renderer='json_ext', xhr=True) |
|
676 | renderer='json_ext', xhr=True) | |
677 |
|
677 | |||
678 | config.add_route( |
|
678 | config.add_route( | |
679 | name='pullrequest_repo_targets', |
|
679 | name='pullrequest_repo_targets', | |
680 | pattern='/{repo_name:.*?[^/]}/pull-request/repo-targets', |
|
680 | pattern='/{repo_name:.*?[^/]}/pull-request/repo-targets', | |
681 | repo_route=True) |
|
681 | repo_route=True) | |
682 | config.add_view( |
|
682 | config.add_view( | |
683 | RepoPullRequestsView, |
|
683 | RepoPullRequestsView, | |
684 | attr='pullrequest_repo_targets', |
|
684 | attr='pullrequest_repo_targets', | |
685 | route_name='pullrequest_repo_targets', request_method='GET', |
|
685 | route_name='pullrequest_repo_targets', request_method='GET', | |
686 | renderer='json_ext', xhr=True) |
|
686 | renderer='json_ext', xhr=True) | |
687 |
|
687 | |||
688 | config.add_route( |
|
688 | config.add_route( | |
689 | name='pullrequest_new', |
|
689 | name='pullrequest_new', | |
690 | pattern='/{repo_name:.*?[^/]}/pull-request/new', |
|
690 | pattern='/{repo_name:.*?[^/]}/pull-request/new', | |
691 | repo_route=True, repo_accepted_types=['hg', 'git'], |
|
691 | repo_route=True, repo_accepted_types=['hg', 'git'], | |
692 | repo_forbid_when_archived=True) |
|
692 | repo_forbid_when_archived=True) | |
693 | config.add_view( |
|
693 | config.add_view( | |
694 | RepoPullRequestsView, |
|
694 | RepoPullRequestsView, | |
695 | attr='pull_request_new', |
|
695 | attr='pull_request_new', | |
696 | route_name='pullrequest_new', request_method='GET', |
|
696 | route_name='pullrequest_new', request_method='GET', | |
697 | renderer='rhodecode:templates/pullrequests/pullrequest.mako') |
|
697 | renderer='rhodecode:templates/pullrequests/pullrequest.mako') | |
698 |
|
698 | |||
699 | config.add_route( |
|
699 | config.add_route( | |
700 | name='pullrequest_create', |
|
700 | name='pullrequest_create', | |
701 | pattern='/{repo_name:.*?[^/]}/pull-request/create', |
|
701 | pattern='/{repo_name:.*?[^/]}/pull-request/create', | |
702 | repo_route=True, repo_accepted_types=['hg', 'git'], |
|
702 | repo_route=True, repo_accepted_types=['hg', 'git'], | |
703 | repo_forbid_when_archived=True) |
|
703 | repo_forbid_when_archived=True) | |
704 | config.add_view( |
|
704 | config.add_view( | |
705 | RepoPullRequestsView, |
|
705 | RepoPullRequestsView, | |
706 | attr='pull_request_create', |
|
706 | attr='pull_request_create', | |
707 | route_name='pullrequest_create', request_method='POST', |
|
707 | route_name='pullrequest_create', request_method='POST', | |
708 | renderer=None) |
|
708 | renderer=None) | |
709 |
|
709 | |||
710 | config.add_route( |
|
710 | config.add_route( | |
711 | name='pullrequest_update', |
|
711 | name='pullrequest_update', | |
712 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update', |
|
712 | pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update', | |
713 | repo_route=True, repo_forbid_when_archived=True) |
|
713 | repo_route=True, repo_forbid_when_archived=True) | |
714 | config.add_view( |
|
714 | config.add_view( | |
715 | RepoPullRequestsView, |
|
715 | RepoPullRequestsView, | |
716 | attr='pull_request_update', |
|
716 | attr='pull_request_update', | |
717 | route_name='pullrequest_update', request_method='POST', |
|
717 | route_name='pullrequest_update', request_method='POST', | |
718 | renderer='json_ext') |
|
718 | renderer='json_ext') | |
719 |
|
719 | |||
720 | config.add_route( |
|
720 | config.add_route( | |
721 | name='pullrequest_merge', |
|
721 | name='pullrequest_merge', | |
722 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge', |
|
722 | pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge', | |
723 | repo_route=True, repo_forbid_when_archived=True) |
|
723 | repo_route=True, repo_forbid_when_archived=True) | |
724 | config.add_view( |
|
724 | config.add_view( | |
725 | RepoPullRequestsView, |
|
725 | RepoPullRequestsView, | |
726 | attr='pull_request_merge', |
|
726 | attr='pull_request_merge', | |
727 | route_name='pullrequest_merge', request_method='POST', |
|
727 | route_name='pullrequest_merge', request_method='POST', | |
728 | renderer='json_ext') |
|
728 | renderer='json_ext') | |
729 |
|
729 | |||
730 | config.add_route( |
|
730 | config.add_route( | |
731 | name='pullrequest_delete', |
|
731 | name='pullrequest_delete', | |
732 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete', |
|
732 | pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete', | |
733 | repo_route=True, repo_forbid_when_archived=True) |
|
733 | repo_route=True, repo_forbid_when_archived=True) | |
734 | config.add_view( |
|
734 | config.add_view( | |
735 | RepoPullRequestsView, |
|
735 | RepoPullRequestsView, | |
736 | attr='pull_request_delete', |
|
736 | attr='pull_request_delete', | |
737 | route_name='pullrequest_delete', request_method='POST', |
|
737 | route_name='pullrequest_delete', request_method='POST', | |
738 | renderer='json_ext') |
|
738 | renderer='json_ext') | |
739 |
|
739 | |||
740 | config.add_route( |
|
740 | config.add_route( | |
741 | name='pullrequest_comment_create', |
|
741 | name='pullrequest_comment_create', | |
742 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment', |
|
742 | pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment', | |
743 | repo_route=True) |
|
743 | repo_route=True) | |
744 | config.add_view( |
|
744 | config.add_view( | |
745 | RepoPullRequestsView, |
|
745 | RepoPullRequestsView, | |
746 | attr='pull_request_comment_create', |
|
746 | attr='pull_request_comment_create', | |
747 | route_name='pullrequest_comment_create', request_method='POST', |
|
747 | route_name='pullrequest_comment_create', request_method='POST', | |
748 | renderer='json_ext') |
|
748 | renderer='json_ext') | |
749 |
|
749 | |||
750 | config.add_route( |
|
750 | config.add_route( | |
751 | name='pullrequest_comment_edit', |
|
751 | name='pullrequest_comment_edit', | |
752 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/edit', |
|
752 | pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/edit', | |
753 | repo_route=True, repo_accepted_types=['hg', 'git']) |
|
753 | repo_route=True, repo_accepted_types=['hg', 'git']) | |
754 | config.add_view( |
|
754 | config.add_view( | |
755 | RepoPullRequestsView, |
|
755 | RepoPullRequestsView, | |
756 | attr='pull_request_comment_edit', |
|
756 | attr='pull_request_comment_edit', | |
757 | route_name='pullrequest_comment_edit', request_method='POST', |
|
757 | route_name='pullrequest_comment_edit', request_method='POST', | |
758 | renderer='json_ext') |
|
758 | renderer='json_ext') | |
759 |
|
759 | |||
760 | config.add_route( |
|
760 | config.add_route( | |
761 | name='pullrequest_comment_delete', |
|
761 | name='pullrequest_comment_delete', | |
762 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete', |
|
762 | pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete', | |
763 | repo_route=True, repo_accepted_types=['hg', 'git']) |
|
763 | repo_route=True, repo_accepted_types=['hg', 'git']) | |
764 | config.add_view( |
|
764 | config.add_view( | |
765 | RepoPullRequestsView, |
|
765 | RepoPullRequestsView, | |
766 | attr='pull_request_comment_delete', |
|
766 | attr='pull_request_comment_delete', | |
767 | route_name='pullrequest_comment_delete', request_method='POST', |
|
767 | route_name='pullrequest_comment_delete', request_method='POST', | |
768 | renderer='json_ext') |
|
768 | renderer='json_ext') | |
769 |
|
769 | |||
770 | config.add_route( |
|
770 | config.add_route( | |
771 | name='pullrequest_comments', |
|
771 | name='pullrequest_comments', | |
772 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comments', |
|
772 | pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comments', | |
773 | repo_route=True) |
|
773 | repo_route=True) | |
774 | config.add_view( |
|
774 | config.add_view( | |
775 | RepoPullRequestsView, |
|
775 | RepoPullRequestsView, | |
776 | attr='pullrequest_comments', |
|
776 | attr='pullrequest_comments', | |
777 | route_name='pullrequest_comments', request_method='POST', |
|
777 | route_name='pullrequest_comments', request_method='POST', | |
778 | renderer='string_html', xhr=True) |
|
778 | renderer='string_html', xhr=True) | |
779 |
|
779 | |||
780 | config.add_route( |
|
780 | config.add_route( | |
781 | name='pullrequest_todos', |
|
781 | name='pullrequest_todos', | |
782 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/todos', |
|
782 | pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/todos', | |
783 | repo_route=True) |
|
783 | repo_route=True) | |
784 | config.add_view( |
|
784 | config.add_view( | |
785 | RepoPullRequestsView, |
|
785 | RepoPullRequestsView, | |
786 | attr='pullrequest_todos', |
|
786 | attr='pullrequest_todos', | |
787 | route_name='pullrequest_todos', request_method='POST', |
|
787 | route_name='pullrequest_todos', request_method='POST', | |
788 | renderer='string_html', xhr=True) |
|
788 | renderer='string_html', xhr=True) | |
789 |
|
789 | |||
790 | config.add_route( |
|
790 | config.add_route( | |
791 | name='pullrequest_drafts', |
|
791 | name='pullrequest_drafts', | |
792 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/drafts', |
|
792 | pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/drafts', | |
793 | repo_route=True) |
|
793 | repo_route=True) | |
794 | config.add_view( |
|
794 | config.add_view( | |
795 | RepoPullRequestsView, |
|
795 | RepoPullRequestsView, | |
796 | attr='pullrequest_drafts', |
|
796 | attr='pullrequest_drafts', | |
797 | route_name='pullrequest_drafts', request_method='POST', |
|
797 | route_name='pullrequest_drafts', request_method='POST', | |
798 | renderer='string_html', xhr=True) |
|
798 | renderer='string_html', xhr=True) | |
799 |
|
799 | |||
800 | # Artifacts, (EE feature) |
|
800 | # Artifacts, (EE feature) | |
801 | config.add_route( |
|
801 | config.add_route( | |
802 | name='repo_artifacts_list', |
|
802 | name='repo_artifacts_list', | |
803 | pattern='/{repo_name:.*?[^/]}/artifacts', repo_route=True) |
|
803 | pattern='/{repo_name:.*?[^/]}/artifacts', repo_route=True) | |
804 | config.add_view( |
|
804 | config.add_view( | |
805 | RepoArtifactsView, |
|
805 | RepoArtifactsView, | |
806 | attr='repo_artifacts', |
|
806 | attr='repo_artifacts', | |
807 | route_name='repo_artifacts_list', request_method='GET', |
|
807 | route_name='repo_artifacts_list', request_method='GET', | |
808 | renderer='rhodecode:templates/artifacts/artifact_list.mako') |
|
808 | renderer='rhodecode:templates/artifacts/artifact_list.mako') | |
809 |
|
809 | |||
810 | # Settings |
|
810 | # Settings | |
811 | config.add_route( |
|
811 | config.add_route( | |
812 | name='edit_repo', |
|
812 | name='edit_repo', | |
813 | pattern='/{repo_name:.*?[^/]}/settings', repo_route=True) |
|
813 | pattern='/{repo_name:.*?[^/]}/settings', repo_route=True) | |
814 | config.add_view( |
|
814 | config.add_view( | |
815 | RepoSettingsView, |
|
815 | RepoSettingsView, | |
816 | attr='edit_settings', |
|
816 | attr='edit_settings', | |
817 | route_name='edit_repo', request_method='GET', |
|
817 | route_name='edit_repo', request_method='GET', | |
818 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
818 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
819 | # update is POST on edit_repo |
|
819 | # update is POST on edit_repo | |
820 | config.add_view( |
|
820 | config.add_view( | |
821 | RepoSettingsView, |
|
821 | RepoSettingsView, | |
822 | attr='edit_settings_update', |
|
822 | attr='edit_settings_update', | |
823 | route_name='edit_repo', request_method='POST', |
|
823 | route_name='edit_repo', request_method='POST', | |
824 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
824 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
825 |
|
825 | |||
826 | # Settings advanced |
|
826 | # Settings advanced | |
827 | config.add_route( |
|
827 | config.add_route( | |
828 | name='edit_repo_advanced', |
|
828 | name='edit_repo_advanced', | |
829 | pattern='/{repo_name:.*?[^/]}/settings/advanced', repo_route=True) |
|
829 | pattern='/{repo_name:.*?[^/]}/settings/advanced', repo_route=True) | |
830 | config.add_view( |
|
830 | config.add_view( | |
831 | RepoSettingsAdvancedView, |
|
831 | RepoSettingsAdvancedView, | |
832 | attr='edit_advanced', |
|
832 | attr='edit_advanced', | |
833 | route_name='edit_repo_advanced', request_method='GET', |
|
833 | route_name='edit_repo_advanced', request_method='GET', | |
834 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
834 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
835 |
|
835 | |||
836 | config.add_route( |
|
836 | config.add_route( | |
837 | name='edit_repo_advanced_archive', |
|
837 | name='edit_repo_advanced_archive', | |
838 | pattern='/{repo_name:.*?[^/]}/settings/advanced/archive', repo_route=True) |
|
838 | pattern='/{repo_name:.*?[^/]}/settings/advanced/archive', repo_route=True) | |
839 | config.add_view( |
|
839 | config.add_view( | |
840 | RepoSettingsAdvancedView, |
|
840 | RepoSettingsAdvancedView, | |
841 | attr='edit_advanced_archive', |
|
841 | attr='edit_advanced_archive', | |
842 | route_name='edit_repo_advanced_archive', request_method='POST', |
|
842 | route_name='edit_repo_advanced_archive', request_method='POST', | |
843 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
843 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
844 |
|
844 | |||
845 | config.add_route( |
|
845 | config.add_route( | |
846 | name='edit_repo_advanced_delete', |
|
846 | name='edit_repo_advanced_delete', | |
847 | pattern='/{repo_name:.*?[^/]}/settings/advanced/delete', repo_route=True) |
|
847 | pattern='/{repo_name:.*?[^/]}/settings/advanced/delete', repo_route=True) | |
848 | config.add_view( |
|
848 | config.add_view( | |
849 | RepoSettingsAdvancedView, |
|
849 | RepoSettingsAdvancedView, | |
850 | attr='edit_advanced_delete', |
|
850 | attr='edit_advanced_delete', | |
851 | route_name='edit_repo_advanced_delete', request_method='POST', |
|
851 | route_name='edit_repo_advanced_delete', request_method='POST', | |
852 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
852 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
853 |
|
853 | |||
854 | config.add_route( |
|
854 | config.add_route( | |
855 | name='edit_repo_advanced_locking', |
|
855 | name='edit_repo_advanced_locking', | |
856 | pattern='/{repo_name:.*?[^/]}/settings/advanced/locking', repo_route=True) |
|
856 | pattern='/{repo_name:.*?[^/]}/settings/advanced/locking', repo_route=True) | |
857 | config.add_view( |
|
857 | config.add_view( | |
858 | RepoSettingsAdvancedView, |
|
858 | RepoSettingsAdvancedView, | |
859 | attr='edit_advanced_toggle_locking', |
|
859 | attr='edit_advanced_toggle_locking', | |
860 | route_name='edit_repo_advanced_locking', request_method='POST', |
|
860 | route_name='edit_repo_advanced_locking', request_method='POST', | |
861 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
861 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
862 |
|
862 | |||
863 | config.add_route( |
|
863 | config.add_route( | |
864 | name='edit_repo_advanced_journal', |
|
864 | name='edit_repo_advanced_journal', | |
865 | pattern='/{repo_name:.*?[^/]}/settings/advanced/journal', repo_route=True) |
|
865 | pattern='/{repo_name:.*?[^/]}/settings/advanced/journal', repo_route=True) | |
866 | config.add_view( |
|
866 | config.add_view( | |
867 | RepoSettingsAdvancedView, |
|
867 | RepoSettingsAdvancedView, | |
868 | attr='edit_advanced_journal', |
|
868 | attr='edit_advanced_journal', | |
869 | route_name='edit_repo_advanced_journal', request_method='POST', |
|
869 | route_name='edit_repo_advanced_journal', request_method='POST', | |
870 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
870 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
871 |
|
871 | |||
872 | config.add_route( |
|
872 | config.add_route( | |
873 | name='edit_repo_advanced_fork', |
|
873 | name='edit_repo_advanced_fork', | |
874 | pattern='/{repo_name:.*?[^/]}/settings/advanced/fork', repo_route=True) |
|
874 | pattern='/{repo_name:.*?[^/]}/settings/advanced/fork', repo_route=True) | |
875 | config.add_view( |
|
875 | config.add_view( | |
876 | RepoSettingsAdvancedView, |
|
876 | RepoSettingsAdvancedView, | |
877 | attr='edit_advanced_fork', |
|
877 | attr='edit_advanced_fork', | |
878 | route_name='edit_repo_advanced_fork', request_method='POST', |
|
878 | route_name='edit_repo_advanced_fork', request_method='POST', | |
879 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
879 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
880 |
|
880 | |||
881 | config.add_route( |
|
881 | config.add_route( | |
882 | name='edit_repo_advanced_hooks', |
|
882 | name='edit_repo_advanced_hooks', | |
883 | pattern='/{repo_name:.*?[^/]}/settings/advanced/hooks', repo_route=True) |
|
883 | pattern='/{repo_name:.*?[^/]}/settings/advanced/hooks', repo_route=True) | |
884 | config.add_view( |
|
884 | config.add_view( | |
885 | RepoSettingsAdvancedView, |
|
885 | RepoSettingsAdvancedView, | |
886 | attr='edit_advanced_install_hooks', |
|
886 | attr='edit_advanced_install_hooks', | |
887 | route_name='edit_repo_advanced_hooks', request_method='GET', |
|
887 | route_name='edit_repo_advanced_hooks', request_method='GET', | |
888 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
888 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
889 |
|
889 | |||
890 | # Caches |
|
890 | # Caches | |
891 | config.add_route( |
|
891 | config.add_route( | |
892 | name='edit_repo_caches', |
|
892 | name='edit_repo_caches', | |
893 | pattern='/{repo_name:.*?[^/]}/settings/caches', repo_route=True) |
|
893 | pattern='/{repo_name:.*?[^/]}/settings/caches', repo_route=True) | |
894 | config.add_view( |
|
894 | config.add_view( | |
895 | RepoCachesView, |
|
895 | RepoCachesView, | |
896 | attr='repo_caches', |
|
896 | attr='repo_caches', | |
897 | route_name='edit_repo_caches', request_method='GET', |
|
897 | route_name='edit_repo_caches', request_method='GET', | |
898 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
898 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
899 | config.add_view( |
|
899 | config.add_view( | |
900 | RepoCachesView, |
|
900 | RepoCachesView, | |
901 | attr='repo_caches_purge', |
|
901 | attr='repo_caches_purge', | |
902 | route_name='edit_repo_caches', request_method='POST') |
|
902 | route_name='edit_repo_caches', request_method='POST') | |
903 |
|
903 | |||
904 | # Permissions |
|
904 | # Permissions | |
905 | config.add_route( |
|
905 | config.add_route( | |
906 | name='edit_repo_perms', |
|
906 | name='edit_repo_perms', | |
907 | pattern='/{repo_name:.*?[^/]}/settings/permissions', repo_route=True) |
|
907 | pattern='/{repo_name:.*?[^/]}/settings/permissions', repo_route=True) | |
908 | config.add_view( |
|
908 | config.add_view( | |
909 | RepoSettingsPermissionsView, |
|
909 | RepoSettingsPermissionsView, | |
910 | attr='edit_permissions', |
|
910 | attr='edit_permissions', | |
911 | route_name='edit_repo_perms', request_method='GET', |
|
911 | route_name='edit_repo_perms', request_method='GET', | |
912 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
912 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
913 | config.add_view( |
|
913 | config.add_view( | |
914 | RepoSettingsPermissionsView, |
|
914 | RepoSettingsPermissionsView, | |
915 | attr='edit_permissions_update', |
|
915 | attr='edit_permissions_update', | |
916 | route_name='edit_repo_perms', request_method='POST', |
|
916 | route_name='edit_repo_perms', request_method='POST', | |
917 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
917 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
918 |
|
918 | |||
919 | config.add_route( |
|
919 | config.add_route( | |
920 | name='edit_repo_perms_set_private', |
|
920 | name='edit_repo_perms_set_private', | |
921 | pattern='/{repo_name:.*?[^/]}/settings/permissions/set_private', repo_route=True) |
|
921 | pattern='/{repo_name:.*?[^/]}/settings/permissions/set_private', repo_route=True) | |
922 | config.add_view( |
|
922 | config.add_view( | |
923 | RepoSettingsPermissionsView, |
|
923 | RepoSettingsPermissionsView, | |
924 | attr='edit_permissions_set_private_repo', |
|
924 | attr='edit_permissions_set_private_repo', | |
925 | route_name='edit_repo_perms_set_private', request_method='POST', |
|
925 | route_name='edit_repo_perms_set_private', request_method='POST', | |
926 | renderer='json_ext') |
|
926 | renderer='json_ext') | |
927 |
|
927 | |||
928 | # Permissions Branch (EE feature) |
|
928 | # Permissions Branch (EE feature) | |
929 | config.add_route( |
|
929 | config.add_route( | |
930 | name='edit_repo_perms_branch', |
|
930 | name='edit_repo_perms_branch', | |
931 | pattern='/{repo_name:.*?[^/]}/settings/branch_permissions', repo_route=True) |
|
931 | pattern='/{repo_name:.*?[^/]}/settings/branch_permissions', repo_route=True) | |
932 | config.add_view( |
|
932 | config.add_view( | |
933 | RepoSettingsBranchPermissionsView, |
|
933 | RepoSettingsBranchPermissionsView, | |
934 | attr='branch_permissions', |
|
934 | attr='branch_permissions', | |
935 | route_name='edit_repo_perms_branch', request_method='GET', |
|
935 | route_name='edit_repo_perms_branch', request_method='GET', | |
936 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
936 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
937 |
|
937 | |||
938 | config.add_route( |
|
938 | config.add_route( | |
939 | name='edit_repo_perms_branch_delete', |
|
939 | name='edit_repo_perms_branch_delete', | |
940 | pattern='/{repo_name:.*?[^/]}/settings/branch_permissions/{rule_id}/delete', |
|
940 | pattern='/{repo_name:.*?[^/]}/settings/branch_permissions/{rule_id}/delete', | |
941 | repo_route=True) |
|
941 | repo_route=True) | |
942 | ## Only implemented in EE |
|
942 | ## Only implemented in EE | |
943 |
|
943 | |||
944 | # Maintenance |
|
944 | # Maintenance | |
945 | config.add_route( |
|
945 | config.add_route( | |
946 | name='edit_repo_maintenance', |
|
946 | name='edit_repo_maintenance', | |
947 | pattern='/{repo_name:.*?[^/]}/settings/maintenance', repo_route=True) |
|
947 | pattern='/{repo_name:.*?[^/]}/settings/maintenance', repo_route=True) | |
948 | config.add_view( |
|
948 | config.add_view( | |
949 | RepoMaintenanceView, |
|
949 | RepoMaintenanceView, | |
950 | attr='repo_maintenance', |
|
950 | attr='repo_maintenance', | |
951 | route_name='edit_repo_maintenance', request_method='GET', |
|
951 | route_name='edit_repo_maintenance', request_method='GET', | |
952 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
952 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
953 |
|
953 | |||
954 | config.add_route( |
|
954 | config.add_route( | |
955 | name='edit_repo_maintenance_execute', |
|
955 | name='edit_repo_maintenance_execute', | |
956 | pattern='/{repo_name:.*?[^/]}/settings/maintenance/execute', repo_route=True) |
|
956 | pattern='/{repo_name:.*?[^/]}/settings/maintenance/execute', repo_route=True) | |
957 | config.add_view( |
|
957 | config.add_view( | |
958 | RepoMaintenanceView, |
|
958 | RepoMaintenanceView, | |
959 | attr='repo_maintenance_execute', |
|
959 | attr='repo_maintenance_execute', | |
960 | route_name='edit_repo_maintenance_execute', request_method='GET', |
|
960 | route_name='edit_repo_maintenance_execute', request_method='GET', | |
961 | renderer='json', xhr=True) |
|
961 | renderer='json', xhr=True) | |
962 |
|
962 | |||
963 | # Fields |
|
963 | # Fields | |
964 | config.add_route( |
|
964 | config.add_route( | |
965 | name='edit_repo_fields', |
|
965 | name='edit_repo_fields', | |
966 | pattern='/{repo_name:.*?[^/]}/settings/fields', repo_route=True) |
|
966 | pattern='/{repo_name:.*?[^/]}/settings/fields', repo_route=True) | |
967 | config.add_view( |
|
967 | config.add_view( | |
968 | RepoSettingsFieldsView, |
|
968 | RepoSettingsFieldsView, | |
969 | attr='repo_field_edit', |
|
969 | attr='repo_field_edit', | |
970 | route_name='edit_repo_fields', request_method='GET', |
|
970 | route_name='edit_repo_fields', request_method='GET', | |
971 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
971 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
972 |
|
972 | |||
973 | config.add_route( |
|
973 | config.add_route( | |
974 | name='edit_repo_fields_create', |
|
974 | name='edit_repo_fields_create', | |
975 | pattern='/{repo_name:.*?[^/]}/settings/fields/create', repo_route=True) |
|
975 | pattern='/{repo_name:.*?[^/]}/settings/fields/create', repo_route=True) | |
976 | config.add_view( |
|
976 | config.add_view( | |
977 | RepoSettingsFieldsView, |
|
977 | RepoSettingsFieldsView, | |
978 | attr='repo_field_create', |
|
978 | attr='repo_field_create', | |
979 | route_name='edit_repo_fields_create', request_method='POST', |
|
979 | route_name='edit_repo_fields_create', request_method='POST', | |
980 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
980 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
981 |
|
981 | |||
982 | config.add_route( |
|
982 | config.add_route( | |
983 | name='edit_repo_fields_delete', |
|
983 | name='edit_repo_fields_delete', | |
984 | pattern='/{repo_name:.*?[^/]}/settings/fields/{field_id}/delete', repo_route=True) |
|
984 | pattern='/{repo_name:.*?[^/]}/settings/fields/{field_id}/delete', repo_route=True) | |
985 | config.add_view( |
|
985 | config.add_view( | |
986 | RepoSettingsFieldsView, |
|
986 | RepoSettingsFieldsView, | |
987 | attr='repo_field_delete', |
|
987 | attr='repo_field_delete', | |
988 | route_name='edit_repo_fields_delete', request_method='POST', |
|
988 | route_name='edit_repo_fields_delete', request_method='POST', | |
989 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
989 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
990 |
|
990 | |||
991 | # quick actions: locking |
|
991 | # quick actions: locking | |
992 | config.add_route( |
|
992 | config.add_route( | |
993 | name='repo_settings_quick_actions', |
|
993 | name='repo_settings_quick_actions', | |
994 | pattern='/{repo_name:.*?[^/]}/settings/quick-action', repo_route=True) |
|
994 | pattern='/{repo_name:.*?[^/]}/settings/quick-action', repo_route=True) | |
995 | config.add_view( |
|
995 | config.add_view( | |
996 | RepoSettingsView, |
|
996 | RepoSettingsView, | |
997 | attr='repo_settings_quick_actions', |
|
997 | attr='repo_settings_quick_actions', | |
998 | route_name='repo_settings_quick_actions', request_method='GET', |
|
998 | route_name='repo_settings_quick_actions', request_method='GET', | |
999 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
999 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
1000 |
|
1000 | |||
1001 | # Remote |
|
1001 | # Remote | |
1002 | config.add_route( |
|
1002 | config.add_route( | |
1003 | name='edit_repo_remote', |
|
1003 | name='edit_repo_remote', | |
1004 | pattern='/{repo_name:.*?[^/]}/settings/remote', repo_route=True) |
|
1004 | pattern='/{repo_name:.*?[^/]}/settings/remote', repo_route=True) | |
1005 | config.add_view( |
|
1005 | config.add_view( | |
1006 | RepoSettingsRemoteView, |
|
1006 | RepoSettingsRemoteView, | |
1007 | attr='repo_remote_edit_form', |
|
1007 | attr='repo_remote_edit_form', | |
1008 | route_name='edit_repo_remote', request_method='GET', |
|
1008 | route_name='edit_repo_remote', request_method='GET', | |
1009 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
1009 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
1010 |
|
1010 | |||
1011 | config.add_route( |
|
1011 | config.add_route( | |
1012 | name='edit_repo_remote_pull', |
|
1012 | name='edit_repo_remote_pull', | |
1013 | pattern='/{repo_name:.*?[^/]}/settings/remote/pull', repo_route=True) |
|
1013 | pattern='/{repo_name:.*?[^/]}/settings/remote/pull', repo_route=True) | |
1014 | config.add_view( |
|
1014 | config.add_view( | |
1015 | RepoSettingsRemoteView, |
|
1015 | RepoSettingsRemoteView, | |
1016 | attr='repo_remote_pull_changes', |
|
1016 | attr='repo_remote_pull_changes', | |
1017 | route_name='edit_repo_remote_pull', request_method='POST', |
|
1017 | route_name='edit_repo_remote_pull', request_method='POST', | |
1018 | renderer=None) |
|
1018 | renderer=None) | |
1019 |
|
1019 | |||
1020 | config.add_route( |
|
1020 | config.add_route( | |
1021 | name='edit_repo_remote_push', |
|
1021 | name='edit_repo_remote_push', | |
1022 | pattern='/{repo_name:.*?[^/]}/settings/remote/push', repo_route=True) |
|
1022 | pattern='/{repo_name:.*?[^/]}/settings/remote/push', repo_route=True) | |
1023 |
|
1023 | |||
1024 | # Statistics |
|
1024 | # Statistics | |
1025 | config.add_route( |
|
1025 | config.add_route( | |
1026 | name='edit_repo_statistics', |
|
1026 | name='edit_repo_statistics', | |
1027 | pattern='/{repo_name:.*?[^/]}/settings/statistics', repo_route=True) |
|
1027 | pattern='/{repo_name:.*?[^/]}/settings/statistics', repo_route=True) | |
1028 | config.add_view( |
|
1028 | config.add_view( | |
1029 | RepoSettingsView, |
|
1029 | RepoSettingsView, | |
1030 | attr='edit_statistics_form', |
|
1030 | attr='edit_statistics_form', | |
1031 | route_name='edit_repo_statistics', request_method='GET', |
|
1031 | route_name='edit_repo_statistics', request_method='GET', | |
1032 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
1032 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
1033 |
|
1033 | |||
1034 | config.add_route( |
|
1034 | config.add_route( | |
1035 | name='edit_repo_statistics_reset', |
|
1035 | name='edit_repo_statistics_reset', | |
1036 | pattern='/{repo_name:.*?[^/]}/settings/statistics/update', repo_route=True) |
|
1036 | pattern='/{repo_name:.*?[^/]}/settings/statistics/update', repo_route=True) | |
1037 | config.add_view( |
|
1037 | config.add_view( | |
1038 | RepoSettingsView, |
|
1038 | RepoSettingsView, | |
1039 | attr='repo_statistics_reset', |
|
1039 | attr='repo_statistics_reset', | |
1040 | route_name='edit_repo_statistics_reset', request_method='POST', |
|
1040 | route_name='edit_repo_statistics_reset', request_method='POST', | |
1041 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
1041 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
1042 |
|
1042 | |||
1043 | # Issue trackers |
|
1043 | # Issue trackers | |
1044 | config.add_route( |
|
1044 | config.add_route( | |
1045 | name='edit_repo_issuetracker', |
|
1045 | name='edit_repo_issuetracker', | |
1046 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers', repo_route=True) |
|
1046 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers', repo_route=True) | |
1047 | config.add_view( |
|
1047 | config.add_view( | |
1048 | RepoSettingsIssueTrackersView, |
|
1048 | RepoSettingsIssueTrackersView, | |
1049 | attr='repo_issuetracker', |
|
1049 | attr='repo_issuetracker', | |
1050 | route_name='edit_repo_issuetracker', request_method='GET', |
|
1050 | route_name='edit_repo_issuetracker', request_method='GET', | |
1051 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
1051 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
1052 |
|
1052 | |||
1053 | config.add_route( |
|
1053 | config.add_route( | |
1054 | name='edit_repo_issuetracker_test', |
|
1054 | name='edit_repo_issuetracker_test', | |
1055 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/test', repo_route=True) |
|
1055 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/test', repo_route=True) | |
1056 | config.add_view( |
|
1056 | config.add_view( | |
1057 | RepoSettingsIssueTrackersView, |
|
1057 | RepoSettingsIssueTrackersView, | |
1058 | attr='repo_issuetracker_test', |
|
1058 | attr='repo_issuetracker_test', | |
1059 | route_name='edit_repo_issuetracker_test', request_method='POST', |
|
1059 | route_name='edit_repo_issuetracker_test', request_method='POST', | |
1060 | renderer='string', xhr=True) |
|
1060 | renderer='string', xhr=True) | |
1061 |
|
1061 | |||
1062 | config.add_route( |
|
1062 | config.add_route( | |
1063 | name='edit_repo_issuetracker_delete', |
|
1063 | name='edit_repo_issuetracker_delete', | |
1064 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/delete', repo_route=True) |
|
1064 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/delete', repo_route=True) | |
1065 | config.add_view( |
|
1065 | config.add_view( | |
1066 | RepoSettingsIssueTrackersView, |
|
1066 | RepoSettingsIssueTrackersView, | |
1067 | attr='repo_issuetracker_delete', |
|
1067 | attr='repo_issuetracker_delete', | |
1068 | route_name='edit_repo_issuetracker_delete', request_method='POST', |
|
1068 | route_name='edit_repo_issuetracker_delete', request_method='POST', | |
1069 | renderer='json_ext', xhr=True) |
|
1069 | renderer='json_ext', xhr=True) | |
1070 |
|
1070 | |||
1071 | config.add_route( |
|
1071 | config.add_route( | |
1072 | name='edit_repo_issuetracker_update', |
|
1072 | name='edit_repo_issuetracker_update', | |
1073 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/update', repo_route=True) |
|
1073 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/update', repo_route=True) | |
1074 | config.add_view( |
|
1074 | config.add_view( | |
1075 | RepoSettingsIssueTrackersView, |
|
1075 | RepoSettingsIssueTrackersView, | |
1076 | attr='repo_issuetracker_update', |
|
1076 | attr='repo_issuetracker_update', | |
1077 | route_name='edit_repo_issuetracker_update', request_method='POST', |
|
1077 | route_name='edit_repo_issuetracker_update', request_method='POST', | |
1078 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
1078 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
1079 |
|
1079 | |||
1080 | # VCS Settings |
|
1080 | # VCS Settings | |
1081 | config.add_route( |
|
1081 | config.add_route( | |
1082 | name='edit_repo_vcs', |
|
1082 | name='edit_repo_vcs', | |
1083 | pattern='/{repo_name:.*?[^/]}/settings/vcs', repo_route=True) |
|
1083 | pattern='/{repo_name:.*?[^/]}/settings/vcs', repo_route=True) | |
1084 | config.add_view( |
|
1084 | config.add_view( | |
1085 | RepoSettingsVcsView, |
|
1085 | RepoSettingsVcsView, | |
1086 | attr='repo_vcs_settings', |
|
1086 | attr='repo_vcs_settings', | |
1087 | route_name='edit_repo_vcs', request_method='GET', |
|
1087 | route_name='edit_repo_vcs', request_method='GET', | |
1088 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
1088 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
1089 |
|
1089 | |||
1090 | config.add_route( |
|
1090 | config.add_route( | |
1091 | name='edit_repo_vcs_update', |
|
1091 | name='edit_repo_vcs_update', | |
1092 | pattern='/{repo_name:.*?[^/]}/settings/vcs/update', repo_route=True) |
|
1092 | pattern='/{repo_name:.*?[^/]}/settings/vcs/update', repo_route=True) | |
1093 | config.add_view( |
|
1093 | config.add_view( | |
1094 | RepoSettingsVcsView, |
|
1094 | RepoSettingsVcsView, | |
1095 | attr='repo_settings_vcs_update', |
|
1095 | attr='repo_settings_vcs_update', | |
1096 | route_name='edit_repo_vcs_update', request_method='POST', |
|
1096 | route_name='edit_repo_vcs_update', request_method='POST', | |
1097 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
1097 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
1098 |
|
1098 | |||
1099 | # svn pattern |
|
1099 | # svn pattern | |
1100 | config.add_route( |
|
1100 | config.add_route( | |
1101 | name='edit_repo_vcs_svn_pattern_delete', |
|
1101 | name='edit_repo_vcs_svn_pattern_delete', | |
1102 | pattern='/{repo_name:.*?[^/]}/settings/vcs/svn_pattern/delete', repo_route=True) |
|
1102 | pattern='/{repo_name:.*?[^/]}/settings/vcs/svn_pattern/delete', repo_route=True) | |
1103 | config.add_view( |
|
1103 | config.add_view( | |
1104 | RepoSettingsVcsView, |
|
1104 | RepoSettingsVcsView, | |
1105 | attr='repo_settings_delete_svn_pattern', |
|
1105 | attr='repo_settings_delete_svn_pattern', | |
1106 | route_name='edit_repo_vcs_svn_pattern_delete', request_method='POST', |
|
1106 | route_name='edit_repo_vcs_svn_pattern_delete', request_method='POST', | |
1107 | renderer='json_ext', xhr=True) |
|
1107 | renderer='json_ext', xhr=True) | |
1108 |
|
1108 | |||
1109 | # Repo Review Rules (EE feature) |
|
1109 | # Repo Review Rules (EE feature) | |
1110 | config.add_route( |
|
1110 | config.add_route( | |
1111 | name='repo_reviewers', |
|
1111 | name='repo_reviewers', | |
1112 | pattern='/{repo_name:.*?[^/]}/settings/review/rules', repo_route=True) |
|
1112 | pattern='/{repo_name:.*?[^/]}/settings/review/rules', repo_route=True) | |
1113 | config.add_view( |
|
1113 | config.add_view( | |
1114 | RepoReviewRulesView, |
|
1114 | RepoReviewRulesView, | |
1115 | attr='repo_review_rules', |
|
1115 | attr='repo_review_rules', | |
1116 | route_name='repo_reviewers', request_method='GET', |
|
1116 | route_name='repo_reviewers', request_method='GET', | |
1117 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
1117 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
1118 |
|
1118 | |||
1119 | config.add_route( |
|
1119 | config.add_route( | |
1120 | name='repo_default_reviewers_data', |
|
1120 | name='repo_default_reviewers_data', | |
1121 | pattern='/{repo_name:.*?[^/]}/settings/review/default-reviewers', repo_route=True) |
|
1121 | pattern='/{repo_name:.*?[^/]}/settings/review/default-reviewers', repo_route=True) | |
1122 | config.add_view( |
|
1122 | config.add_view( | |
1123 | RepoReviewRulesView, |
|
1123 | RepoReviewRulesView, | |
1124 | attr='repo_default_reviewers_data', |
|
1124 | attr='repo_default_reviewers_data', | |
1125 | route_name='repo_default_reviewers_data', request_method='GET', |
|
1125 | route_name='repo_default_reviewers_data', request_method='GET', | |
1126 | renderer='json_ext') |
|
1126 | renderer='json_ext') | |
1127 |
|
1127 | |||
1128 | # Repo Automation (EE feature) |
|
1128 | # Repo Automation (EE feature) | |
1129 | config.add_route( |
|
1129 | config.add_route( | |
1130 | name='repo_automation', |
|
1130 | name='repo_automation', | |
1131 | pattern='/{repo_name:.*?[^/]}/settings/automation', repo_route=True) |
|
1131 | pattern='/{repo_name:.*?[^/]}/settings/automation', repo_route=True) | |
1132 | config.add_view( |
|
1132 | config.add_view( | |
1133 | RepoAutomationView, |
|
1133 | RepoAutomationView, | |
1134 | attr='repo_automation', |
|
1134 | attr='repo_automation', | |
1135 | route_name='repo_automation', request_method='GET', |
|
1135 | route_name='repo_automation', request_method='GET', | |
1136 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
1136 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
1137 |
|
1137 | |||
1138 | # Strip |
|
1138 | # Strip | |
1139 | config.add_route( |
|
1139 | config.add_route( | |
1140 | name='edit_repo_strip', |
|
1140 | name='edit_repo_strip', | |
1141 | pattern='/{repo_name:.*?[^/]}/settings/strip', repo_route=True) |
|
1141 | pattern='/{repo_name:.*?[^/]}/settings/strip', repo_route=True) | |
1142 | config.add_view( |
|
1142 | config.add_view( | |
1143 | RepoStripView, |
|
1143 | RepoStripView, | |
1144 | attr='strip', |
|
1144 | attr='strip', | |
1145 | route_name='edit_repo_strip', request_method='GET', |
|
1145 | route_name='edit_repo_strip', request_method='GET', | |
1146 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
1146 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
1147 |
|
1147 | |||
1148 | config.add_route( |
|
1148 | config.add_route( | |
1149 | name='strip_check', |
|
1149 | name='strip_check', | |
1150 | pattern='/{repo_name:.*?[^/]}/settings/strip_check', repo_route=True) |
|
1150 | pattern='/{repo_name:.*?[^/]}/settings/strip_check', repo_route=True) | |
1151 | config.add_view( |
|
1151 | config.add_view( | |
1152 | RepoStripView, |
|
1152 | RepoStripView, | |
1153 | attr='strip_check', |
|
1153 | attr='strip_check', | |
1154 | route_name='strip_check', request_method='POST', |
|
1154 | route_name='strip_check', request_method='POST', | |
1155 | renderer='json', xhr=True) |
|
1155 | renderer='json', xhr=True) | |
1156 |
|
1156 | |||
1157 | config.add_route( |
|
1157 | config.add_route( | |
1158 | name='strip_execute', |
|
1158 | name='strip_execute', | |
1159 | pattern='/{repo_name:.*?[^/]}/settings/strip_execute', repo_route=True) |
|
1159 | pattern='/{repo_name:.*?[^/]}/settings/strip_execute', repo_route=True) | |
1160 | config.add_view( |
|
1160 | config.add_view( | |
1161 | RepoStripView, |
|
1161 | RepoStripView, | |
1162 | attr='strip_execute', |
|
1162 | attr='strip_execute', | |
1163 | route_name='strip_execute', request_method='POST', |
|
1163 | route_name='strip_execute', request_method='POST', | |
1164 | renderer='json', xhr=True) |
|
1164 | renderer='json', xhr=True) | |
1165 |
|
1165 | |||
1166 | # Audit logs |
|
1166 | # Audit logs | |
1167 | config.add_route( |
|
1167 | config.add_route( | |
1168 | name='edit_repo_audit_logs', |
|
1168 | name='edit_repo_audit_logs', | |
1169 | pattern='/{repo_name:.*?[^/]}/settings/audit_logs', repo_route=True) |
|
1169 | pattern='/{repo_name:.*?[^/]}/settings/audit_logs', repo_route=True) | |
1170 | config.add_view( |
|
1170 | config.add_view( | |
1171 | AuditLogsView, |
|
1171 | AuditLogsView, | |
1172 | attr='repo_audit_logs', |
|
1172 | attr='repo_audit_logs', | |
1173 | route_name='edit_repo_audit_logs', request_method='GET', |
|
1173 | route_name='edit_repo_audit_logs', request_method='GET', | |
1174 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') |
|
1174 | renderer='rhodecode:templates/admin/repos/repo_edit.mako') | |
1175 |
|
1175 | |||
1176 | # ATOM/RSS Feed, shouldn't contain slashes for outlook compatibility |
|
1176 | # ATOM/RSS Feed, shouldn't contain slashes for outlook compatibility | |
1177 | config.add_route( |
|
1177 | config.add_route( | |
1178 | name='rss_feed_home', |
|
1178 | name='rss_feed_home', | |
1179 | pattern='/{repo_name:.*?[^/]}/feed-rss', repo_route=True) |
|
1179 | pattern='/{repo_name:.*?[^/]}/feed-rss', repo_route=True) | |
1180 | config.add_view( |
|
1180 | config.add_view( | |
1181 | RepoFeedView, |
|
1181 | RepoFeedView, | |
1182 | attr='rss', |
|
1182 | attr='rss', | |
1183 | route_name='rss_feed_home', request_method='GET', renderer=None) |
|
1183 | route_name='rss_feed_home', request_method='GET', renderer=None) | |
1184 |
|
1184 | |||
1185 | config.add_route( |
|
1185 | config.add_route( | |
1186 | name='rss_feed_home_old', |
|
1186 | name='rss_feed_home_old', | |
1187 | pattern='/{repo_name:.*?[^/]}/feed/rss', repo_route=True) |
|
1187 | pattern='/{repo_name:.*?[^/]}/feed/rss', repo_route=True) | |
1188 | config.add_view( |
|
1188 | config.add_view( | |
1189 | RepoFeedView, |
|
1189 | RepoFeedView, | |
1190 | attr='rss', |
|
1190 | attr='rss', | |
1191 | route_name='rss_feed_home_old', request_method='GET', renderer=None) |
|
1191 | route_name='rss_feed_home_old', request_method='GET', renderer=None) | |
1192 |
|
1192 | |||
1193 | config.add_route( |
|
1193 | config.add_route( | |
1194 | name='atom_feed_home', |
|
1194 | name='atom_feed_home', | |
1195 | pattern='/{repo_name:.*?[^/]}/feed-atom', repo_route=True) |
|
1195 | pattern='/{repo_name:.*?[^/]}/feed-atom', repo_route=True) | |
1196 | config.add_view( |
|
1196 | config.add_view( | |
1197 | RepoFeedView, |
|
1197 | RepoFeedView, | |
1198 | attr='atom', |
|
1198 | attr='atom', | |
1199 | route_name='atom_feed_home', request_method='GET', renderer=None) |
|
1199 | route_name='atom_feed_home', request_method='GET', renderer=None) | |
1200 |
|
1200 | |||
1201 | config.add_route( |
|
1201 | config.add_route( | |
1202 | name='atom_feed_home_old', |
|
1202 | name='atom_feed_home_old', | |
1203 | pattern='/{repo_name:.*?[^/]}/feed/atom', repo_route=True) |
|
1203 | pattern='/{repo_name:.*?[^/]}/feed/atom', repo_route=True) | |
1204 | config.add_view( |
|
1204 | config.add_view( | |
1205 | RepoFeedView, |
|
1205 | RepoFeedView, | |
1206 | attr='atom', |
|
1206 | attr='atom', | |
1207 | route_name='atom_feed_home_old', request_method='GET', renderer=None) |
|
1207 | route_name='atom_feed_home_old', request_method='GET', renderer=None) | |
1208 |
|
1208 | |||
1209 | # NOTE(marcink): needs to be at the end for catch-all |
|
1209 | # NOTE(marcink): needs to be at the end for catch-all | |
1210 | add_route_with_slash( |
|
1210 | add_route_with_slash( | |
1211 | config, |
|
1211 | config, | |
1212 | name='repo_summary', |
|
1212 | name='repo_summary', | |
1213 | pattern='/{repo_name:.*?[^/]}', repo_route=True) |
|
1213 | pattern='/{repo_name:.*?[^/]}', repo_route=True) | |
1214 | config.add_view( |
|
1214 | config.add_view( | |
1215 | RepoSummaryView, |
|
1215 | RepoSummaryView, | |
1216 | attr='summary', |
|
1216 | attr='summary', | |
1217 | route_name='repo_summary', request_method='GET', |
|
1217 | route_name='repo_summary', request_method='GET', | |
1218 | renderer='rhodecode:templates/summary/summary.mako') |
|
1218 | renderer='rhodecode:templates/summary/summary.mako') | |
1219 |
|
1219 | |||
1220 | # TODO(marcink): there's no such route?? |
|
1220 | # TODO(marcink): there's no such route?? | |
1221 | config.add_view( |
|
1221 | config.add_view( | |
1222 | RepoSummaryView, |
|
1222 | RepoSummaryView, | |
1223 | attr='summary', |
|
1223 | attr='summary', | |
1224 | route_name='repo_summary_slash', request_method='GET', |
|
1224 | route_name='repo_summary_slash', request_method='GET', | |
1225 | renderer='rhodecode:templates/summary/summary.mako') No newline at end of file |
|
1225 | renderer='rhodecode:templates/summary/summary.mako') |
@@ -1,159 +1,155 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 |
|
||||
20 | from rhodecode.apps._base.navigation import NavigationRegistry |
|
|||
21 | from rhodecode.apps._base import ADMIN_PREFIX |
|
19 | from rhodecode.apps._base import ADMIN_PREFIX | |
22 | from rhodecode.lib.utils2 import str2bool |
|
|||
23 |
|
20 | |||
24 |
|
21 | |||
25 | def admin_routes(config): |
|
22 | def admin_routes(config): | |
26 | """ |
|
23 | """ | |
27 | User groups /_admin prefixed routes |
|
24 | User groups /_admin prefixed routes | |
28 | """ |
|
25 | """ | |
29 | from rhodecode.apps.user_group.views import UserGroupsView |
|
26 | from rhodecode.apps.user_group.views import UserGroupsView | |
30 |
|
27 | |||
31 | config.add_route( |
|
28 | config.add_route( | |
32 | name='user_group_members_data', |
|
29 | name='user_group_members_data', | |
33 | pattern='/user_groups/{user_group_id:\d+}/members', |
|
30 | pattern=r'/user_groups/{user_group_id:\d+}/members', | |
34 | user_group_route=True) |
|
31 | user_group_route=True) | |
35 | config.add_view( |
|
32 | config.add_view( | |
36 | UserGroupsView, |
|
33 | UserGroupsView, | |
37 | attr='user_group_members', |
|
34 | attr='user_group_members', | |
38 | route_name='user_group_members_data', request_method='GET', |
|
35 | route_name='user_group_members_data', request_method='GET', | |
39 | renderer='json_ext', xhr=True) |
|
36 | renderer='json_ext', xhr=True) | |
40 |
|
37 | |||
41 | # user groups perms |
|
38 | # user groups perms | |
42 | config.add_route( |
|
39 | config.add_route( | |
43 | name='edit_user_group_perms_summary', |
|
40 | name='edit_user_group_perms_summary', | |
44 | pattern='/user_groups/{user_group_id:\d+}/edit/permissions_summary', |
|
41 | pattern=r'/user_groups/{user_group_id:\d+}/edit/permissions_summary', | |
45 | user_group_route=True) |
|
42 | user_group_route=True) | |
46 | config.add_view( |
|
43 | config.add_view( | |
47 | UserGroupsView, |
|
44 | UserGroupsView, | |
48 | attr='user_group_perms_summary', |
|
45 | attr='user_group_perms_summary', | |
49 | route_name='edit_user_group_perms_summary', request_method='GET', |
|
46 | route_name='edit_user_group_perms_summary', request_method='GET', | |
50 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') |
|
47 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') | |
51 |
|
48 | |||
52 | config.add_route( |
|
49 | config.add_route( | |
53 | name='edit_user_group_perms_summary_json', |
|
50 | name='edit_user_group_perms_summary_json', | |
54 | pattern='/user_groups/{user_group_id:\d+}/edit/permissions_summary/json', |
|
51 | pattern=r'/user_groups/{user_group_id:\d+}/edit/permissions_summary/json', | |
55 | user_group_route=True) |
|
52 | user_group_route=True) | |
56 | config.add_view( |
|
53 | config.add_view( | |
57 | UserGroupsView, |
|
54 | UserGroupsView, | |
58 | attr='user_group_perms_summary_json', |
|
55 | attr='user_group_perms_summary_json', | |
59 | route_name='edit_user_group_perms_summary_json', request_method='GET', |
|
56 | route_name='edit_user_group_perms_summary_json', request_method='GET', | |
60 | renderer='json_ext') |
|
57 | renderer='json_ext') | |
61 |
|
58 | |||
62 | # user groups edit |
|
59 | # user groups edit | |
63 | config.add_route( |
|
60 | config.add_route( | |
64 | name='edit_user_group', |
|
61 | name='edit_user_group', | |
65 | pattern='/user_groups/{user_group_id:\d+}/edit', |
|
62 | pattern=r'/user_groups/{user_group_id:\d+}/edit', | |
66 | user_group_route=True) |
|
63 | user_group_route=True) | |
67 | config.add_view( |
|
64 | config.add_view( | |
68 | UserGroupsView, |
|
65 | UserGroupsView, | |
69 | attr='user_group_edit', |
|
66 | attr='user_group_edit', | |
70 | route_name='edit_user_group', request_method='GET', |
|
67 | route_name='edit_user_group', request_method='GET', | |
71 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') |
|
68 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') | |
72 |
|
69 | |||
73 | # user groups update |
|
70 | # user groups update | |
74 | config.add_route( |
|
71 | config.add_route( | |
75 | name='user_groups_update', |
|
72 | name='user_groups_update', | |
76 | pattern='/user_groups/{user_group_id:\d+}/update', |
|
73 | pattern=r'/user_groups/{user_group_id:\d+}/update', | |
77 | user_group_route=True) |
|
74 | user_group_route=True) | |
78 | config.add_view( |
|
75 | config.add_view( | |
79 | UserGroupsView, |
|
76 | UserGroupsView, | |
80 | attr='user_group_update', |
|
77 | attr='user_group_update', | |
81 | route_name='user_groups_update', request_method='POST', |
|
78 | route_name='user_groups_update', request_method='POST', | |
82 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') |
|
79 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') | |
83 |
|
80 | |||
84 | config.add_route( |
|
81 | config.add_route( | |
85 | name='edit_user_group_global_perms', |
|
82 | name='edit_user_group_global_perms', | |
86 | pattern='/user_groups/{user_group_id:\d+}/edit/global_permissions', |
|
83 | pattern=r'/user_groups/{user_group_id:\d+}/edit/global_permissions', | |
87 | user_group_route=True) |
|
84 | user_group_route=True) | |
88 | config.add_view( |
|
85 | config.add_view( | |
89 | UserGroupsView, |
|
86 | UserGroupsView, | |
90 | attr='user_group_global_perms_edit', |
|
87 | attr='user_group_global_perms_edit', | |
91 | route_name='edit_user_group_global_perms', request_method='GET', |
|
88 | route_name='edit_user_group_global_perms', request_method='GET', | |
92 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') |
|
89 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') | |
93 |
|
90 | |||
94 | config.add_route( |
|
91 | config.add_route( | |
95 | name='edit_user_group_global_perms_update', |
|
92 | name='edit_user_group_global_perms_update', | |
96 | pattern='/user_groups/{user_group_id:\d+}/edit/global_permissions/update', |
|
93 | pattern=r'/user_groups/{user_group_id:\d+}/edit/global_permissions/update', | |
97 | user_group_route=True) |
|
94 | user_group_route=True) | |
98 | config.add_view( |
|
95 | config.add_view( | |
99 | UserGroupsView, |
|
96 | UserGroupsView, | |
100 | attr='user_group_global_perms_update', |
|
97 | attr='user_group_global_perms_update', | |
101 | route_name='edit_user_group_global_perms_update', request_method='POST', |
|
98 | route_name='edit_user_group_global_perms_update', request_method='POST', | |
102 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') |
|
99 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') | |
103 |
|
100 | |||
104 | config.add_route( |
|
101 | config.add_route( | |
105 | name='edit_user_group_perms', |
|
102 | name='edit_user_group_perms', | |
106 | pattern='/user_groups/{user_group_id:\d+}/edit/permissions', |
|
103 | pattern=r'/user_groups/{user_group_id:\d+}/edit/permissions', | |
107 | user_group_route=True) |
|
104 | user_group_route=True) | |
108 | config.add_view( |
|
105 | config.add_view( | |
109 | UserGroupsView, |
|
106 | UserGroupsView, | |
110 | attr='user_group_edit_perms', |
|
107 | attr='user_group_edit_perms', | |
111 | route_name='edit_user_group_perms', request_method='GET', |
|
108 | route_name='edit_user_group_perms', request_method='GET', | |
112 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') |
|
109 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') | |
113 |
|
110 | |||
114 | config.add_route( |
|
111 | config.add_route( | |
115 | name='edit_user_group_perms_update', |
|
112 | name='edit_user_group_perms_update', | |
116 | pattern='/user_groups/{user_group_id:\d+}/edit/permissions/update', |
|
113 | pattern=r'/user_groups/{user_group_id:\d+}/edit/permissions/update', | |
117 | user_group_route=True) |
|
114 | user_group_route=True) | |
118 | config.add_view( |
|
115 | config.add_view( | |
119 | UserGroupsView, |
|
116 | UserGroupsView, | |
120 | attr='user_group_update_perms', |
|
117 | attr='user_group_update_perms', | |
121 | route_name='edit_user_group_perms_update', request_method='POST', |
|
118 | route_name='edit_user_group_perms_update', request_method='POST', | |
122 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') |
|
119 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') | |
123 |
|
120 | |||
124 | config.add_route( |
|
121 | config.add_route( | |
125 | name='edit_user_group_advanced', |
|
122 | name='edit_user_group_advanced', | |
126 | pattern='/user_groups/{user_group_id:\d+}/edit/advanced', |
|
123 | pattern=r'/user_groups/{user_group_id:\d+}/edit/advanced', | |
127 | user_group_route=True) |
|
124 | user_group_route=True) | |
128 | config.add_view( |
|
125 | config.add_view( | |
129 | UserGroupsView, |
|
126 | UserGroupsView, | |
130 | attr='user_group_edit_advanced', |
|
127 | attr='user_group_edit_advanced', | |
131 | route_name='edit_user_group_advanced', request_method='GET', |
|
128 | route_name='edit_user_group_advanced', request_method='GET', | |
132 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') |
|
129 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') | |
133 |
|
130 | |||
134 | config.add_route( |
|
131 | config.add_route( | |
135 | name='edit_user_group_advanced_sync', |
|
132 | name='edit_user_group_advanced_sync', | |
136 | pattern='/user_groups/{user_group_id:\d+}/edit/advanced/sync', |
|
133 | pattern=r'/user_groups/{user_group_id:\d+}/edit/advanced/sync', | |
137 | user_group_route=True) |
|
134 | user_group_route=True) | |
138 | config.add_view( |
|
135 | config.add_view( | |
139 | UserGroupsView, |
|
136 | UserGroupsView, | |
140 | attr='user_group_edit_advanced_set_synchronization', |
|
137 | attr='user_group_edit_advanced_set_synchronization', | |
141 | route_name='edit_user_group_advanced_sync', request_method='POST', |
|
138 | route_name='edit_user_group_advanced_sync', request_method='POST', | |
142 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') |
|
139 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') | |
143 |
|
140 | |||
144 | # user groups delete |
|
141 | # user groups delete | |
145 | config.add_route( |
|
142 | config.add_route( | |
146 | name='user_groups_delete', |
|
143 | name='user_groups_delete', | |
147 | pattern='/user_groups/{user_group_id:\d+}/delete', |
|
144 | pattern=r'/user_groups/{user_group_id:\d+}/delete', | |
148 | user_group_route=True) |
|
145 | user_group_route=True) | |
149 | config.add_view( |
|
146 | config.add_view( | |
150 | UserGroupsView, |
|
147 | UserGroupsView, | |
151 | attr='user_group_delete', |
|
148 | attr='user_group_delete', | |
152 | route_name='user_groups_delete', request_method='POST', |
|
149 | route_name='user_groups_delete', request_method='POST', | |
153 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') |
|
150 | renderer='rhodecode:templates/admin/user_groups/user_group_edit.mako') | |
154 |
|
151 | |||
155 |
|
152 | |||
156 | def includeme(config): |
|
153 | def includeme(config): | |
157 | # main admin routes |
|
154 | # main admin routes | |
158 | config.include(admin_routes, route_prefix=ADMIN_PREFIX) |
|
155 | config.include(admin_routes, route_prefix=ADMIN_PREFIX) | |
159 |
|
General Comments 0
You need to be logged in to leave comments.
Login now