Show More
@@ -0,0 +1,19 b'' | |||||
|
1 | # -*- coding: utf-8 -*- | |||
|
2 | ||||
|
3 | # Copyright (C) 2016-2017 RhodeCode GmbH | |||
|
4 | # | |||
|
5 | # This program is free software: you can redistribute it and/or modify | |||
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |||
|
7 | # (only), as published by the Free Software Foundation. | |||
|
8 | # | |||
|
9 | # This program is distributed in the hope that it will be useful, | |||
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
|
12 | # GNU General Public License for more details. | |||
|
13 | # | |||
|
14 | # You should have received a copy of the GNU Affero General Public License | |||
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
|
16 | # | |||
|
17 | # This program is dual-licensed. If you wish to learn more about the | |||
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |||
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ No newline at end of file |
@@ -1,192 +1,192 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2016-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2016-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 |
|
20 | |||
21 |
|
21 | |||
22 | from rhodecode.apps.admin.navigation import NavigationRegistry |
|
22 | from rhodecode.apps.admin.navigation import NavigationRegistry | |
23 | from rhodecode.config.routing import ADMIN_PREFIX |
|
23 | from rhodecode.config.routing import ADMIN_PREFIX | |
24 | from rhodecode.lib.utils2 import str2bool |
|
24 | from rhodecode.lib.utils2 import str2bool | |
25 |
|
25 | |||
26 |
|
26 | |||
27 | def admin_routes(config): |
|
27 | def admin_routes(config): | |
28 | """ |
|
28 | """ | |
29 | Admin prefixed routes |
|
29 | Admin prefixed routes | |
30 | """ |
|
30 | """ | |
31 |
|
31 | |||
32 | config.add_route( |
|
32 | config.add_route( | |
33 | name='admin_audit_logs', |
|
33 | name='admin_audit_logs', | |
34 | pattern='/audit_logs') |
|
34 | pattern='/audit_logs') | |
35 |
|
35 | |||
36 | config.add_route( |
|
36 | config.add_route( | |
37 | name='pull_requests_global_0', # backward compat |
|
37 | name='pull_requests_global_0', # backward compat | |
38 | pattern='/pull_requests/{pull_request_id:\d+}') |
|
38 | pattern='/pull_requests/{pull_request_id:\d+}') | |
39 | config.add_route( |
|
39 | config.add_route( | |
40 | name='pull_requests_global_1', # backward compat |
|
40 | name='pull_requests_global_1', # backward compat | |
41 | pattern='/pull-requests/{pull_request_id:\d+}') |
|
41 | pattern='/pull-requests/{pull_request_id:\d+}') | |
42 | config.add_route( |
|
42 | config.add_route( | |
43 | name='pull_requests_global', |
|
43 | name='pull_requests_global', | |
44 | pattern='/pull-request/{pull_request_id:\d+}') |
|
44 | pattern='/pull-request/{pull_request_id:\d+}') | |
45 |
|
45 | |||
46 | config.add_route( |
|
46 | config.add_route( | |
47 | name='admin_settings_open_source', |
|
47 | name='admin_settings_open_source', | |
48 | pattern='/settings/open_source') |
|
48 | pattern='/settings/open_source') | |
49 | config.add_route( |
|
49 | config.add_route( | |
50 | name='admin_settings_vcs_svn_generate_cfg', |
|
50 | name='admin_settings_vcs_svn_generate_cfg', | |
51 | pattern='/settings/vcs/svn_generate_cfg') |
|
51 | pattern='/settings/vcs/svn_generate_cfg') | |
52 |
|
52 | |||
53 | config.add_route( |
|
53 | config.add_route( | |
54 | name='admin_settings_system', |
|
54 | name='admin_settings_system', | |
55 | pattern='/settings/system') |
|
55 | pattern='/settings/system') | |
56 | config.add_route( |
|
56 | config.add_route( | |
57 | name='admin_settings_system_update', |
|
57 | name='admin_settings_system_update', | |
58 | pattern='/settings/system/updates') |
|
58 | pattern='/settings/system/updates') | |
59 |
|
59 | |||
60 | config.add_route( |
|
60 | config.add_route( | |
61 | name='admin_settings_sessions', |
|
61 | name='admin_settings_sessions', | |
62 | pattern='/settings/sessions') |
|
62 | pattern='/settings/sessions') | |
63 | config.add_route( |
|
63 | config.add_route( | |
64 | name='admin_settings_sessions_cleanup', |
|
64 | name='admin_settings_sessions_cleanup', | |
65 | pattern='/settings/sessions/cleanup') |
|
65 | pattern='/settings/sessions/cleanup') | |
66 |
|
66 | |||
67 | config.add_route( |
|
67 | config.add_route( | |
68 | name='admin_settings_process_management', |
|
68 | name='admin_settings_process_management', | |
69 | pattern='/settings/process_management') |
|
69 | pattern='/settings/process_management') | |
70 | config.add_route( |
|
70 | config.add_route( | |
71 | name='admin_settings_process_management_signal', |
|
71 | name='admin_settings_process_management_signal', | |
72 | pattern='/settings/process_management/signal') |
|
72 | pattern='/settings/process_management/signal') | |
73 |
|
73 | |||
74 | # global permissions |
|
74 | # global permissions | |
75 |
|
75 | |||
76 | config.add_route( |
|
76 | config.add_route( | |
77 | name='admin_permissions_application', |
|
77 | name='admin_permissions_application', | |
78 | pattern='/permissions/application') |
|
78 | pattern='/permissions/application') | |
79 | config.add_route( |
|
79 | config.add_route( | |
80 | name='admin_permissions_application_update', |
|
80 | name='admin_permissions_application_update', | |
81 | pattern='/permissions/application/update') |
|
81 | pattern='/permissions/application/update') | |
82 |
|
82 | |||
83 | config.add_route( |
|
83 | config.add_route( | |
84 | name='admin_permissions_global', |
|
84 | name='admin_permissions_global', | |
85 | pattern='/permissions/global') |
|
85 | pattern='/permissions/global') | |
86 | config.add_route( |
|
86 | config.add_route( | |
87 | name='admin_permissions_global_update', |
|
87 | name='admin_permissions_global_update', | |
88 | pattern='/permissions/global/update') |
|
88 | pattern='/permissions/global/update') | |
89 |
|
89 | |||
90 | config.add_route( |
|
90 | config.add_route( | |
91 | name='admin_permissions_object', |
|
91 | name='admin_permissions_object', | |
92 | pattern='/permissions/object') |
|
92 | pattern='/permissions/object') | |
93 | config.add_route( |
|
93 | config.add_route( | |
94 | name='admin_permissions_object_update', |
|
94 | name='admin_permissions_object_update', | |
95 | pattern='/permissions/object/update') |
|
95 | pattern='/permissions/object/update') | |
96 |
|
96 | |||
97 | config.add_route( |
|
97 | config.add_route( | |
98 | name='admin_permissions_ips', |
|
98 | name='admin_permissions_ips', | |
99 | pattern='/permissions/ips') |
|
99 | pattern='/permissions/ips') | |
100 |
|
100 | |||
101 | config.add_route( |
|
101 | config.add_route( | |
102 | name='admin_permissions_overview', |
|
102 | name='admin_permissions_overview', | |
103 | pattern='/permissions/overview') |
|
103 | pattern='/permissions/overview') | |
104 |
|
104 | |||
105 | config.add_route( |
|
105 | config.add_route( | |
106 | name='admin_permissions_auth_token_access', |
|
106 | name='admin_permissions_auth_token_access', | |
107 | pattern='/permissions/auth_token_access') |
|
107 | pattern='/permissions/auth_token_access') | |
108 |
|
108 | |||
109 | # users admin |
|
109 | # users admin | |
110 | config.add_route( |
|
110 | config.add_route( | |
111 | name='users', |
|
111 | name='users', | |
112 | pattern='/users') |
|
112 | pattern='/users') | |
113 |
|
113 | |||
114 | config.add_route( |
|
114 | config.add_route( | |
115 | name='users_data', |
|
115 | name='users_data', | |
116 | pattern='/users_data') |
|
116 | pattern='/users_data') | |
117 |
|
117 | |||
118 | # user auth tokens |
|
118 | # user auth tokens | |
119 | config.add_route( |
|
119 | config.add_route( | |
120 | name='edit_user_auth_tokens', |
|
120 | name='edit_user_auth_tokens', | |
121 | pattern='/users/{user_id:\d+}/edit/auth_tokens') |
|
121 | pattern='/users/{user_id:\d+}/edit/auth_tokens') | |
122 | config.add_route( |
|
122 | config.add_route( | |
123 | name='edit_user_auth_tokens_add', |
|
123 | name='edit_user_auth_tokens_add', | |
124 | pattern='/users/{user_id:\d+}/edit/auth_tokens/new') |
|
124 | pattern='/users/{user_id:\d+}/edit/auth_tokens/new') | |
125 | config.add_route( |
|
125 | config.add_route( | |
126 | name='edit_user_auth_tokens_delete', |
|
126 | name='edit_user_auth_tokens_delete', | |
127 | pattern='/users/{user_id:\d+}/edit/auth_tokens/delete') |
|
127 | pattern='/users/{user_id:\d+}/edit/auth_tokens/delete') | |
128 |
|
128 | |||
129 | # user emails |
|
129 | # user emails | |
130 | config.add_route( |
|
130 | config.add_route( | |
131 | name='edit_user_emails', |
|
131 | name='edit_user_emails', | |
132 | pattern='/users/{user_id:\d+}/edit/emails') |
|
132 | pattern='/users/{user_id:\d+}/edit/emails') | |
133 | config.add_route( |
|
133 | config.add_route( | |
134 | name='edit_user_emails_add', |
|
134 | name='edit_user_emails_add', | |
135 | pattern='/users/{user_id:\d+}/edit/emails/new') |
|
135 | pattern='/users/{user_id:\d+}/edit/emails/new') | |
136 | config.add_route( |
|
136 | config.add_route( | |
137 | name='edit_user_emails_delete', |
|
137 | name='edit_user_emails_delete', | |
138 | pattern='/users/{user_id:\d+}/edit/emails/delete') |
|
138 | pattern='/users/{user_id:\d+}/edit/emails/delete') | |
139 |
|
139 | |||
140 | # user IPs |
|
140 | # user IPs | |
141 | config.add_route( |
|
141 | config.add_route( | |
142 | name='edit_user_ips', |
|
142 | name='edit_user_ips', | |
143 | pattern='/users/{user_id:\d+}/edit/ips') |
|
143 | pattern='/users/{user_id:\d+}/edit/ips') | |
144 | config.add_route( |
|
144 | config.add_route( | |
145 | name='edit_user_ips_add', |
|
145 | name='edit_user_ips_add', | |
146 | pattern='/users/{user_id:\d+}/edit/ips/new') |
|
146 | pattern='/users/{user_id:\d+}/edit/ips/new') | |
147 | config.add_route( |
|
147 | config.add_route( | |
148 | name='edit_user_ips_delete', |
|
148 | name='edit_user_ips_delete', | |
149 | pattern='/users/{user_id:\d+}/edit/ips/delete') |
|
149 | pattern='/users/{user_id:\d+}/edit/ips/delete') | |
150 |
|
150 | |||
151 | # user groups management |
|
151 | # user groups management | |
152 | config.add_route( |
|
152 | config.add_route( | |
153 | name='edit_user_groups_management', |
|
153 | name='edit_user_groups_management', | |
154 | pattern='/users/{user_id:\d+}/edit/groups_management') |
|
154 | pattern='/users/{user_id:\d+}/edit/groups_management') | |
155 |
|
155 | |||
156 | config.add_route( |
|
156 | config.add_route( | |
157 | name='edit_user_groups_management_updates', |
|
157 | name='edit_user_groups_management_updates', | |
158 | pattern='/users/{user_id:\d+}/edit/edit_user_groups_management/updates') |
|
158 | pattern='/users/{user_id:\d+}/edit/edit_user_groups_management/updates') | |
159 |
|
159 | |||
160 | # user audit logs |
|
160 | # user audit logs | |
161 | config.add_route( |
|
161 | config.add_route( | |
162 | name='edit_user_audit_logs', |
|
162 | name='edit_user_audit_logs', | |
163 | pattern='/users/{user_id:\d+}/edit/audit') |
|
163 | pattern='/users/{user_id:\d+}/edit/audit') | |
164 |
|
164 | |||
165 | # user groups admin |
|
165 | # user groups admin | |
166 | config.add_route( |
|
166 | config.add_route( | |
167 | name='user_groups', |
|
167 | name='user_groups', | |
168 | pattern='/user_groups') |
|
168 | pattern='/user_groups') | |
169 |
|
169 | |||
170 | config.add_route( |
|
170 | config.add_route( | |
171 | name='user_groups_data', |
|
171 | name='user_groups_data', | |
172 | pattern='/user_groups_data') |
|
172 | pattern='/user_groups_data') | |
173 |
|
173 | |||
174 | config.add_route( |
|
174 | config.add_route( | |
175 | name='user_group_members_data', |
|
175 | name='user_group_members_data', | |
176 | pattern='/user_groups/{user_group_id:\d+}/members') |
|
176 | pattern='/user_groups/{user_group_id:\d+}/members') | |
177 |
|
177 | |||
178 |
|
178 | |||
179 | def includeme(config): |
|
179 | def includeme(config): | |
180 | settings = config.get_settings() |
|
180 | settings = config.get_settings() | |
181 |
|
181 | |||
182 | # Create admin navigation registry and add it to the pyramid registry. |
|
182 | # Create admin navigation registry and add it to the pyramid registry. | |
183 | labs_active = str2bool(settings.get('labs_settings_active', False)) |
|
183 | labs_active = str2bool(settings.get('labs_settings_active', False)) | |
184 | navigation_registry = NavigationRegistry(labs_active=labs_active) |
|
184 | navigation_registry = NavigationRegistry(labs_active=labs_active) | |
185 | config.registry.registerUtility(navigation_registry) |
|
185 | config.registry.registerUtility(navigation_registry) | |
186 |
|
186 | |||
187 | # main admin routes |
|
187 | # main admin routes | |
188 | config.add_route(name='admin_home', pattern=ADMIN_PREFIX) |
|
188 | config.add_route(name='admin_home', pattern=ADMIN_PREFIX) | |
189 | config.include(admin_routes, route_prefix=ADMIN_PREFIX) |
|
189 | config.include(admin_routes, route_prefix=ADMIN_PREFIX) | |
190 |
|
190 | |||
191 | # Scan module for configuration decorators. |
|
191 | # Scan module for configuration decorators. | |
192 | config.scan() |
|
192 | config.scan('.views', ignore='.tests') |
@@ -1,90 +1,90 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2010-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2010-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 |
|
20 | |||
21 | import os |
|
21 | import os | |
22 |
|
22 | |||
23 | from pyramid.settings import asbool |
|
23 | from pyramid.settings import asbool | |
24 |
|
24 | |||
25 | from rhodecode.config.routing import ADMIN_PREFIX |
|
25 | from rhodecode.config.routing import ADMIN_PREFIX | |
26 | from rhodecode.lib.ext_json import json |
|
26 | from rhodecode.lib.ext_json import json | |
27 |
|
27 | |||
28 |
|
28 | |||
29 | def url_gen(request): |
|
29 | def url_gen(request): | |
30 | registry = request.registry |
|
30 | registry = request.registry | |
31 | longpoll_url = registry.settings.get('channelstream.longpoll_url', '') |
|
31 | longpoll_url = registry.settings.get('channelstream.longpoll_url', '') | |
32 | ws_url = registry.settings.get('channelstream.ws_url', '') |
|
32 | ws_url = registry.settings.get('channelstream.ws_url', '') | |
33 | proxy_url = request.route_url('channelstream_proxy') |
|
33 | proxy_url = request.route_url('channelstream_proxy') | |
34 | urls = { |
|
34 | urls = { | |
35 | 'connect': request.route_path('channelstream_connect'), |
|
35 | 'connect': request.route_path('channelstream_connect'), | |
36 | 'subscribe': request.route_path('channelstream_subscribe'), |
|
36 | 'subscribe': request.route_path('channelstream_subscribe'), | |
37 | 'longpoll': longpoll_url or proxy_url, |
|
37 | 'longpoll': longpoll_url or proxy_url, | |
38 | 'ws': ws_url or proxy_url.replace('http', 'ws') |
|
38 | 'ws': ws_url or proxy_url.replace('http', 'ws') | |
39 | } |
|
39 | } | |
40 | return json.dumps(urls) |
|
40 | return json.dumps(urls) | |
41 |
|
41 | |||
42 |
|
42 | |||
43 | PLUGIN_DEFINITION = { |
|
43 | PLUGIN_DEFINITION = { | |
44 | 'name': 'channelstream', |
|
44 | 'name': 'channelstream', | |
45 | 'config': { |
|
45 | 'config': { | |
46 | 'javascript': [], |
|
46 | 'javascript': [], | |
47 | 'css': [], |
|
47 | 'css': [], | |
48 | 'template_hooks': { |
|
48 | 'template_hooks': { | |
49 | 'plugin_init_template': 'rhodecode:templates/channelstream/plugin_init.mako' |
|
49 | 'plugin_init_template': 'rhodecode:templates/channelstream/plugin_init.mako' | |
50 | }, |
|
50 | }, | |
51 | 'url_gen': url_gen, |
|
51 | 'url_gen': url_gen, | |
52 | 'static': None, |
|
52 | 'static': None, | |
53 | 'enabled': False, |
|
53 | 'enabled': False, | |
54 | 'server': '', |
|
54 | 'server': '', | |
55 | 'secret': '' |
|
55 | 'secret': '' | |
56 | } |
|
56 | } | |
57 | } |
|
57 | } | |
58 |
|
58 | |||
59 |
|
59 | |||
60 | def includeme(config): |
|
60 | def includeme(config): | |
61 | settings = config.registry.settings |
|
61 | settings = config.registry.settings | |
62 | PLUGIN_DEFINITION['config']['enabled'] = asbool( |
|
62 | PLUGIN_DEFINITION['config']['enabled'] = asbool( | |
63 | settings.get('channelstream.enabled')) |
|
63 | settings.get('channelstream.enabled')) | |
64 | PLUGIN_DEFINITION['config']['server'] = settings.get( |
|
64 | PLUGIN_DEFINITION['config']['server'] = settings.get( | |
65 | 'channelstream.server', '') |
|
65 | 'channelstream.server', '') | |
66 | PLUGIN_DEFINITION['config']['secret'] = settings.get( |
|
66 | PLUGIN_DEFINITION['config']['secret'] = settings.get( | |
67 | 'channelstream.secret', '') |
|
67 | 'channelstream.secret', '') | |
68 | PLUGIN_DEFINITION['config']['history.location'] = settings.get( |
|
68 | PLUGIN_DEFINITION['config']['history.location'] = settings.get( | |
69 | 'channelstream.history.location', '') |
|
69 | 'channelstream.history.location', '') | |
70 | config.register_rhodecode_plugin( |
|
70 | config.register_rhodecode_plugin( | |
71 | PLUGIN_DEFINITION['name'], |
|
71 | PLUGIN_DEFINITION['name'], | |
72 | PLUGIN_DEFINITION['config'] |
|
72 | PLUGIN_DEFINITION['config'] | |
73 | ) |
|
73 | ) | |
74 | # create plugin history location |
|
74 | # create plugin history location | |
75 | history_dir = PLUGIN_DEFINITION['config']['history.location'] |
|
75 | history_dir = PLUGIN_DEFINITION['config']['history.location'] | |
76 | if history_dir and not os.path.exists(history_dir): |
|
76 | if history_dir and not os.path.exists(history_dir): | |
77 | os.makedirs(history_dir, 0750) |
|
77 | os.makedirs(history_dir, 0750) | |
78 |
|
78 | |||
79 | config.add_route( |
|
79 | config.add_route( | |
80 | name='channelstream_connect', |
|
80 | name='channelstream_connect', | |
81 | pattern=ADMIN_PREFIX + '/channelstream/connect') |
|
81 | pattern=ADMIN_PREFIX + '/channelstream/connect') | |
82 | config.add_route( |
|
82 | config.add_route( | |
83 | name='channelstream_subscribe', |
|
83 | name='channelstream_subscribe', | |
84 | pattern=ADMIN_PREFIX + '/channelstream/subscribe') |
|
84 | pattern=ADMIN_PREFIX + '/channelstream/subscribe') | |
85 | config.add_route( |
|
85 | config.add_route( | |
86 | name='channelstream_proxy', |
|
86 | name='channelstream_proxy', | |
87 | pattern=settings.get('channelstream.proxy_path') or '/_channelstream') |
|
87 | pattern=settings.get('channelstream.proxy_path') or '/_channelstream') | |
88 |
|
88 | |||
89 | # Scan module for configuration decorators. |
|
89 | # Scan module for configuration decorators. | |
90 | config.scan() |
|
90 | config.scan('.views', ignore='.tests') |
@@ -1,42 +1,42 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2016-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2016-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 | from rhodecode.apps._base import ADMIN_PREFIX |
|
20 | from rhodecode.apps._base import ADMIN_PREFIX | |
21 | from rhodecode.lib.utils2 import str2bool |
|
21 | from rhodecode.lib.utils2 import str2bool | |
22 |
|
22 | |||
23 |
|
23 | |||
24 | def debug_style_enabled(info, request): |
|
24 | def debug_style_enabled(info, request): | |
25 | return str2bool(request.registry.settings.get('debug_style')) |
|
25 | return str2bool(request.registry.settings.get('debug_style')) | |
26 |
|
26 | |||
27 |
|
27 | |||
28 | def includeme(config): |
|
28 | def includeme(config): | |
29 | config.add_route( |
|
29 | config.add_route( | |
30 | name='debug_style_home', |
|
30 | name='debug_style_home', | |
31 | pattern=ADMIN_PREFIX + '/debug_style', |
|
31 | pattern=ADMIN_PREFIX + '/debug_style', | |
32 | custom_predicates=(debug_style_enabled,)) |
|
32 | custom_predicates=(debug_style_enabled,)) | |
33 | config.add_route( |
|
33 | config.add_route( | |
34 | name='debug_style_template', |
|
34 | name='debug_style_template', | |
35 | pattern=ADMIN_PREFIX + '/debug_style/t/{t_path}', |
|
35 | pattern=ADMIN_PREFIX + '/debug_style/t/{t_path}', | |
36 | custom_predicates=(debug_style_enabled,)) |
|
36 | custom_predicates=(debug_style_enabled,)) | |
37 |
|
37 | |||
38 | # Scan module for configuration decorators. |
|
38 | # Scan module for configuration decorators. | |
39 | config.scan() |
|
39 | config.scan('.views', ignore='.tests') | |
40 |
|
40 | |||
41 |
|
41 | |||
42 |
|
42 |
@@ -1,62 +1,62 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2016-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2016-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 | 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 | config.add_route( |
|
24 | config.add_route( | |
25 | name='gists_show', pattern='/gists') |
|
25 | name='gists_show', pattern='/gists') | |
26 | config.add_route( |
|
26 | config.add_route( | |
27 | name='gists_new', pattern='/gists/new') |
|
27 | name='gists_new', pattern='/gists/new') | |
28 | config.add_route( |
|
28 | config.add_route( | |
29 | name='gists_create', pattern='/gists/create') |
|
29 | name='gists_create', pattern='/gists/create') | |
30 |
|
30 | |||
31 | config.add_route( |
|
31 | config.add_route( | |
32 | name='gist_show', pattern='/gists/{gist_id}') |
|
32 | name='gist_show', pattern='/gists/{gist_id}') | |
33 |
|
33 | |||
34 | config.add_route( |
|
34 | config.add_route( | |
35 | name='gist_delete', pattern='/gists/{gist_id}/delete') |
|
35 | name='gist_delete', pattern='/gists/{gist_id}/delete') | |
36 |
|
36 | |||
37 | config.add_route( |
|
37 | config.add_route( | |
38 | name='gist_edit', pattern='/gists/{gist_id}/edit') |
|
38 | name='gist_edit', pattern='/gists/{gist_id}/edit') | |
39 |
|
39 | |||
40 | config.add_route( |
|
40 | config.add_route( | |
41 | name='gist_edit_check_revision', |
|
41 | name='gist_edit_check_revision', | |
42 | pattern='/gists/{gist_id}/edit/check_revision') |
|
42 | pattern='/gists/{gist_id}/edit/check_revision') | |
43 |
|
43 | |||
44 | config.add_route( |
|
44 | config.add_route( | |
45 | name='gist_update', pattern='/gists/{gist_id}/update') |
|
45 | name='gist_update', pattern='/gists/{gist_id}/update') | |
46 |
|
46 | |||
47 | config.add_route( |
|
47 | config.add_route( | |
48 | name='gist_show_rev', |
|
48 | name='gist_show_rev', | |
49 | pattern='/gists/{gist_id}/{revision}') |
|
49 | pattern='/gists/{gist_id}/{revision}') | |
50 | config.add_route( |
|
50 | config.add_route( | |
51 | name='gist_show_formatted', |
|
51 | name='gist_show_formatted', | |
52 | pattern='/gists/{gist_id}/{revision}/{format}') |
|
52 | pattern='/gists/{gist_id}/{revision}/{format}') | |
53 |
|
53 | |||
54 | config.add_route( |
|
54 | config.add_route( | |
55 | name='gist_show_formatted_path', |
|
55 | name='gist_show_formatted_path', | |
56 | pattern='/gists/{gist_id}/{revision}/{format}/{f_path:.*}') |
|
56 | pattern='/gists/{gist_id}/{revision}/{format}/{f_path:.*}') | |
57 |
|
57 | |||
58 |
|
58 | |||
59 | def includeme(config): |
|
59 | def includeme(config): | |
60 | config.include(admin_routes, route_prefix=ADMIN_PREFIX) |
|
60 | config.include(admin_routes, route_prefix=ADMIN_PREFIX) | |
61 | # Scan module for configuration decorators. |
|
61 | # Scan module for configuration decorators. | |
62 | config.scan() |
|
62 | config.scan('.views', ignore='.tests') |
@@ -1,49 +1,49 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2016-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2016-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 | from rhodecode.config import routing_links |
|
20 | from rhodecode.config import routing_links | |
21 |
|
21 | |||
22 |
|
22 | |||
23 | def includeme(config): |
|
23 | def includeme(config): | |
24 |
|
24 | |||
25 | config.add_route( |
|
25 | config.add_route( | |
26 | name='home', |
|
26 | name='home', | |
27 | pattern='/') |
|
27 | pattern='/') | |
28 |
|
28 | |||
29 | config.add_route( |
|
29 | config.add_route( | |
30 | name='user_autocomplete_data', |
|
30 | name='user_autocomplete_data', | |
31 | pattern='/_users') |
|
31 | pattern='/_users') | |
32 |
|
32 | |||
33 | config.add_route( |
|
33 | config.add_route( | |
34 | name='user_group_autocomplete_data', |
|
34 | name='user_group_autocomplete_data', | |
35 | pattern='/_user_groups') |
|
35 | pattern='/_user_groups') | |
36 |
|
36 | |||
37 | config.add_route( |
|
37 | config.add_route( | |
38 | name='repo_list_data', |
|
38 | name='repo_list_data', | |
39 | pattern='/_repos') |
|
39 | pattern='/_repos') | |
40 |
|
40 | |||
41 | config.add_route( |
|
41 | config.add_route( | |
42 | name='goto_switcher_data', |
|
42 | name='goto_switcher_data', | |
43 | pattern='/_goto_data') |
|
43 | pattern='/_goto_data') | |
44 |
|
44 | |||
45 | # register our static links via redirection mechanism |
|
45 | # register our static links via redirection mechanism | |
46 | routing_links.connect_redirection_links(config) |
|
46 | routing_links.connect_redirection_links(config) | |
47 |
|
47 | |||
48 | # Scan module for configuration decorators. |
|
48 | # Scan module for configuration decorators. | |
49 | config.scan() |
|
49 | config.scan('.views', ignore='.tests') |
@@ -1,53 +1,53 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2016-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2016-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 |
|
20 | |||
21 |
|
21 | |||
22 | from rhodecode.apps._base import ADMIN_PREFIX |
|
22 | from rhodecode.apps._base import ADMIN_PREFIX | |
23 |
|
23 | |||
24 |
|
24 | |||
25 | def admin_routes(config): |
|
25 | def admin_routes(config): | |
26 |
|
26 | |||
27 | config.add_route( |
|
27 | config.add_route( | |
28 | name='journal', pattern='/journal') |
|
28 | name='journal', pattern='/journal') | |
29 | config.add_route( |
|
29 | config.add_route( | |
30 | name='journal_rss', pattern='/journal/rss') |
|
30 | name='journal_rss', pattern='/journal/rss') | |
31 | config.add_route( |
|
31 | config.add_route( | |
32 | name='journal_atom', pattern='/journal/atom') |
|
32 | name='journal_atom', pattern='/journal/atom') | |
33 |
|
33 | |||
34 | config.add_route( |
|
34 | config.add_route( | |
35 | name='journal_public', pattern='/public_journal') |
|
35 | name='journal_public', pattern='/public_journal') | |
36 | config.add_route( |
|
36 | config.add_route( | |
37 | name='journal_public_atom', pattern='/public_journal/atom') |
|
37 | name='journal_public_atom', pattern='/public_journal/atom') | |
38 | config.add_route( |
|
38 | config.add_route( | |
39 | name='journal_public_atom_old', pattern='/public_journal_atom') |
|
39 | name='journal_public_atom_old', pattern='/public_journal_atom') | |
40 |
|
40 | |||
41 | config.add_route( |
|
41 | config.add_route( | |
42 | name='journal_public_rss', pattern='/public_journal/rss') |
|
42 | name='journal_public_rss', pattern='/public_journal/rss') | |
43 | config.add_route( |
|
43 | config.add_route( | |
44 | name='journal_public_rss_old', pattern='/public_journal_rss') |
|
44 | name='journal_public_rss_old', pattern='/public_journal_rss') | |
45 |
|
45 | |||
46 | config.add_route( |
|
46 | config.add_route( | |
47 | name='toggle_following', pattern='/toggle_following') |
|
47 | name='toggle_following', pattern='/toggle_following') | |
48 |
|
48 | |||
49 |
|
49 | |||
50 | def includeme(config): |
|
50 | def includeme(config): | |
51 | config.include(admin_routes, route_prefix=ADMIN_PREFIX) |
|
51 | config.include(admin_routes, route_prefix=ADMIN_PREFIX) | |
52 | # Scan module for configuration decorators. |
|
52 | # Scan module for configuration decorators. | |
53 | config.scan() No newline at end of file |
|
53 | config.scan('.views', ignore='.tests') |
@@ -1,44 +1,44 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2016-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2016-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 |
|
20 | |||
21 |
|
21 | |||
22 | from rhodecode.config.routing import ADMIN_PREFIX |
|
22 | from rhodecode.config.routing import ADMIN_PREFIX | |
23 |
|
23 | |||
24 |
|
24 | |||
25 | def includeme(config): |
|
25 | def includeme(config): | |
26 |
|
26 | |||
27 | config.add_route( |
|
27 | config.add_route( | |
28 | name='login', |
|
28 | name='login', | |
29 | pattern=ADMIN_PREFIX + '/login') |
|
29 | pattern=ADMIN_PREFIX + '/login') | |
30 | config.add_route( |
|
30 | config.add_route( | |
31 | name='logout', |
|
31 | name='logout', | |
32 | pattern=ADMIN_PREFIX + '/logout') |
|
32 | pattern=ADMIN_PREFIX + '/logout') | |
33 | config.add_route( |
|
33 | config.add_route( | |
34 | name='register', |
|
34 | name='register', | |
35 | pattern=ADMIN_PREFIX + '/register') |
|
35 | pattern=ADMIN_PREFIX + '/register') | |
36 | config.add_route( |
|
36 | config.add_route( | |
37 | name='reset_password', |
|
37 | name='reset_password', | |
38 | pattern=ADMIN_PREFIX + '/password_reset') |
|
38 | pattern=ADMIN_PREFIX + '/password_reset') | |
39 | config.add_route( |
|
39 | config.add_route( | |
40 | name='reset_password_confirmation', |
|
40 | name='reset_password_confirmation', | |
41 | pattern=ADMIN_PREFIX + '/password_reset_confirmation') |
|
41 | pattern=ADMIN_PREFIX + '/password_reset_confirmation') | |
42 |
|
42 | |||
43 | # Scan module for configuration decorators. |
|
43 | # Scan module for configuration decorators. | |
44 | config.scan() |
|
44 | config.scan('.views', ignore='.tests') |
@@ -1,126 +1,126 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2016-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2016-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 |
|
20 | |||
21 |
|
21 | |||
22 | from rhodecode.apps._base import ADMIN_PREFIX |
|
22 | from rhodecode.apps._base import ADMIN_PREFIX | |
23 |
|
23 | |||
24 |
|
24 | |||
25 | def includeme(config): |
|
25 | def includeme(config): | |
26 |
|
26 | |||
27 | config.add_route( |
|
27 | config.add_route( | |
28 | name='my_account_profile', |
|
28 | name='my_account_profile', | |
29 | pattern=ADMIN_PREFIX + '/my_account/profile') |
|
29 | pattern=ADMIN_PREFIX + '/my_account/profile') | |
30 |
|
30 | |||
31 | # my account edit details |
|
31 | # my account edit details | |
32 | config.add_route( |
|
32 | config.add_route( | |
33 | name='my_account_edit', |
|
33 | name='my_account_edit', | |
34 | pattern=ADMIN_PREFIX + '/my_account/edit') |
|
34 | pattern=ADMIN_PREFIX + '/my_account/edit') | |
35 | config.add_route( |
|
35 | config.add_route( | |
36 | name='my_account_update', |
|
36 | name='my_account_update', | |
37 | pattern=ADMIN_PREFIX + '/my_account/update') |
|
37 | pattern=ADMIN_PREFIX + '/my_account/update') | |
38 |
|
38 | |||
39 | # my account password |
|
39 | # my account password | |
40 | config.add_route( |
|
40 | config.add_route( | |
41 | name='my_account_password', |
|
41 | name='my_account_password', | |
42 | pattern=ADMIN_PREFIX + '/my_account/password') |
|
42 | pattern=ADMIN_PREFIX + '/my_account/password') | |
43 |
|
43 | |||
44 | config.add_route( |
|
44 | config.add_route( | |
45 | name='my_account_password_update', |
|
45 | name='my_account_password_update', | |
46 | pattern=ADMIN_PREFIX + '/my_account/password/update') |
|
46 | pattern=ADMIN_PREFIX + '/my_account/password/update') | |
47 |
|
47 | |||
48 | # my account tokens |
|
48 | # my account tokens | |
49 | config.add_route( |
|
49 | config.add_route( | |
50 | name='my_account_auth_tokens', |
|
50 | name='my_account_auth_tokens', | |
51 | pattern=ADMIN_PREFIX + '/my_account/auth_tokens') |
|
51 | pattern=ADMIN_PREFIX + '/my_account/auth_tokens') | |
52 | config.add_route( |
|
52 | config.add_route( | |
53 | name='my_account_auth_tokens_add', |
|
53 | name='my_account_auth_tokens_add', | |
54 | pattern=ADMIN_PREFIX + '/my_account/auth_tokens/new') |
|
54 | pattern=ADMIN_PREFIX + '/my_account/auth_tokens/new') | |
55 | config.add_route( |
|
55 | config.add_route( | |
56 | name='my_account_auth_tokens_delete', |
|
56 | name='my_account_auth_tokens_delete', | |
57 | pattern=ADMIN_PREFIX + '/my_account/auth_tokens/delete') |
|
57 | pattern=ADMIN_PREFIX + '/my_account/auth_tokens/delete') | |
58 |
|
58 | |||
59 | # my account emails |
|
59 | # my account emails | |
60 | config.add_route( |
|
60 | config.add_route( | |
61 | name='my_account_emails', |
|
61 | name='my_account_emails', | |
62 | pattern=ADMIN_PREFIX + '/my_account/emails') |
|
62 | pattern=ADMIN_PREFIX + '/my_account/emails') | |
63 | config.add_route( |
|
63 | config.add_route( | |
64 | name='my_account_emails_add', |
|
64 | name='my_account_emails_add', | |
65 | pattern=ADMIN_PREFIX + '/my_account/emails/new') |
|
65 | pattern=ADMIN_PREFIX + '/my_account/emails/new') | |
66 | config.add_route( |
|
66 | config.add_route( | |
67 | name='my_account_emails_delete', |
|
67 | name='my_account_emails_delete', | |
68 | pattern=ADMIN_PREFIX + '/my_account/emails/delete') |
|
68 | pattern=ADMIN_PREFIX + '/my_account/emails/delete') | |
69 |
|
69 | |||
70 | config.add_route( |
|
70 | config.add_route( | |
71 | name='my_account_repos', |
|
71 | name='my_account_repos', | |
72 | pattern=ADMIN_PREFIX + '/my_account/repos') |
|
72 | pattern=ADMIN_PREFIX + '/my_account/repos') | |
73 |
|
73 | |||
74 | config.add_route( |
|
74 | config.add_route( | |
75 | name='my_account_watched', |
|
75 | name='my_account_watched', | |
76 | pattern=ADMIN_PREFIX + '/my_account/watched') |
|
76 | pattern=ADMIN_PREFIX + '/my_account/watched') | |
77 |
|
77 | |||
78 | config.add_route( |
|
78 | config.add_route( | |
79 | name='my_account_perms', |
|
79 | name='my_account_perms', | |
80 | pattern=ADMIN_PREFIX + '/my_account/perms') |
|
80 | pattern=ADMIN_PREFIX + '/my_account/perms') | |
81 |
|
81 | |||
82 | config.add_route( |
|
82 | config.add_route( | |
83 | name='my_account_notifications', |
|
83 | name='my_account_notifications', | |
84 | pattern=ADMIN_PREFIX + '/my_account/notifications') |
|
84 | pattern=ADMIN_PREFIX + '/my_account/notifications') | |
85 |
|
85 | |||
86 | config.add_route( |
|
86 | config.add_route( | |
87 | name='my_account_notifications_toggle_visibility', |
|
87 | name='my_account_notifications_toggle_visibility', | |
88 | pattern=ADMIN_PREFIX + '/my_account/toggle_visibility') |
|
88 | pattern=ADMIN_PREFIX + '/my_account/toggle_visibility') | |
89 |
|
89 | |||
90 | # my account pull requests |
|
90 | # my account pull requests | |
91 | config.add_route( |
|
91 | config.add_route( | |
92 | name='my_account_pullrequests', |
|
92 | name='my_account_pullrequests', | |
93 | pattern=ADMIN_PREFIX + '/my_account/pull_requests') |
|
93 | pattern=ADMIN_PREFIX + '/my_account/pull_requests') | |
94 | config.add_route( |
|
94 | config.add_route( | |
95 | name='my_account_pullrequests_data', |
|
95 | name='my_account_pullrequests_data', | |
96 | pattern=ADMIN_PREFIX + '/my_account/pull_requests/data') |
|
96 | pattern=ADMIN_PREFIX + '/my_account/pull_requests/data') | |
97 |
|
97 | |||
98 | # notifications |
|
98 | # notifications | |
99 | config.add_route( |
|
99 | config.add_route( | |
100 | name='notifications_show_all', |
|
100 | name='notifications_show_all', | |
101 | pattern=ADMIN_PREFIX + '/notifications') |
|
101 | pattern=ADMIN_PREFIX + '/notifications') | |
102 |
|
102 | |||
103 | # notifications |
|
103 | # notifications | |
104 | config.add_route( |
|
104 | config.add_route( | |
105 | name='notifications_mark_all_read', |
|
105 | name='notifications_mark_all_read', | |
106 | pattern=ADMIN_PREFIX + '/notifications/mark_all_read') |
|
106 | pattern=ADMIN_PREFIX + '/notifications/mark_all_read') | |
107 |
|
107 | |||
108 | config.add_route( |
|
108 | config.add_route( | |
109 | name='notifications_show', |
|
109 | name='notifications_show', | |
110 | pattern=ADMIN_PREFIX + '/notifications/{notification_id}') |
|
110 | pattern=ADMIN_PREFIX + '/notifications/{notification_id}') | |
111 |
|
111 | |||
112 | config.add_route( |
|
112 | config.add_route( | |
113 | name='notifications_update', |
|
113 | name='notifications_update', | |
114 | pattern=ADMIN_PREFIX + '/notifications/{notification_id}/update') |
|
114 | pattern=ADMIN_PREFIX + '/notifications/{notification_id}/update') | |
115 |
|
115 | |||
116 | config.add_route( |
|
116 | config.add_route( | |
117 | name='notifications_delete', |
|
117 | name='notifications_delete', | |
118 | pattern=ADMIN_PREFIX + '/notifications/{notification_id}/delete') |
|
118 | pattern=ADMIN_PREFIX + '/notifications/{notification_id}/delete') | |
119 |
|
119 | |||
120 | # channelstream test |
|
120 | # channelstream test | |
121 | config.add_route( |
|
121 | config.add_route( | |
122 | name='my_account_notifications_test_channelstream', |
|
122 | name='my_account_notifications_test_channelstream', | |
123 | pattern=ADMIN_PREFIX + '/my_account/test_channelstream') |
|
123 | pattern=ADMIN_PREFIX + '/my_account/test_channelstream') | |
124 |
|
124 | |||
125 | # Scan module for configuration decorators. |
|
125 | # Scan module for configuration decorators. | |
126 | config.scan() |
|
126 | config.scan('.views', ignore='.tests') |
@@ -1,41 +1,41 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2016-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2016-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 |
|
20 | |||
21 | from rhodecode.config.routing import ADMIN_PREFIX |
|
21 | from rhodecode.config.routing import ADMIN_PREFIX | |
22 |
|
22 | |||
23 |
|
23 | |||
24 | def admin_routes(config): |
|
24 | def admin_routes(config): | |
25 | config.add_route( |
|
25 | config.add_route( | |
26 | name='ops_ping', |
|
26 | name='ops_ping', | |
27 | pattern='/ping') |
|
27 | pattern='/ping') | |
28 | config.add_route( |
|
28 | config.add_route( | |
29 | name='ops_error_test', |
|
29 | name='ops_error_test', | |
30 | pattern='/error') |
|
30 | pattern='/error') | |
31 | config.add_route( |
|
31 | config.add_route( | |
32 | name='ops_redirect_test', |
|
32 | name='ops_redirect_test', | |
33 | pattern='/redirect') |
|
33 | pattern='/redirect') | |
34 |
|
34 | |||
35 |
|
35 | |||
36 | def includeme(config): |
|
36 | def includeme(config): | |
37 |
|
37 | |||
38 | config.include(admin_routes, route_prefix=ADMIN_PREFIX + '/ops') |
|
38 | config.include(admin_routes, route_prefix=ADMIN_PREFIX + '/ops') | |
39 |
|
39 | |||
40 | # Scan module for configuration decorators. |
|
40 | # Scan module for configuration decorators. | |
41 | config.scan() |
|
41 | config.scan('.views', ignore='.tests') |
@@ -1,33 +1,33 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2016-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2016-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 | from rhodecode.apps._base import add_route_with_slash |
|
20 | from rhodecode.apps._base import add_route_with_slash | |
21 |
|
21 | |||
22 |
|
22 | |||
23 | def includeme(config): |
|
23 | def includeme(config): | |
24 |
|
24 | |||
25 | # Summary |
|
25 | # Summary | |
26 | add_route_with_slash( |
|
26 | add_route_with_slash( | |
27 | config, |
|
27 | config, | |
28 | name='repo_group_home', |
|
28 | name='repo_group_home', | |
29 | pattern='/{repo_group_name:.*?[^/]}', repo_group_route=True) |
|
29 | pattern='/{repo_group_name:.*?[^/]}', repo_group_route=True) | |
30 |
|
30 | |||
31 | # Scan module for configuration decorators. |
|
31 | # Scan module for configuration decorators. | |
32 | config.scan() |
|
32 | config.scan('.views', ignore='.tests') | |
33 |
|
33 |
@@ -1,387 +1,387 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2016-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2016-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 | from rhodecode.apps._base import add_route_with_slash |
|
20 | from rhodecode.apps._base import add_route_with_slash | |
21 |
|
21 | |||
22 |
|
22 | |||
23 | def includeme(config): |
|
23 | def includeme(config): | |
24 |
|
24 | |||
25 | # repo creating checks, special cases that aren't repo routes |
|
25 | # repo creating checks, special cases that aren't repo routes | |
26 | config.add_route( |
|
26 | config.add_route( | |
27 | name='repo_creating', |
|
27 | name='repo_creating', | |
28 | pattern='/{repo_name:.*?[^/]}/repo_creating') |
|
28 | pattern='/{repo_name:.*?[^/]}/repo_creating') | |
29 |
|
29 | |||
30 | config.add_route( |
|
30 | config.add_route( | |
31 | name='repo_creating_check', |
|
31 | name='repo_creating_check', | |
32 | pattern='/{repo_name:.*?[^/]}/repo_creating_check') |
|
32 | pattern='/{repo_name:.*?[^/]}/repo_creating_check') | |
33 |
|
33 | |||
34 | # Summary |
|
34 | # Summary | |
35 | # NOTE(marcink): one additional route is defined in very bottom, catch |
|
35 | # NOTE(marcink): one additional route is defined in very bottom, catch | |
36 | # all pattern |
|
36 | # all pattern | |
37 | config.add_route( |
|
37 | config.add_route( | |
38 | name='repo_summary_explicit', |
|
38 | name='repo_summary_explicit', | |
39 | pattern='/{repo_name:.*?[^/]}/summary', repo_route=True) |
|
39 | pattern='/{repo_name:.*?[^/]}/summary', repo_route=True) | |
40 | config.add_route( |
|
40 | config.add_route( | |
41 | name='repo_summary_commits', |
|
41 | name='repo_summary_commits', | |
42 | pattern='/{repo_name:.*?[^/]}/summary-commits', repo_route=True) |
|
42 | pattern='/{repo_name:.*?[^/]}/summary-commits', repo_route=True) | |
43 |
|
43 | |||
44 | # Commits |
|
44 | # Commits | |
45 | config.add_route( |
|
45 | config.add_route( | |
46 | name='repo_commit', |
|
46 | name='repo_commit', | |
47 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}', repo_route=True) |
|
47 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}', repo_route=True) | |
48 |
|
48 | |||
49 | config.add_route( |
|
49 | config.add_route( | |
50 | name='repo_commit_children', |
|
50 | name='repo_commit_children', | |
51 | pattern='/{repo_name:.*?[^/]}/changeset_children/{commit_id}', repo_route=True) |
|
51 | pattern='/{repo_name:.*?[^/]}/changeset_children/{commit_id}', repo_route=True) | |
52 |
|
52 | |||
53 | config.add_route( |
|
53 | config.add_route( | |
54 | name='repo_commit_parents', |
|
54 | name='repo_commit_parents', | |
55 | pattern='/{repo_name:.*?[^/]}/changeset_parents/{commit_id}', repo_route=True) |
|
55 | pattern='/{repo_name:.*?[^/]}/changeset_parents/{commit_id}', repo_route=True) | |
56 |
|
56 | |||
57 | config.add_route( |
|
57 | config.add_route( | |
58 | name='repo_commit_raw', |
|
58 | name='repo_commit_raw', | |
59 | pattern='/{repo_name:.*?[^/]}/changeset-diff/{commit_id}', repo_route=True) |
|
59 | pattern='/{repo_name:.*?[^/]}/changeset-diff/{commit_id}', repo_route=True) | |
60 |
|
60 | |||
61 | config.add_route( |
|
61 | config.add_route( | |
62 | name='repo_commit_patch', |
|
62 | name='repo_commit_patch', | |
63 | pattern='/{repo_name:.*?[^/]}/changeset-patch/{commit_id}', repo_route=True) |
|
63 | pattern='/{repo_name:.*?[^/]}/changeset-patch/{commit_id}', repo_route=True) | |
64 |
|
64 | |||
65 | config.add_route( |
|
65 | config.add_route( | |
66 | name='repo_commit_download', |
|
66 | name='repo_commit_download', | |
67 | pattern='/{repo_name:.*?[^/]}/changeset-download/{commit_id}', repo_route=True) |
|
67 | pattern='/{repo_name:.*?[^/]}/changeset-download/{commit_id}', repo_route=True) | |
68 |
|
68 | |||
69 | config.add_route( |
|
69 | config.add_route( | |
70 | name='repo_commit_data', |
|
70 | name='repo_commit_data', | |
71 | pattern='/{repo_name:.*?[^/]}/changeset-data/{commit_id}', repo_route=True) |
|
71 | pattern='/{repo_name:.*?[^/]}/changeset-data/{commit_id}', repo_route=True) | |
72 |
|
72 | |||
73 | config.add_route( |
|
73 | config.add_route( | |
74 | name='repo_commit_comment_create', |
|
74 | name='repo_commit_comment_create', | |
75 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/create', repo_route=True) |
|
75 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/create', repo_route=True) | |
76 |
|
76 | |||
77 | config.add_route( |
|
77 | config.add_route( | |
78 | name='repo_commit_comment_preview', |
|
78 | name='repo_commit_comment_preview', | |
79 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/preview', repo_route=True) |
|
79 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/preview', repo_route=True) | |
80 |
|
80 | |||
81 | config.add_route( |
|
81 | config.add_route( | |
82 | name='repo_commit_comment_delete', |
|
82 | name='repo_commit_comment_delete', | |
83 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/delete', repo_route=True) |
|
83 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/delete', repo_route=True) | |
84 |
|
84 | |||
85 | # still working url for backward compat. |
|
85 | # still working url for backward compat. | |
86 | config.add_route( |
|
86 | config.add_route( | |
87 | name='repo_commit_raw_deprecated', |
|
87 | name='repo_commit_raw_deprecated', | |
88 | pattern='/{repo_name:.*?[^/]}/raw-changeset/{commit_id}', repo_route=True) |
|
88 | pattern='/{repo_name:.*?[^/]}/raw-changeset/{commit_id}', repo_route=True) | |
89 |
|
89 | |||
90 | # Files |
|
90 | # Files | |
91 | config.add_route( |
|
91 | config.add_route( | |
92 | name='repo_archivefile', |
|
92 | name='repo_archivefile', | |
93 | pattern='/{repo_name:.*?[^/]}/archive/{fname}', repo_route=True) |
|
93 | pattern='/{repo_name:.*?[^/]}/archive/{fname}', repo_route=True) | |
94 |
|
94 | |||
95 | config.add_route( |
|
95 | config.add_route( | |
96 | name='repo_files_diff', |
|
96 | name='repo_files_diff', | |
97 | pattern='/{repo_name:.*?[^/]}/diff/{f_path:.*}', repo_route=True) |
|
97 | pattern='/{repo_name:.*?[^/]}/diff/{f_path:.*}', repo_route=True) | |
98 | config.add_route( # legacy route to make old links work |
|
98 | config.add_route( # legacy route to make old links work | |
99 | name='repo_files_diff_2way_redirect', |
|
99 | name='repo_files_diff_2way_redirect', | |
100 | pattern='/{repo_name:.*?[^/]}/diff-2way/{f_path:.*}', repo_route=True) |
|
100 | pattern='/{repo_name:.*?[^/]}/diff-2way/{f_path:.*}', repo_route=True) | |
101 |
|
101 | |||
102 | config.add_route( |
|
102 | config.add_route( | |
103 | name='repo_files', |
|
103 | name='repo_files', | |
104 | pattern='/{repo_name:.*?[^/]}/files/{commit_id}/{f_path:.*}', repo_route=True) |
|
104 | pattern='/{repo_name:.*?[^/]}/files/{commit_id}/{f_path:.*}', repo_route=True) | |
105 | config.add_route( |
|
105 | config.add_route( | |
106 | name='repo_files:default_path', |
|
106 | name='repo_files:default_path', | |
107 | pattern='/{repo_name:.*?[^/]}/files/{commit_id}/', repo_route=True) |
|
107 | pattern='/{repo_name:.*?[^/]}/files/{commit_id}/', repo_route=True) | |
108 | config.add_route( |
|
108 | config.add_route( | |
109 | name='repo_files:default_commit', |
|
109 | name='repo_files:default_commit', | |
110 | pattern='/{repo_name:.*?[^/]}/files', repo_route=True) |
|
110 | pattern='/{repo_name:.*?[^/]}/files', repo_route=True) | |
111 |
|
111 | |||
112 | config.add_route( |
|
112 | config.add_route( | |
113 | name='repo_files:rendered', |
|
113 | name='repo_files:rendered', | |
114 | pattern='/{repo_name:.*?[^/]}/render/{commit_id}/{f_path:.*}', repo_route=True) |
|
114 | pattern='/{repo_name:.*?[^/]}/render/{commit_id}/{f_path:.*}', repo_route=True) | |
115 |
|
115 | |||
116 | config.add_route( |
|
116 | config.add_route( | |
117 | name='repo_files:annotated', |
|
117 | name='repo_files:annotated', | |
118 | pattern='/{repo_name:.*?[^/]}/annotate/{commit_id}/{f_path:.*}', repo_route=True) |
|
118 | pattern='/{repo_name:.*?[^/]}/annotate/{commit_id}/{f_path:.*}', repo_route=True) | |
119 | config.add_route( |
|
119 | config.add_route( | |
120 | name='repo_files:annotated_previous', |
|
120 | name='repo_files:annotated_previous', | |
121 | pattern='/{repo_name:.*?[^/]}/annotate-previous/{commit_id}/{f_path:.*}', repo_route=True) |
|
121 | pattern='/{repo_name:.*?[^/]}/annotate-previous/{commit_id}/{f_path:.*}', repo_route=True) | |
122 |
|
122 | |||
123 | config.add_route( |
|
123 | config.add_route( | |
124 | name='repo_nodetree_full', |
|
124 | name='repo_nodetree_full', | |
125 | pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/{f_path:.*}', repo_route=True) |
|
125 | pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/{f_path:.*}', repo_route=True) | |
126 | config.add_route( |
|
126 | config.add_route( | |
127 | name='repo_nodetree_full:default_path', |
|
127 | name='repo_nodetree_full:default_path', | |
128 | pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/', repo_route=True) |
|
128 | pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/', repo_route=True) | |
129 |
|
129 | |||
130 | config.add_route( |
|
130 | config.add_route( | |
131 | name='repo_files_nodelist', |
|
131 | name='repo_files_nodelist', | |
132 | pattern='/{repo_name:.*?[^/]}/nodelist/{commit_id}/{f_path:.*}', repo_route=True) |
|
132 | pattern='/{repo_name:.*?[^/]}/nodelist/{commit_id}/{f_path:.*}', repo_route=True) | |
133 |
|
133 | |||
134 | config.add_route( |
|
134 | config.add_route( | |
135 | name='repo_file_raw', |
|
135 | name='repo_file_raw', | |
136 | pattern='/{repo_name:.*?[^/]}/raw/{commit_id}/{f_path:.*}', repo_route=True) |
|
136 | pattern='/{repo_name:.*?[^/]}/raw/{commit_id}/{f_path:.*}', repo_route=True) | |
137 |
|
137 | |||
138 | config.add_route( |
|
138 | config.add_route( | |
139 | name='repo_file_download', |
|
139 | name='repo_file_download', | |
140 | pattern='/{repo_name:.*?[^/]}/download/{commit_id}/{f_path:.*}', repo_route=True) |
|
140 | pattern='/{repo_name:.*?[^/]}/download/{commit_id}/{f_path:.*}', repo_route=True) | |
141 | config.add_route( # backward compat to keep old links working |
|
141 | config.add_route( # backward compat to keep old links working | |
142 | name='repo_file_download:legacy', |
|
142 | name='repo_file_download:legacy', | |
143 | pattern='/{repo_name:.*?[^/]}/rawfile/{commit_id}/{f_path:.*}', |
|
143 | pattern='/{repo_name:.*?[^/]}/rawfile/{commit_id}/{f_path:.*}', | |
144 | repo_route=True) |
|
144 | repo_route=True) | |
145 |
|
145 | |||
146 | config.add_route( |
|
146 | config.add_route( | |
147 | name='repo_file_history', |
|
147 | name='repo_file_history', | |
148 | pattern='/{repo_name:.*?[^/]}/history/{commit_id}/{f_path:.*}', repo_route=True) |
|
148 | pattern='/{repo_name:.*?[^/]}/history/{commit_id}/{f_path:.*}', repo_route=True) | |
149 |
|
149 | |||
150 | config.add_route( |
|
150 | config.add_route( | |
151 | name='repo_file_authors', |
|
151 | name='repo_file_authors', | |
152 | pattern='/{repo_name:.*?[^/]}/authors/{commit_id}/{f_path:.*}', repo_route=True) |
|
152 | pattern='/{repo_name:.*?[^/]}/authors/{commit_id}/{f_path:.*}', repo_route=True) | |
153 |
|
153 | |||
154 | config.add_route( |
|
154 | config.add_route( | |
155 | name='repo_files_remove_file', |
|
155 | name='repo_files_remove_file', | |
156 | pattern='/{repo_name:.*?[^/]}/remove_file/{commit_id}/{f_path:.*}', |
|
156 | pattern='/{repo_name:.*?[^/]}/remove_file/{commit_id}/{f_path:.*}', | |
157 | repo_route=True) |
|
157 | repo_route=True) | |
158 | config.add_route( |
|
158 | config.add_route( | |
159 | name='repo_files_delete_file', |
|
159 | name='repo_files_delete_file', | |
160 | pattern='/{repo_name:.*?[^/]}/delete_file/{commit_id}/{f_path:.*}', |
|
160 | pattern='/{repo_name:.*?[^/]}/delete_file/{commit_id}/{f_path:.*}', | |
161 | repo_route=True) |
|
161 | repo_route=True) | |
162 | config.add_route( |
|
162 | config.add_route( | |
163 | name='repo_files_edit_file', |
|
163 | name='repo_files_edit_file', | |
164 | pattern='/{repo_name:.*?[^/]}/edit_file/{commit_id}/{f_path:.*}', |
|
164 | pattern='/{repo_name:.*?[^/]}/edit_file/{commit_id}/{f_path:.*}', | |
165 | repo_route=True) |
|
165 | repo_route=True) | |
166 | config.add_route( |
|
166 | config.add_route( | |
167 | name='repo_files_update_file', |
|
167 | name='repo_files_update_file', | |
168 | pattern='/{repo_name:.*?[^/]}/update_file/{commit_id}/{f_path:.*}', |
|
168 | pattern='/{repo_name:.*?[^/]}/update_file/{commit_id}/{f_path:.*}', | |
169 | repo_route=True) |
|
169 | repo_route=True) | |
170 | config.add_route( |
|
170 | config.add_route( | |
171 | name='repo_files_add_file', |
|
171 | name='repo_files_add_file', | |
172 | pattern='/{repo_name:.*?[^/]}/add_file/{commit_id}/{f_path:.*}', |
|
172 | pattern='/{repo_name:.*?[^/]}/add_file/{commit_id}/{f_path:.*}', | |
173 | repo_route=True) |
|
173 | repo_route=True) | |
174 | config.add_route( |
|
174 | config.add_route( | |
175 | name='repo_files_create_file', |
|
175 | name='repo_files_create_file', | |
176 | pattern='/{repo_name:.*?[^/]}/create_file/{commit_id}/{f_path:.*}', |
|
176 | pattern='/{repo_name:.*?[^/]}/create_file/{commit_id}/{f_path:.*}', | |
177 | repo_route=True) |
|
177 | repo_route=True) | |
178 |
|
178 | |||
179 | # Refs data |
|
179 | # Refs data | |
180 | config.add_route( |
|
180 | config.add_route( | |
181 | name='repo_refs_data', |
|
181 | name='repo_refs_data', | |
182 | pattern='/{repo_name:.*?[^/]}/refs-data', repo_route=True) |
|
182 | pattern='/{repo_name:.*?[^/]}/refs-data', repo_route=True) | |
183 |
|
183 | |||
184 | config.add_route( |
|
184 | config.add_route( | |
185 | name='repo_refs_changelog_data', |
|
185 | name='repo_refs_changelog_data', | |
186 | pattern='/{repo_name:.*?[^/]}/refs-data-changelog', repo_route=True) |
|
186 | pattern='/{repo_name:.*?[^/]}/refs-data-changelog', repo_route=True) | |
187 |
|
187 | |||
188 | config.add_route( |
|
188 | config.add_route( | |
189 | name='repo_stats', |
|
189 | name='repo_stats', | |
190 | pattern='/{repo_name:.*?[^/]}/repo_stats/{commit_id}', repo_route=True) |
|
190 | pattern='/{repo_name:.*?[^/]}/repo_stats/{commit_id}', repo_route=True) | |
191 |
|
191 | |||
192 | # Changelog |
|
192 | # Changelog | |
193 | config.add_route( |
|
193 | config.add_route( | |
194 | name='repo_changelog', |
|
194 | name='repo_changelog', | |
195 | pattern='/{repo_name:.*?[^/]}/changelog', repo_route=True) |
|
195 | pattern='/{repo_name:.*?[^/]}/changelog', repo_route=True) | |
196 | config.add_route( |
|
196 | config.add_route( | |
197 | name='repo_changelog_file', |
|
197 | name='repo_changelog_file', | |
198 | pattern='/{repo_name:.*?[^/]}/changelog/{commit_id}/{f_path:.*}', repo_route=True) |
|
198 | pattern='/{repo_name:.*?[^/]}/changelog/{commit_id}/{f_path:.*}', repo_route=True) | |
199 | config.add_route( |
|
199 | config.add_route( | |
200 | name='repo_changelog_elements', |
|
200 | name='repo_changelog_elements', | |
201 | pattern='/{repo_name:.*?[^/]}/changelog_elements', repo_route=True) |
|
201 | pattern='/{repo_name:.*?[^/]}/changelog_elements', repo_route=True) | |
202 |
|
202 | |||
203 | # Compare |
|
203 | # Compare | |
204 | config.add_route( |
|
204 | config.add_route( | |
205 | name='repo_compare_select', |
|
205 | name='repo_compare_select', | |
206 | pattern='/{repo_name:.*?[^/]}/compare', repo_route=True) |
|
206 | pattern='/{repo_name:.*?[^/]}/compare', repo_route=True) | |
207 |
|
207 | |||
208 | config.add_route( |
|
208 | config.add_route( | |
209 | name='repo_compare', |
|
209 | name='repo_compare', | |
210 | pattern='/{repo_name:.*?[^/]}/compare/{source_ref_type}@{source_ref:.*?}...{target_ref_type}@{target_ref:.*?}', repo_route=True) |
|
210 | pattern='/{repo_name:.*?[^/]}/compare/{source_ref_type}@{source_ref:.*?}...{target_ref_type}@{target_ref:.*?}', repo_route=True) | |
211 |
|
211 | |||
212 | # Tags |
|
212 | # Tags | |
213 | config.add_route( |
|
213 | config.add_route( | |
214 | name='tags_home', |
|
214 | name='tags_home', | |
215 | pattern='/{repo_name:.*?[^/]}/tags', repo_route=True) |
|
215 | pattern='/{repo_name:.*?[^/]}/tags', repo_route=True) | |
216 |
|
216 | |||
217 | # Branches |
|
217 | # Branches | |
218 | config.add_route( |
|
218 | config.add_route( | |
219 | name='branches_home', |
|
219 | name='branches_home', | |
220 | pattern='/{repo_name:.*?[^/]}/branches', repo_route=True) |
|
220 | pattern='/{repo_name:.*?[^/]}/branches', repo_route=True) | |
221 |
|
221 | |||
222 | # Bookmarks |
|
222 | # Bookmarks | |
223 | config.add_route( |
|
223 | config.add_route( | |
224 | name='bookmarks_home', |
|
224 | name='bookmarks_home', | |
225 | pattern='/{repo_name:.*?[^/]}/bookmarks', repo_route=True) |
|
225 | pattern='/{repo_name:.*?[^/]}/bookmarks', repo_route=True) | |
226 |
|
226 | |||
227 | # Forks |
|
227 | # Forks | |
228 | config.add_route( |
|
228 | config.add_route( | |
229 | name='repo_fork_new', |
|
229 | name='repo_fork_new', | |
230 | pattern='/{repo_name:.*?[^/]}/fork', repo_route=True, |
|
230 | pattern='/{repo_name:.*?[^/]}/fork', repo_route=True, | |
231 | repo_accepted_types=['hg', 'git']) |
|
231 | repo_accepted_types=['hg', 'git']) | |
232 |
|
232 | |||
233 | config.add_route( |
|
233 | config.add_route( | |
234 | name='repo_fork_create', |
|
234 | name='repo_fork_create', | |
235 | pattern='/{repo_name:.*?[^/]}/fork/create', repo_route=True, |
|
235 | pattern='/{repo_name:.*?[^/]}/fork/create', repo_route=True, | |
236 | repo_accepted_types=['hg', 'git']) |
|
236 | repo_accepted_types=['hg', 'git']) | |
237 |
|
237 | |||
238 | config.add_route( |
|
238 | config.add_route( | |
239 | name='repo_forks_show_all', |
|
239 | name='repo_forks_show_all', | |
240 | pattern='/{repo_name:.*?[^/]}/forks', repo_route=True, |
|
240 | pattern='/{repo_name:.*?[^/]}/forks', repo_route=True, | |
241 | repo_accepted_types=['hg', 'git']) |
|
241 | repo_accepted_types=['hg', 'git']) | |
242 | config.add_route( |
|
242 | config.add_route( | |
243 | name='repo_forks_data', |
|
243 | name='repo_forks_data', | |
244 | pattern='/{repo_name:.*?[^/]}/forks/data', repo_route=True, |
|
244 | pattern='/{repo_name:.*?[^/]}/forks/data', repo_route=True, | |
245 | repo_accepted_types=['hg', 'git']) |
|
245 | repo_accepted_types=['hg', 'git']) | |
246 |
|
246 | |||
247 | # Pull Requests |
|
247 | # Pull Requests | |
248 | config.add_route( |
|
248 | config.add_route( | |
249 | name='pullrequest_show', |
|
249 | name='pullrequest_show', | |
250 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}', |
|
250 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}', | |
251 | repo_route=True) |
|
251 | repo_route=True) | |
252 |
|
252 | |||
253 | config.add_route( |
|
253 | config.add_route( | |
254 | name='pullrequest_show_all', |
|
254 | name='pullrequest_show_all', | |
255 | pattern='/{repo_name:.*?[^/]}/pull-request', |
|
255 | pattern='/{repo_name:.*?[^/]}/pull-request', | |
256 | repo_route=True, repo_accepted_types=['hg', 'git']) |
|
256 | repo_route=True, repo_accepted_types=['hg', 'git']) | |
257 |
|
257 | |||
258 | config.add_route( |
|
258 | config.add_route( | |
259 | name='pullrequest_show_all_data', |
|
259 | name='pullrequest_show_all_data', | |
260 | pattern='/{repo_name:.*?[^/]}/pull-request-data', |
|
260 | pattern='/{repo_name:.*?[^/]}/pull-request-data', | |
261 | repo_route=True, repo_accepted_types=['hg', 'git']) |
|
261 | repo_route=True, repo_accepted_types=['hg', 'git']) | |
262 |
|
262 | |||
263 | config.add_route( |
|
263 | config.add_route( | |
264 | name='pullrequest_repo_refs', |
|
264 | name='pullrequest_repo_refs', | |
265 | pattern='/{repo_name:.*?[^/]}/pull-request/refs/{target_repo_name:.*?[^/]}', |
|
265 | pattern='/{repo_name:.*?[^/]}/pull-request/refs/{target_repo_name:.*?[^/]}', | |
266 | repo_route=True) |
|
266 | repo_route=True) | |
267 |
|
267 | |||
268 | config.add_route( |
|
268 | config.add_route( | |
269 | name='pullrequest_repo_destinations', |
|
269 | name='pullrequest_repo_destinations', | |
270 | pattern='/{repo_name:.*?[^/]}/pull-request/repo-destinations', |
|
270 | pattern='/{repo_name:.*?[^/]}/pull-request/repo-destinations', | |
271 | repo_route=True) |
|
271 | repo_route=True) | |
272 |
|
272 | |||
273 | config.add_route( |
|
273 | config.add_route( | |
274 | name='pullrequest_new', |
|
274 | name='pullrequest_new', | |
275 | pattern='/{repo_name:.*?[^/]}/pull-request/new', |
|
275 | pattern='/{repo_name:.*?[^/]}/pull-request/new', | |
276 | repo_route=True, repo_accepted_types=['hg', 'git']) |
|
276 | repo_route=True, repo_accepted_types=['hg', 'git']) | |
277 |
|
277 | |||
278 | config.add_route( |
|
278 | config.add_route( | |
279 | name='pullrequest_create', |
|
279 | name='pullrequest_create', | |
280 | pattern='/{repo_name:.*?[^/]}/pull-request/create', |
|
280 | pattern='/{repo_name:.*?[^/]}/pull-request/create', | |
281 | repo_route=True, repo_accepted_types=['hg', 'git']) |
|
281 | repo_route=True, repo_accepted_types=['hg', 'git']) | |
282 |
|
282 | |||
283 | config.add_route( |
|
283 | config.add_route( | |
284 | name='pullrequest_update', |
|
284 | name='pullrequest_update', | |
285 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update', |
|
285 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update', | |
286 | repo_route=True) |
|
286 | repo_route=True) | |
287 |
|
287 | |||
288 | config.add_route( |
|
288 | config.add_route( | |
289 | name='pullrequest_merge', |
|
289 | name='pullrequest_merge', | |
290 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge', |
|
290 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge', | |
291 | repo_route=True) |
|
291 | repo_route=True) | |
292 |
|
292 | |||
293 | config.add_route( |
|
293 | config.add_route( | |
294 | name='pullrequest_delete', |
|
294 | name='pullrequest_delete', | |
295 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete', |
|
295 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete', | |
296 | repo_route=True) |
|
296 | repo_route=True) | |
297 |
|
297 | |||
298 | config.add_route( |
|
298 | config.add_route( | |
299 | name='pullrequest_comment_create', |
|
299 | name='pullrequest_comment_create', | |
300 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment', |
|
300 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment', | |
301 | repo_route=True) |
|
301 | repo_route=True) | |
302 |
|
302 | |||
303 | config.add_route( |
|
303 | config.add_route( | |
304 | name='pullrequest_comment_delete', |
|
304 | name='pullrequest_comment_delete', | |
305 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete', |
|
305 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete', | |
306 | repo_route=True, repo_accepted_types=['hg', 'git']) |
|
306 | repo_route=True, repo_accepted_types=['hg', 'git']) | |
307 |
|
307 | |||
308 | # Settings |
|
308 | # Settings | |
309 | config.add_route( |
|
309 | config.add_route( | |
310 | name='edit_repo', |
|
310 | name='edit_repo', | |
311 | pattern='/{repo_name:.*?[^/]}/settings', repo_route=True) |
|
311 | pattern='/{repo_name:.*?[^/]}/settings', repo_route=True) | |
312 |
|
312 | |||
313 | # Settings advanced |
|
313 | # Settings advanced | |
314 | config.add_route( |
|
314 | config.add_route( | |
315 | name='edit_repo_advanced', |
|
315 | name='edit_repo_advanced', | |
316 | pattern='/{repo_name:.*?[^/]}/settings/advanced', repo_route=True) |
|
316 | pattern='/{repo_name:.*?[^/]}/settings/advanced', repo_route=True) | |
317 | config.add_route( |
|
317 | config.add_route( | |
318 | name='edit_repo_advanced_delete', |
|
318 | name='edit_repo_advanced_delete', | |
319 | pattern='/{repo_name:.*?[^/]}/settings/advanced/delete', repo_route=True) |
|
319 | pattern='/{repo_name:.*?[^/]}/settings/advanced/delete', repo_route=True) | |
320 | config.add_route( |
|
320 | config.add_route( | |
321 | name='edit_repo_advanced_locking', |
|
321 | name='edit_repo_advanced_locking', | |
322 | pattern='/{repo_name:.*?[^/]}/settings/advanced/locking', repo_route=True) |
|
322 | pattern='/{repo_name:.*?[^/]}/settings/advanced/locking', repo_route=True) | |
323 | config.add_route( |
|
323 | config.add_route( | |
324 | name='edit_repo_advanced_journal', |
|
324 | name='edit_repo_advanced_journal', | |
325 | pattern='/{repo_name:.*?[^/]}/settings/advanced/journal', repo_route=True) |
|
325 | pattern='/{repo_name:.*?[^/]}/settings/advanced/journal', repo_route=True) | |
326 | config.add_route( |
|
326 | config.add_route( | |
327 | name='edit_repo_advanced_fork', |
|
327 | name='edit_repo_advanced_fork', | |
328 | pattern='/{repo_name:.*?[^/]}/settings/advanced/fork', repo_route=True) |
|
328 | pattern='/{repo_name:.*?[^/]}/settings/advanced/fork', repo_route=True) | |
329 |
|
329 | |||
330 | # Caches |
|
330 | # Caches | |
331 | config.add_route( |
|
331 | config.add_route( | |
332 | name='edit_repo_caches', |
|
332 | name='edit_repo_caches', | |
333 | pattern='/{repo_name:.*?[^/]}/settings/caches', repo_route=True) |
|
333 | pattern='/{repo_name:.*?[^/]}/settings/caches', repo_route=True) | |
334 |
|
334 | |||
335 | # Permissions |
|
335 | # Permissions | |
336 | config.add_route( |
|
336 | config.add_route( | |
337 | name='edit_repo_perms', |
|
337 | name='edit_repo_perms', | |
338 | pattern='/{repo_name:.*?[^/]}/settings/permissions', repo_route=True) |
|
338 | pattern='/{repo_name:.*?[^/]}/settings/permissions', repo_route=True) | |
339 |
|
339 | |||
340 | # Repo Review Rules |
|
340 | # Repo Review Rules | |
341 | config.add_route( |
|
341 | config.add_route( | |
342 | name='repo_reviewers', |
|
342 | name='repo_reviewers', | |
343 | pattern='/{repo_name:.*?[^/]}/settings/review/rules', repo_route=True) |
|
343 | pattern='/{repo_name:.*?[^/]}/settings/review/rules', repo_route=True) | |
344 |
|
344 | |||
345 | config.add_route( |
|
345 | config.add_route( | |
346 | name='repo_default_reviewers_data', |
|
346 | name='repo_default_reviewers_data', | |
347 | pattern='/{repo_name:.*?[^/]}/settings/review/default-reviewers', repo_route=True) |
|
347 | pattern='/{repo_name:.*?[^/]}/settings/review/default-reviewers', repo_route=True) | |
348 |
|
348 | |||
349 | # Maintenance |
|
349 | # Maintenance | |
350 | config.add_route( |
|
350 | config.add_route( | |
351 | name='repo_maintenance', |
|
351 | name='repo_maintenance', | |
352 | pattern='/{repo_name:.*?[^/]}/settings/maintenance', repo_route=True) |
|
352 | pattern='/{repo_name:.*?[^/]}/settings/maintenance', repo_route=True) | |
353 |
|
353 | |||
354 | config.add_route( |
|
354 | config.add_route( | |
355 | name='repo_maintenance_execute', |
|
355 | name='repo_maintenance_execute', | |
356 | pattern='/{repo_name:.*?[^/]}/settings/maintenance/execute', repo_route=True) |
|
356 | pattern='/{repo_name:.*?[^/]}/settings/maintenance/execute', repo_route=True) | |
357 |
|
357 | |||
358 | # Strip |
|
358 | # Strip | |
359 | config.add_route( |
|
359 | config.add_route( | |
360 | name='strip', |
|
360 | name='strip', | |
361 | pattern='/{repo_name:.*?[^/]}/settings/strip', repo_route=True) |
|
361 | pattern='/{repo_name:.*?[^/]}/settings/strip', repo_route=True) | |
362 |
|
362 | |||
363 | config.add_route( |
|
363 | config.add_route( | |
364 | name='strip_check', |
|
364 | name='strip_check', | |
365 | pattern='/{repo_name:.*?[^/]}/settings/strip_check', repo_route=True) |
|
365 | pattern='/{repo_name:.*?[^/]}/settings/strip_check', repo_route=True) | |
366 |
|
366 | |||
367 | config.add_route( |
|
367 | config.add_route( | |
368 | name='strip_execute', |
|
368 | name='strip_execute', | |
369 | pattern='/{repo_name:.*?[^/]}/settings/strip_execute', repo_route=True) |
|
369 | pattern='/{repo_name:.*?[^/]}/settings/strip_execute', repo_route=True) | |
370 |
|
370 | |||
371 | # ATOM/RSS Feed |
|
371 | # ATOM/RSS Feed | |
372 | config.add_route( |
|
372 | config.add_route( | |
373 | name='rss_feed_home', |
|
373 | name='rss_feed_home', | |
374 | pattern='/{repo_name:.*?[^/]}/feed/rss', repo_route=True) |
|
374 | pattern='/{repo_name:.*?[^/]}/feed/rss', repo_route=True) | |
375 |
|
375 | |||
376 | config.add_route( |
|
376 | config.add_route( | |
377 | name='atom_feed_home', |
|
377 | name='atom_feed_home', | |
378 | pattern='/{repo_name:.*?[^/]}/feed/atom', repo_route=True) |
|
378 | pattern='/{repo_name:.*?[^/]}/feed/atom', repo_route=True) | |
379 |
|
379 | |||
380 | # NOTE(marcink): needs to be at the end for catch-all |
|
380 | # NOTE(marcink): needs to be at the end for catch-all | |
381 | add_route_with_slash( |
|
381 | add_route_with_slash( | |
382 | config, |
|
382 | config, | |
383 | name='repo_summary', |
|
383 | name='repo_summary', | |
384 | pattern='/{repo_name:.*?[^/]}', repo_route=True) |
|
384 | pattern='/{repo_name:.*?[^/]}', repo_route=True) | |
385 |
|
385 | |||
386 | # Scan module for configuration decorators. |
|
386 | # Scan module for configuration decorators. | |
387 | config.scan() |
|
387 | config.scan('.views', ignore='.tests') |
@@ -1,44 +1,34 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2016-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2016-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 | from rhodecode.apps._base import ADMIN_PREFIX |
|
20 | from rhodecode.apps._base import ADMIN_PREFIX | |
21 |
|
21 | |||
22 |
|
22 | |||
23 | def includeme(config): |
|
23 | def includeme(config): | |
24 |
|
24 | |||
25 | config.add_route( |
|
25 | config.add_route( | |
26 | name='search', |
|
26 | name='search', | |
27 | pattern=ADMIN_PREFIX + '/search') |
|
27 | pattern=ADMIN_PREFIX + '/search') | |
28 |
|
28 | |||
29 | config.add_route( |
|
29 | config.add_route( | |
30 | name='search_repo', |
|
30 | name='search_repo', | |
31 | pattern='/{repo_name:.*?[^/]}/search', repo_route=True) |
|
31 | pattern='/{repo_name:.*?[^/]}/search', repo_route=True) | |
32 |
|
32 | |||
33 | # Scan module for configuration decorators. |
|
33 | # Scan module for configuration decorators. | |
34 | config.scan() |
|
34 | config.scan('.views', ignore='.tests') | |
35 |
|
||||
36 |
|
||||
37 | # # FULL TEXT SEARCH |
|
|||
38 | # rmap.connect('search', '%s/search' % (ADMIN_PREFIX,), |
|
|||
39 | # controller='search') |
|
|||
40 | # rmap.connect('search_repo_home', '/{repo_name}/search', |
|
|||
41 | # controller='search', |
|
|||
42 | # action='index', |
|
|||
43 | # conditions={'function': check_repo}, |
|
|||
44 | # requirements=URL_NAME_REQUIREMENTS) No newline at end of file |
|
@@ -1,28 +1,28 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2016-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2016-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 |
|
20 | |||
21 |
|
21 | |||
22 | def includeme(config): |
|
22 | def includeme(config): | |
23 | config.add_route( |
|
23 | config.add_route( | |
24 | name='user_profile', |
|
24 | name='user_profile', | |
25 | pattern='/_profiles/{username}') |
|
25 | pattern='/_profiles/{username}') | |
26 |
|
26 | |||
27 | # Scan module for configuration decorators. |
|
27 | # Scan module for configuration decorators. | |
28 | config.scan() |
|
28 | config.scan('.views', ignore='.tests') |
General Comments 0
You need to be logged in to leave comments.
Login now