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