Show More
@@ -1,629 +1,629 b'' | |||||
1 | """ |
|
1 | """ | |
2 | Routes configuration |
|
2 | Routes configuration | |
3 |
|
3 | |||
4 | The more specific and detailed routes should be defined first so they |
|
4 | The more specific and detailed routes should be defined first so they | |
5 | may take precedent over the more generic routes. For more information |
|
5 | may take precedent over the more generic routes. For more information | |
6 | refer to the routes manual at http://routes.groovie.org/docs/ |
|
6 | refer to the routes manual at http://routes.groovie.org/docs/ | |
7 | """ |
|
7 | """ | |
8 | from __future__ import with_statement |
|
8 | from __future__ import with_statement | |
9 | from routes import Mapper |
|
9 | from routes import Mapper | |
10 |
|
10 | |||
11 | # prefix for non repository related links needs to be prefixed with `/` |
|
11 | # prefix for non repository related links needs to be prefixed with `/` | |
12 | ADMIN_PREFIX = '/_admin' |
|
12 | ADMIN_PREFIX = '/_admin' | |
13 |
|
13 | |||
14 |
|
14 | |||
15 | def make_map(config): |
|
15 | def make_map(config): | |
16 | """Create, configure and return the routes Mapper""" |
|
16 | """Create, configure and return the routes Mapper""" | |
17 | rmap = Mapper(directory=config['pylons.paths']['controllers'], |
|
17 | rmap = Mapper(directory=config['pylons.paths']['controllers'], | |
18 | always_scan=config['debug']) |
|
18 | always_scan=config['debug']) | |
19 | rmap.minimization = False |
|
19 | rmap.minimization = False | |
20 | rmap.explicit = False |
|
20 | rmap.explicit = False | |
21 |
|
21 | |||
22 | from rhodecode.lib.utils import is_valid_repo |
|
22 | from rhodecode.lib.utils import is_valid_repo | |
23 | from rhodecode.lib.utils import is_valid_repos_group |
|
23 | from rhodecode.lib.utils import is_valid_repos_group | |
24 |
|
24 | |||
25 | def check_repo(environ, match_dict): |
|
25 | def check_repo(environ, match_dict): | |
26 | """ |
|
26 | """ | |
27 | check for valid repository for proper 404 handling |
|
27 | check for valid repository for proper 404 handling | |
28 |
|
28 | |||
29 | :param environ: |
|
29 | :param environ: | |
30 | :param match_dict: |
|
30 | :param match_dict: | |
31 | """ |
|
31 | """ | |
32 | from rhodecode.model.db import Repository |
|
32 | from rhodecode.model.db import Repository | |
33 | repo_name = match_dict.get('repo_name') |
|
33 | repo_name = match_dict.get('repo_name') | |
34 |
|
34 | |||
35 | if match_dict.get('f_path'): |
|
35 | if match_dict.get('f_path'): | |
36 | #fix for multiple initial slashes that causes errors |
|
36 | #fix for multiple initial slashes that causes errors | |
37 | match_dict['f_path'] = match_dict['f_path'].lstrip('/') |
|
37 | match_dict['f_path'] = match_dict['f_path'].lstrip('/') | |
38 |
|
38 | |||
39 | try: |
|
39 | try: | |
40 | by_id = repo_name.split('_') |
|
40 | by_id = repo_name.split('_') | |
41 | if len(by_id) == 2 and by_id[1].isdigit() and by_id[0] == '': |
|
41 | if len(by_id) == 2 and by_id[1].isdigit() and by_id[0] == '': | |
42 | repo_name = Repository.get(by_id[1]).repo_name |
|
42 | repo_name = Repository.get(by_id[1]).repo_name | |
43 | match_dict['repo_name'] = repo_name |
|
43 | match_dict['repo_name'] = repo_name | |
44 | except: |
|
44 | except: | |
45 | pass |
|
45 | pass | |
46 |
|
46 | |||
47 | return is_valid_repo(repo_name, config['base_path']) |
|
47 | return is_valid_repo(repo_name, config['base_path']) | |
48 |
|
48 | |||
49 | def check_group(environ, match_dict): |
|
49 | def check_group(environ, match_dict): | |
50 | """ |
|
50 | """ | |
51 | check for valid repositories group for proper 404 handling |
|
51 | check for valid repositories group for proper 404 handling | |
52 |
|
52 | |||
53 | :param environ: |
|
53 | :param environ: | |
54 | :param match_dict: |
|
54 | :param match_dict: | |
55 | """ |
|
55 | """ | |
56 | repos_group_name = match_dict.get('group_name') |
|
56 | repos_group_name = match_dict.get('group_name') | |
57 | return is_valid_repos_group(repos_group_name, config['base_path']) |
|
57 | return is_valid_repos_group(repos_group_name, config['base_path']) | |
58 |
|
58 | |||
59 | def check_int(environ, match_dict): |
|
59 | def check_int(environ, match_dict): | |
60 | return match_dict.get('id').isdigit() |
|
60 | return match_dict.get('id').isdigit() | |
61 |
|
61 | |||
62 | # The ErrorController route (handles 404/500 error pages); it should |
|
62 | # The ErrorController route (handles 404/500 error pages); it should | |
63 | # likely stay at the top, ensuring it can always be resolved |
|
63 | # likely stay at the top, ensuring it can always be resolved | |
64 | rmap.connect('/error/{action}', controller='error') |
|
64 | rmap.connect('/error/{action}', controller='error') | |
65 | rmap.connect('/error/{action}/{id}', controller='error') |
|
65 | rmap.connect('/error/{action}/{id}', controller='error') | |
66 |
|
66 | |||
67 | #========================================================================== |
|
67 | #========================================================================== | |
68 | # CUSTOM ROUTES HERE |
|
68 | # CUSTOM ROUTES HERE | |
69 | #========================================================================== |
|
69 | #========================================================================== | |
70 |
|
70 | |||
71 | #MAIN PAGE |
|
71 | #MAIN PAGE | |
72 | rmap.connect('home', '/', controller='home', action='index') |
|
72 | rmap.connect('home', '/', controller='home', action='index') | |
73 | rmap.connect('repo_switcher', '/repos', controller='home', |
|
73 | rmap.connect('repo_switcher', '/repos', controller='home', | |
74 | action='repo_switcher') |
|
74 | action='repo_switcher') | |
75 | rmap.connect('branch_tag_switcher', '/branches-tags/{repo_name:.*?}', |
|
75 | rmap.connect('branch_tag_switcher', '/branches-tags/{repo_name:.*?}', | |
76 | controller='home', action='branch_tag_switcher') |
|
76 | controller='home', action='branch_tag_switcher') | |
77 | rmap.connect('bugtracker', |
|
77 | rmap.connect('bugtracker', | |
78 | "http://bitbucket.org/marcinkuzminski/rhodecode/issues", |
|
78 | "http://bitbucket.org/marcinkuzminski/rhodecode/issues", | |
79 | _static=True) |
|
79 | _static=True) | |
80 | rmap.connect('rst_help', |
|
80 | rmap.connect('rst_help', | |
81 | "http://docutils.sourceforge.net/docs/user/rst/quickref.html", |
|
81 | "http://docutils.sourceforge.net/docs/user/rst/quickref.html", | |
82 | _static=True) |
|
82 | _static=True) | |
83 | rmap.connect('rhodecode_official', "http://rhodecode.org", _static=True) |
|
83 | rmap.connect('rhodecode_official', "http://rhodecode.org", _static=True) | |
84 |
|
84 | |||
85 | #ADMIN REPOSITORY REST ROUTES |
|
85 | #ADMIN REPOSITORY REST ROUTES | |
86 | with rmap.submapper(path_prefix=ADMIN_PREFIX, |
|
86 | with rmap.submapper(path_prefix=ADMIN_PREFIX, | |
87 | controller='admin/repos') as m: |
|
87 | controller='admin/repos') as m: | |
88 | m.connect("repos", "/repos", |
|
88 | m.connect("repos", "/repos", | |
89 | action="create", conditions=dict(method=["POST"])) |
|
89 | action="create", conditions=dict(method=["POST"])) | |
90 | m.connect("repos", "/repos", |
|
90 | m.connect("repos", "/repos", | |
91 | action="index", conditions=dict(method=["GET"])) |
|
91 | action="index", conditions=dict(method=["GET"])) | |
92 | m.connect("formatted_repos", "/repos.{format}", |
|
92 | m.connect("formatted_repos", "/repos.{format}", | |
93 | action="index", |
|
93 | action="index", | |
94 | conditions=dict(method=["GET"])) |
|
94 | conditions=dict(method=["GET"])) | |
95 | m.connect("new_repo", "/repos/new", |
|
95 | m.connect("new_repo", "/repos/new", | |
96 | action="new", conditions=dict(method=["GET"])) |
|
96 | action="new", conditions=dict(method=["GET"])) | |
97 | m.connect("formatted_new_repo", "/repos/new.{format}", |
|
97 | m.connect("formatted_new_repo", "/repos/new.{format}", | |
98 | action="new", conditions=dict(method=["GET"])) |
|
98 | action="new", conditions=dict(method=["GET"])) | |
99 | m.connect("/repos/{repo_name:.*?}", |
|
99 | m.connect("/repos/{repo_name:.*?}", | |
100 | action="update", conditions=dict(method=["PUT"], |
|
100 | action="update", conditions=dict(method=["PUT"], | |
101 | function=check_repo)) |
|
101 | function=check_repo)) | |
102 | m.connect("/repos/{repo_name:.*?}", |
|
102 | m.connect("/repos/{repo_name:.*?}", | |
103 | action="delete", conditions=dict(method=["DELETE"], |
|
103 | action="delete", conditions=dict(method=["DELETE"], | |
104 | function=check_repo)) |
|
104 | function=check_repo)) | |
105 | m.connect("edit_repo", "/repos/{repo_name:.*?}/edit", |
|
105 | m.connect("edit_repo", "/repos/{repo_name:.*?}/edit", | |
106 | action="edit", conditions=dict(method=["GET"], |
|
106 | action="edit", conditions=dict(method=["GET"], | |
107 | function=check_repo)) |
|
107 | function=check_repo)) | |
108 | m.connect("formatted_edit_repo", "/repos/{repo_name:.*?}.{format}/edit", |
|
108 | m.connect("formatted_edit_repo", "/repos/{repo_name:.*?}.{format}/edit", | |
109 | action="edit", conditions=dict(method=["GET"], |
|
109 | action="edit", conditions=dict(method=["GET"], | |
110 | function=check_repo)) |
|
110 | function=check_repo)) | |
111 | m.connect("repo", "/repos/{repo_name:.*?}", |
|
111 | m.connect("repo", "/repos/{repo_name:.*?}", | |
112 | action="show", conditions=dict(method=["GET"], |
|
112 | action="show", conditions=dict(method=["GET"], | |
113 | function=check_repo)) |
|
113 | function=check_repo)) | |
114 | m.connect("formatted_repo", "/repos/{repo_name:.*?}.{format}", |
|
114 | m.connect("formatted_repo", "/repos/{repo_name:.*?}.{format}", | |
115 | action="show", conditions=dict(method=["GET"], |
|
115 | action="show", conditions=dict(method=["GET"], | |
116 | function=check_repo)) |
|
116 | function=check_repo)) | |
117 | #ajax delete repo perm user |
|
117 | #ajax delete repo perm user | |
118 | m.connect('delete_repo_user', "/repos_delete_user/{repo_name:.*?}", |
|
118 | m.connect('delete_repo_user', "/repos_delete_user/{repo_name:.*?}", | |
119 | action="delete_perm_user", |
|
119 | action="delete_perm_user", | |
120 | conditions=dict(method=["DELETE"], function=check_repo)) |
|
120 | conditions=dict(method=["DELETE"], function=check_repo)) | |
121 |
|
121 | |||
122 | #ajax delete repo perm users_group |
|
122 | #ajax delete repo perm users_group | |
123 | m.connect('delete_repo_users_group', |
|
123 | m.connect('delete_repo_users_group', | |
124 | "/repos_delete_users_group/{repo_name:.*?}", |
|
124 | "/repos_delete_users_group/{repo_name:.*?}", | |
125 | action="delete_perm_users_group", |
|
125 | action="delete_perm_users_group", | |
126 | conditions=dict(method=["DELETE"], function=check_repo)) |
|
126 | conditions=dict(method=["DELETE"], function=check_repo)) | |
127 |
|
127 | |||
128 | #settings actions |
|
128 | #settings actions | |
129 | m.connect('repo_stats', "/repos_stats/{repo_name:.*?}", |
|
129 | m.connect('repo_stats', "/repos_stats/{repo_name:.*?}", | |
130 | action="repo_stats", conditions=dict(method=["DELETE"], |
|
130 | action="repo_stats", conditions=dict(method=["DELETE"], | |
131 | function=check_repo)) |
|
131 | function=check_repo)) | |
132 | m.connect('repo_cache', "/repos_cache/{repo_name:.*?}", |
|
132 | m.connect('repo_cache', "/repos_cache/{repo_name:.*?}", | |
133 | action="repo_cache", conditions=dict(method=["DELETE"], |
|
133 | action="repo_cache", conditions=dict(method=["DELETE"], | |
134 | function=check_repo)) |
|
134 | function=check_repo)) | |
135 | m.connect('repo_public_journal', "/repos_public_journal/{repo_name:.*?}", |
|
135 | m.connect('repo_public_journal', "/repos_public_journal/{repo_name:.*?}", | |
136 | action="repo_public_journal", conditions=dict(method=["PUT"], |
|
136 | action="repo_public_journal", conditions=dict(method=["PUT"], | |
137 | function=check_repo)) |
|
137 | function=check_repo)) | |
138 | m.connect('repo_pull', "/repo_pull/{repo_name:.*?}", |
|
138 | m.connect('repo_pull', "/repo_pull/{repo_name:.*?}", | |
139 | action="repo_pull", conditions=dict(method=["PUT"], |
|
139 | action="repo_pull", conditions=dict(method=["PUT"], | |
140 | function=check_repo)) |
|
140 | function=check_repo)) | |
141 | m.connect('repo_as_fork', "/repo_as_fork/{repo_name:.*?}", |
|
141 | m.connect('repo_as_fork', "/repo_as_fork/{repo_name:.*?}", | |
142 | action="repo_as_fork", conditions=dict(method=["PUT"], |
|
142 | action="repo_as_fork", conditions=dict(method=["PUT"], | |
143 | function=check_repo)) |
|
143 | function=check_repo)) | |
144 | m.connect('repo_locking', "/repo_locking/{repo_name:.*?}", |
|
144 | m.connect('repo_locking', "/repo_locking/{repo_name:.*?}", | |
145 | action="repo_locking", conditions=dict(method=["PUT"], |
|
145 | action="repo_locking", conditions=dict(method=["PUT"], | |
146 | function=check_repo)) |
|
146 | function=check_repo)) | |
147 |
|
147 | |||
148 | with rmap.submapper(path_prefix=ADMIN_PREFIX, |
|
148 | with rmap.submapper(path_prefix=ADMIN_PREFIX, | |
149 | controller='admin/repos_groups') as m: |
|
149 | controller='admin/repos_groups') as m: | |
150 | m.connect("repos_groups", "/repos_groups", |
|
150 | m.connect("repos_groups", "/repos_groups", | |
151 | action="create", conditions=dict(method=["POST"])) |
|
151 | action="create", conditions=dict(method=["POST"])) | |
152 | m.connect("repos_groups", "/repos_groups", |
|
152 | m.connect("repos_groups", "/repos_groups", | |
153 | action="index", conditions=dict(method=["GET"])) |
|
153 | action="index", conditions=dict(method=["GET"])) | |
154 | m.connect("formatted_repos_groups", "/repos_groups.{format}", |
|
154 | m.connect("formatted_repos_groups", "/repos_groups.{format}", | |
155 | action="index", conditions=dict(method=["GET"])) |
|
155 | action="index", conditions=dict(method=["GET"])) | |
156 | m.connect("new_repos_group", "/repos_groups/new", |
|
156 | m.connect("new_repos_group", "/repos_groups/new", | |
157 | action="new", conditions=dict(method=["GET"])) |
|
157 | action="new", conditions=dict(method=["GET"])) | |
158 | m.connect("formatted_new_repos_group", "/repos_groups/new.{format}", |
|
158 | m.connect("formatted_new_repos_group", "/repos_groups/new.{format}", | |
159 | action="new", conditions=dict(method=["GET"])) |
|
159 | action="new", conditions=dict(method=["GET"])) | |
160 | m.connect("update_repos_group", "/repos_groups/{group_name:.*?}", |
|
160 | m.connect("update_repos_group", "/repos_groups/{group_name:.*?}", | |
161 | action="update", conditions=dict(method=["PUT"], |
|
161 | action="update", conditions=dict(method=["PUT"], | |
162 | function=check_group)) |
|
162 | function=check_group)) | |
163 | m.connect("delete_repos_group", "/repos_groups/{group_name:.*?}", |
|
163 | m.connect("delete_repos_group", "/repos_groups/{group_name:.*?}", | |
164 | action="delete", conditions=dict(method=["DELETE"], |
|
164 | action="delete", conditions=dict(method=["DELETE"], | |
165 | function=check_group)) |
|
165 | function=check_group)) | |
166 | m.connect("edit_repos_group", "/repos_groups/{group_name:.*?}/edit", |
|
166 | m.connect("edit_repos_group", "/repos_groups/{group_name:.*?}/edit", | |
167 | action="edit", conditions=dict(method=["GET"],)) |
|
167 | action="edit", conditions=dict(method=["GET"],)) | |
168 | m.connect("formatted_edit_repos_group", |
|
168 | m.connect("formatted_edit_repos_group", | |
169 | "/repos_groups/{group_name:.*?}.{format}/edit", |
|
169 | "/repos_groups/{group_name:.*?}.{format}/edit", | |
170 | action="edit", conditions=dict(method=["GET"], |
|
170 | action="edit", conditions=dict(method=["GET"], | |
171 | function=check_group)) |
|
171 | function=check_group)) | |
172 | m.connect("repos_group", "/repos_groups/{group_name:.*?}", |
|
172 | m.connect("repos_group", "/repos_groups/{group_name:.*?}", | |
173 | action="show", conditions=dict(method=["GET"], |
|
173 | action="show", conditions=dict(method=["GET"], | |
174 | function=check_group)) |
|
174 | function=check_group)) | |
175 | m.connect("formatted_repos_group", "/repos_groups/{group_name:.*?}.{format}", |
|
175 | m.connect("formatted_repos_group", "/repos_groups/{group_name:.*?}.{format}", | |
176 | action="show", conditions=dict(method=["GET"], |
|
176 | action="show", conditions=dict(method=["GET"], | |
177 | function=check_group)) |
|
177 | function=check_group)) | |
178 | # ajax delete repos group perm user |
|
178 | # ajax delete repos group perm user | |
179 | m.connect('delete_repos_group_user_perm', |
|
179 | m.connect('delete_repos_group_user_perm', | |
180 | "/delete_repos_group_user_perm/{group_name:.*?}", |
|
180 | "/delete_repos_group_user_perm/{group_name:.*?}", | |
181 | action="delete_repos_group_user_perm", |
|
181 | action="delete_repos_group_user_perm", | |
182 | conditions=dict(method=["DELETE"], function=check_group)) |
|
182 | conditions=dict(method=["DELETE"], function=check_group)) | |
183 |
|
183 | |||
184 | # ajax delete repos group perm users_group |
|
184 | # ajax delete repos group perm users_group | |
185 | m.connect('delete_repos_group_users_group_perm', |
|
185 | m.connect('delete_repos_group_users_group_perm', | |
186 | "/delete_repos_group_users_group_perm/{group_name:.*?}", |
|
186 | "/delete_repos_group_users_group_perm/{group_name:.*?}", | |
187 | action="delete_repos_group_users_group_perm", |
|
187 | action="delete_repos_group_users_group_perm", | |
188 | conditions=dict(method=["DELETE"], function=check_group)) |
|
188 | conditions=dict(method=["DELETE"], function=check_group)) | |
189 |
|
189 | |||
190 | #ADMIN USER REST ROUTES |
|
190 | #ADMIN USER REST ROUTES | |
191 | with rmap.submapper(path_prefix=ADMIN_PREFIX, |
|
191 | with rmap.submapper(path_prefix=ADMIN_PREFIX, | |
192 | controller='admin/users') as m: |
|
192 | controller='admin/users') as m: | |
193 | m.connect("users", "/users", |
|
193 | m.connect("users", "/users", | |
194 | action="create", conditions=dict(method=["POST"])) |
|
194 | action="create", conditions=dict(method=["POST"])) | |
195 | m.connect("users", "/users", |
|
195 | m.connect("users", "/users", | |
196 | action="index", conditions=dict(method=["GET"])) |
|
196 | action="index", conditions=dict(method=["GET"])) | |
197 | m.connect("formatted_users", "/users.{format}", |
|
197 | m.connect("formatted_users", "/users.{format}", | |
198 | action="index", conditions=dict(method=["GET"])) |
|
198 | action="index", conditions=dict(method=["GET"])) | |
199 | m.connect("new_user", "/users/new", |
|
199 | m.connect("new_user", "/users/new", | |
200 | action="new", conditions=dict(method=["GET"])) |
|
200 | action="new", conditions=dict(method=["GET"])) | |
201 | m.connect("formatted_new_user", "/users/new.{format}", |
|
201 | m.connect("formatted_new_user", "/users/new.{format}", | |
202 | action="new", conditions=dict(method=["GET"])) |
|
202 | action="new", conditions=dict(method=["GET"])) | |
203 | m.connect("update_user", "/users/{id}", |
|
203 | m.connect("update_user", "/users/{id}", | |
204 | action="update", conditions=dict(method=["PUT"])) |
|
204 | action="update", conditions=dict(method=["PUT"])) | |
205 | m.connect("delete_user", "/users/{id}", |
|
205 | m.connect("delete_user", "/users/{id}", | |
206 | action="delete", conditions=dict(method=["DELETE"])) |
|
206 | action="delete", conditions=dict(method=["DELETE"])) | |
207 | m.connect("edit_user", "/users/{id}/edit", |
|
207 | m.connect("edit_user", "/users/{id}/edit", | |
208 | action="edit", conditions=dict(method=["GET"])) |
|
208 | action="edit", conditions=dict(method=["GET"])) | |
209 | m.connect("formatted_edit_user", |
|
209 | m.connect("formatted_edit_user", | |
210 | "/users/{id}.{format}/edit", |
|
210 | "/users/{id}.{format}/edit", | |
211 | action="edit", conditions=dict(method=["GET"])) |
|
211 | action="edit", conditions=dict(method=["GET"])) | |
212 | m.connect("user", "/users/{id}", |
|
212 | m.connect("user", "/users/{id}", | |
213 | action="show", conditions=dict(method=["GET"])) |
|
213 | action="show", conditions=dict(method=["GET"])) | |
214 | m.connect("formatted_user", "/users/{id}.{format}", |
|
214 | m.connect("formatted_user", "/users/{id}.{format}", | |
215 | action="show", conditions=dict(method=["GET"])) |
|
215 | action="show", conditions=dict(method=["GET"])) | |
216 |
|
216 | |||
217 | #EXTRAS USER ROUTES |
|
217 | #EXTRAS USER ROUTES | |
218 | m.connect("user_perm", "/users_perm/{id}", |
|
218 | m.connect("user_perm", "/users_perm/{id}", | |
219 | action="update_perm", conditions=dict(method=["PUT"])) |
|
219 | action="update_perm", conditions=dict(method=["PUT"])) | |
220 | m.connect("user_emails", "/users_emails/{id}", |
|
220 | m.connect("user_emails", "/users_emails/{id}", | |
221 | action="add_email", conditions=dict(method=["PUT"])) |
|
221 | action="add_email", conditions=dict(method=["PUT"])) | |
222 | m.connect("user_emails_delete", "/users_emails/{id}", |
|
222 | m.connect("user_emails_delete", "/users_emails/{id}", | |
223 | action="delete_email", conditions=dict(method=["DELETE"])) |
|
223 | action="delete_email", conditions=dict(method=["DELETE"])) | |
224 | m.connect("user_ips", "/users_ips/{id}", |
|
224 | m.connect("user_ips", "/users_ips/{id}", | |
225 | action="add_ip", conditions=dict(method=["PUT"])) |
|
225 | action="add_ip", conditions=dict(method=["PUT"])) | |
226 | m.connect("user_ips_delete", "/users_ips/{id}", |
|
226 | m.connect("user_ips_delete", "/users_ips/{id}", | |
227 | action="delete_ip", conditions=dict(method=["DELETE"])) |
|
227 | action="delete_ip", conditions=dict(method=["DELETE"])) | |
228 |
|
228 | |||
229 | #ADMIN USERS GROUPS REST ROUTES |
|
229 | #ADMIN USERS GROUPS REST ROUTES | |
230 | with rmap.submapper(path_prefix=ADMIN_PREFIX, |
|
230 | with rmap.submapper(path_prefix=ADMIN_PREFIX, | |
231 | controller='admin/users_groups') as m: |
|
231 | controller='admin/users_groups') as m: | |
232 | m.connect("users_groups", "/users_groups", |
|
232 | m.connect("users_groups", "/users_groups", | |
233 | action="create", conditions=dict(method=["POST"])) |
|
233 | action="create", conditions=dict(method=["POST"])) | |
234 | m.connect("users_groups", "/users_groups", |
|
234 | m.connect("users_groups", "/users_groups", | |
235 | action="index", conditions=dict(method=["GET"])) |
|
235 | action="index", conditions=dict(method=["GET"])) | |
236 | m.connect("formatted_users_groups", "/users_groups.{format}", |
|
236 | m.connect("formatted_users_groups", "/users_groups.{format}", | |
237 | action="index", conditions=dict(method=["GET"])) |
|
237 | action="index", conditions=dict(method=["GET"])) | |
238 | m.connect("new_users_group", "/users_groups/new", |
|
238 | m.connect("new_users_group", "/users_groups/new", | |
239 | action="new", conditions=dict(method=["GET"])) |
|
239 | action="new", conditions=dict(method=["GET"])) | |
240 | m.connect("formatted_new_users_group", "/users_groups/new.{format}", |
|
240 | m.connect("formatted_new_users_group", "/users_groups/new.{format}", | |
241 | action="new", conditions=dict(method=["GET"])) |
|
241 | action="new", conditions=dict(method=["GET"])) | |
242 | m.connect("update_users_group", "/users_groups/{id}", |
|
242 | m.connect("update_users_group", "/users_groups/{id}", | |
243 | action="update", conditions=dict(method=["PUT"])) |
|
243 | action="update", conditions=dict(method=["PUT"])) | |
244 | m.connect("delete_users_group", "/users_groups/{id}", |
|
244 | m.connect("delete_users_group", "/users_groups/{id}", | |
245 | action="delete", conditions=dict(method=["DELETE"])) |
|
245 | action="delete", conditions=dict(method=["DELETE"])) | |
246 | m.connect("edit_users_group", "/users_groups/{id}/edit", |
|
246 | m.connect("edit_users_group", "/users_groups/{id}/edit", | |
247 | action="edit", conditions=dict(method=["GET"])) |
|
247 | action="edit", conditions=dict(method=["GET"])) | |
248 | m.connect("formatted_edit_users_group", |
|
248 | m.connect("formatted_edit_users_group", | |
249 | "/users_groups/{id}.{format}/edit", |
|
249 | "/users_groups/{id}.{format}/edit", | |
250 | action="edit", conditions=dict(method=["GET"])) |
|
250 | action="edit", conditions=dict(method=["GET"])) | |
251 | m.connect("users_group", "/users_groups/{id}", |
|
251 | m.connect("users_group", "/users_groups/{id}", | |
252 | action="show", conditions=dict(method=["GET"])) |
|
252 | action="show", conditions=dict(method=["GET"])) | |
253 | m.connect("formatted_users_group", "/users_groups/{id}.{format}", |
|
253 | m.connect("formatted_users_group", "/users_groups/{id}.{format}", | |
254 | action="show", conditions=dict(method=["GET"])) |
|
254 | action="show", conditions=dict(method=["GET"])) | |
255 |
|
255 | |||
256 | #EXTRAS USER ROUTES |
|
256 | #EXTRAS USER ROUTES | |
257 | m.connect("users_group_perm", "/users_groups_perm/{id}", |
|
257 | m.connect("users_group_perm", "/users_groups_perm/{id}", | |
258 | action="update_perm", conditions=dict(method=["PUT"])) |
|
258 | action="update_perm", conditions=dict(method=["PUT"])) | |
259 |
|
259 | |||
260 | #ADMIN GROUP REST ROUTES |
|
260 | #ADMIN GROUP REST ROUTES | |
261 | rmap.resource('group', 'groups', |
|
261 | rmap.resource('group', 'groups', | |
262 | controller='admin/groups', path_prefix=ADMIN_PREFIX) |
|
262 | controller='admin/groups', path_prefix=ADMIN_PREFIX) | |
263 |
|
263 | |||
264 | #ADMIN PERMISSIONS REST ROUTES |
|
264 | #ADMIN PERMISSIONS REST ROUTES | |
265 | rmap.resource('permission', 'permissions', |
|
265 | rmap.resource('permission', 'permissions', | |
266 | controller='admin/permissions', path_prefix=ADMIN_PREFIX) |
|
266 | controller='admin/permissions', path_prefix=ADMIN_PREFIX) | |
267 |
|
267 | |||
268 | #ADMIN DEFAULTS REST ROUTES |
|
268 | #ADMIN DEFAULTS REST ROUTES | |
269 | rmap.resource('default', 'defaults', |
|
269 | rmap.resource('default', 'defaults', | |
270 | controller='admin/defaults', path_prefix=ADMIN_PREFIX) |
|
270 | controller='admin/defaults', path_prefix=ADMIN_PREFIX) | |
271 |
|
271 | |||
272 | ##ADMIN LDAP SETTINGS |
|
272 | ##ADMIN LDAP SETTINGS | |
273 | rmap.connect('ldap_settings', '%s/ldap' % ADMIN_PREFIX, |
|
273 | rmap.connect('ldap_settings', '%s/ldap' % ADMIN_PREFIX, | |
274 | controller='admin/ldap_settings', action='ldap_settings', |
|
274 | controller='admin/ldap_settings', action='ldap_settings', | |
275 | conditions=dict(method=["POST"])) |
|
275 | conditions=dict(method=["POST"])) | |
276 |
|
276 | |||
277 | rmap.connect('ldap_home', '%s/ldap' % ADMIN_PREFIX, |
|
277 | rmap.connect('ldap_home', '%s/ldap' % ADMIN_PREFIX, | |
278 | controller='admin/ldap_settings') |
|
278 | controller='admin/ldap_settings') | |
279 |
|
279 | |||
280 | #ADMIN SETTINGS REST ROUTES |
|
280 | #ADMIN SETTINGS REST ROUTES | |
281 | with rmap.submapper(path_prefix=ADMIN_PREFIX, |
|
281 | with rmap.submapper(path_prefix=ADMIN_PREFIX, | |
282 | controller='admin/settings') as m: |
|
282 | controller='admin/settings') as m: | |
283 | m.connect("admin_settings", "/settings", |
|
283 | m.connect("admin_settings", "/settings", | |
284 | action="create", conditions=dict(method=["POST"])) |
|
284 | action="create", conditions=dict(method=["POST"])) | |
285 | m.connect("admin_settings", "/settings", |
|
285 | m.connect("admin_settings", "/settings", | |
286 | action="index", conditions=dict(method=["GET"])) |
|
286 | action="index", conditions=dict(method=["GET"])) | |
287 | m.connect("formatted_admin_settings", "/settings.{format}", |
|
287 | m.connect("formatted_admin_settings", "/settings.{format}", | |
288 | action="index", conditions=dict(method=["GET"])) |
|
288 | action="index", conditions=dict(method=["GET"])) | |
289 | m.connect("admin_new_setting", "/settings/new", |
|
289 | m.connect("admin_new_setting", "/settings/new", | |
290 | action="new", conditions=dict(method=["GET"])) |
|
290 | action="new", conditions=dict(method=["GET"])) | |
291 | m.connect("formatted_admin_new_setting", "/settings/new.{format}", |
|
291 | m.connect("formatted_admin_new_setting", "/settings/new.{format}", | |
292 | action="new", conditions=dict(method=["GET"])) |
|
292 | action="new", conditions=dict(method=["GET"])) | |
293 | m.connect("/settings/{setting_id}", |
|
293 | m.connect("/settings/{setting_id}", | |
294 | action="update", conditions=dict(method=["PUT"])) |
|
294 | action="update", conditions=dict(method=["PUT"])) | |
295 | m.connect("/settings/{setting_id}", |
|
295 | m.connect("/settings/{setting_id}", | |
296 | action="delete", conditions=dict(method=["DELETE"])) |
|
296 | action="delete", conditions=dict(method=["DELETE"])) | |
297 | m.connect("admin_edit_setting", "/settings/{setting_id}/edit", |
|
297 | m.connect("admin_edit_setting", "/settings/{setting_id}/edit", | |
298 | action="edit", conditions=dict(method=["GET"])) |
|
298 | action="edit", conditions=dict(method=["GET"])) | |
299 | m.connect("formatted_admin_edit_setting", |
|
299 | m.connect("formatted_admin_edit_setting", | |
300 | "/settings/{setting_id}.{format}/edit", |
|
300 | "/settings/{setting_id}.{format}/edit", | |
301 | action="edit", conditions=dict(method=["GET"])) |
|
301 | action="edit", conditions=dict(method=["GET"])) | |
302 | m.connect("admin_setting", "/settings/{setting_id}", |
|
302 | m.connect("admin_setting", "/settings/{setting_id}", | |
303 | action="show", conditions=dict(method=["GET"])) |
|
303 | action="show", conditions=dict(method=["GET"])) | |
304 | m.connect("formatted_admin_setting", "/settings/{setting_id}.{format}", |
|
304 | m.connect("formatted_admin_setting", "/settings/{setting_id}.{format}", | |
305 | action="show", conditions=dict(method=["GET"])) |
|
305 | action="show", conditions=dict(method=["GET"])) | |
306 | m.connect("admin_settings_my_account", "/my_account", |
|
306 | m.connect("admin_settings_my_account", "/my_account", | |
307 | action="my_account", conditions=dict(method=["GET"])) |
|
307 | action="my_account", conditions=dict(method=["GET"])) | |
308 | m.connect("admin_settings_my_account_update", "/my_account_update", |
|
308 | m.connect("admin_settings_my_account_update", "/my_account_update", | |
309 | action="my_account_update", conditions=dict(method=["PUT"])) |
|
309 | action="my_account_update", conditions=dict(method=["PUT"])) | |
310 | m.connect("admin_settings_create_repository", "/create_repository", |
|
310 | m.connect("admin_settings_create_repository", "/create_repository", | |
311 | action="create_repository", conditions=dict(method=["GET"])) |
|
311 | action="create_repository", conditions=dict(method=["GET"])) | |
312 | m.connect("admin_settings_my_repos", "/my_account/repos", |
|
312 | m.connect("admin_settings_my_repos", "/my_account/repos", | |
313 | action="my_account_my_repos", conditions=dict(method=["GET"])) |
|
313 | action="my_account_my_repos", conditions=dict(method=["GET"])) | |
314 | m.connect("admin_settings_my_pullrequests", "/my_account/pull_requests", |
|
314 | m.connect("admin_settings_my_pullrequests", "/my_account/pull_requests", | |
315 | action="my_account_my_pullrequests", conditions=dict(method=["GET"])) |
|
315 | action="my_account_my_pullrequests", conditions=dict(method=["GET"])) | |
316 |
|
316 | |||
317 | #NOTIFICATION REST ROUTES |
|
317 | #NOTIFICATION REST ROUTES | |
318 | with rmap.submapper(path_prefix=ADMIN_PREFIX, |
|
318 | with rmap.submapper(path_prefix=ADMIN_PREFIX, | |
319 | controller='admin/notifications') as m: |
|
319 | controller='admin/notifications') as m: | |
320 | m.connect("notifications", "/notifications", |
|
320 | m.connect("notifications", "/notifications", | |
321 | action="create", conditions=dict(method=["POST"])) |
|
321 | action="create", conditions=dict(method=["POST"])) | |
322 | m.connect("notifications", "/notifications", |
|
322 | m.connect("notifications", "/notifications", | |
323 | action="index", conditions=dict(method=["GET"])) |
|
323 | action="index", conditions=dict(method=["GET"])) | |
324 | m.connect("notifications_mark_all_read", "/notifications/mark_all_read", |
|
324 | m.connect("notifications_mark_all_read", "/notifications/mark_all_read", | |
325 | action="mark_all_read", conditions=dict(method=["GET"])) |
|
325 | action="mark_all_read", conditions=dict(method=["GET"])) | |
326 | m.connect("formatted_notifications", "/notifications.{format}", |
|
326 | m.connect("formatted_notifications", "/notifications.{format}", | |
327 | action="index", conditions=dict(method=["GET"])) |
|
327 | action="index", conditions=dict(method=["GET"])) | |
328 | m.connect("new_notification", "/notifications/new", |
|
328 | m.connect("new_notification", "/notifications/new", | |
329 | action="new", conditions=dict(method=["GET"])) |
|
329 | action="new", conditions=dict(method=["GET"])) | |
330 | m.connect("formatted_new_notification", "/notifications/new.{format}", |
|
330 | m.connect("formatted_new_notification", "/notifications/new.{format}", | |
331 | action="new", conditions=dict(method=["GET"])) |
|
331 | action="new", conditions=dict(method=["GET"])) | |
332 | m.connect("/notification/{notification_id}", |
|
332 | m.connect("/notification/{notification_id}", | |
333 | action="update", conditions=dict(method=["PUT"])) |
|
333 | action="update", conditions=dict(method=["PUT"])) | |
334 | m.connect("/notification/{notification_id}", |
|
334 | m.connect("/notification/{notification_id}", | |
335 | action="delete", conditions=dict(method=["DELETE"])) |
|
335 | action="delete", conditions=dict(method=["DELETE"])) | |
336 | m.connect("edit_notification", "/notification/{notification_id}/edit", |
|
336 | m.connect("edit_notification", "/notification/{notification_id}/edit", | |
337 | action="edit", conditions=dict(method=["GET"])) |
|
337 | action="edit", conditions=dict(method=["GET"])) | |
338 | m.connect("formatted_edit_notification", |
|
338 | m.connect("formatted_edit_notification", | |
339 | "/notification/{notification_id}.{format}/edit", |
|
339 | "/notification/{notification_id}.{format}/edit", | |
340 | action="edit", conditions=dict(method=["GET"])) |
|
340 | action="edit", conditions=dict(method=["GET"])) | |
341 | m.connect("notification", "/notification/{notification_id}", |
|
341 | m.connect("notification", "/notification/{notification_id}", | |
342 | action="show", conditions=dict(method=["GET"])) |
|
342 | action="show", conditions=dict(method=["GET"])) | |
343 | m.connect("formatted_notification", "/notifications/{notification_id}.{format}", |
|
343 | m.connect("formatted_notification", "/notifications/{notification_id}.{format}", | |
344 | action="show", conditions=dict(method=["GET"])) |
|
344 | action="show", conditions=dict(method=["GET"])) | |
345 |
|
345 | |||
346 | #ADMIN MAIN PAGES |
|
346 | #ADMIN MAIN PAGES | |
347 | with rmap.submapper(path_prefix=ADMIN_PREFIX, |
|
347 | with rmap.submapper(path_prefix=ADMIN_PREFIX, | |
348 | controller='admin/admin') as m: |
|
348 | controller='admin/admin') as m: | |
349 | m.connect('admin_home', '', action='index') |
|
349 | m.connect('admin_home', '', action='index') | |
350 | m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}', |
|
350 | m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}', | |
351 | action='add_repo') |
|
351 | action='add_repo') | |
352 |
|
352 | |||
353 | #========================================================================== |
|
353 | #========================================================================== | |
354 | # API V2 |
|
354 | # API V2 | |
355 | #========================================================================== |
|
355 | #========================================================================== | |
356 | with rmap.submapper(path_prefix=ADMIN_PREFIX, |
|
356 | with rmap.submapper(path_prefix=ADMIN_PREFIX, | |
357 | controller='api/api') as m: |
|
357 | controller='api/api') as m: | |
358 | m.connect('api', '/api') |
|
358 | m.connect('api', '/api') | |
359 |
|
359 | |||
360 | #USER JOURNAL |
|
360 | #USER JOURNAL | |
361 | rmap.connect('journal', '%s/journal' % ADMIN_PREFIX, |
|
361 | rmap.connect('journal', '%s/journal' % ADMIN_PREFIX, | |
362 | controller='journal', action='index') |
|
362 | controller='journal', action='index') | |
363 | rmap.connect('journal_rss', '%s/journal/rss' % ADMIN_PREFIX, |
|
363 | rmap.connect('journal_rss', '%s/journal/rss' % ADMIN_PREFIX, | |
364 | controller='journal', action='journal_rss') |
|
364 | controller='journal', action='journal_rss') | |
365 | rmap.connect('journal_atom', '%s/journal/atom' % ADMIN_PREFIX, |
|
365 | rmap.connect('journal_atom', '%s/journal/atom' % ADMIN_PREFIX, | |
366 | controller='journal', action='journal_atom') |
|
366 | controller='journal', action='journal_atom') | |
367 |
|
367 | |||
368 | rmap.connect('public_journal', '%s/public_journal' % ADMIN_PREFIX, |
|
368 | rmap.connect('public_journal', '%s/public_journal' % ADMIN_PREFIX, | |
369 | controller='journal', action="public_journal") |
|
369 | controller='journal', action="public_journal") | |
370 |
|
370 | |||
371 | rmap.connect('public_journal_rss', '%s/public_journal/rss' % ADMIN_PREFIX, |
|
371 | rmap.connect('public_journal_rss', '%s/public_journal/rss' % ADMIN_PREFIX, | |
372 | controller='journal', action="public_journal_rss") |
|
372 | controller='journal', action="public_journal_rss") | |
373 |
|
373 | |||
374 | rmap.connect('public_journal_rss_old', '%s/public_journal_rss' % ADMIN_PREFIX, |
|
374 | rmap.connect('public_journal_rss_old', '%s/public_journal_rss' % ADMIN_PREFIX, | |
375 | controller='journal', action="public_journal_rss") |
|
375 | controller='journal', action="public_journal_rss") | |
376 |
|
376 | |||
377 | rmap.connect('public_journal_atom', |
|
377 | rmap.connect('public_journal_atom', | |
378 | '%s/public_journal/atom' % ADMIN_PREFIX, controller='journal', |
|
378 | '%s/public_journal/atom' % ADMIN_PREFIX, controller='journal', | |
379 | action="public_journal_atom") |
|
379 | action="public_journal_atom") | |
380 |
|
380 | |||
381 | rmap.connect('public_journal_atom_old', |
|
381 | rmap.connect('public_journal_atom_old', | |
382 | '%s/public_journal_atom' % ADMIN_PREFIX, controller='journal', |
|
382 | '%s/public_journal_atom' % ADMIN_PREFIX, controller='journal', | |
383 | action="public_journal_atom") |
|
383 | action="public_journal_atom") | |
384 |
|
384 | |||
385 | rmap.connect('toggle_following', '%s/toggle_following' % ADMIN_PREFIX, |
|
385 | rmap.connect('toggle_following', '%s/toggle_following' % ADMIN_PREFIX, | |
386 | controller='journal', action='toggle_following', |
|
386 | controller='journal', action='toggle_following', | |
387 | conditions=dict(method=["POST"])) |
|
387 | conditions=dict(method=["POST"])) | |
388 |
|
388 | |||
389 | #SEARCH |
|
389 | #SEARCH | |
390 | rmap.connect('search', '%s/search' % ADMIN_PREFIX, controller='search',) |
|
390 | rmap.connect('search', '%s/search' % ADMIN_PREFIX, controller='search',) | |
391 | rmap.connect('search_repo', '%s/search/{search_repo:.*}' % ADMIN_PREFIX, |
|
391 | rmap.connect('search_repo', '%s/search/{search_repo:.*}' % ADMIN_PREFIX, | |
392 | controller='search') |
|
392 | controller='search') | |
393 |
|
393 | |||
394 | #LOGIN/LOGOUT/REGISTER/SIGN IN |
|
394 | #LOGIN/LOGOUT/REGISTER/SIGN IN | |
395 | rmap.connect('login_home', '%s/login' % ADMIN_PREFIX, controller='login') |
|
395 | rmap.connect('login_home', '%s/login' % ADMIN_PREFIX, controller='login') | |
396 | rmap.connect('logout_home', '%s/logout' % ADMIN_PREFIX, controller='login', |
|
396 | rmap.connect('logout_home', '%s/logout' % ADMIN_PREFIX, controller='login', | |
397 | action='logout') |
|
397 | action='logout') | |
398 |
|
398 | |||
399 | rmap.connect('register', '%s/register' % ADMIN_PREFIX, controller='login', |
|
399 | rmap.connect('register', '%s/register' % ADMIN_PREFIX, controller='login', | |
400 | action='register') |
|
400 | action='register') | |
401 |
|
401 | |||
402 | rmap.connect('reset_password', '%s/password_reset' % ADMIN_PREFIX, |
|
402 | rmap.connect('reset_password', '%s/password_reset' % ADMIN_PREFIX, | |
403 | controller='login', action='password_reset') |
|
403 | controller='login', action='password_reset') | |
404 |
|
404 | |||
405 | rmap.connect('reset_password_confirmation', |
|
405 | rmap.connect('reset_password_confirmation', | |
406 | '%s/password_reset_confirmation' % ADMIN_PREFIX, |
|
406 | '%s/password_reset_confirmation' % ADMIN_PREFIX, | |
407 | controller='login', action='password_reset_confirmation') |
|
407 | controller='login', action='password_reset_confirmation') | |
408 |
|
408 | |||
409 | #FEEDS |
|
409 | #FEEDS | |
410 | rmap.connect('rss_feed_home', '/{repo_name:.*?}/feed/rss', |
|
410 | rmap.connect('rss_feed_home', '/{repo_name:.*?}/feed/rss', | |
411 | controller='feed', action='rss', |
|
411 | controller='feed', action='rss', | |
412 | conditions=dict(function=check_repo)) |
|
412 | conditions=dict(function=check_repo)) | |
413 |
|
413 | |||
414 | rmap.connect('atom_feed_home', '/{repo_name:.*?}/feed/atom', |
|
414 | rmap.connect('atom_feed_home', '/{repo_name:.*?}/feed/atom', | |
415 | controller='feed', action='atom', |
|
415 | controller='feed', action='atom', | |
416 | conditions=dict(function=check_repo)) |
|
416 | conditions=dict(function=check_repo)) | |
417 |
|
417 | |||
418 | #========================================================================== |
|
418 | #========================================================================== | |
419 | # REPOSITORY ROUTES |
|
419 | # REPOSITORY ROUTES | |
420 | #========================================================================== |
|
420 | #========================================================================== | |
421 | rmap.connect('summary_home', '/{repo_name:.*?}', |
|
421 | rmap.connect('summary_home', '/{repo_name:.*?}', | |
422 | controller='summary', |
|
422 | controller='summary', | |
423 | conditions=dict(function=check_repo)) |
|
423 | conditions=dict(function=check_repo)) | |
424 |
|
424 | |||
425 | rmap.connect('repo_size', '/{repo_name:.*?}/repo_size', |
|
425 | rmap.connect('repo_size', '/{repo_name:.*?}/repo_size', | |
426 | controller='summary', action='repo_size', |
|
426 | controller='summary', action='repo_size', | |
427 | conditions=dict(function=check_repo)) |
|
427 | conditions=dict(function=check_repo)) | |
428 |
|
428 | |||
429 | rmap.connect('repos_group_home', '/{group_name:.*}', |
|
429 | rmap.connect('repos_group_home', '/{group_name:.*}', | |
430 | controller='admin/repos_groups', action="show_by_name", |
|
430 | controller='admin/repos_groups', action="show_by_name", | |
431 | conditions=dict(function=check_group)) |
|
431 | conditions=dict(function=check_group)) | |
432 |
|
432 | |||
433 | rmap.connect('changeset_home', '/{repo_name:.*?}/changeset/{revision}', |
|
433 | rmap.connect('changeset_home', '/{repo_name:.*?}/changeset/{revision}', | |
434 | controller='changeset', revision='tip', |
|
434 | controller='changeset', revision='tip', | |
435 | conditions=dict(function=check_repo)) |
|
435 | conditions=dict(function=check_repo)) | |
436 |
|
436 | |||
437 | #still working url for backward compat. |
|
437 | #still working url for backward compat. | |
438 | rmap.connect('raw_changeset_home_depraced', |
|
438 | rmap.connect('raw_changeset_home_depraced', | |
439 | '/{repo_name:.*?}/raw-changeset/{revision}', |
|
439 | '/{repo_name:.*?}/raw-changeset/{revision}', | |
440 | controller='changeset', action='changeset_raw', |
|
440 | controller='changeset', action='changeset_raw', | |
441 | revision='tip', conditions=dict(function=check_repo)) |
|
441 | revision='tip', conditions=dict(function=check_repo)) | |
442 |
|
442 | |||
443 | ## new URLs |
|
443 | ## new URLs | |
444 | rmap.connect('changeset_raw_home', |
|
444 | rmap.connect('changeset_raw_home', | |
445 | '/{repo_name:.*?}/changeset-diff/{revision}', |
|
445 | '/{repo_name:.*?}/changeset-diff/{revision}', | |
446 | controller='changeset', action='changeset_raw', |
|
446 | controller='changeset', action='changeset_raw', | |
447 | revision='tip', conditions=dict(function=check_repo)) |
|
447 | revision='tip', conditions=dict(function=check_repo)) | |
448 |
|
448 | |||
449 | rmap.connect('changeset_patch_home', |
|
449 | rmap.connect('changeset_patch_home', | |
450 | '/{repo_name:.*?}/changeset-patch/{revision}', |
|
450 | '/{repo_name:.*?}/changeset-patch/{revision}', | |
451 | controller='changeset', action='changeset_patch', |
|
451 | controller='changeset', action='changeset_patch', | |
452 | revision='tip', conditions=dict(function=check_repo)) |
|
452 | revision='tip', conditions=dict(function=check_repo)) | |
453 |
|
453 | |||
454 | rmap.connect('changeset_download_home', |
|
454 | rmap.connect('changeset_download_home', | |
455 | '/{repo_name:.*?}/changeset-download/{revision}', |
|
455 | '/{repo_name:.*?}/changeset-download/{revision}', | |
456 | controller='changeset', action='changeset_download', |
|
456 | controller='changeset', action='changeset_download', | |
457 | revision='tip', conditions=dict(function=check_repo)) |
|
457 | revision='tip', conditions=dict(function=check_repo)) | |
458 |
|
458 | |||
459 | rmap.connect('changeset_comment', |
|
459 | rmap.connect('changeset_comment', | |
460 | '/{repo_name:.*?}/changeset/{revision}/comment', |
|
460 | '/{repo_name:.*?}/changeset/{revision}/comment', | |
461 | controller='changeset', revision='tip', action='comment', |
|
461 | controller='changeset', revision='tip', action='comment', | |
462 | conditions=dict(function=check_repo)) |
|
462 | conditions=dict(function=check_repo)) | |
463 |
|
463 | |||
464 | rmap.connect('changeset_comment_delete', |
|
464 | rmap.connect('changeset_comment_delete', | |
465 | '/{repo_name:.*?}/changeset/comment/{comment_id}/delete', |
|
465 | '/{repo_name:.*?}/changeset/comment/{comment_id}/delete', | |
466 | controller='changeset', action='delete_comment', |
|
466 | controller='changeset', action='delete_comment', | |
467 | conditions=dict(function=check_repo, method=["DELETE"])) |
|
467 | conditions=dict(function=check_repo, method=["DELETE"])) | |
468 |
|
468 | |||
469 | rmap.connect('changeset_info', '/changeset_info/{repo_name:.*?}/{revision}', |
|
469 | rmap.connect('changeset_info', '/changeset_info/{repo_name:.*?}/{revision}', | |
470 | controller='changeset', action='changeset_info') |
|
470 | controller='changeset', action='changeset_info') | |
471 |
|
471 | |||
472 | rmap.connect('compare_url', |
|
472 | rmap.connect('compare_url', | |
473 | '/{repo_name:.*?}/compare/{org_ref_type}@{org_ref:.*?}...{other_ref_type}@{other_ref:.*?}', |
|
473 | '/{repo_name:.*?}/compare/{org_ref_type}@{org_ref:.*?}...{other_ref_type}@{other_ref:.*?}', | |
474 | controller='compare', action='index', |
|
474 | controller='compare', action='index', | |
475 | conditions=dict(function=check_repo), |
|
475 | conditions=dict(function=check_repo), | |
476 | requirements=dict( |
|
476 | requirements=dict( | |
477 | org_ref_type='(branch|book|tag|rev|org_ref_type)', |
|
477 | org_ref_type='(branch|book|tag|rev|org_ref_type)', | |
478 | other_ref_type='(branch|book|tag|rev|other_ref_type)') |
|
478 | other_ref_type='(branch|book|tag|rev|other_ref_type)') | |
479 | ) |
|
479 | ) | |
480 |
|
480 | |||
481 | rmap.connect('pullrequest_home', |
|
481 | rmap.connect('pullrequest_home', | |
482 | '/{repo_name:.*?}/pull-request/new', controller='pullrequests', |
|
482 | '/{repo_name:.*?}/pull-request/new', controller='pullrequests', | |
483 | action='index', conditions=dict(function=check_repo, |
|
483 | action='index', conditions=dict(function=check_repo, | |
484 | method=["GET"])) |
|
484 | method=["GET"])) | |
485 |
|
485 | |||
486 | rmap.connect('pullrequest', |
|
486 | rmap.connect('pullrequest', | |
487 | '/{repo_name:.*?}/pull-request/new', controller='pullrequests', |
|
487 | '/{repo_name:.*?}/pull-request/new', controller='pullrequests', | |
488 | action='create', conditions=dict(function=check_repo, |
|
488 | action='create', conditions=dict(function=check_repo, | |
489 | method=["POST"])) |
|
489 | method=["POST"])) | |
490 |
|
490 | |||
491 | rmap.connect('pullrequest_show', |
|
491 | rmap.connect('pullrequest_show', | |
492 | '/{repo_name:.*?}/pull-request/{pull_request_id}', |
|
492 | '/{repo_name:.*?}/pull-request/{pull_request_id}', | |
493 | controller='pullrequests', |
|
493 | controller='pullrequests', | |
494 | action='show', conditions=dict(function=check_repo, |
|
494 | action='show', conditions=dict(function=check_repo, | |
495 | method=["GET"])) |
|
495 | method=["GET"])) | |
496 | rmap.connect('pullrequest_update', |
|
496 | rmap.connect('pullrequest_update', | |
497 | '/{repo_name:.*?}/pull-request/{pull_request_id}', |
|
497 | '/{repo_name:.*?}/pull-request/{pull_request_id}', | |
498 | controller='pullrequests', |
|
498 | controller='pullrequests', | |
499 | action='update', conditions=dict(function=check_repo, |
|
499 | action='update', conditions=dict(function=check_repo, | |
500 | method=["PUT"])) |
|
500 | method=["PUT"])) | |
501 | rmap.connect('pullrequest_delete', |
|
501 | rmap.connect('pullrequest_delete', | |
502 | '/{repo_name:.*?}/pull-request/{pull_request_id}', |
|
502 | '/{repo_name:.*?}/pull-request/{pull_request_id}', | |
503 | controller='pullrequests', |
|
503 | controller='pullrequests', | |
504 | action='delete', conditions=dict(function=check_repo, |
|
504 | action='delete', conditions=dict(function=check_repo, | |
505 | method=["DELETE"])) |
|
505 | method=["DELETE"])) | |
506 |
|
506 | |||
507 | rmap.connect('pullrequest_show_all', |
|
507 | rmap.connect('pullrequest_show_all', | |
508 | '/{repo_name:.*?}/pull-request', |
|
508 | '/{repo_name:.*?}/pull-request', | |
509 | controller='pullrequests', |
|
509 | controller='pullrequests', | |
510 | action='show_all', conditions=dict(function=check_repo, |
|
510 | action='show_all', conditions=dict(function=check_repo, | |
511 | method=["GET"])) |
|
511 | method=["GET"])) | |
512 |
|
512 | |||
513 | rmap.connect('pullrequest_comment', |
|
513 | rmap.connect('pullrequest_comment', | |
514 | '/{repo_name:.*?}/pull-request-comment/{pull_request_id}', |
|
514 | '/{repo_name:.*?}/pull-request-comment/{pull_request_id}', | |
515 | controller='pullrequests', |
|
515 | controller='pullrequests', | |
516 | action='comment', conditions=dict(function=check_repo, |
|
516 | action='comment', conditions=dict(function=check_repo, | |
517 | method=["POST"])) |
|
517 | method=["POST"])) | |
518 |
|
518 | |||
519 | rmap.connect('pullrequest_comment_delete', |
|
519 | rmap.connect('pullrequest_comment_delete', | |
520 | '/{repo_name:.*?}/pull-request-comment/{comment_id}/delete', |
|
520 | '/{repo_name:.*?}/pull-request-comment/{comment_id}/delete', | |
521 | controller='pullrequests', action='delete_comment', |
|
521 | controller='pullrequests', action='delete_comment', | |
522 | conditions=dict(function=check_repo, method=["DELETE"])) |
|
522 | conditions=dict(function=check_repo, method=["DELETE"])) | |
523 |
|
523 | |||
524 | rmap.connect('summary_home', '/{repo_name:.*?}/summary', |
|
524 | rmap.connect('summary_home_summary', '/{repo_name:.*?}/summary', | |
525 | controller='summary', conditions=dict(function=check_repo)) |
|
525 | controller='summary', conditions=dict(function=check_repo)) | |
526 |
|
526 | |||
527 | rmap.connect('shortlog_home', '/{repo_name:.*?}/shortlog', |
|
527 | rmap.connect('shortlog_home', '/{repo_name:.*?}/shortlog', | |
528 | controller='shortlog', conditions=dict(function=check_repo)) |
|
528 | controller='shortlog', conditions=dict(function=check_repo)) | |
529 |
|
529 | |||
530 | rmap.connect('shortlog_file_home', '/{repo_name:.*?}/shortlog/{revision}/{f_path:.*}', |
|
530 | rmap.connect('shortlog_file_home', '/{repo_name:.*?}/shortlog/{revision}/{f_path:.*}', | |
531 | controller='shortlog', f_path=None, |
|
531 | controller='shortlog', f_path=None, | |
532 | conditions=dict(function=check_repo)) |
|
532 | conditions=dict(function=check_repo)) | |
533 |
|
533 | |||
534 | rmap.connect('branches_home', '/{repo_name:.*?}/branches', |
|
534 | rmap.connect('branches_home', '/{repo_name:.*?}/branches', | |
535 | controller='branches', conditions=dict(function=check_repo)) |
|
535 | controller='branches', conditions=dict(function=check_repo)) | |
536 |
|
536 | |||
537 | rmap.connect('tags_home', '/{repo_name:.*?}/tags', |
|
537 | rmap.connect('tags_home', '/{repo_name:.*?}/tags', | |
538 | controller='tags', conditions=dict(function=check_repo)) |
|
538 | controller='tags', conditions=dict(function=check_repo)) | |
539 |
|
539 | |||
540 | rmap.connect('bookmarks_home', '/{repo_name:.*?}/bookmarks', |
|
540 | rmap.connect('bookmarks_home', '/{repo_name:.*?}/bookmarks', | |
541 | controller='bookmarks', conditions=dict(function=check_repo)) |
|
541 | controller='bookmarks', conditions=dict(function=check_repo)) | |
542 |
|
542 | |||
543 | rmap.connect('changelog_home', '/{repo_name:.*?}/changelog', |
|
543 | rmap.connect('changelog_home', '/{repo_name:.*?}/changelog', | |
544 | controller='changelog', conditions=dict(function=check_repo)) |
|
544 | controller='changelog', conditions=dict(function=check_repo)) | |
545 |
|
545 | |||
546 | rmap.connect('changelog_details', '/{repo_name:.*?}/changelog_details/{cs}', |
|
546 | rmap.connect('changelog_details', '/{repo_name:.*?}/changelog_details/{cs}', | |
547 | controller='changelog', action='changelog_details', |
|
547 | controller='changelog', action='changelog_details', | |
548 | conditions=dict(function=check_repo)) |
|
548 | conditions=dict(function=check_repo)) | |
549 |
|
549 | |||
550 | rmap.connect('files_home', '/{repo_name:.*?}/files/{revision}/{f_path:.*}', |
|
550 | rmap.connect('files_home', '/{repo_name:.*?}/files/{revision}/{f_path:.*}', | |
551 | controller='files', revision='tip', f_path='', |
|
551 | controller='files', revision='tip', f_path='', | |
552 | conditions=dict(function=check_repo)) |
|
552 | conditions=dict(function=check_repo)) | |
553 |
|
553 | |||
554 | rmap.connect('files_history_home', |
|
554 | rmap.connect('files_history_home', | |
555 | '/{repo_name:.*?}/history/{revision}/{f_path:.*}', |
|
555 | '/{repo_name:.*?}/history/{revision}/{f_path:.*}', | |
556 | controller='files', action='history', revision='tip', f_path='', |
|
556 | controller='files', action='history', revision='tip', f_path='', | |
557 | conditions=dict(function=check_repo)) |
|
557 | conditions=dict(function=check_repo)) | |
558 |
|
558 | |||
559 | rmap.connect('files_diff_home', '/{repo_name:.*?}/diff/{f_path:.*}', |
|
559 | rmap.connect('files_diff_home', '/{repo_name:.*?}/diff/{f_path:.*}', | |
560 | controller='files', action='diff', revision='tip', f_path='', |
|
560 | controller='files', action='diff', revision='tip', f_path='', | |
561 | conditions=dict(function=check_repo)) |
|
561 | conditions=dict(function=check_repo)) | |
562 |
|
562 | |||
563 | rmap.connect('files_rawfile_home', |
|
563 | rmap.connect('files_rawfile_home', | |
564 | '/{repo_name:.*?}/rawfile/{revision}/{f_path:.*}', |
|
564 | '/{repo_name:.*?}/rawfile/{revision}/{f_path:.*}', | |
565 | controller='files', action='rawfile', revision='tip', |
|
565 | controller='files', action='rawfile', revision='tip', | |
566 | f_path='', conditions=dict(function=check_repo)) |
|
566 | f_path='', conditions=dict(function=check_repo)) | |
567 |
|
567 | |||
568 | rmap.connect('files_raw_home', |
|
568 | rmap.connect('files_raw_home', | |
569 | '/{repo_name:.*?}/raw/{revision}/{f_path:.*}', |
|
569 | '/{repo_name:.*?}/raw/{revision}/{f_path:.*}', | |
570 | controller='files', action='raw', revision='tip', f_path='', |
|
570 | controller='files', action='raw', revision='tip', f_path='', | |
571 | conditions=dict(function=check_repo)) |
|
571 | conditions=dict(function=check_repo)) | |
572 |
|
572 | |||
573 | rmap.connect('files_annotate_home', |
|
573 | rmap.connect('files_annotate_home', | |
574 | '/{repo_name:.*?}/annotate/{revision}/{f_path:.*}', |
|
574 | '/{repo_name:.*?}/annotate/{revision}/{f_path:.*}', | |
575 | controller='files', action='index', revision='tip', |
|
575 | controller='files', action='index', revision='tip', | |
576 | f_path='', annotate=True, conditions=dict(function=check_repo)) |
|
576 | f_path='', annotate=True, conditions=dict(function=check_repo)) | |
577 |
|
577 | |||
578 | rmap.connect('files_edit_home', |
|
578 | rmap.connect('files_edit_home', | |
579 | '/{repo_name:.*?}/edit/{revision}/{f_path:.*}', |
|
579 | '/{repo_name:.*?}/edit/{revision}/{f_path:.*}', | |
580 | controller='files', action='edit', revision='tip', |
|
580 | controller='files', action='edit', revision='tip', | |
581 | f_path='', conditions=dict(function=check_repo)) |
|
581 | f_path='', conditions=dict(function=check_repo)) | |
582 |
|
582 | |||
583 | rmap.connect('files_add_home', |
|
583 | rmap.connect('files_add_home', | |
584 | '/{repo_name:.*?}/add/{revision}/{f_path:.*}', |
|
584 | '/{repo_name:.*?}/add/{revision}/{f_path:.*}', | |
585 | controller='files', action='add', revision='tip', |
|
585 | controller='files', action='add', revision='tip', | |
586 | f_path='', conditions=dict(function=check_repo)) |
|
586 | f_path='', conditions=dict(function=check_repo)) | |
587 |
|
587 | |||
588 | rmap.connect('files_archive_home', '/{repo_name:.*?}/archive/{fname}', |
|
588 | rmap.connect('files_archive_home', '/{repo_name:.*?}/archive/{fname}', | |
589 | controller='files', action='archivefile', |
|
589 | controller='files', action='archivefile', | |
590 | conditions=dict(function=check_repo)) |
|
590 | conditions=dict(function=check_repo)) | |
591 |
|
591 | |||
592 | rmap.connect('files_nodelist_home', |
|
592 | rmap.connect('files_nodelist_home', | |
593 | '/{repo_name:.*?}/nodelist/{revision}/{f_path:.*}', |
|
593 | '/{repo_name:.*?}/nodelist/{revision}/{f_path:.*}', | |
594 | controller='files', action='nodelist', |
|
594 | controller='files', action='nodelist', | |
595 | conditions=dict(function=check_repo)) |
|
595 | conditions=dict(function=check_repo)) | |
596 |
|
596 | |||
597 | rmap.connect('repo_settings_delete', '/{repo_name:.*?}/settings', |
|
597 | rmap.connect('repo_settings_delete', '/{repo_name:.*?}/settings', | |
598 | controller='settings', action="delete", |
|
598 | controller='settings', action="delete", | |
599 | conditions=dict(method=["DELETE"], function=check_repo)) |
|
599 | conditions=dict(method=["DELETE"], function=check_repo)) | |
600 |
|
600 | |||
601 | rmap.connect('repo_settings_update', '/{repo_name:.*?}/settings', |
|
601 | rmap.connect('repo_settings_update', '/{repo_name:.*?}/settings', | |
602 | controller='settings', action="update", |
|
602 | controller='settings', action="update", | |
603 | conditions=dict(method=["PUT"], function=check_repo)) |
|
603 | conditions=dict(method=["PUT"], function=check_repo)) | |
604 |
|
604 | |||
605 | rmap.connect('repo_settings_home', '/{repo_name:.*?}/settings', |
|
605 | rmap.connect('repo_settings_home', '/{repo_name:.*?}/settings', | |
606 | controller='settings', action='index', |
|
606 | controller='settings', action='index', | |
607 | conditions=dict(function=check_repo)) |
|
607 | conditions=dict(function=check_repo)) | |
608 |
|
608 | |||
609 | rmap.connect('toggle_locking', "/{repo_name:.*?}/locking_toggle", |
|
609 | rmap.connect('toggle_locking', "/{repo_name:.*?}/locking_toggle", | |
610 | controller='settings', action="toggle_locking", |
|
610 | controller='settings', action="toggle_locking", | |
611 | conditions=dict(method=["GET"], function=check_repo)) |
|
611 | conditions=dict(method=["GET"], function=check_repo)) | |
612 |
|
612 | |||
613 | rmap.connect('repo_fork_create_home', '/{repo_name:.*?}/fork', |
|
613 | rmap.connect('repo_fork_create_home', '/{repo_name:.*?}/fork', | |
614 | controller='forks', action='fork_create', |
|
614 | controller='forks', action='fork_create', | |
615 | conditions=dict(function=check_repo, method=["POST"])) |
|
615 | conditions=dict(function=check_repo, method=["POST"])) | |
616 |
|
616 | |||
617 | rmap.connect('repo_fork_home', '/{repo_name:.*?}/fork', |
|
617 | rmap.connect('repo_fork_home', '/{repo_name:.*?}/fork', | |
618 | controller='forks', action='fork', |
|
618 | controller='forks', action='fork', | |
619 | conditions=dict(function=check_repo)) |
|
619 | conditions=dict(function=check_repo)) | |
620 |
|
620 | |||
621 | rmap.connect('repo_forks_home', '/{repo_name:.*?}/forks', |
|
621 | rmap.connect('repo_forks_home', '/{repo_name:.*?}/forks', | |
622 | controller='forks', action='forks', |
|
622 | controller='forks', action='forks', | |
623 | conditions=dict(function=check_repo)) |
|
623 | conditions=dict(function=check_repo)) | |
624 |
|
624 | |||
625 | rmap.connect('repo_followers_home', '/{repo_name:.*?}/followers', |
|
625 | rmap.connect('repo_followers_home', '/{repo_name:.*?}/followers', | |
626 | controller='followers', action='followers', |
|
626 | controller='followers', action='followers', | |
627 | conditions=dict(function=check_repo)) |
|
627 | conditions=dict(function=check_repo)) | |
628 |
|
628 | |||
629 | return rmap |
|
629 | return rmap |
General Comments 0
You need to be logged in to leave comments.
Login now