Show More
@@ -9,6 +9,9 b' from __future__ import with_statement' | |||||
9 | from routes import Mapper |
|
9 | from routes import Mapper | |
10 | from rhodecode.lib.utils import check_repo_fast as cr |
|
10 | from rhodecode.lib.utils import check_repo_fast as cr | |
11 |
|
11 | |||
|
12 | # prefix for non repository related links needs to be prefixed with `/` | |||
|
13 | ADMIN_PREFIX = '/_admin' | |||
|
14 | ||||
12 |
|
15 | |||
13 | def make_map(config): |
|
16 | def make_map(config): | |
14 | """Create, configure and return the routes Mapper""" |
|
17 | """Create, configure and return the routes Mapper""" | |
@@ -45,7 +48,8 b' def make_map(config):' | |||||
45 | rmap.connect('rhodecode_official', "http://rhodecode.org", _static=True) |
|
48 | rmap.connect('rhodecode_official', "http://rhodecode.org", _static=True) | |
46 |
|
49 | |||
47 | #ADMIN REPOSITORY REST ROUTES |
|
50 | #ADMIN REPOSITORY REST ROUTES | |
48 | with rmap.submapper(path_prefix='/_admin', controller='admin/repos') as m: |
|
51 | with rmap.submapper(path_prefix=ADMIN_PREFIX, | |
|
52 | controller='admin/repos') as m: | |||
49 | m.connect("repos", "/repos", |
|
53 | m.connect("repos", "/repos", | |
50 | action="create", conditions=dict(method=["POST"])) |
|
54 | action="create", conditions=dict(method=["POST"])) | |
51 | m.connect("repos", "/repos", |
|
55 | m.connect("repos", "/repos", | |
@@ -102,10 +106,11 b' def make_map(config):' | |||||
102 |
|
106 | |||
103 | #ADMIN REPOS GROUP REST ROUTES |
|
107 | #ADMIN REPOS GROUP REST ROUTES | |
104 | rmap.resource('repos_group', 'repos_groups', |
|
108 | rmap.resource('repos_group', 'repos_groups', | |
105 |
controller='admin/repos_groups', path_prefix= |
|
109 | controller='admin/repos_groups', path_prefix=ADMIN_PREFIX) | |
106 |
|
110 | |||
107 | #ADMIN USER REST ROUTES |
|
111 | #ADMIN USER REST ROUTES | |
108 | with rmap.submapper(path_prefix='/_admin', controller='admin/users') as m: |
|
112 | with rmap.submapper(path_prefix=ADMIN_PREFIX, | |
|
113 | controller='admin/users') as m: | |||
109 | m.connect("users", "/users", |
|
114 | m.connect("users", "/users", | |
110 | action="create", conditions=dict(method=["POST"])) |
|
115 | action="create", conditions=dict(method=["POST"])) | |
111 | m.connect("users", "/users", |
|
116 | m.connect("users", "/users", | |
@@ -135,7 +140,7 b' def make_map(config):' | |||||
135 | action="update_perm", conditions=dict(method=["PUT"])) |
|
140 | action="update_perm", conditions=dict(method=["PUT"])) | |
136 |
|
141 | |||
137 | #ADMIN USERS REST ROUTES |
|
142 | #ADMIN USERS REST ROUTES | |
138 |
with rmap.submapper(path_prefix= |
|
143 | with rmap.submapper(path_prefix=ADMIN_PREFIX, | |
139 | controller='admin/users_groups') as m: |
|
144 | controller='admin/users_groups') as m: | |
140 | m.connect("users_groups", "/users_groups", |
|
145 | m.connect("users_groups", "/users_groups", | |
141 | action="create", conditions=dict(method=["POST"])) |
|
146 | action="create", conditions=dict(method=["POST"])) | |
@@ -167,22 +172,22 b' def make_map(config):' | |||||
167 |
|
172 | |||
168 | #ADMIN GROUP REST ROUTES |
|
173 | #ADMIN GROUP REST ROUTES | |
169 | rmap.resource('group', 'groups', |
|
174 | rmap.resource('group', 'groups', | |
170 |
controller='admin/groups', path_prefix= |
|
175 | controller='admin/groups', path_prefix=ADMIN_PREFIX) | |
171 |
|
176 | |||
172 | #ADMIN PERMISSIONS REST ROUTES |
|
177 | #ADMIN PERMISSIONS REST ROUTES | |
173 | rmap.resource('permission', 'permissions', |
|
178 | rmap.resource('permission', 'permissions', | |
174 |
controller='admin/permissions', path_prefix= |
|
179 | controller='admin/permissions', path_prefix=ADMIN_PREFIX) | |
175 |
|
180 | |||
176 | ##ADMIN LDAP SETTINGS |
|
181 | ##ADMIN LDAP SETTINGS | |
177 |
rmap.connect('ldap_settings', ' |
|
182 | rmap.connect('ldap_settings', '%s/ldap' % ADMIN_PREFIX, | |
178 | controller='admin/ldap_settings', action='ldap_settings', |
|
183 | controller='admin/ldap_settings', action='ldap_settings', | |
179 | conditions=dict(method=["POST"])) |
|
184 | conditions=dict(method=["POST"])) | |
180 |
|
185 | |||
181 |
rmap.connect('ldap_home', ' |
|
186 | rmap.connect('ldap_home', '%s/ldap' % ADMIN_PREFIX, | |
182 | controller='admin/ldap_settings') |
|
187 | controller='admin/ldap_settings') | |
183 |
|
188 | |||
184 | #ADMIN SETTINGS REST ROUTES |
|
189 | #ADMIN SETTINGS REST ROUTES | |
185 |
with rmap.submapper(path_prefix= |
|
190 | with rmap.submapper(path_prefix=ADMIN_PREFIX, | |
186 | controller='admin/settings') as m: |
|
191 | controller='admin/settings') as m: | |
187 | m.connect("admin_settings", "/settings", |
|
192 | m.connect("admin_settings", "/settings", | |
188 | action="create", conditions=dict(method=["POST"])) |
|
193 | action="create", conditions=dict(method=["POST"])) | |
@@ -215,41 +220,43 b' def make_map(config):' | |||||
215 | action="create_repository", conditions=dict(method=["GET"])) |
|
220 | action="create_repository", conditions=dict(method=["GET"])) | |
216 |
|
221 | |||
217 | #ADMIN MAIN PAGES |
|
222 | #ADMIN MAIN PAGES | |
218 | with rmap.submapper(path_prefix='/_admin', controller='admin/admin') as m: |
|
223 | with rmap.submapper(path_prefix=ADMIN_PREFIX, | |
|
224 | controller='admin/admin') as m: | |||
219 | m.connect('admin_home', '', action='index') |
|
225 | m.connect('admin_home', '', action='index') | |
220 | m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}', |
|
226 | m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}', | |
221 | action='add_repo') |
|
227 | action='add_repo') | |
222 |
|
228 | |||
223 | #USER JOURNAL |
|
229 | #USER JOURNAL | |
224 |
rmap.connect('journal', ' |
|
230 | rmap.connect('journal', '%s/journal' % ADMIN_PREFIX, controller='journal') | |
225 |
|
231 | |||
226 |
rmap.connect('public_journal', ' |
|
232 | rmap.connect('public_journal', '%s/public_journal' % ADMIN_PREFIX, | |
227 | controller='journal', action="public_journal") |
|
233 | controller='journal', action="public_journal") | |
228 |
|
234 | |||
229 |
rmap.connect('public_journal_rss', ' |
|
235 | rmap.connect('public_journal_rss', '%s/public_journal_rss' % ADMIN_PREFIX, | |
230 | controller='journal', action="public_journal_rss") |
|
236 | controller='journal', action="public_journal_rss") | |
231 |
|
237 | |||
232 |
rmap.connect('public_journal_atom', |
|
238 | rmap.connect('public_journal_atom', | |
233 | controller='journal', action="public_journal_atom") |
|
239 | '%s/public_journal_atom' % ADMIN_PREFIX, controller='journal', | |
|
240 | action="public_journal_atom") | |||
234 |
|
241 | |||
235 |
rmap.connect('toggle_following', ' |
|
242 | rmap.connect('toggle_following', '%s/toggle_following' % ADMIN_PREFIX, | |
236 | controller='journal', action='toggle_following', |
|
243 | controller='journal', action='toggle_following', | |
237 | conditions=dict(method=["POST"])) |
|
244 | conditions=dict(method=["POST"])) | |
238 |
|
245 | |||
239 | #SEARCH |
|
246 | #SEARCH | |
240 |
rmap.connect('search', ' |
|
247 | rmap.connect('search', '%s/search' % ADMIN_PREFIX, controller='search',) | |
241 |
rmap.connect('search_repo', ' |
|
248 | rmap.connect('search_repo', '%s/search/{search_repo:.*}' % ADMIN_PREFIX, | |
242 | controller='search') |
|
249 | controller='search') | |
243 |
|
250 | |||
244 | #LOGIN/LOGOUT/REGISTER/SIGN IN |
|
251 | #LOGIN/LOGOUT/REGISTER/SIGN IN | |
245 |
rmap.connect('login_home', ' |
|
252 | rmap.connect('login_home', '%s/login' % ADMIN_PREFIX, controller='login') | |
246 |
rmap.connect('logout_home', ' |
|
253 | rmap.connect('logout_home', '%s/logout' % ADMIN_PREFIX, controller='login', | |
247 | action='logout') |
|
254 | action='logout') | |
248 |
|
255 | |||
249 |
rmap.connect('register', ' |
|
256 | rmap.connect('register', '%s/register' % ADMIN_PREFIX, controller='login', | |
250 | action='register') |
|
257 | action='register') | |
251 |
|
258 | |||
252 |
rmap.connect('reset_password', ' |
|
259 | rmap.connect('reset_password', '%s/password_reset' % ADMIN_PREFIX, | |
253 | controller='login', action='password_reset') |
|
260 | controller='login', action='password_reset') | |
254 |
|
261 | |||
255 | #FEEDS |
|
262 | #FEEDS |
General Comments 0
You need to be logged in to leave comments.
Login now