##// END OF EJS Templates
routes: make changeset_info route use repo_name at start, to follow...
dan -
r471:61564d6e default
parent child Browse files
Show More
@@ -1,1155 +1,1155 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 # Copyright (C) 2010-2016 RhodeCode GmbH
3 # Copyright (C) 2010-2016 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 Routes configuration
22 Routes configuration
23
23
24 The more specific and detailed routes should be defined first so they
24 The more specific and detailed routes should be defined first so they
25 may take precedent over the more generic routes. For more information
25 may take precedent over the more generic routes. For more information
26 refer to the routes manual at http://routes.groovie.org/docs/
26 refer to the routes manual at http://routes.groovie.org/docs/
27
27
28 IMPORTANT: if you change any routing here, make sure to take a look at lib/base.py
28 IMPORTANT: if you change any routing here, make sure to take a look at lib/base.py
29 and _route_name variable which uses some of stored naming here to do redirects.
29 and _route_name variable which uses some of stored naming here to do redirects.
30 """
30 """
31 import os
31 import os
32 import re
32 import re
33 from routes import Mapper
33 from routes import Mapper
34
34
35 from rhodecode.config import routing_links
35 from rhodecode.config import routing_links
36
36
37 # prefix for non repository related links needs to be prefixed with `/`
37 # prefix for non repository related links needs to be prefixed with `/`
38 ADMIN_PREFIX = '/_admin'
38 ADMIN_PREFIX = '/_admin'
39 STATIC_FILE_PREFIX = '/_static'
39 STATIC_FILE_PREFIX = '/_static'
40
40
41 # Default requirements for URL parts
41 # Default requirements for URL parts
42 URL_NAME_REQUIREMENTS = {
42 URL_NAME_REQUIREMENTS = {
43 # group name can have a slash in them, but they must not end with a slash
43 # group name can have a slash in them, but they must not end with a slash
44 'group_name': r'.*?[^/]',
44 'group_name': r'.*?[^/]',
45 # repo names can have a slash in them, but they must not end with a slash
45 # repo names can have a slash in them, but they must not end with a slash
46 'repo_name': r'.*?[^/]',
46 'repo_name': r'.*?[^/]',
47 # file path eats up everything at the end
47 # file path eats up everything at the end
48 'f_path': r'.*',
48 'f_path': r'.*',
49 # reference types
49 # reference types
50 'source_ref_type': '(branch|book|tag|rev|\%\(source_ref_type\)s)',
50 'source_ref_type': '(branch|book|tag|rev|\%\(source_ref_type\)s)',
51 'target_ref_type': '(branch|book|tag|rev|\%\(target_ref_type\)s)',
51 'target_ref_type': '(branch|book|tag|rev|\%\(target_ref_type\)s)',
52 }
52 }
53
53
54
54
55 def add_route_requirements(route_path, requirements):
55 def add_route_requirements(route_path, requirements):
56 """
56 """
57 Adds regex requirements to pyramid routes using a mapping dict
57 Adds regex requirements to pyramid routes using a mapping dict
58
58
59 >>> add_route_requirements('/{action}/{id}', {'id': r'\d+'})
59 >>> add_route_requirements('/{action}/{id}', {'id': r'\d+'})
60 '/{action}/{id:\d+}'
60 '/{action}/{id:\d+}'
61
61
62 """
62 """
63 for key, regex in requirements.items():
63 for key, regex in requirements.items():
64 route_path = route_path.replace('{%s}' % key, '{%s:%s}' % (key, regex))
64 route_path = route_path.replace('{%s}' % key, '{%s:%s}' % (key, regex))
65 return route_path
65 return route_path
66
66
67
67
68 class JSRoutesMapper(Mapper):
68 class JSRoutesMapper(Mapper):
69 """
69 """
70 Wrapper for routes.Mapper to make pyroutes compatible url definitions
70 Wrapper for routes.Mapper to make pyroutes compatible url definitions
71 """
71 """
72 _named_route_regex = re.compile(r'^[a-z-_0-9A-Z]+$')
72 _named_route_regex = re.compile(r'^[a-z-_0-9A-Z]+$')
73 _argument_prog = re.compile('\{(.*?)\}|:\((.*)\)')
73 _argument_prog = re.compile('\{(.*?)\}|:\((.*)\)')
74 def __init__(self, *args, **kw):
74 def __init__(self, *args, **kw):
75 super(JSRoutesMapper, self).__init__(*args, **kw)
75 super(JSRoutesMapper, self).__init__(*args, **kw)
76 self._jsroutes = []
76 self._jsroutes = []
77
77
78 def connect(self, *args, **kw):
78 def connect(self, *args, **kw):
79 """
79 """
80 Wrapper for connect to take an extra argument jsroute=True
80 Wrapper for connect to take an extra argument jsroute=True
81
81
82 :param jsroute: boolean, if True will add the route to the pyroutes list
82 :param jsroute: boolean, if True will add the route to the pyroutes list
83 """
83 """
84 if kw.pop('jsroute', False):
84 if kw.pop('jsroute', False):
85 if not self._named_route_regex.match(args[0]):
85 if not self._named_route_regex.match(args[0]):
86 raise Exception('only named routes can be added to pyroutes')
86 raise Exception('only named routes can be added to pyroutes')
87 self._jsroutes.append(args[0])
87 self._jsroutes.append(args[0])
88
88
89 super(JSRoutesMapper, self).connect(*args, **kw)
89 super(JSRoutesMapper, self).connect(*args, **kw)
90
90
91 def _extract_route_information(self, route):
91 def _extract_route_information(self, route):
92 """
92 """
93 Convert a route into tuple(name, path, args), eg:
93 Convert a route into tuple(name, path, args), eg:
94 ('user_profile', '/profile/%(username)s', ['username'])
94 ('user_profile', '/profile/%(username)s', ['username'])
95 """
95 """
96 routepath = route.routepath
96 routepath = route.routepath
97 def replace(matchobj):
97 def replace(matchobj):
98 if matchobj.group(1):
98 if matchobj.group(1):
99 return "%%(%s)s" % matchobj.group(1).split(':')[0]
99 return "%%(%s)s" % matchobj.group(1).split(':')[0]
100 else:
100 else:
101 return "%%(%s)s" % matchobj.group(2)
101 return "%%(%s)s" % matchobj.group(2)
102
102
103 routepath = self._argument_prog.sub(replace, routepath)
103 routepath = self._argument_prog.sub(replace, routepath)
104 return (
104 return (
105 route.name,
105 route.name,
106 routepath,
106 routepath,
107 [(arg[0].split(':')[0] if arg[0] != '' else arg[1])
107 [(arg[0].split(':')[0] if arg[0] != '' else arg[1])
108 for arg in self._argument_prog.findall(route.routepath)]
108 for arg in self._argument_prog.findall(route.routepath)]
109 )
109 )
110
110
111 def jsroutes(self):
111 def jsroutes(self):
112 """
112 """
113 Return a list of pyroutes.js compatible routes
113 Return a list of pyroutes.js compatible routes
114 """
114 """
115 for route_name in self._jsroutes:
115 for route_name in self._jsroutes:
116 yield self._extract_route_information(self._routenames[route_name])
116 yield self._extract_route_information(self._routenames[route_name])
117
117
118
118
119 def make_map(config):
119 def make_map(config):
120 """Create, configure and return the routes Mapper"""
120 """Create, configure and return the routes Mapper"""
121 rmap = JSRoutesMapper(directory=config['pylons.paths']['controllers'],
121 rmap = JSRoutesMapper(directory=config['pylons.paths']['controllers'],
122 always_scan=config['debug'])
122 always_scan=config['debug'])
123 rmap.minimization = False
123 rmap.minimization = False
124 rmap.explicit = False
124 rmap.explicit = False
125
125
126 from rhodecode.lib.utils2 import str2bool
126 from rhodecode.lib.utils2 import str2bool
127 from rhodecode.model import repo, repo_group
127 from rhodecode.model import repo, repo_group
128
128
129 def check_repo(environ, match_dict):
129 def check_repo(environ, match_dict):
130 """
130 """
131 check for valid repository for proper 404 handling
131 check for valid repository for proper 404 handling
132
132
133 :param environ:
133 :param environ:
134 :param match_dict:
134 :param match_dict:
135 """
135 """
136 repo_name = match_dict.get('repo_name')
136 repo_name = match_dict.get('repo_name')
137
137
138 if match_dict.get('f_path'):
138 if match_dict.get('f_path'):
139 # fix for multiple initial slashes that causes errors
139 # fix for multiple initial slashes that causes errors
140 match_dict['f_path'] = match_dict['f_path'].lstrip('/')
140 match_dict['f_path'] = match_dict['f_path'].lstrip('/')
141 repo_model = repo.RepoModel()
141 repo_model = repo.RepoModel()
142 by_name_match = repo_model.get_by_repo_name(repo_name)
142 by_name_match = repo_model.get_by_repo_name(repo_name)
143 # if we match quickly from database, short circuit the operation,
143 # if we match quickly from database, short circuit the operation,
144 # and validate repo based on the type.
144 # and validate repo based on the type.
145 if by_name_match:
145 if by_name_match:
146 return True
146 return True
147
147
148 by_id_match = repo_model.get_repo_by_id(repo_name)
148 by_id_match = repo_model.get_repo_by_id(repo_name)
149 if by_id_match:
149 if by_id_match:
150 repo_name = by_id_match.repo_name
150 repo_name = by_id_match.repo_name
151 match_dict['repo_name'] = repo_name
151 match_dict['repo_name'] = repo_name
152 return True
152 return True
153
153
154 return False
154 return False
155
155
156 def check_group(environ, match_dict):
156 def check_group(environ, match_dict):
157 """
157 """
158 check for valid repository group path for proper 404 handling
158 check for valid repository group path for proper 404 handling
159
159
160 :param environ:
160 :param environ:
161 :param match_dict:
161 :param match_dict:
162 """
162 """
163 repo_group_name = match_dict.get('group_name')
163 repo_group_name = match_dict.get('group_name')
164 repo_group_model = repo_group.RepoGroupModel()
164 repo_group_model = repo_group.RepoGroupModel()
165 by_name_match = repo_group_model.get_by_group_name(repo_group_name)
165 by_name_match = repo_group_model.get_by_group_name(repo_group_name)
166 if by_name_match:
166 if by_name_match:
167 return True
167 return True
168
168
169 return False
169 return False
170
170
171 def check_user_group(environ, match_dict):
171 def check_user_group(environ, match_dict):
172 """
172 """
173 check for valid user group for proper 404 handling
173 check for valid user group for proper 404 handling
174
174
175 :param environ:
175 :param environ:
176 :param match_dict:
176 :param match_dict:
177 """
177 """
178 return True
178 return True
179
179
180 def check_int(environ, match_dict):
180 def check_int(environ, match_dict):
181 return match_dict.get('id').isdigit()
181 return match_dict.get('id').isdigit()
182
182
183
183
184 #==========================================================================
184 #==========================================================================
185 # CUSTOM ROUTES HERE
185 # CUSTOM ROUTES HERE
186 #==========================================================================
186 #==========================================================================
187
187
188 # MAIN PAGE
188 # MAIN PAGE
189 rmap.connect('home', '/', controller='home', action='index', jsroute=True)
189 rmap.connect('home', '/', controller='home', action='index', jsroute=True)
190 rmap.connect('goto_switcher_data', '/_goto_data', controller='home',
190 rmap.connect('goto_switcher_data', '/_goto_data', controller='home',
191 action='goto_switcher_data')
191 action='goto_switcher_data')
192 rmap.connect('repo_list_data', '/_repos', controller='home',
192 rmap.connect('repo_list_data', '/_repos', controller='home',
193 action='repo_list_data')
193 action='repo_list_data')
194
194
195 rmap.connect('user_autocomplete_data', '/_users', controller='home',
195 rmap.connect('user_autocomplete_data', '/_users', controller='home',
196 action='user_autocomplete_data', jsroute=True)
196 action='user_autocomplete_data', jsroute=True)
197 rmap.connect('user_group_autocomplete_data', '/_user_groups', controller='home',
197 rmap.connect('user_group_autocomplete_data', '/_user_groups', controller='home',
198 action='user_group_autocomplete_data')
198 action='user_group_autocomplete_data')
199
199
200 rmap.connect(
200 rmap.connect(
201 'user_profile', '/_profiles/{username}', controller='users',
201 'user_profile', '/_profiles/{username}', controller='users',
202 action='user_profile')
202 action='user_profile')
203
203
204 # TODO: johbo: Static links, to be replaced by our redirection mechanism
204 # TODO: johbo: Static links, to be replaced by our redirection mechanism
205 rmap.connect('rst_help',
205 rmap.connect('rst_help',
206 'http://docutils.sourceforge.net/docs/user/rst/quickref.html',
206 'http://docutils.sourceforge.net/docs/user/rst/quickref.html',
207 _static=True)
207 _static=True)
208 rmap.connect('markdown_help',
208 rmap.connect('markdown_help',
209 'http://daringfireball.net/projects/markdown/syntax',
209 'http://daringfireball.net/projects/markdown/syntax',
210 _static=True)
210 _static=True)
211 rmap.connect('rhodecode_official', 'https://rhodecode.com', _static=True)
211 rmap.connect('rhodecode_official', 'https://rhodecode.com', _static=True)
212 rmap.connect('rhodecode_support', 'https://rhodecode.com/help/', _static=True)
212 rmap.connect('rhodecode_support', 'https://rhodecode.com/help/', _static=True)
213 rmap.connect('rhodecode_translations', 'https://rhodecode.com/translate/enterprise', _static=True)
213 rmap.connect('rhodecode_translations', 'https://rhodecode.com/translate/enterprise', _static=True)
214 # TODO: anderson - making this a static link since redirect won't play
214 # TODO: anderson - making this a static link since redirect won't play
215 # nice with POST requests
215 # nice with POST requests
216 rmap.connect('enterprise_license_convert_from_old',
216 rmap.connect('enterprise_license_convert_from_old',
217 'https://rhodecode.com/u/license-upgrade',
217 'https://rhodecode.com/u/license-upgrade',
218 _static=True)
218 _static=True)
219
219
220 routing_links.connect_redirection_links(rmap)
220 routing_links.connect_redirection_links(rmap)
221
221
222 rmap.connect('ping', '%s/ping' % (ADMIN_PREFIX,), controller='home', action='ping')
222 rmap.connect('ping', '%s/ping' % (ADMIN_PREFIX,), controller='home', action='ping')
223 rmap.connect('error_test', '%s/error_test' % (ADMIN_PREFIX,), controller='home', action='error_test')
223 rmap.connect('error_test', '%s/error_test' % (ADMIN_PREFIX,), controller='home', action='error_test')
224
224
225 # ADMIN REPOSITORY ROUTES
225 # ADMIN REPOSITORY ROUTES
226 with rmap.submapper(path_prefix=ADMIN_PREFIX,
226 with rmap.submapper(path_prefix=ADMIN_PREFIX,
227 controller='admin/repos') as m:
227 controller='admin/repos') as m:
228 m.connect('repos', '/repos',
228 m.connect('repos', '/repos',
229 action='create', conditions={'method': ['POST']})
229 action='create', conditions={'method': ['POST']})
230 m.connect('repos', '/repos',
230 m.connect('repos', '/repos',
231 action='index', conditions={'method': ['GET']})
231 action='index', conditions={'method': ['GET']})
232 m.connect('new_repo', '/create_repository', jsroute=True,
232 m.connect('new_repo', '/create_repository', jsroute=True,
233 action='create_repository', conditions={'method': ['GET']})
233 action='create_repository', conditions={'method': ['GET']})
234 m.connect('/repos/{repo_name}',
234 m.connect('/repos/{repo_name}',
235 action='update', conditions={'method': ['PUT'],
235 action='update', conditions={'method': ['PUT'],
236 'function': check_repo},
236 'function': check_repo},
237 requirements=URL_NAME_REQUIREMENTS)
237 requirements=URL_NAME_REQUIREMENTS)
238 m.connect('delete_repo', '/repos/{repo_name}',
238 m.connect('delete_repo', '/repos/{repo_name}',
239 action='delete', conditions={'method': ['DELETE']},
239 action='delete', conditions={'method': ['DELETE']},
240 requirements=URL_NAME_REQUIREMENTS)
240 requirements=URL_NAME_REQUIREMENTS)
241 m.connect('repo', '/repos/{repo_name}',
241 m.connect('repo', '/repos/{repo_name}',
242 action='show', conditions={'method': ['GET'],
242 action='show', conditions={'method': ['GET'],
243 'function': check_repo},
243 'function': check_repo},
244 requirements=URL_NAME_REQUIREMENTS)
244 requirements=URL_NAME_REQUIREMENTS)
245
245
246 # ADMIN REPOSITORY GROUPS ROUTES
246 # ADMIN REPOSITORY GROUPS ROUTES
247 with rmap.submapper(path_prefix=ADMIN_PREFIX,
247 with rmap.submapper(path_prefix=ADMIN_PREFIX,
248 controller='admin/repo_groups') as m:
248 controller='admin/repo_groups') as m:
249 m.connect('repo_groups', '/repo_groups',
249 m.connect('repo_groups', '/repo_groups',
250 action='create', conditions={'method': ['POST']})
250 action='create', conditions={'method': ['POST']})
251 m.connect('repo_groups', '/repo_groups',
251 m.connect('repo_groups', '/repo_groups',
252 action='index', conditions={'method': ['GET']})
252 action='index', conditions={'method': ['GET']})
253 m.connect('new_repo_group', '/repo_groups/new',
253 m.connect('new_repo_group', '/repo_groups/new',
254 action='new', conditions={'method': ['GET']})
254 action='new', conditions={'method': ['GET']})
255 m.connect('update_repo_group', '/repo_groups/{group_name}',
255 m.connect('update_repo_group', '/repo_groups/{group_name}',
256 action='update', conditions={'method': ['PUT'],
256 action='update', conditions={'method': ['PUT'],
257 'function': check_group},
257 'function': check_group},
258 requirements=URL_NAME_REQUIREMENTS)
258 requirements=URL_NAME_REQUIREMENTS)
259
259
260 # EXTRAS REPO GROUP ROUTES
260 # EXTRAS REPO GROUP ROUTES
261 m.connect('edit_repo_group', '/repo_groups/{group_name}/edit',
261 m.connect('edit_repo_group', '/repo_groups/{group_name}/edit',
262 action='edit',
262 action='edit',
263 conditions={'method': ['GET'], 'function': check_group},
263 conditions={'method': ['GET'], 'function': check_group},
264 requirements=URL_NAME_REQUIREMENTS)
264 requirements=URL_NAME_REQUIREMENTS)
265 m.connect('edit_repo_group', '/repo_groups/{group_name}/edit',
265 m.connect('edit_repo_group', '/repo_groups/{group_name}/edit',
266 action='edit',
266 action='edit',
267 conditions={'method': ['PUT'], 'function': check_group},
267 conditions={'method': ['PUT'], 'function': check_group},
268 requirements=URL_NAME_REQUIREMENTS)
268 requirements=URL_NAME_REQUIREMENTS)
269
269
270 m.connect('edit_repo_group_advanced', '/repo_groups/{group_name}/edit/advanced',
270 m.connect('edit_repo_group_advanced', '/repo_groups/{group_name}/edit/advanced',
271 action='edit_repo_group_advanced',
271 action='edit_repo_group_advanced',
272 conditions={'method': ['GET'], 'function': check_group},
272 conditions={'method': ['GET'], 'function': check_group},
273 requirements=URL_NAME_REQUIREMENTS)
273 requirements=URL_NAME_REQUIREMENTS)
274 m.connect('edit_repo_group_advanced', '/repo_groups/{group_name}/edit/advanced',
274 m.connect('edit_repo_group_advanced', '/repo_groups/{group_name}/edit/advanced',
275 action='edit_repo_group_advanced',
275 action='edit_repo_group_advanced',
276 conditions={'method': ['PUT'], 'function': check_group},
276 conditions={'method': ['PUT'], 'function': check_group},
277 requirements=URL_NAME_REQUIREMENTS)
277 requirements=URL_NAME_REQUIREMENTS)
278
278
279 m.connect('edit_repo_group_perms', '/repo_groups/{group_name}/edit/permissions',
279 m.connect('edit_repo_group_perms', '/repo_groups/{group_name}/edit/permissions',
280 action='edit_repo_group_perms',
280 action='edit_repo_group_perms',
281 conditions={'method': ['GET'], 'function': check_group},
281 conditions={'method': ['GET'], 'function': check_group},
282 requirements=URL_NAME_REQUIREMENTS)
282 requirements=URL_NAME_REQUIREMENTS)
283 m.connect('edit_repo_group_perms', '/repo_groups/{group_name}/edit/permissions',
283 m.connect('edit_repo_group_perms', '/repo_groups/{group_name}/edit/permissions',
284 action='update_perms',
284 action='update_perms',
285 conditions={'method': ['PUT'], 'function': check_group},
285 conditions={'method': ['PUT'], 'function': check_group},
286 requirements=URL_NAME_REQUIREMENTS)
286 requirements=URL_NAME_REQUIREMENTS)
287
287
288 m.connect('delete_repo_group', '/repo_groups/{group_name}',
288 m.connect('delete_repo_group', '/repo_groups/{group_name}',
289 action='delete', conditions={'method': ['DELETE'],
289 action='delete', conditions={'method': ['DELETE'],
290 'function': check_group},
290 'function': check_group},
291 requirements=URL_NAME_REQUIREMENTS)
291 requirements=URL_NAME_REQUIREMENTS)
292
292
293 # ADMIN USER ROUTES
293 # ADMIN USER ROUTES
294 with rmap.submapper(path_prefix=ADMIN_PREFIX,
294 with rmap.submapper(path_prefix=ADMIN_PREFIX,
295 controller='admin/users') as m:
295 controller='admin/users') as m:
296 m.connect('users', '/users',
296 m.connect('users', '/users',
297 action='create', conditions={'method': ['POST']})
297 action='create', conditions={'method': ['POST']})
298 m.connect('users', '/users',
298 m.connect('users', '/users',
299 action='index', conditions={'method': ['GET']})
299 action='index', conditions={'method': ['GET']})
300 m.connect('new_user', '/users/new',
300 m.connect('new_user', '/users/new',
301 action='new', conditions={'method': ['GET']})
301 action='new', conditions={'method': ['GET']})
302 m.connect('update_user', '/users/{user_id}',
302 m.connect('update_user', '/users/{user_id}',
303 action='update', conditions={'method': ['PUT']})
303 action='update', conditions={'method': ['PUT']})
304 m.connect('delete_user', '/users/{user_id}',
304 m.connect('delete_user', '/users/{user_id}',
305 action='delete', conditions={'method': ['DELETE']})
305 action='delete', conditions={'method': ['DELETE']})
306 m.connect('edit_user', '/users/{user_id}/edit',
306 m.connect('edit_user', '/users/{user_id}/edit',
307 action='edit', conditions={'method': ['GET']})
307 action='edit', conditions={'method': ['GET']})
308 m.connect('user', '/users/{user_id}',
308 m.connect('user', '/users/{user_id}',
309 action='show', conditions={'method': ['GET']})
309 action='show', conditions={'method': ['GET']})
310 m.connect('force_password_reset_user', '/users/{user_id}/password_reset',
310 m.connect('force_password_reset_user', '/users/{user_id}/password_reset',
311 action='reset_password', conditions={'method': ['POST']})
311 action='reset_password', conditions={'method': ['POST']})
312 m.connect('create_personal_repo_group', '/users/{user_id}/create_repo_group',
312 m.connect('create_personal_repo_group', '/users/{user_id}/create_repo_group',
313 action='create_personal_repo_group', conditions={'method': ['POST']})
313 action='create_personal_repo_group', conditions={'method': ['POST']})
314
314
315 # EXTRAS USER ROUTES
315 # EXTRAS USER ROUTES
316 m.connect('edit_user_advanced', '/users/{user_id}/edit/advanced',
316 m.connect('edit_user_advanced', '/users/{user_id}/edit/advanced',
317 action='edit_advanced', conditions={'method': ['GET']})
317 action='edit_advanced', conditions={'method': ['GET']})
318 m.connect('edit_user_advanced', '/users/{user_id}/edit/advanced',
318 m.connect('edit_user_advanced', '/users/{user_id}/edit/advanced',
319 action='update_advanced', conditions={'method': ['PUT']})
319 action='update_advanced', conditions={'method': ['PUT']})
320
320
321 m.connect('edit_user_auth_tokens', '/users/{user_id}/edit/auth_tokens',
321 m.connect('edit_user_auth_tokens', '/users/{user_id}/edit/auth_tokens',
322 action='edit_auth_tokens', conditions={'method': ['GET']})
322 action='edit_auth_tokens', conditions={'method': ['GET']})
323 m.connect('edit_user_auth_tokens', '/users/{user_id}/edit/auth_tokens',
323 m.connect('edit_user_auth_tokens', '/users/{user_id}/edit/auth_tokens',
324 action='add_auth_token', conditions={'method': ['PUT']})
324 action='add_auth_token', conditions={'method': ['PUT']})
325 m.connect('edit_user_auth_tokens', '/users/{user_id}/edit/auth_tokens',
325 m.connect('edit_user_auth_tokens', '/users/{user_id}/edit/auth_tokens',
326 action='delete_auth_token', conditions={'method': ['DELETE']})
326 action='delete_auth_token', conditions={'method': ['DELETE']})
327
327
328 m.connect('edit_user_global_perms', '/users/{user_id}/edit/global_permissions',
328 m.connect('edit_user_global_perms', '/users/{user_id}/edit/global_permissions',
329 action='edit_global_perms', conditions={'method': ['GET']})
329 action='edit_global_perms', conditions={'method': ['GET']})
330 m.connect('edit_user_global_perms', '/users/{user_id}/edit/global_permissions',
330 m.connect('edit_user_global_perms', '/users/{user_id}/edit/global_permissions',
331 action='update_global_perms', conditions={'method': ['PUT']})
331 action='update_global_perms', conditions={'method': ['PUT']})
332
332
333 m.connect('edit_user_perms_summary', '/users/{user_id}/edit/permissions_summary',
333 m.connect('edit_user_perms_summary', '/users/{user_id}/edit/permissions_summary',
334 action='edit_perms_summary', conditions={'method': ['GET']})
334 action='edit_perms_summary', conditions={'method': ['GET']})
335
335
336 m.connect('edit_user_emails', '/users/{user_id}/edit/emails',
336 m.connect('edit_user_emails', '/users/{user_id}/edit/emails',
337 action='edit_emails', conditions={'method': ['GET']})
337 action='edit_emails', conditions={'method': ['GET']})
338 m.connect('edit_user_emails', '/users/{user_id}/edit/emails',
338 m.connect('edit_user_emails', '/users/{user_id}/edit/emails',
339 action='add_email', conditions={'method': ['PUT']})
339 action='add_email', conditions={'method': ['PUT']})
340 m.connect('edit_user_emails', '/users/{user_id}/edit/emails',
340 m.connect('edit_user_emails', '/users/{user_id}/edit/emails',
341 action='delete_email', conditions={'method': ['DELETE']})
341 action='delete_email', conditions={'method': ['DELETE']})
342
342
343 m.connect('edit_user_ips', '/users/{user_id}/edit/ips',
343 m.connect('edit_user_ips', '/users/{user_id}/edit/ips',
344 action='edit_ips', conditions={'method': ['GET']})
344 action='edit_ips', conditions={'method': ['GET']})
345 m.connect('edit_user_ips', '/users/{user_id}/edit/ips',
345 m.connect('edit_user_ips', '/users/{user_id}/edit/ips',
346 action='add_ip', conditions={'method': ['PUT']})
346 action='add_ip', conditions={'method': ['PUT']})
347 m.connect('edit_user_ips', '/users/{user_id}/edit/ips',
347 m.connect('edit_user_ips', '/users/{user_id}/edit/ips',
348 action='delete_ip', conditions={'method': ['DELETE']})
348 action='delete_ip', conditions={'method': ['DELETE']})
349
349
350 # ADMIN USER GROUPS REST ROUTES
350 # ADMIN USER GROUPS REST ROUTES
351 with rmap.submapper(path_prefix=ADMIN_PREFIX,
351 with rmap.submapper(path_prefix=ADMIN_PREFIX,
352 controller='admin/user_groups') as m:
352 controller='admin/user_groups') as m:
353 m.connect('users_groups', '/user_groups',
353 m.connect('users_groups', '/user_groups',
354 action='create', conditions={'method': ['POST']})
354 action='create', conditions={'method': ['POST']})
355 m.connect('users_groups', '/user_groups',
355 m.connect('users_groups', '/user_groups',
356 action='index', conditions={'method': ['GET']})
356 action='index', conditions={'method': ['GET']})
357 m.connect('new_users_group', '/user_groups/new',
357 m.connect('new_users_group', '/user_groups/new',
358 action='new', conditions={'method': ['GET']})
358 action='new', conditions={'method': ['GET']})
359 m.connect('update_users_group', '/user_groups/{user_group_id}',
359 m.connect('update_users_group', '/user_groups/{user_group_id}',
360 action='update', conditions={'method': ['PUT']})
360 action='update', conditions={'method': ['PUT']})
361 m.connect('delete_users_group', '/user_groups/{user_group_id}',
361 m.connect('delete_users_group', '/user_groups/{user_group_id}',
362 action='delete', conditions={'method': ['DELETE']})
362 action='delete', conditions={'method': ['DELETE']})
363 m.connect('edit_users_group', '/user_groups/{user_group_id}/edit',
363 m.connect('edit_users_group', '/user_groups/{user_group_id}/edit',
364 action='edit', conditions={'method': ['GET']},
364 action='edit', conditions={'method': ['GET']},
365 function=check_user_group)
365 function=check_user_group)
366
366
367 # EXTRAS USER GROUP ROUTES
367 # EXTRAS USER GROUP ROUTES
368 m.connect('edit_user_group_global_perms',
368 m.connect('edit_user_group_global_perms',
369 '/user_groups/{user_group_id}/edit/global_permissions',
369 '/user_groups/{user_group_id}/edit/global_permissions',
370 action='edit_global_perms', conditions={'method': ['GET']})
370 action='edit_global_perms', conditions={'method': ['GET']})
371 m.connect('edit_user_group_global_perms',
371 m.connect('edit_user_group_global_perms',
372 '/user_groups/{user_group_id}/edit/global_permissions',
372 '/user_groups/{user_group_id}/edit/global_permissions',
373 action='update_global_perms', conditions={'method': ['PUT']})
373 action='update_global_perms', conditions={'method': ['PUT']})
374 m.connect('edit_user_group_perms_summary',
374 m.connect('edit_user_group_perms_summary',
375 '/user_groups/{user_group_id}/edit/permissions_summary',
375 '/user_groups/{user_group_id}/edit/permissions_summary',
376 action='edit_perms_summary', conditions={'method': ['GET']})
376 action='edit_perms_summary', conditions={'method': ['GET']})
377
377
378 m.connect('edit_user_group_perms',
378 m.connect('edit_user_group_perms',
379 '/user_groups/{user_group_id}/edit/permissions',
379 '/user_groups/{user_group_id}/edit/permissions',
380 action='edit_perms', conditions={'method': ['GET']})
380 action='edit_perms', conditions={'method': ['GET']})
381 m.connect('edit_user_group_perms',
381 m.connect('edit_user_group_perms',
382 '/user_groups/{user_group_id}/edit/permissions',
382 '/user_groups/{user_group_id}/edit/permissions',
383 action='update_perms', conditions={'method': ['PUT']})
383 action='update_perms', conditions={'method': ['PUT']})
384
384
385 m.connect('edit_user_group_advanced',
385 m.connect('edit_user_group_advanced',
386 '/user_groups/{user_group_id}/edit/advanced',
386 '/user_groups/{user_group_id}/edit/advanced',
387 action='edit_advanced', conditions={'method': ['GET']})
387 action='edit_advanced', conditions={'method': ['GET']})
388
388
389 m.connect('edit_user_group_members',
389 m.connect('edit_user_group_members',
390 '/user_groups/{user_group_id}/edit/members', jsroute=True,
390 '/user_groups/{user_group_id}/edit/members', jsroute=True,
391 action='edit_members', conditions={'method': ['GET']})
391 action='edit_members', conditions={'method': ['GET']})
392
392
393 # ADMIN PERMISSIONS ROUTES
393 # ADMIN PERMISSIONS ROUTES
394 with rmap.submapper(path_prefix=ADMIN_PREFIX,
394 with rmap.submapper(path_prefix=ADMIN_PREFIX,
395 controller='admin/permissions') as m:
395 controller='admin/permissions') as m:
396 m.connect('admin_permissions_application', '/permissions/application',
396 m.connect('admin_permissions_application', '/permissions/application',
397 action='permission_application_update', conditions={'method': ['POST']})
397 action='permission_application_update', conditions={'method': ['POST']})
398 m.connect('admin_permissions_application', '/permissions/application',
398 m.connect('admin_permissions_application', '/permissions/application',
399 action='permission_application', conditions={'method': ['GET']})
399 action='permission_application', conditions={'method': ['GET']})
400
400
401 m.connect('admin_permissions_global', '/permissions/global',
401 m.connect('admin_permissions_global', '/permissions/global',
402 action='permission_global_update', conditions={'method': ['POST']})
402 action='permission_global_update', conditions={'method': ['POST']})
403 m.connect('admin_permissions_global', '/permissions/global',
403 m.connect('admin_permissions_global', '/permissions/global',
404 action='permission_global', conditions={'method': ['GET']})
404 action='permission_global', conditions={'method': ['GET']})
405
405
406 m.connect('admin_permissions_object', '/permissions/object',
406 m.connect('admin_permissions_object', '/permissions/object',
407 action='permission_objects_update', conditions={'method': ['POST']})
407 action='permission_objects_update', conditions={'method': ['POST']})
408 m.connect('admin_permissions_object', '/permissions/object',
408 m.connect('admin_permissions_object', '/permissions/object',
409 action='permission_objects', conditions={'method': ['GET']})
409 action='permission_objects', conditions={'method': ['GET']})
410
410
411 m.connect('admin_permissions_ips', '/permissions/ips',
411 m.connect('admin_permissions_ips', '/permissions/ips',
412 action='permission_ips', conditions={'method': ['POST']})
412 action='permission_ips', conditions={'method': ['POST']})
413 m.connect('admin_permissions_ips', '/permissions/ips',
413 m.connect('admin_permissions_ips', '/permissions/ips',
414 action='permission_ips', conditions={'method': ['GET']})
414 action='permission_ips', conditions={'method': ['GET']})
415
415
416 m.connect('admin_permissions_overview', '/permissions/overview',
416 m.connect('admin_permissions_overview', '/permissions/overview',
417 action='permission_perms', conditions={'method': ['GET']})
417 action='permission_perms', conditions={'method': ['GET']})
418
418
419 # ADMIN DEFAULTS REST ROUTES
419 # ADMIN DEFAULTS REST ROUTES
420 with rmap.submapper(path_prefix=ADMIN_PREFIX,
420 with rmap.submapper(path_prefix=ADMIN_PREFIX,
421 controller='admin/defaults') as m:
421 controller='admin/defaults') as m:
422 m.connect('admin_defaults_repositories', '/defaults/repositories',
422 m.connect('admin_defaults_repositories', '/defaults/repositories',
423 action='update_repository_defaults', conditions={'method': ['POST']})
423 action='update_repository_defaults', conditions={'method': ['POST']})
424 m.connect('admin_defaults_repositories', '/defaults/repositories',
424 m.connect('admin_defaults_repositories', '/defaults/repositories',
425 action='index', conditions={'method': ['GET']})
425 action='index', conditions={'method': ['GET']})
426
426
427 # ADMIN DEBUG STYLE ROUTES
427 # ADMIN DEBUG STYLE ROUTES
428 if str2bool(config.get('debug_style')):
428 if str2bool(config.get('debug_style')):
429 with rmap.submapper(path_prefix=ADMIN_PREFIX + '/debug_style',
429 with rmap.submapper(path_prefix=ADMIN_PREFIX + '/debug_style',
430 controller='debug_style') as m:
430 controller='debug_style') as m:
431 m.connect('debug_style_home', '',
431 m.connect('debug_style_home', '',
432 action='index', conditions={'method': ['GET']})
432 action='index', conditions={'method': ['GET']})
433 m.connect('debug_style_template', '/t/{t_path}',
433 m.connect('debug_style_template', '/t/{t_path}',
434 action='template', conditions={'method': ['GET']})
434 action='template', conditions={'method': ['GET']})
435
435
436 # ADMIN SETTINGS ROUTES
436 # ADMIN SETTINGS ROUTES
437 with rmap.submapper(path_prefix=ADMIN_PREFIX,
437 with rmap.submapper(path_prefix=ADMIN_PREFIX,
438 controller='admin/settings') as m:
438 controller='admin/settings') as m:
439
439
440 # default
440 # default
441 m.connect('admin_settings', '/settings',
441 m.connect('admin_settings', '/settings',
442 action='settings_global_update',
442 action='settings_global_update',
443 conditions={'method': ['POST']})
443 conditions={'method': ['POST']})
444 m.connect('admin_settings', '/settings',
444 m.connect('admin_settings', '/settings',
445 action='settings_global', conditions={'method': ['GET']})
445 action='settings_global', conditions={'method': ['GET']})
446
446
447 m.connect('admin_settings_vcs', '/settings/vcs',
447 m.connect('admin_settings_vcs', '/settings/vcs',
448 action='settings_vcs_update',
448 action='settings_vcs_update',
449 conditions={'method': ['POST']})
449 conditions={'method': ['POST']})
450 m.connect('admin_settings_vcs', '/settings/vcs',
450 m.connect('admin_settings_vcs', '/settings/vcs',
451 action='settings_vcs',
451 action='settings_vcs',
452 conditions={'method': ['GET']})
452 conditions={'method': ['GET']})
453 m.connect('admin_settings_vcs', '/settings/vcs',
453 m.connect('admin_settings_vcs', '/settings/vcs',
454 action='delete_svn_pattern',
454 action='delete_svn_pattern',
455 conditions={'method': ['DELETE']})
455 conditions={'method': ['DELETE']})
456
456
457 m.connect('admin_settings_mapping', '/settings/mapping',
457 m.connect('admin_settings_mapping', '/settings/mapping',
458 action='settings_mapping_update',
458 action='settings_mapping_update',
459 conditions={'method': ['POST']})
459 conditions={'method': ['POST']})
460 m.connect('admin_settings_mapping', '/settings/mapping',
460 m.connect('admin_settings_mapping', '/settings/mapping',
461 action='settings_mapping', conditions={'method': ['GET']})
461 action='settings_mapping', conditions={'method': ['GET']})
462
462
463 m.connect('admin_settings_global', '/settings/global',
463 m.connect('admin_settings_global', '/settings/global',
464 action='settings_global_update',
464 action='settings_global_update',
465 conditions={'method': ['POST']})
465 conditions={'method': ['POST']})
466 m.connect('admin_settings_global', '/settings/global',
466 m.connect('admin_settings_global', '/settings/global',
467 action='settings_global', conditions={'method': ['GET']})
467 action='settings_global', conditions={'method': ['GET']})
468
468
469 m.connect('admin_settings_visual', '/settings/visual',
469 m.connect('admin_settings_visual', '/settings/visual',
470 action='settings_visual_update',
470 action='settings_visual_update',
471 conditions={'method': ['POST']})
471 conditions={'method': ['POST']})
472 m.connect('admin_settings_visual', '/settings/visual',
472 m.connect('admin_settings_visual', '/settings/visual',
473 action='settings_visual', conditions={'method': ['GET']})
473 action='settings_visual', conditions={'method': ['GET']})
474
474
475 m.connect('admin_settings_issuetracker',
475 m.connect('admin_settings_issuetracker',
476 '/settings/issue-tracker', action='settings_issuetracker',
476 '/settings/issue-tracker', action='settings_issuetracker',
477 conditions={'method': ['GET']})
477 conditions={'method': ['GET']})
478 m.connect('admin_settings_issuetracker_save',
478 m.connect('admin_settings_issuetracker_save',
479 '/settings/issue-tracker/save',
479 '/settings/issue-tracker/save',
480 action='settings_issuetracker_save',
480 action='settings_issuetracker_save',
481 conditions={'method': ['POST']})
481 conditions={'method': ['POST']})
482 m.connect('admin_issuetracker_test', '/settings/issue-tracker/test',
482 m.connect('admin_issuetracker_test', '/settings/issue-tracker/test',
483 action='settings_issuetracker_test',
483 action='settings_issuetracker_test',
484 conditions={'method': ['POST']})
484 conditions={'method': ['POST']})
485 m.connect('admin_issuetracker_delete',
485 m.connect('admin_issuetracker_delete',
486 '/settings/issue-tracker/delete',
486 '/settings/issue-tracker/delete',
487 action='settings_issuetracker_delete',
487 action='settings_issuetracker_delete',
488 conditions={'method': ['DELETE']})
488 conditions={'method': ['DELETE']})
489
489
490 m.connect('admin_settings_email', '/settings/email',
490 m.connect('admin_settings_email', '/settings/email',
491 action='settings_email_update',
491 action='settings_email_update',
492 conditions={'method': ['POST']})
492 conditions={'method': ['POST']})
493 m.connect('admin_settings_email', '/settings/email',
493 m.connect('admin_settings_email', '/settings/email',
494 action='settings_email', conditions={'method': ['GET']})
494 action='settings_email', conditions={'method': ['GET']})
495
495
496 m.connect('admin_settings_hooks', '/settings/hooks',
496 m.connect('admin_settings_hooks', '/settings/hooks',
497 action='settings_hooks_update',
497 action='settings_hooks_update',
498 conditions={'method': ['POST', 'DELETE']})
498 conditions={'method': ['POST', 'DELETE']})
499 m.connect('admin_settings_hooks', '/settings/hooks',
499 m.connect('admin_settings_hooks', '/settings/hooks',
500 action='settings_hooks', conditions={'method': ['GET']})
500 action='settings_hooks', conditions={'method': ['GET']})
501
501
502 m.connect('admin_settings_search', '/settings/search',
502 m.connect('admin_settings_search', '/settings/search',
503 action='settings_search', conditions={'method': ['GET']})
503 action='settings_search', conditions={'method': ['GET']})
504
504
505 m.connect('admin_settings_system', '/settings/system',
505 m.connect('admin_settings_system', '/settings/system',
506 action='settings_system', conditions={'method': ['GET']})
506 action='settings_system', conditions={'method': ['GET']})
507
507
508 m.connect('admin_settings_system_update', '/settings/system/updates',
508 m.connect('admin_settings_system_update', '/settings/system/updates',
509 action='settings_system_update', conditions={'method': ['GET']})
509 action='settings_system_update', conditions={'method': ['GET']})
510
510
511 m.connect('admin_settings_supervisor', '/settings/supervisor',
511 m.connect('admin_settings_supervisor', '/settings/supervisor',
512 action='settings_supervisor', conditions={'method': ['GET']})
512 action='settings_supervisor', conditions={'method': ['GET']})
513 m.connect('admin_settings_supervisor_log', '/settings/supervisor/{procid}/log',
513 m.connect('admin_settings_supervisor_log', '/settings/supervisor/{procid}/log',
514 action='settings_supervisor_log', conditions={'method': ['GET']})
514 action='settings_supervisor_log', conditions={'method': ['GET']})
515
515
516 m.connect('admin_settings_labs', '/settings/labs',
516 m.connect('admin_settings_labs', '/settings/labs',
517 action='settings_labs_update',
517 action='settings_labs_update',
518 conditions={'method': ['POST']})
518 conditions={'method': ['POST']})
519 m.connect('admin_settings_labs', '/settings/labs',
519 m.connect('admin_settings_labs', '/settings/labs',
520 action='settings_labs', conditions={'method': ['GET']})
520 action='settings_labs', conditions={'method': ['GET']})
521
521
522 # ADMIN MY ACCOUNT
522 # ADMIN MY ACCOUNT
523 with rmap.submapper(path_prefix=ADMIN_PREFIX,
523 with rmap.submapper(path_prefix=ADMIN_PREFIX,
524 controller='admin/my_account') as m:
524 controller='admin/my_account') as m:
525
525
526 m.connect('my_account', '/my_account',
526 m.connect('my_account', '/my_account',
527 action='my_account', conditions={'method': ['GET']})
527 action='my_account', conditions={'method': ['GET']})
528 m.connect('my_account_edit', '/my_account/edit',
528 m.connect('my_account_edit', '/my_account/edit',
529 action='my_account_edit', conditions={'method': ['GET']})
529 action='my_account_edit', conditions={'method': ['GET']})
530 m.connect('my_account', '/my_account',
530 m.connect('my_account', '/my_account',
531 action='my_account_update', conditions={'method': ['POST']})
531 action='my_account_update', conditions={'method': ['POST']})
532
532
533 m.connect('my_account_password', '/my_account/password',
533 m.connect('my_account_password', '/my_account/password',
534 action='my_account_password', conditions={'method': ['GET']})
534 action='my_account_password', conditions={'method': ['GET']})
535 m.connect('my_account_password', '/my_account/password',
535 m.connect('my_account_password', '/my_account/password',
536 action='my_account_password_update', conditions={'method': ['POST']})
536 action='my_account_password_update', conditions={'method': ['POST']})
537
537
538 m.connect('my_account_repos', '/my_account/repos',
538 m.connect('my_account_repos', '/my_account/repos',
539 action='my_account_repos', conditions={'method': ['GET']})
539 action='my_account_repos', conditions={'method': ['GET']})
540
540
541 m.connect('my_account_watched', '/my_account/watched',
541 m.connect('my_account_watched', '/my_account/watched',
542 action='my_account_watched', conditions={'method': ['GET']})
542 action='my_account_watched', conditions={'method': ['GET']})
543
543
544 m.connect('my_account_pullrequests', '/my_account/pull_requests',
544 m.connect('my_account_pullrequests', '/my_account/pull_requests',
545 action='my_account_pullrequests', conditions={'method': ['GET']})
545 action='my_account_pullrequests', conditions={'method': ['GET']})
546
546
547 m.connect('my_account_perms', '/my_account/perms',
547 m.connect('my_account_perms', '/my_account/perms',
548 action='my_account_perms', conditions={'method': ['GET']})
548 action='my_account_perms', conditions={'method': ['GET']})
549
549
550 m.connect('my_account_emails', '/my_account/emails',
550 m.connect('my_account_emails', '/my_account/emails',
551 action='my_account_emails', conditions={'method': ['GET']})
551 action='my_account_emails', conditions={'method': ['GET']})
552 m.connect('my_account_emails', '/my_account/emails',
552 m.connect('my_account_emails', '/my_account/emails',
553 action='my_account_emails_add', conditions={'method': ['POST']})
553 action='my_account_emails_add', conditions={'method': ['POST']})
554 m.connect('my_account_emails', '/my_account/emails',
554 m.connect('my_account_emails', '/my_account/emails',
555 action='my_account_emails_delete', conditions={'method': ['DELETE']})
555 action='my_account_emails_delete', conditions={'method': ['DELETE']})
556
556
557 m.connect('my_account_auth_tokens', '/my_account/auth_tokens',
557 m.connect('my_account_auth_tokens', '/my_account/auth_tokens',
558 action='my_account_auth_tokens', conditions={'method': ['GET']})
558 action='my_account_auth_tokens', conditions={'method': ['GET']})
559 m.connect('my_account_auth_tokens', '/my_account/auth_tokens',
559 m.connect('my_account_auth_tokens', '/my_account/auth_tokens',
560 action='my_account_auth_tokens_add', conditions={'method': ['POST']})
560 action='my_account_auth_tokens_add', conditions={'method': ['POST']})
561 m.connect('my_account_auth_tokens', '/my_account/auth_tokens',
561 m.connect('my_account_auth_tokens', '/my_account/auth_tokens',
562 action='my_account_auth_tokens_delete', conditions={'method': ['DELETE']})
562 action='my_account_auth_tokens_delete', conditions={'method': ['DELETE']})
563
563
564 # NOTIFICATION REST ROUTES
564 # NOTIFICATION REST ROUTES
565 with rmap.submapper(path_prefix=ADMIN_PREFIX,
565 with rmap.submapper(path_prefix=ADMIN_PREFIX,
566 controller='admin/notifications') as m:
566 controller='admin/notifications') as m:
567 m.connect('notifications', '/notifications',
567 m.connect('notifications', '/notifications',
568 action='index', conditions={'method': ['GET']})
568 action='index', conditions={'method': ['GET']})
569 m.connect('notifications_mark_all_read', '/notifications/mark_all_read',
569 m.connect('notifications_mark_all_read', '/notifications/mark_all_read',
570 action='mark_all_read', conditions={'method': ['POST']})
570 action='mark_all_read', conditions={'method': ['POST']})
571
571
572 m.connect('/notifications/{notification_id}',
572 m.connect('/notifications/{notification_id}',
573 action='update', conditions={'method': ['PUT']})
573 action='update', conditions={'method': ['PUT']})
574 m.connect('/notifications/{notification_id}',
574 m.connect('/notifications/{notification_id}',
575 action='delete', conditions={'method': ['DELETE']})
575 action='delete', conditions={'method': ['DELETE']})
576 m.connect('notification', '/notifications/{notification_id}',
576 m.connect('notification', '/notifications/{notification_id}',
577 action='show', conditions={'method': ['GET']})
577 action='show', conditions={'method': ['GET']})
578
578
579 # ADMIN GIST
579 # ADMIN GIST
580 with rmap.submapper(path_prefix=ADMIN_PREFIX,
580 with rmap.submapper(path_prefix=ADMIN_PREFIX,
581 controller='admin/gists') as m:
581 controller='admin/gists') as m:
582 m.connect('gists', '/gists',
582 m.connect('gists', '/gists',
583 action='create', conditions={'method': ['POST']})
583 action='create', conditions={'method': ['POST']})
584 m.connect('gists', '/gists', jsroute=True,
584 m.connect('gists', '/gists', jsroute=True,
585 action='index', conditions={'method': ['GET']})
585 action='index', conditions={'method': ['GET']})
586 m.connect('new_gist', '/gists/new', jsroute=True,
586 m.connect('new_gist', '/gists/new', jsroute=True,
587 action='new', conditions={'method': ['GET']})
587 action='new', conditions={'method': ['GET']})
588
588
589 m.connect('/gists/{gist_id}',
589 m.connect('/gists/{gist_id}',
590 action='delete', conditions={'method': ['DELETE']})
590 action='delete', conditions={'method': ['DELETE']})
591 m.connect('edit_gist', '/gists/{gist_id}/edit',
591 m.connect('edit_gist', '/gists/{gist_id}/edit',
592 action='edit_form', conditions={'method': ['GET']})
592 action='edit_form', conditions={'method': ['GET']})
593 m.connect('edit_gist', '/gists/{gist_id}/edit',
593 m.connect('edit_gist', '/gists/{gist_id}/edit',
594 action='edit', conditions={'method': ['POST']})
594 action='edit', conditions={'method': ['POST']})
595 m.connect(
595 m.connect(
596 'edit_gist_check_revision', '/gists/{gist_id}/edit/check_revision',
596 'edit_gist_check_revision', '/gists/{gist_id}/edit/check_revision',
597 action='check_revision', conditions={'method': ['GET']})
597 action='check_revision', conditions={'method': ['GET']})
598
598
599 m.connect('gist', '/gists/{gist_id}',
599 m.connect('gist', '/gists/{gist_id}',
600 action='show', conditions={'method': ['GET']})
600 action='show', conditions={'method': ['GET']})
601 m.connect('gist_rev', '/gists/{gist_id}/{revision}',
601 m.connect('gist_rev', '/gists/{gist_id}/{revision}',
602 revision='tip',
602 revision='tip',
603 action='show', conditions={'method': ['GET']})
603 action='show', conditions={'method': ['GET']})
604 m.connect('formatted_gist', '/gists/{gist_id}/{revision}/{format}',
604 m.connect('formatted_gist', '/gists/{gist_id}/{revision}/{format}',
605 revision='tip',
605 revision='tip',
606 action='show', conditions={'method': ['GET']})
606 action='show', conditions={'method': ['GET']})
607 m.connect('formatted_gist_file', '/gists/{gist_id}/{revision}/{format}/{f_path}',
607 m.connect('formatted_gist_file', '/gists/{gist_id}/{revision}/{format}/{f_path}',
608 revision='tip',
608 revision='tip',
609 action='show', conditions={'method': ['GET']},
609 action='show', conditions={'method': ['GET']},
610 requirements=URL_NAME_REQUIREMENTS)
610 requirements=URL_NAME_REQUIREMENTS)
611
611
612 # ADMIN MAIN PAGES
612 # ADMIN MAIN PAGES
613 with rmap.submapper(path_prefix=ADMIN_PREFIX,
613 with rmap.submapper(path_prefix=ADMIN_PREFIX,
614 controller='admin/admin') as m:
614 controller='admin/admin') as m:
615 m.connect('admin_home', '', action='index')
615 m.connect('admin_home', '', action='index')
616 m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}',
616 m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}',
617 action='add_repo')
617 action='add_repo')
618 m.connect(
618 m.connect(
619 'pull_requests_global_0', '/pull_requests/{pull_request_id:[0-9]+}',
619 'pull_requests_global_0', '/pull_requests/{pull_request_id:[0-9]+}',
620 action='pull_requests')
620 action='pull_requests')
621 m.connect(
621 m.connect(
622 'pull_requests_global', '/pull-requests/{pull_request_id:[0-9]+}',
622 'pull_requests_global', '/pull-requests/{pull_request_id:[0-9]+}',
623 action='pull_requests')
623 action='pull_requests')
624
624
625
625
626 # USER JOURNAL
626 # USER JOURNAL
627 rmap.connect('journal', '%s/journal' % (ADMIN_PREFIX,),
627 rmap.connect('journal', '%s/journal' % (ADMIN_PREFIX,),
628 controller='journal', action='index')
628 controller='journal', action='index')
629 rmap.connect('journal_rss', '%s/journal/rss' % (ADMIN_PREFIX,),
629 rmap.connect('journal_rss', '%s/journal/rss' % (ADMIN_PREFIX,),
630 controller='journal', action='journal_rss')
630 controller='journal', action='journal_rss')
631 rmap.connect('journal_atom', '%s/journal/atom' % (ADMIN_PREFIX,),
631 rmap.connect('journal_atom', '%s/journal/atom' % (ADMIN_PREFIX,),
632 controller='journal', action='journal_atom')
632 controller='journal', action='journal_atom')
633
633
634 rmap.connect('public_journal', '%s/public_journal' % (ADMIN_PREFIX,),
634 rmap.connect('public_journal', '%s/public_journal' % (ADMIN_PREFIX,),
635 controller='journal', action='public_journal')
635 controller='journal', action='public_journal')
636
636
637 rmap.connect('public_journal_rss', '%s/public_journal/rss' % (ADMIN_PREFIX,),
637 rmap.connect('public_journal_rss', '%s/public_journal/rss' % (ADMIN_PREFIX,),
638 controller='journal', action='public_journal_rss')
638 controller='journal', action='public_journal_rss')
639
639
640 rmap.connect('public_journal_rss_old', '%s/public_journal_rss' % (ADMIN_PREFIX,),
640 rmap.connect('public_journal_rss_old', '%s/public_journal_rss' % (ADMIN_PREFIX,),
641 controller='journal', action='public_journal_rss')
641 controller='journal', action='public_journal_rss')
642
642
643 rmap.connect('public_journal_atom',
643 rmap.connect('public_journal_atom',
644 '%s/public_journal/atom' % (ADMIN_PREFIX,), controller='journal',
644 '%s/public_journal/atom' % (ADMIN_PREFIX,), controller='journal',
645 action='public_journal_atom')
645 action='public_journal_atom')
646
646
647 rmap.connect('public_journal_atom_old',
647 rmap.connect('public_journal_atom_old',
648 '%s/public_journal_atom' % (ADMIN_PREFIX,), controller='journal',
648 '%s/public_journal_atom' % (ADMIN_PREFIX,), controller='journal',
649 action='public_journal_atom')
649 action='public_journal_atom')
650
650
651 rmap.connect('toggle_following', '%s/toggle_following' % (ADMIN_PREFIX,),
651 rmap.connect('toggle_following', '%s/toggle_following' % (ADMIN_PREFIX,),
652 controller='journal', action='toggle_following', jsroute=True,
652 controller='journal', action='toggle_following', jsroute=True,
653 conditions={'method': ['POST']})
653 conditions={'method': ['POST']})
654
654
655 # FULL TEXT SEARCH
655 # FULL TEXT SEARCH
656 rmap.connect('search', '%s/search' % (ADMIN_PREFIX,),
656 rmap.connect('search', '%s/search' % (ADMIN_PREFIX,),
657 controller='search')
657 controller='search')
658 rmap.connect('search_repo_home', '/{repo_name}/search',
658 rmap.connect('search_repo_home', '/{repo_name}/search',
659 controller='search',
659 controller='search',
660 action='index',
660 action='index',
661 conditions={'function': check_repo},
661 conditions={'function': check_repo},
662 requirements=URL_NAME_REQUIREMENTS)
662 requirements=URL_NAME_REQUIREMENTS)
663
663
664 # FEEDS
664 # FEEDS
665 rmap.connect('rss_feed_home', '/{repo_name}/feed/rss',
665 rmap.connect('rss_feed_home', '/{repo_name}/feed/rss',
666 controller='feed', action='rss',
666 controller='feed', action='rss',
667 conditions={'function': check_repo},
667 conditions={'function': check_repo},
668 requirements=URL_NAME_REQUIREMENTS)
668 requirements=URL_NAME_REQUIREMENTS)
669
669
670 rmap.connect('atom_feed_home', '/{repo_name}/feed/atom',
670 rmap.connect('atom_feed_home', '/{repo_name}/feed/atom',
671 controller='feed', action='atom',
671 controller='feed', action='atom',
672 conditions={'function': check_repo},
672 conditions={'function': check_repo},
673 requirements=URL_NAME_REQUIREMENTS)
673 requirements=URL_NAME_REQUIREMENTS)
674
674
675 #==========================================================================
675 #==========================================================================
676 # REPOSITORY ROUTES
676 # REPOSITORY ROUTES
677 #==========================================================================
677 #==========================================================================
678
678
679 rmap.connect('repo_creating_home', '/{repo_name}/repo_creating',
679 rmap.connect('repo_creating_home', '/{repo_name}/repo_creating',
680 controller='admin/repos', action='repo_creating',
680 controller='admin/repos', action='repo_creating',
681 requirements=URL_NAME_REQUIREMENTS)
681 requirements=URL_NAME_REQUIREMENTS)
682 rmap.connect('repo_check_home', '/{repo_name}/crepo_check',
682 rmap.connect('repo_check_home', '/{repo_name}/crepo_check',
683 controller='admin/repos', action='repo_check',
683 controller='admin/repos', action='repo_check',
684 requirements=URL_NAME_REQUIREMENTS)
684 requirements=URL_NAME_REQUIREMENTS)
685
685
686 rmap.connect('repo_stats', '/{repo_name}/repo_stats/{commit_id}',
686 rmap.connect('repo_stats', '/{repo_name}/repo_stats/{commit_id}',
687 controller='summary', action='repo_stats',
687 controller='summary', action='repo_stats',
688 conditions={'function': check_repo},
688 conditions={'function': check_repo},
689 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
689 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
690
690
691 rmap.connect('repo_refs_data', '/{repo_name}/refs-data',
691 rmap.connect('repo_refs_data', '/{repo_name}/refs-data',
692 controller='summary', action='repo_refs_data', jsroute=True,
692 controller='summary', action='repo_refs_data', jsroute=True,
693 requirements=URL_NAME_REQUIREMENTS)
693 requirements=URL_NAME_REQUIREMENTS)
694 rmap.connect('repo_refs_changelog_data', '/{repo_name}/refs-data-changelog',
694 rmap.connect('repo_refs_changelog_data', '/{repo_name}/refs-data-changelog',
695 controller='summary', action='repo_refs_changelog_data',
695 controller='summary', action='repo_refs_changelog_data',
696 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
696 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
697
697
698 rmap.connect('changeset_home', '/{repo_name}/changeset/{revision}',
698 rmap.connect('changeset_home', '/{repo_name}/changeset/{revision}',
699 controller='changeset', revision='tip', jsroute=True,
699 controller='changeset', revision='tip', jsroute=True,
700 conditions={'function': check_repo},
700 conditions={'function': check_repo},
701 requirements=URL_NAME_REQUIREMENTS)
701 requirements=URL_NAME_REQUIREMENTS)
702 rmap.connect('changeset_children', '/{repo_name}/changeset_children/{revision}',
702 rmap.connect('changeset_children', '/{repo_name}/changeset_children/{revision}',
703 controller='changeset', revision='tip', action='changeset_children',
703 controller='changeset', revision='tip', action='changeset_children',
704 conditions={'function': check_repo},
704 conditions={'function': check_repo},
705 requirements=URL_NAME_REQUIREMENTS)
705 requirements=URL_NAME_REQUIREMENTS)
706 rmap.connect('changeset_parents', '/{repo_name}/changeset_parents/{revision}',
706 rmap.connect('changeset_parents', '/{repo_name}/changeset_parents/{revision}',
707 controller='changeset', revision='tip', action='changeset_parents',
707 controller='changeset', revision='tip', action='changeset_parents',
708 conditions={'function': check_repo},
708 conditions={'function': check_repo},
709 requirements=URL_NAME_REQUIREMENTS)
709 requirements=URL_NAME_REQUIREMENTS)
710
710
711 # repo edit options
711 # repo edit options
712 rmap.connect('edit_repo', '/{repo_name}/settings', jsroute=True,
712 rmap.connect('edit_repo', '/{repo_name}/settings', jsroute=True,
713 controller='admin/repos', action='edit',
713 controller='admin/repos', action='edit',
714 conditions={'method': ['GET'], 'function': check_repo},
714 conditions={'method': ['GET'], 'function': check_repo},
715 requirements=URL_NAME_REQUIREMENTS)
715 requirements=URL_NAME_REQUIREMENTS)
716
716
717 rmap.connect('edit_repo_perms', '/{repo_name}/settings/permissions',
717 rmap.connect('edit_repo_perms', '/{repo_name}/settings/permissions',
718 jsroute=True,
718 jsroute=True,
719 controller='admin/repos', action='edit_permissions',
719 controller='admin/repos', action='edit_permissions',
720 conditions={'method': ['GET'], 'function': check_repo},
720 conditions={'method': ['GET'], 'function': check_repo},
721 requirements=URL_NAME_REQUIREMENTS)
721 requirements=URL_NAME_REQUIREMENTS)
722 rmap.connect('edit_repo_perms_update', '/{repo_name}/settings/permissions',
722 rmap.connect('edit_repo_perms_update', '/{repo_name}/settings/permissions',
723 controller='admin/repos', action='edit_permissions_update',
723 controller='admin/repos', action='edit_permissions_update',
724 conditions={'method': ['PUT'], 'function': check_repo},
724 conditions={'method': ['PUT'], 'function': check_repo},
725 requirements=URL_NAME_REQUIREMENTS)
725 requirements=URL_NAME_REQUIREMENTS)
726
726
727 rmap.connect('edit_repo_fields', '/{repo_name}/settings/fields',
727 rmap.connect('edit_repo_fields', '/{repo_name}/settings/fields',
728 controller='admin/repos', action='edit_fields',
728 controller='admin/repos', action='edit_fields',
729 conditions={'method': ['GET'], 'function': check_repo},
729 conditions={'method': ['GET'], 'function': check_repo},
730 requirements=URL_NAME_REQUIREMENTS)
730 requirements=URL_NAME_REQUIREMENTS)
731 rmap.connect('create_repo_fields', '/{repo_name}/settings/fields/new',
731 rmap.connect('create_repo_fields', '/{repo_name}/settings/fields/new',
732 controller='admin/repos', action='create_repo_field',
732 controller='admin/repos', action='create_repo_field',
733 conditions={'method': ['PUT'], 'function': check_repo},
733 conditions={'method': ['PUT'], 'function': check_repo},
734 requirements=URL_NAME_REQUIREMENTS)
734 requirements=URL_NAME_REQUIREMENTS)
735 rmap.connect('delete_repo_fields', '/{repo_name}/settings/fields/{field_id}',
735 rmap.connect('delete_repo_fields', '/{repo_name}/settings/fields/{field_id}',
736 controller='admin/repos', action='delete_repo_field',
736 controller='admin/repos', action='delete_repo_field',
737 conditions={'method': ['DELETE'], 'function': check_repo},
737 conditions={'method': ['DELETE'], 'function': check_repo},
738 requirements=URL_NAME_REQUIREMENTS)
738 requirements=URL_NAME_REQUIREMENTS)
739
739
740 rmap.connect('edit_repo_advanced', '/{repo_name}/settings/advanced',
740 rmap.connect('edit_repo_advanced', '/{repo_name}/settings/advanced',
741 controller='admin/repos', action='edit_advanced',
741 controller='admin/repos', action='edit_advanced',
742 conditions={'method': ['GET'], 'function': check_repo},
742 conditions={'method': ['GET'], 'function': check_repo},
743 requirements=URL_NAME_REQUIREMENTS)
743 requirements=URL_NAME_REQUIREMENTS)
744
744
745 rmap.connect('edit_repo_advanced_locking', '/{repo_name}/settings/advanced/locking',
745 rmap.connect('edit_repo_advanced_locking', '/{repo_name}/settings/advanced/locking',
746 controller='admin/repos', action='edit_advanced_locking',
746 controller='admin/repos', action='edit_advanced_locking',
747 conditions={'method': ['PUT'], 'function': check_repo},
747 conditions={'method': ['PUT'], 'function': check_repo},
748 requirements=URL_NAME_REQUIREMENTS)
748 requirements=URL_NAME_REQUIREMENTS)
749 rmap.connect('toggle_locking', '/{repo_name}/settings/advanced/locking_toggle',
749 rmap.connect('toggle_locking', '/{repo_name}/settings/advanced/locking_toggle',
750 controller='admin/repos', action='toggle_locking',
750 controller='admin/repos', action='toggle_locking',
751 conditions={'method': ['GET'], 'function': check_repo},
751 conditions={'method': ['GET'], 'function': check_repo},
752 requirements=URL_NAME_REQUIREMENTS)
752 requirements=URL_NAME_REQUIREMENTS)
753
753
754 rmap.connect('edit_repo_advanced_journal', '/{repo_name}/settings/advanced/journal',
754 rmap.connect('edit_repo_advanced_journal', '/{repo_name}/settings/advanced/journal',
755 controller='admin/repos', action='edit_advanced_journal',
755 controller='admin/repos', action='edit_advanced_journal',
756 conditions={'method': ['PUT'], 'function': check_repo},
756 conditions={'method': ['PUT'], 'function': check_repo},
757 requirements=URL_NAME_REQUIREMENTS)
757 requirements=URL_NAME_REQUIREMENTS)
758
758
759 rmap.connect('edit_repo_advanced_fork', '/{repo_name}/settings/advanced/fork',
759 rmap.connect('edit_repo_advanced_fork', '/{repo_name}/settings/advanced/fork',
760 controller='admin/repos', action='edit_advanced_fork',
760 controller='admin/repos', action='edit_advanced_fork',
761 conditions={'method': ['PUT'], 'function': check_repo},
761 conditions={'method': ['PUT'], 'function': check_repo},
762 requirements=URL_NAME_REQUIREMENTS)
762 requirements=URL_NAME_REQUIREMENTS)
763
763
764 rmap.connect('edit_repo_caches', '/{repo_name}/settings/caches',
764 rmap.connect('edit_repo_caches', '/{repo_name}/settings/caches',
765 controller='admin/repos', action='edit_caches_form',
765 controller='admin/repos', action='edit_caches_form',
766 conditions={'method': ['GET'], 'function': check_repo},
766 conditions={'method': ['GET'], 'function': check_repo},
767 requirements=URL_NAME_REQUIREMENTS)
767 requirements=URL_NAME_REQUIREMENTS)
768 rmap.connect('edit_repo_caches', '/{repo_name}/settings/caches',
768 rmap.connect('edit_repo_caches', '/{repo_name}/settings/caches',
769 controller='admin/repos', action='edit_caches',
769 controller='admin/repos', action='edit_caches',
770 conditions={'method': ['PUT'], 'function': check_repo},
770 conditions={'method': ['PUT'], 'function': check_repo},
771 requirements=URL_NAME_REQUIREMENTS)
771 requirements=URL_NAME_REQUIREMENTS)
772
772
773 rmap.connect('edit_repo_remote', '/{repo_name}/settings/remote',
773 rmap.connect('edit_repo_remote', '/{repo_name}/settings/remote',
774 controller='admin/repos', action='edit_remote_form',
774 controller='admin/repos', action='edit_remote_form',
775 conditions={'method': ['GET'], 'function': check_repo},
775 conditions={'method': ['GET'], 'function': check_repo},
776 requirements=URL_NAME_REQUIREMENTS)
776 requirements=URL_NAME_REQUIREMENTS)
777 rmap.connect('edit_repo_remote', '/{repo_name}/settings/remote',
777 rmap.connect('edit_repo_remote', '/{repo_name}/settings/remote',
778 controller='admin/repos', action='edit_remote',
778 controller='admin/repos', action='edit_remote',
779 conditions={'method': ['PUT'], 'function': check_repo},
779 conditions={'method': ['PUT'], 'function': check_repo},
780 requirements=URL_NAME_REQUIREMENTS)
780 requirements=URL_NAME_REQUIREMENTS)
781
781
782 rmap.connect('edit_repo_statistics', '/{repo_name}/settings/statistics',
782 rmap.connect('edit_repo_statistics', '/{repo_name}/settings/statistics',
783 controller='admin/repos', action='edit_statistics_form',
783 controller='admin/repos', action='edit_statistics_form',
784 conditions={'method': ['GET'], 'function': check_repo},
784 conditions={'method': ['GET'], 'function': check_repo},
785 requirements=URL_NAME_REQUIREMENTS)
785 requirements=URL_NAME_REQUIREMENTS)
786 rmap.connect('edit_repo_statistics', '/{repo_name}/settings/statistics',
786 rmap.connect('edit_repo_statistics', '/{repo_name}/settings/statistics',
787 controller='admin/repos', action='edit_statistics',
787 controller='admin/repos', action='edit_statistics',
788 conditions={'method': ['PUT'], 'function': check_repo},
788 conditions={'method': ['PUT'], 'function': check_repo},
789 requirements=URL_NAME_REQUIREMENTS)
789 requirements=URL_NAME_REQUIREMENTS)
790 rmap.connect('repo_settings_issuetracker',
790 rmap.connect('repo_settings_issuetracker',
791 '/{repo_name}/settings/issue-tracker',
791 '/{repo_name}/settings/issue-tracker',
792 controller='admin/repos', action='repo_issuetracker',
792 controller='admin/repos', action='repo_issuetracker',
793 conditions={'method': ['GET'], 'function': check_repo},
793 conditions={'method': ['GET'], 'function': check_repo},
794 requirements=URL_NAME_REQUIREMENTS)
794 requirements=URL_NAME_REQUIREMENTS)
795 rmap.connect('repo_issuetracker_test',
795 rmap.connect('repo_issuetracker_test',
796 '/{repo_name}/settings/issue-tracker/test',
796 '/{repo_name}/settings/issue-tracker/test',
797 controller='admin/repos', action='repo_issuetracker_test',
797 controller='admin/repos', action='repo_issuetracker_test',
798 conditions={'method': ['POST'], 'function': check_repo},
798 conditions={'method': ['POST'], 'function': check_repo},
799 requirements=URL_NAME_REQUIREMENTS)
799 requirements=URL_NAME_REQUIREMENTS)
800 rmap.connect('repo_issuetracker_delete',
800 rmap.connect('repo_issuetracker_delete',
801 '/{repo_name}/settings/issue-tracker/delete',
801 '/{repo_name}/settings/issue-tracker/delete',
802 controller='admin/repos', action='repo_issuetracker_delete',
802 controller='admin/repos', action='repo_issuetracker_delete',
803 conditions={'method': ['DELETE'], 'function': check_repo},
803 conditions={'method': ['DELETE'], 'function': check_repo},
804 requirements=URL_NAME_REQUIREMENTS)
804 requirements=URL_NAME_REQUIREMENTS)
805 rmap.connect('repo_issuetracker_save',
805 rmap.connect('repo_issuetracker_save',
806 '/{repo_name}/settings/issue-tracker/save',
806 '/{repo_name}/settings/issue-tracker/save',
807 controller='admin/repos', action='repo_issuetracker_save',
807 controller='admin/repos', action='repo_issuetracker_save',
808 conditions={'method': ['POST'], 'function': check_repo},
808 conditions={'method': ['POST'], 'function': check_repo},
809 requirements=URL_NAME_REQUIREMENTS)
809 requirements=URL_NAME_REQUIREMENTS)
810 rmap.connect('repo_vcs_settings', '/{repo_name}/settings/vcs',
810 rmap.connect('repo_vcs_settings', '/{repo_name}/settings/vcs',
811 controller='admin/repos', action='repo_settings_vcs_update',
811 controller='admin/repos', action='repo_settings_vcs_update',
812 conditions={'method': ['POST'], 'function': check_repo},
812 conditions={'method': ['POST'], 'function': check_repo},
813 requirements=URL_NAME_REQUIREMENTS)
813 requirements=URL_NAME_REQUIREMENTS)
814 rmap.connect('repo_vcs_settings', '/{repo_name}/settings/vcs',
814 rmap.connect('repo_vcs_settings', '/{repo_name}/settings/vcs',
815 controller='admin/repos', action='repo_settings_vcs',
815 controller='admin/repos', action='repo_settings_vcs',
816 conditions={'method': ['GET'], 'function': check_repo},
816 conditions={'method': ['GET'], 'function': check_repo},
817 requirements=URL_NAME_REQUIREMENTS)
817 requirements=URL_NAME_REQUIREMENTS)
818 rmap.connect('repo_vcs_settings', '/{repo_name}/settings/vcs',
818 rmap.connect('repo_vcs_settings', '/{repo_name}/settings/vcs',
819 controller='admin/repos', action='repo_delete_svn_pattern',
819 controller='admin/repos', action='repo_delete_svn_pattern',
820 conditions={'method': ['DELETE'], 'function': check_repo},
820 conditions={'method': ['DELETE'], 'function': check_repo},
821 requirements=URL_NAME_REQUIREMENTS)
821 requirements=URL_NAME_REQUIREMENTS)
822
822
823 # still working url for backward compat.
823 # still working url for backward compat.
824 rmap.connect('raw_changeset_home_depraced',
824 rmap.connect('raw_changeset_home_depraced',
825 '/{repo_name}/raw-changeset/{revision}',
825 '/{repo_name}/raw-changeset/{revision}',
826 controller='changeset', action='changeset_raw',
826 controller='changeset', action='changeset_raw',
827 revision='tip', conditions={'function': check_repo},
827 revision='tip', conditions={'function': check_repo},
828 requirements=URL_NAME_REQUIREMENTS)
828 requirements=URL_NAME_REQUIREMENTS)
829
829
830 # new URLs
830 # new URLs
831 rmap.connect('changeset_raw_home',
831 rmap.connect('changeset_raw_home',
832 '/{repo_name}/changeset-diff/{revision}',
832 '/{repo_name}/changeset-diff/{revision}',
833 controller='changeset', action='changeset_raw',
833 controller='changeset', action='changeset_raw',
834 revision='tip', conditions={'function': check_repo},
834 revision='tip', conditions={'function': check_repo},
835 requirements=URL_NAME_REQUIREMENTS)
835 requirements=URL_NAME_REQUIREMENTS)
836
836
837 rmap.connect('changeset_patch_home',
837 rmap.connect('changeset_patch_home',
838 '/{repo_name}/changeset-patch/{revision}',
838 '/{repo_name}/changeset-patch/{revision}',
839 controller='changeset', action='changeset_patch',
839 controller='changeset', action='changeset_patch',
840 revision='tip', conditions={'function': check_repo},
840 revision='tip', conditions={'function': check_repo},
841 requirements=URL_NAME_REQUIREMENTS)
841 requirements=URL_NAME_REQUIREMENTS)
842
842
843 rmap.connect('changeset_download_home',
843 rmap.connect('changeset_download_home',
844 '/{repo_name}/changeset-download/{revision}',
844 '/{repo_name}/changeset-download/{revision}',
845 controller='changeset', action='changeset_download',
845 controller='changeset', action='changeset_download',
846 revision='tip', conditions={'function': check_repo},
846 revision='tip', conditions={'function': check_repo},
847 requirements=URL_NAME_REQUIREMENTS)
847 requirements=URL_NAME_REQUIREMENTS)
848
848
849 rmap.connect('changeset_comment',
849 rmap.connect('changeset_comment',
850 '/{repo_name}/changeset/{revision}/comment', jsroute=True,
850 '/{repo_name}/changeset/{revision}/comment', jsroute=True,
851 controller='changeset', revision='tip', action='comment',
851 controller='changeset', revision='tip', action='comment',
852 conditions={'function': check_repo},
852 conditions={'function': check_repo},
853 requirements=URL_NAME_REQUIREMENTS)
853 requirements=URL_NAME_REQUIREMENTS)
854
854
855 rmap.connect('changeset_comment_preview',
855 rmap.connect('changeset_comment_preview',
856 '/{repo_name}/changeset/comment/preview', jsroute=True,
856 '/{repo_name}/changeset/comment/preview', jsroute=True,
857 controller='changeset', action='preview_comment',
857 controller='changeset', action='preview_comment',
858 conditions={'function': check_repo, 'method': ['POST']},
858 conditions={'function': check_repo, 'method': ['POST']},
859 requirements=URL_NAME_REQUIREMENTS)
859 requirements=URL_NAME_REQUIREMENTS)
860
860
861 rmap.connect('changeset_comment_delete',
861 rmap.connect('changeset_comment_delete',
862 '/{repo_name}/changeset/comment/{comment_id}/delete',
862 '/{repo_name}/changeset/comment/{comment_id}/delete',
863 controller='changeset', action='delete_comment',
863 controller='changeset', action='delete_comment',
864 conditions={'function': check_repo, 'method': ['DELETE']},
864 conditions={'function': check_repo, 'method': ['DELETE']},
865 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
865 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
866
866
867 rmap.connect('changeset_info', '/changeset_info/{repo_name}/{revision}',
867 rmap.connect('changeset_info', '/{repo_name}/changeset_info/{revision}',
868 controller='changeset', action='changeset_info',
868 controller='changeset', action='changeset_info',
869 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
869 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
870
870
871 rmap.connect('compare_home',
871 rmap.connect('compare_home',
872 '/{repo_name}/compare',
872 '/{repo_name}/compare',
873 controller='compare', action='index',
873 controller='compare', action='index',
874 conditions={'function': check_repo},
874 conditions={'function': check_repo},
875 requirements=URL_NAME_REQUIREMENTS)
875 requirements=URL_NAME_REQUIREMENTS)
876
876
877 rmap.connect('compare_url',
877 rmap.connect('compare_url',
878 '/{repo_name}/compare/{source_ref_type}@{source_ref:.*?}...{target_ref_type}@{target_ref:.*?}',
878 '/{repo_name}/compare/{source_ref_type}@{source_ref:.*?}...{target_ref_type}@{target_ref:.*?}',
879 controller='compare', action='compare',
879 controller='compare', action='compare',
880 conditions={'function': check_repo},
880 conditions={'function': check_repo},
881 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
881 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
882
882
883 rmap.connect('pullrequest_home',
883 rmap.connect('pullrequest_home',
884 '/{repo_name}/pull-request/new', controller='pullrequests',
884 '/{repo_name}/pull-request/new', controller='pullrequests',
885 action='index', conditions={'function': check_repo,
885 action='index', conditions={'function': check_repo,
886 'method': ['GET']},
886 'method': ['GET']},
887 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
887 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
888
888
889 rmap.connect('pullrequest',
889 rmap.connect('pullrequest',
890 '/{repo_name}/pull-request/new', controller='pullrequests',
890 '/{repo_name}/pull-request/new', controller='pullrequests',
891 action='create', conditions={'function': check_repo,
891 action='create', conditions={'function': check_repo,
892 'method': ['POST']},
892 'method': ['POST']},
893 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
893 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
894
894
895 rmap.connect('pullrequest_repo_refs',
895 rmap.connect('pullrequest_repo_refs',
896 '/{repo_name}/pull-request/refs/{target_repo_name:.*?[^/]}',
896 '/{repo_name}/pull-request/refs/{target_repo_name:.*?[^/]}',
897 controller='pullrequests',
897 controller='pullrequests',
898 action='get_repo_refs',
898 action='get_repo_refs',
899 conditions={'function': check_repo, 'method': ['GET']},
899 conditions={'function': check_repo, 'method': ['GET']},
900 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
900 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
901
901
902 rmap.connect('pullrequest_repo_destinations',
902 rmap.connect('pullrequest_repo_destinations',
903 '/{repo_name}/pull-request/repo-destinations',
903 '/{repo_name}/pull-request/repo-destinations',
904 controller='pullrequests',
904 controller='pullrequests',
905 action='get_repo_destinations',
905 action='get_repo_destinations',
906 conditions={'function': check_repo, 'method': ['GET']},
906 conditions={'function': check_repo, 'method': ['GET']},
907 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
907 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
908
908
909 rmap.connect('pullrequest_show',
909 rmap.connect('pullrequest_show',
910 '/{repo_name}/pull-request/{pull_request_id}',
910 '/{repo_name}/pull-request/{pull_request_id}',
911 controller='pullrequests',
911 controller='pullrequests',
912 action='show', conditions={'function': check_repo,
912 action='show', conditions={'function': check_repo,
913 'method': ['GET']},
913 'method': ['GET']},
914 requirements=URL_NAME_REQUIREMENTS)
914 requirements=URL_NAME_REQUIREMENTS)
915
915
916 rmap.connect('pullrequest_update',
916 rmap.connect('pullrequest_update',
917 '/{repo_name}/pull-request/{pull_request_id}',
917 '/{repo_name}/pull-request/{pull_request_id}',
918 controller='pullrequests',
918 controller='pullrequests',
919 action='update', conditions={'function': check_repo,
919 action='update', conditions={'function': check_repo,
920 'method': ['PUT']},
920 'method': ['PUT']},
921 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
921 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
922
922
923 rmap.connect('pullrequest_merge',
923 rmap.connect('pullrequest_merge',
924 '/{repo_name}/pull-request/{pull_request_id}',
924 '/{repo_name}/pull-request/{pull_request_id}',
925 controller='pullrequests',
925 controller='pullrequests',
926 action='merge', conditions={'function': check_repo,
926 action='merge', conditions={'function': check_repo,
927 'method': ['POST']},
927 'method': ['POST']},
928 requirements=URL_NAME_REQUIREMENTS)
928 requirements=URL_NAME_REQUIREMENTS)
929
929
930 rmap.connect('pullrequest_delete',
930 rmap.connect('pullrequest_delete',
931 '/{repo_name}/pull-request/{pull_request_id}',
931 '/{repo_name}/pull-request/{pull_request_id}',
932 controller='pullrequests',
932 controller='pullrequests',
933 action='delete', conditions={'function': check_repo,
933 action='delete', conditions={'function': check_repo,
934 'method': ['DELETE']},
934 'method': ['DELETE']},
935 requirements=URL_NAME_REQUIREMENTS)
935 requirements=URL_NAME_REQUIREMENTS)
936
936
937 rmap.connect('pullrequest_show_all',
937 rmap.connect('pullrequest_show_all',
938 '/{repo_name}/pull-request',
938 '/{repo_name}/pull-request',
939 controller='pullrequests',
939 controller='pullrequests',
940 action='show_all', conditions={'function': check_repo,
940 action='show_all', conditions={'function': check_repo,
941 'method': ['GET']},
941 'method': ['GET']},
942 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
942 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
943
943
944 rmap.connect('pullrequest_comment',
944 rmap.connect('pullrequest_comment',
945 '/{repo_name}/pull-request-comment/{pull_request_id}',
945 '/{repo_name}/pull-request-comment/{pull_request_id}',
946 controller='pullrequests',
946 controller='pullrequests',
947 action='comment', conditions={'function': check_repo,
947 action='comment', conditions={'function': check_repo,
948 'method': ['POST']},
948 'method': ['POST']},
949 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
949 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
950
950
951 rmap.connect('pullrequest_comment_delete',
951 rmap.connect('pullrequest_comment_delete',
952 '/{repo_name}/pull-request-comment/{comment_id}/delete',
952 '/{repo_name}/pull-request-comment/{comment_id}/delete',
953 controller='pullrequests', action='delete_comment',
953 controller='pullrequests', action='delete_comment',
954 conditions={'function': check_repo, 'method': ['DELETE']},
954 conditions={'function': check_repo, 'method': ['DELETE']},
955 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
955 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
956
956
957 rmap.connect('summary_home_explicit', '/{repo_name}/summary',
957 rmap.connect('summary_home_explicit', '/{repo_name}/summary',
958 controller='summary', conditions={'function': check_repo},
958 controller='summary', conditions={'function': check_repo},
959 requirements=URL_NAME_REQUIREMENTS)
959 requirements=URL_NAME_REQUIREMENTS)
960
960
961 rmap.connect('branches_home', '/{repo_name}/branches',
961 rmap.connect('branches_home', '/{repo_name}/branches',
962 controller='branches', conditions={'function': check_repo},
962 controller='branches', conditions={'function': check_repo},
963 requirements=URL_NAME_REQUIREMENTS)
963 requirements=URL_NAME_REQUIREMENTS)
964
964
965 rmap.connect('tags_home', '/{repo_name}/tags',
965 rmap.connect('tags_home', '/{repo_name}/tags',
966 controller='tags', conditions={'function': check_repo},
966 controller='tags', conditions={'function': check_repo},
967 requirements=URL_NAME_REQUIREMENTS)
967 requirements=URL_NAME_REQUIREMENTS)
968
968
969 rmap.connect('bookmarks_home', '/{repo_name}/bookmarks',
969 rmap.connect('bookmarks_home', '/{repo_name}/bookmarks',
970 controller='bookmarks', conditions={'function': check_repo},
970 controller='bookmarks', conditions={'function': check_repo},
971 requirements=URL_NAME_REQUIREMENTS)
971 requirements=URL_NAME_REQUIREMENTS)
972
972
973 rmap.connect('changelog_home', '/{repo_name}/changelog', jsroute=True,
973 rmap.connect('changelog_home', '/{repo_name}/changelog', jsroute=True,
974 controller='changelog', conditions={'function': check_repo},
974 controller='changelog', conditions={'function': check_repo},
975 requirements=URL_NAME_REQUIREMENTS)
975 requirements=URL_NAME_REQUIREMENTS)
976
976
977 rmap.connect('changelog_summary_home', '/{repo_name}/changelog_summary',
977 rmap.connect('changelog_summary_home', '/{repo_name}/changelog_summary',
978 controller='changelog', action='changelog_summary',
978 controller='changelog', action='changelog_summary',
979 conditions={'function': check_repo},
979 conditions={'function': check_repo},
980 requirements=URL_NAME_REQUIREMENTS)
980 requirements=URL_NAME_REQUIREMENTS)
981
981
982 rmap.connect('changelog_file_home',
982 rmap.connect('changelog_file_home',
983 '/{repo_name}/changelog/{revision}/{f_path}',
983 '/{repo_name}/changelog/{revision}/{f_path}',
984 controller='changelog', f_path=None,
984 controller='changelog', f_path=None,
985 conditions={'function': check_repo},
985 conditions={'function': check_repo},
986 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
986 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
987
987
988 rmap.connect('changelog_details', '/{repo_name}/changelog_details/{cs}',
988 rmap.connect('changelog_details', '/{repo_name}/changelog_details/{cs}',
989 controller='changelog', action='changelog_details',
989 controller='changelog', action='changelog_details',
990 conditions={'function': check_repo},
990 conditions={'function': check_repo},
991 requirements=URL_NAME_REQUIREMENTS)
991 requirements=URL_NAME_REQUIREMENTS)
992
992
993 rmap.connect('files_home', '/{repo_name}/files/{revision}/{f_path}',
993 rmap.connect('files_home', '/{repo_name}/files/{revision}/{f_path}',
994 controller='files', revision='tip', f_path='',
994 controller='files', revision='tip', f_path='',
995 conditions={'function': check_repo},
995 conditions={'function': check_repo},
996 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
996 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
997
997
998 rmap.connect('files_home_simple_catchrev',
998 rmap.connect('files_home_simple_catchrev',
999 '/{repo_name}/files/{revision}',
999 '/{repo_name}/files/{revision}',
1000 controller='files', revision='tip', f_path='',
1000 controller='files', revision='tip', f_path='',
1001 conditions={'function': check_repo},
1001 conditions={'function': check_repo},
1002 requirements=URL_NAME_REQUIREMENTS)
1002 requirements=URL_NAME_REQUIREMENTS)
1003
1003
1004 rmap.connect('files_home_simple_catchall',
1004 rmap.connect('files_home_simple_catchall',
1005 '/{repo_name}/files',
1005 '/{repo_name}/files',
1006 controller='files', revision='tip', f_path='',
1006 controller='files', revision='tip', f_path='',
1007 conditions={'function': check_repo},
1007 conditions={'function': check_repo},
1008 requirements=URL_NAME_REQUIREMENTS)
1008 requirements=URL_NAME_REQUIREMENTS)
1009
1009
1010 rmap.connect('files_history_home',
1010 rmap.connect('files_history_home',
1011 '/{repo_name}/history/{revision}/{f_path}',
1011 '/{repo_name}/history/{revision}/{f_path}',
1012 controller='files', action='history', revision='tip', f_path='',
1012 controller='files', action='history', revision='tip', f_path='',
1013 conditions={'function': check_repo},
1013 conditions={'function': check_repo},
1014 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
1014 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
1015
1015
1016 rmap.connect('files_authors_home',
1016 rmap.connect('files_authors_home',
1017 '/{repo_name}/authors/{revision}/{f_path}',
1017 '/{repo_name}/authors/{revision}/{f_path}',
1018 controller='files', action='authors', revision='tip', f_path='',
1018 controller='files', action='authors', revision='tip', f_path='',
1019 conditions={'function': check_repo},
1019 conditions={'function': check_repo},
1020 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
1020 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
1021
1021
1022 rmap.connect('files_diff_home', '/{repo_name}/diff/{f_path}',
1022 rmap.connect('files_diff_home', '/{repo_name}/diff/{f_path}',
1023 controller='files', action='diff', f_path='',
1023 controller='files', action='diff', f_path='',
1024 conditions={'function': check_repo},
1024 conditions={'function': check_repo},
1025 requirements=URL_NAME_REQUIREMENTS)
1025 requirements=URL_NAME_REQUIREMENTS)
1026
1026
1027 rmap.connect('files_diff_2way_home',
1027 rmap.connect('files_diff_2way_home',
1028 '/{repo_name}/diff-2way/{f_path}',
1028 '/{repo_name}/diff-2way/{f_path}',
1029 controller='files', action='diff_2way', f_path='',
1029 controller='files', action='diff_2way', f_path='',
1030 conditions={'function': check_repo},
1030 conditions={'function': check_repo},
1031 requirements=URL_NAME_REQUIREMENTS)
1031 requirements=URL_NAME_REQUIREMENTS)
1032
1032
1033 rmap.connect('files_rawfile_home',
1033 rmap.connect('files_rawfile_home',
1034 '/{repo_name}/rawfile/{revision}/{f_path}',
1034 '/{repo_name}/rawfile/{revision}/{f_path}',
1035 controller='files', action='rawfile', revision='tip',
1035 controller='files', action='rawfile', revision='tip',
1036 f_path='', conditions={'function': check_repo},
1036 f_path='', conditions={'function': check_repo},
1037 requirements=URL_NAME_REQUIREMENTS)
1037 requirements=URL_NAME_REQUIREMENTS)
1038
1038
1039 rmap.connect('files_raw_home',
1039 rmap.connect('files_raw_home',
1040 '/{repo_name}/raw/{revision}/{f_path}',
1040 '/{repo_name}/raw/{revision}/{f_path}',
1041 controller='files', action='raw', revision='tip', f_path='',
1041 controller='files', action='raw', revision='tip', f_path='',
1042 conditions={'function': check_repo},
1042 conditions={'function': check_repo},
1043 requirements=URL_NAME_REQUIREMENTS)
1043 requirements=URL_NAME_REQUIREMENTS)
1044
1044
1045 rmap.connect('files_render_home',
1045 rmap.connect('files_render_home',
1046 '/{repo_name}/render/{revision}/{f_path}',
1046 '/{repo_name}/render/{revision}/{f_path}',
1047 controller='files', action='index', revision='tip', f_path='',
1047 controller='files', action='index', revision='tip', f_path='',
1048 rendered=True, conditions={'function': check_repo},
1048 rendered=True, conditions={'function': check_repo},
1049 requirements=URL_NAME_REQUIREMENTS)
1049 requirements=URL_NAME_REQUIREMENTS)
1050
1050
1051 rmap.connect('files_annotate_home',
1051 rmap.connect('files_annotate_home',
1052 '/{repo_name}/annotate/{revision}/{f_path}',
1052 '/{repo_name}/annotate/{revision}/{f_path}',
1053 controller='files', action='index', revision='tip',
1053 controller='files', action='index', revision='tip',
1054 f_path='', annotate=True, conditions={'function': check_repo},
1054 f_path='', annotate=True, conditions={'function': check_repo},
1055 requirements=URL_NAME_REQUIREMENTS)
1055 requirements=URL_NAME_REQUIREMENTS)
1056
1056
1057 rmap.connect('files_edit',
1057 rmap.connect('files_edit',
1058 '/{repo_name}/edit/{revision}/{f_path}',
1058 '/{repo_name}/edit/{revision}/{f_path}',
1059 controller='files', action='edit', revision='tip',
1059 controller='files', action='edit', revision='tip',
1060 f_path='',
1060 f_path='',
1061 conditions={'function': check_repo, 'method': ['POST']},
1061 conditions={'function': check_repo, 'method': ['POST']},
1062 requirements=URL_NAME_REQUIREMENTS)
1062 requirements=URL_NAME_REQUIREMENTS)
1063
1063
1064 rmap.connect('files_edit_home',
1064 rmap.connect('files_edit_home',
1065 '/{repo_name}/edit/{revision}/{f_path}',
1065 '/{repo_name}/edit/{revision}/{f_path}',
1066 controller='files', action='edit_home', revision='tip',
1066 controller='files', action='edit_home', revision='tip',
1067 f_path='', conditions={'function': check_repo},
1067 f_path='', conditions={'function': check_repo},
1068 requirements=URL_NAME_REQUIREMENTS)
1068 requirements=URL_NAME_REQUIREMENTS)
1069
1069
1070 rmap.connect('files_add',
1070 rmap.connect('files_add',
1071 '/{repo_name}/add/{revision}/{f_path}',
1071 '/{repo_name}/add/{revision}/{f_path}',
1072 controller='files', action='add', revision='tip',
1072 controller='files', action='add', revision='tip',
1073 f_path='',
1073 f_path='',
1074 conditions={'function': check_repo, 'method': ['POST']},
1074 conditions={'function': check_repo, 'method': ['POST']},
1075 requirements=URL_NAME_REQUIREMENTS)
1075 requirements=URL_NAME_REQUIREMENTS)
1076
1076
1077 rmap.connect('files_add_home',
1077 rmap.connect('files_add_home',
1078 '/{repo_name}/add/{revision}/{f_path}',
1078 '/{repo_name}/add/{revision}/{f_path}',
1079 controller='files', action='add_home', revision='tip',
1079 controller='files', action='add_home', revision='tip',
1080 f_path='', conditions={'function': check_repo},
1080 f_path='', conditions={'function': check_repo},
1081 requirements=URL_NAME_REQUIREMENTS)
1081 requirements=URL_NAME_REQUIREMENTS)
1082
1082
1083 rmap.connect('files_delete',
1083 rmap.connect('files_delete',
1084 '/{repo_name}/delete/{revision}/{f_path}',
1084 '/{repo_name}/delete/{revision}/{f_path}',
1085 controller='files', action='delete', revision='tip',
1085 controller='files', action='delete', revision='tip',
1086 f_path='',
1086 f_path='',
1087 conditions={'function': check_repo, 'method': ['POST']},
1087 conditions={'function': check_repo, 'method': ['POST']},
1088 requirements=URL_NAME_REQUIREMENTS)
1088 requirements=URL_NAME_REQUIREMENTS)
1089
1089
1090 rmap.connect('files_delete_home',
1090 rmap.connect('files_delete_home',
1091 '/{repo_name}/delete/{revision}/{f_path}',
1091 '/{repo_name}/delete/{revision}/{f_path}',
1092 controller='files', action='delete_home', revision='tip',
1092 controller='files', action='delete_home', revision='tip',
1093 f_path='', conditions={'function': check_repo},
1093 f_path='', conditions={'function': check_repo},
1094 requirements=URL_NAME_REQUIREMENTS)
1094 requirements=URL_NAME_REQUIREMENTS)
1095
1095
1096 rmap.connect('files_archive_home', '/{repo_name}/archive/{fname}',
1096 rmap.connect('files_archive_home', '/{repo_name}/archive/{fname}',
1097 controller='files', action='archivefile',
1097 controller='files', action='archivefile',
1098 conditions={'function': check_repo},
1098 conditions={'function': check_repo},
1099 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
1099 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
1100
1100
1101 rmap.connect('files_nodelist_home',
1101 rmap.connect('files_nodelist_home',
1102 '/{repo_name}/nodelist/{revision}/{f_path}',
1102 '/{repo_name}/nodelist/{revision}/{f_path}',
1103 controller='files', action='nodelist',
1103 controller='files', action='nodelist',
1104 conditions={'function': check_repo},
1104 conditions={'function': check_repo},
1105 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
1105 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
1106
1106
1107 rmap.connect('files_nodetree_full',
1107 rmap.connect('files_nodetree_full',
1108 '/{repo_name}/nodetree_full/{commit_id}/{f_path}',
1108 '/{repo_name}/nodetree_full/{commit_id}/{f_path}',
1109 controller='files', action='nodetree_full',
1109 controller='files', action='nodetree_full',
1110 conditions={'function': check_repo},
1110 conditions={'function': check_repo},
1111 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
1111 requirements=URL_NAME_REQUIREMENTS, jsroute=True)
1112
1112
1113 rmap.connect('repo_fork_create_home', '/{repo_name}/fork',
1113 rmap.connect('repo_fork_create_home', '/{repo_name}/fork',
1114 controller='forks', action='fork_create',
1114 controller='forks', action='fork_create',
1115 conditions={'function': check_repo, 'method': ['POST']},
1115 conditions={'function': check_repo, 'method': ['POST']},
1116 requirements=URL_NAME_REQUIREMENTS)
1116 requirements=URL_NAME_REQUIREMENTS)
1117
1117
1118 rmap.connect('repo_fork_home', '/{repo_name}/fork',
1118 rmap.connect('repo_fork_home', '/{repo_name}/fork',
1119 controller='forks', action='fork',
1119 controller='forks', action='fork',
1120 conditions={'function': check_repo},
1120 conditions={'function': check_repo},
1121 requirements=URL_NAME_REQUIREMENTS)
1121 requirements=URL_NAME_REQUIREMENTS)
1122
1122
1123 rmap.connect('repo_forks_home', '/{repo_name}/forks',
1123 rmap.connect('repo_forks_home', '/{repo_name}/forks',
1124 controller='forks', action='forks',
1124 controller='forks', action='forks',
1125 conditions={'function': check_repo},
1125 conditions={'function': check_repo},
1126 requirements=URL_NAME_REQUIREMENTS)
1126 requirements=URL_NAME_REQUIREMENTS)
1127
1127
1128 rmap.connect('repo_followers_home', '/{repo_name}/followers',
1128 rmap.connect('repo_followers_home', '/{repo_name}/followers',
1129 controller='followers', action='followers',
1129 controller='followers', action='followers',
1130 conditions={'function': check_repo},
1130 conditions={'function': check_repo},
1131 requirements=URL_NAME_REQUIREMENTS)
1131 requirements=URL_NAME_REQUIREMENTS)
1132
1132
1133 # must be here for proper group/repo catching pattern
1133 # must be here for proper group/repo catching pattern
1134 _connect_with_slash(
1134 _connect_with_slash(
1135 rmap, 'repo_group_home', '/{group_name}',
1135 rmap, 'repo_group_home', '/{group_name}',
1136 controller='home', action='index_repo_group',
1136 controller='home', action='index_repo_group',
1137 conditions={'function': check_group},
1137 conditions={'function': check_group},
1138 requirements=URL_NAME_REQUIREMENTS)
1138 requirements=URL_NAME_REQUIREMENTS)
1139
1139
1140 # catch all, at the end
1140 # catch all, at the end
1141 _connect_with_slash(
1141 _connect_with_slash(
1142 rmap, 'summary_home', '/{repo_name}', jsroute=True,
1142 rmap, 'summary_home', '/{repo_name}', jsroute=True,
1143 controller='summary', action='index',
1143 controller='summary', action='index',
1144 conditions={'function': check_repo},
1144 conditions={'function': check_repo},
1145 requirements=URL_NAME_REQUIREMENTS)
1145 requirements=URL_NAME_REQUIREMENTS)
1146
1146
1147 return rmap
1147 return rmap
1148
1148
1149
1149
1150 def _connect_with_slash(mapper, name, path, *args, **kwargs):
1150 def _connect_with_slash(mapper, name, path, *args, **kwargs):
1151 """
1151 """
1152 Connect a route with an optional trailing slash in `path`.
1152 Connect a route with an optional trailing slash in `path`.
1153 """
1153 """
1154 mapper.connect(name + '_slash', path + '/', *args, **kwargs)
1154 mapper.connect(name + '_slash', path + '/', *args, **kwargs)
1155 mapper.connect(name, path, *args, **kwargs)
1155 mapper.connect(name, path, *args, **kwargs)
@@ -1,51 +1,51 b''
1
1
2 /******************************************************************************
2 /******************************************************************************
3 * *
3 * *
4 * DO NOT CHANGE THIS FILE MANUALLY *
4 * DO NOT CHANGE THIS FILE MANUALLY *
5 * *
5 * *
6 * *
6 * *
7 * This file is automatically generated when the app starts up with *
7 * This file is automatically generated when the app starts up with *
8 * generate_js_files = true *
8 * generate_js_files = true *
9 * *
9 * *
10 * To add a route here pass jsroute=True to the route definition in the app *
10 * To add a route here pass jsroute=True to the route definition in the app *
11 * *
11 * *
12 ******************************************************************************/
12 ******************************************************************************/
13 function registerRCRoutes() {
13 function registerRCRoutes() {
14 // routes registration
14 // routes registration
15 pyroutes.register('home', '/', []);
15 pyroutes.register('home', '/', []);
16 pyroutes.register('user_autocomplete_data', '/_users', []);
16 pyroutes.register('user_autocomplete_data', '/_users', []);
17 pyroutes.register('new_repo', '/_admin/create_repository', []);
17 pyroutes.register('new_repo', '/_admin/create_repository', []);
18 pyroutes.register('edit_user_group_members', '/_admin/user_groups/%(user_group_id)s/edit/members', ['user_group_id']);
18 pyroutes.register('edit_user_group_members', '/_admin/user_groups/%(user_group_id)s/edit/members', ['user_group_id']);
19 pyroutes.register('gists', '/_admin/gists', []);
19 pyroutes.register('gists', '/_admin/gists', []);
20 pyroutes.register('new_gist', '/_admin/gists/new', []);
20 pyroutes.register('new_gist', '/_admin/gists/new', []);
21 pyroutes.register('toggle_following', '/_admin/toggle_following', []);
21 pyroutes.register('toggle_following', '/_admin/toggle_following', []);
22 pyroutes.register('repo_stats', '/%(repo_name)s/repo_stats/%(commit_id)s', ['repo_name', 'commit_id']);
22 pyroutes.register('repo_stats', '/%(repo_name)s/repo_stats/%(commit_id)s', ['repo_name', 'commit_id']);
23 pyroutes.register('repo_refs_data', '/%(repo_name)s/refs-data', ['repo_name']);
23 pyroutes.register('repo_refs_data', '/%(repo_name)s/refs-data', ['repo_name']);
24 pyroutes.register('repo_refs_changelog_data', '/%(repo_name)s/refs-data-changelog', ['repo_name']);
24 pyroutes.register('repo_refs_changelog_data', '/%(repo_name)s/refs-data-changelog', ['repo_name']);
25 pyroutes.register('changeset_home', '/%(repo_name)s/changeset/%(revision)s', ['repo_name', 'revision']);
25 pyroutes.register('changeset_home', '/%(repo_name)s/changeset/%(revision)s', ['repo_name', 'revision']);
26 pyroutes.register('edit_repo', '/%(repo_name)s/settings', ['repo_name']);
26 pyroutes.register('edit_repo', '/%(repo_name)s/settings', ['repo_name']);
27 pyroutes.register('edit_repo_perms', '/%(repo_name)s/settings/permissions', ['repo_name']);
27 pyroutes.register('edit_repo_perms', '/%(repo_name)s/settings/permissions', ['repo_name']);
28 pyroutes.register('changeset_comment', '/%(repo_name)s/changeset/%(revision)s/comment', ['repo_name', 'revision']);
28 pyroutes.register('changeset_comment', '/%(repo_name)s/changeset/%(revision)s/comment', ['repo_name', 'revision']);
29 pyroutes.register('changeset_comment_preview', '/%(repo_name)s/changeset/comment/preview', ['repo_name']);
29 pyroutes.register('changeset_comment_preview', '/%(repo_name)s/changeset/comment/preview', ['repo_name']);
30 pyroutes.register('changeset_comment_delete', '/%(repo_name)s/changeset/comment/%(comment_id)s/delete', ['repo_name', 'comment_id']);
30 pyroutes.register('changeset_comment_delete', '/%(repo_name)s/changeset/comment/%(comment_id)s/delete', ['repo_name', 'comment_id']);
31 pyroutes.register('changeset_info', '/changeset_info/%(repo_name)s/%(revision)s', ['repo_name', 'revision']);
31 pyroutes.register('changeset_info', '/%(repo_name)s/changeset_info/%(revision)s', ['repo_name', 'revision']);
32 pyroutes.register('compare_url', '/%(repo_name)s/compare/%(source_ref_type)s@%(source_ref)s...%(target_ref_type)s@%(target_ref)s', ['repo_name', 'source_ref_type', 'source_ref', 'target_ref_type', 'target_ref']);
32 pyroutes.register('compare_url', '/%(repo_name)s/compare/%(source_ref_type)s@%(source_ref)s...%(target_ref_type)s@%(target_ref)s', ['repo_name', 'source_ref_type', 'source_ref', 'target_ref_type', 'target_ref']);
33 pyroutes.register('pullrequest_home', '/%(repo_name)s/pull-request/new', ['repo_name']);
33 pyroutes.register('pullrequest_home', '/%(repo_name)s/pull-request/new', ['repo_name']);
34 pyroutes.register('pullrequest', '/%(repo_name)s/pull-request/new', ['repo_name']);
34 pyroutes.register('pullrequest', '/%(repo_name)s/pull-request/new', ['repo_name']);
35 pyroutes.register('pullrequest_repo_refs', '/%(repo_name)s/pull-request/refs/%(target_repo_name)s', ['repo_name', 'target_repo_name']);
35 pyroutes.register('pullrequest_repo_refs', '/%(repo_name)s/pull-request/refs/%(target_repo_name)s', ['repo_name', 'target_repo_name']);
36 pyroutes.register('pullrequest_repo_destinations', '/%(repo_name)s/pull-request/repo-destinations', ['repo_name']);
36 pyroutes.register('pullrequest_repo_destinations', '/%(repo_name)s/pull-request/repo-destinations', ['repo_name']);
37 pyroutes.register('pullrequest_update', '/%(repo_name)s/pull-request/%(pull_request_id)s', ['repo_name', 'pull_request_id']);
37 pyroutes.register('pullrequest_update', '/%(repo_name)s/pull-request/%(pull_request_id)s', ['repo_name', 'pull_request_id']);
38 pyroutes.register('pullrequest_show_all', '/%(repo_name)s/pull-request', ['repo_name']);
38 pyroutes.register('pullrequest_show_all', '/%(repo_name)s/pull-request', ['repo_name']);
39 pyroutes.register('pullrequest_comment', '/%(repo_name)s/pull-request-comment/%(pull_request_id)s', ['repo_name', 'pull_request_id']);
39 pyroutes.register('pullrequest_comment', '/%(repo_name)s/pull-request-comment/%(pull_request_id)s', ['repo_name', 'pull_request_id']);
40 pyroutes.register('pullrequest_comment_delete', '/%(repo_name)s/pull-request-comment/%(comment_id)s/delete', ['repo_name', 'comment_id']);
40 pyroutes.register('pullrequest_comment_delete', '/%(repo_name)s/pull-request-comment/%(comment_id)s/delete', ['repo_name', 'comment_id']);
41 pyroutes.register('changelog_home', '/%(repo_name)s/changelog', ['repo_name']);
41 pyroutes.register('changelog_home', '/%(repo_name)s/changelog', ['repo_name']);
42 pyroutes.register('changelog_file_home', '/%(repo_name)s/changelog/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
42 pyroutes.register('changelog_file_home', '/%(repo_name)s/changelog/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
43 pyroutes.register('files_home', '/%(repo_name)s/files/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
43 pyroutes.register('files_home', '/%(repo_name)s/files/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
44 pyroutes.register('files_history_home', '/%(repo_name)s/history/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
44 pyroutes.register('files_history_home', '/%(repo_name)s/history/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
45 pyroutes.register('files_authors_home', '/%(repo_name)s/authors/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
45 pyroutes.register('files_authors_home', '/%(repo_name)s/authors/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
46 pyroutes.register('files_archive_home', '/%(repo_name)s/archive/%(fname)s', ['repo_name', 'fname']);
46 pyroutes.register('files_archive_home', '/%(repo_name)s/archive/%(fname)s', ['repo_name', 'fname']);
47 pyroutes.register('files_nodelist_home', '/%(repo_name)s/nodelist/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
47 pyroutes.register('files_nodelist_home', '/%(repo_name)s/nodelist/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
48 pyroutes.register('files_nodetree_full', '/%(repo_name)s/nodetree_full/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
48 pyroutes.register('files_nodetree_full', '/%(repo_name)s/nodetree_full/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
49 pyroutes.register('summary_home_slash', '/%(repo_name)s/', ['repo_name']);
49 pyroutes.register('summary_home_slash', '/%(repo_name)s/', ['repo_name']);
50 pyroutes.register('summary_home', '/%(repo_name)s', ['repo_name']);
50 pyroutes.register('summary_home', '/%(repo_name)s', ['repo_name']);
51 }
51 }
General Comments 0
You need to be logged in to leave comments. Login now