Mercurial > kallithea
annotate rhodecode/config/routing.py @ 723:bf26b46e82d6 beta
some tests update
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 18 Nov 2010 23:11:51 +0100 |
parents | b9bbc0d6e9f3 |
children | 49eb69d78988 |
rev | line source |
---|---|
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
1 """ |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
2 Routes configuration |
0 | 3 |
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 | |
6 refer to the routes manual at http://routes.groovie.org/docs/ | |
7 """ | |
371
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
8 from __future__ import with_statement |
0 | 9 from routes import Mapper |
547
1e757ac98988
renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
530
diff
changeset
|
10 from rhodecode.lib.utils import check_repo_fast as cr |
0 | 11 |
43 | 12 def make_map(config): |
0 | 13 """Create, configure and return the routes Mapper""" |
43 | 14 map = Mapper(directory=config['pylons.paths']['controllers'], |
15 always_scan=config['debug']) | |
0 | 16 map.minimization = False |
43 | 17 map.explicit = False |
0 | 18 |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
19 def check_repo(environ, match_dict): |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
20 """ |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
21 check for valid repository for proper 404 handling |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
22 :param environ: |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
23 :param match_dict: |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
24 """ |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
25 repo_name = match_dict.get('repo_name') |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
26 return not cr(repo_name, config['base_path']) |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
27 |
0 | 28 # The ErrorController route (handles 404/500 error pages); it should |
29 # likely stay at the top, ensuring it can always be resolved | |
43 | 30 map.connect('/error/{action}', controller='error') |
31 map.connect('/error/{action}/{id}', controller='error') | |
0 | 32 |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
33 #========================================================================== |
0 | 34 # CUSTOM ROUTES HERE |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
35 #========================================================================== |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
36 |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
37 #MAIN PAGE |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
626
diff
changeset
|
38 map.connect('home', '/', controller='home', action='index') |
626
dfa7e1a95b60
added gpl license and submit a bug footer links
Marcin Kuzminski <marcin@python-works.com>
parents:
604
diff
changeset
|
39 map.connect('bugtracker', "http://bitbucket.org/marcinkuzminski/rhodecode/issues", _static=True) |
dfa7e1a95b60
added gpl license and submit a bug footer links
Marcin Kuzminski <marcin@python-works.com>
parents:
604
diff
changeset
|
40 map.connect('gpl_license', "http://www.gnu.org/licenses/gpl.html", _static=True) |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
41 #ADMIN REPOSITORY REST ROUTES |
346
51362853ac3b
added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
323
diff
changeset
|
42 with map.submapper(path_prefix='/_admin', controller='admin/repos') as m: |
248
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
43 m.connect("repos", "/repos", |
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
44 action="create", conditions=dict(method=["POST"])) |
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
45 m.connect("repos", "/repos", |
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
46 action="index", conditions=dict(method=["GET"])) |
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
47 m.connect("formatted_repos", "/repos.{format}", |
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
48 action="index", |
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
49 conditions=dict(method=["GET"])) |
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
50 m.connect("new_repo", "/repos/new", |
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
51 action="new", conditions=dict(method=["GET"])) |
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
52 m.connect("formatted_new_repo", "/repos/new.{format}", |
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
53 action="new", conditions=dict(method=["GET"])) |
299
d303aacb3349
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes.
Marcin Kuzminski <marcin@python-works.com>
parents:
248
diff
changeset
|
54 m.connect("/repos/{repo_name:.*}", |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
55 action="update", conditions=dict(method=["PUT"], |
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
56 function=check_repo)) |
299
d303aacb3349
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes.
Marcin Kuzminski <marcin@python-works.com>
parents:
248
diff
changeset
|
57 m.connect("/repos/{repo_name:.*}", |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
58 action="delete", conditions=dict(method=["DELETE"], |
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
59 function=check_repo)) |
299
d303aacb3349
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes.
Marcin Kuzminski <marcin@python-works.com>
parents:
248
diff
changeset
|
60 m.connect("edit_repo", "/repos/{repo_name:.*}/edit", |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
61 action="edit", conditions=dict(method=["GET"], |
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
62 function=check_repo)) |
299
d303aacb3349
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes.
Marcin Kuzminski <marcin@python-works.com>
parents:
248
diff
changeset
|
63 m.connect("formatted_edit_repo", "/repos/{repo_name:.*}.{format}/edit", |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
64 action="edit", conditions=dict(method=["GET"], |
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
65 function=check_repo)) |
299
d303aacb3349
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes.
Marcin Kuzminski <marcin@python-works.com>
parents:
248
diff
changeset
|
66 m.connect("repo", "/repos/{repo_name:.*}", |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
67 action="show", conditions=dict(method=["GET"], |
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
68 function=check_repo)) |
299
d303aacb3349
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes.
Marcin Kuzminski <marcin@python-works.com>
parents:
248
diff
changeset
|
69 m.connect("formatted_repo", "/repos/{repo_name:.*}.{format}", |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
70 action="show", conditions=dict(method=["GET"], |
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
71 function=check_repo)) |
299
d303aacb3349
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes.
Marcin Kuzminski <marcin@python-works.com>
parents:
248
diff
changeset
|
72 #ajax delete repo perm user |
d303aacb3349
repos crud controllers - change id into repo_name for compatability, added ajax repo perm user function variuos html fixes, permissions forms and managment fixes.
Marcin Kuzminski <marcin@python-works.com>
parents:
248
diff
changeset
|
73 m.connect('delete_repo_user', "/repos_delete_user/{repo_name:.*}", |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
74 action="delete_perm_user", conditions=dict(method=["DELETE"], |
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
75 function=check_repo)) |
708
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
705
diff
changeset
|
76 #settings actions |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
705
diff
changeset
|
77 m.connect('repo_stats', "/repos_stats/{repo_name:.*}", |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
705
diff
changeset
|
78 action="repo_stats", conditions=dict(method=["DELETE"], |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
705
diff
changeset
|
79 function=check_repo)) |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
705
diff
changeset
|
80 m.connect('repo_cache', "/repos_cache/{repo_name:.*}", |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
705
diff
changeset
|
81 action="repo_cache", conditions=dict(method=["DELETE"], |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
705
diff
changeset
|
82 function=check_repo)) |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
83 #ADMIN USER REST ROUTES |
346
51362853ac3b
added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
323
diff
changeset
|
84 map.resource('user', 'users', controller='admin/users', path_prefix='/_admin') |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
85 |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
86 #ADMIN PERMISSIONS REST ROUTES |
346
51362853ac3b
added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
323
diff
changeset
|
87 map.resource('permission', 'permissions', controller='admin/permissions', path_prefix='/_admin') |
705
9e9f1b919c0c
implements #60, ldap configuration and authentication.
Marcin Kuzminski <marcin@python-works.com>
parents:
636
diff
changeset
|
88 map.connect('permissions_ldap', '/_admin/permissions_ldap', controller='admin/permissions', action='ldap') |
9e9f1b919c0c
implements #60, ldap configuration and authentication.
Marcin Kuzminski <marcin@python-works.com>
parents:
636
diff
changeset
|
89 |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
90 |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
91 #ADMIN SETTINGS REST ROUTES |
371
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
92 with map.submapper(path_prefix='/_admin', controller='admin/settings') as m: |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
93 m.connect("admin_settings", "/settings", |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
94 action="create", conditions=dict(method=["POST"])) |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
95 m.connect("admin_settings", "/settings", |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
96 action="index", conditions=dict(method=["GET"])) |
459
7c978511c951
implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents:
406
diff
changeset
|
97 m.connect("formatted_admin_settings", "/settings.{format}", |
371
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
98 action="index", conditions=dict(method=["GET"])) |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
99 m.connect("admin_new_setting", "/settings/new", |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
100 action="new", conditions=dict(method=["GET"])) |
459
7c978511c951
implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents:
406
diff
changeset
|
101 m.connect("formatted_admin_new_setting", "/settings/new.{format}", |
371
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
102 action="new", conditions=dict(method=["GET"])) |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
103 m.connect("/settings/{setting_id}", |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
104 action="update", conditions=dict(method=["PUT"])) |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
105 m.connect("/settings/{setting_id}", |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
106 action="delete", conditions=dict(method=["DELETE"])) |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
107 m.connect("admin_edit_setting", "/settings/{setting_id}/edit", |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
108 action="edit", conditions=dict(method=["GET"])) |
459
7c978511c951
implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents:
406
diff
changeset
|
109 m.connect("formatted_admin_edit_setting", "/settings/{setting_id}.{format}/edit", |
371
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
110 action="edit", conditions=dict(method=["GET"])) |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
111 m.connect("admin_setting", "/settings/{setting_id}", |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
112 action="show", conditions=dict(method=["GET"])) |
459
7c978511c951
implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents:
406
diff
changeset
|
113 m.connect("formatted_admin_setting", "/settings/{setting_id}.{format}", |
371
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
114 action="show", conditions=dict(method=["GET"])) |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
115 m.connect("admin_settings_my_account", "/my_account", |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
116 action="my_account", conditions=dict(method=["GET"])) |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
117 m.connect("admin_settings_my_account_update", "/my_account_update", |
5cd6616b8673
routes python 2.5 compatible
Marcin Kuzminski <marcin@python-works.com>
parents:
363
diff
changeset
|
118 action="my_account_update", conditions=dict(method=["PUT"])) |
380
ca54622e39a1
Added separate create repository views for non administrative users.
Marcin Kuzminski <marcin@python-works.com>
parents:
371
diff
changeset
|
119 m.connect("admin_settings_create_repository", "/create_repository", |
ca54622e39a1
Added separate create repository views for non administrative users.
Marcin Kuzminski <marcin@python-works.com>
parents:
371
diff
changeset
|
120 action="create_repository", conditions=dict(method=["GET"])) |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
121 |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
122 #ADMIN MAIN PAGES |
346
51362853ac3b
added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
323
diff
changeset
|
123 with map.submapper(path_prefix='/_admin', controller='admin/admin') as m: |
306 | 124 m.connect('admin_home', '', action='index')#main page |
149
b3c93efd1c97
Updated template for summary (archives links)
Marcin Kuzminski <marcin@python-works.com>
parents:
148
diff
changeset
|
125 m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}', |
b3c93efd1c97
Updated template for summary (archives links)
Marcin Kuzminski <marcin@python-works.com>
parents:
148
diff
changeset
|
126 action='add_repo') |
406
b153a51b1d3b
Implemented search using whoosh. Still as experimental option.
Marcin Kuzminski <marcin@python-works.com>
parents:
380
diff
changeset
|
127 #SEARCH |
525
87d80c84df09
added search in specific repository
Marcin Kuzminski <marcin@python-works.com>
parents:
485
diff
changeset
|
128 map.connect('search', '/_admin/search', controller='search',) |
87d80c84df09
added search in specific repository
Marcin Kuzminski <marcin@python-works.com>
parents:
485
diff
changeset
|
129 map.connect('search_repo', '/_admin/search/{search_repo:.*}', controller='search') |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
130 |
474
a3d9d24acbec
Implemented password reset(forms/models/ tasks) and mailing tasks.
Marcin Kuzminski <marcin@python-works.com>
parents:
466
diff
changeset
|
131 #LOGIN/LOGOUT/REGISTER/SIGN IN |
363
98abf8953b87
Added user registration, changed login url schema, moved it into _admin/ for safety
Marcin Kuzminski <marcin@python-works.com>
parents:
346
diff
changeset
|
132 map.connect('login_home', '/_admin/login', controller='login') |
98abf8953b87
Added user registration, changed login url schema, moved it into _admin/ for safety
Marcin Kuzminski <marcin@python-works.com>
parents:
346
diff
changeset
|
133 map.connect('logout_home', '/_admin/logout', controller='login', action='logout') |
98abf8953b87
Added user registration, changed login url schema, moved it into _admin/ for safety
Marcin Kuzminski <marcin@python-works.com>
parents:
346
diff
changeset
|
134 map.connect('register', '/_admin/register', controller='login', action='register') |
474
a3d9d24acbec
Implemented password reset(forms/models/ tasks) and mailing tasks.
Marcin Kuzminski <marcin@python-works.com>
parents:
466
diff
changeset
|
135 map.connect('reset_password', '/_admin/password_reset', controller='login', action='password_reset') |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
136 |
205
66b20f525750
Added feed controllers, urls,and changed index page to use them.
Marcin Kuzminski <marcin@python-works.com>
parents:
181
diff
changeset
|
137 #FEEDS |
248
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
138 map.connect('rss_feed_home', '/{repo_name:.*}/feed/rss', |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
139 controller='feed', action='rss', |
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
140 conditions=dict(function=check_repo)) |
248
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
141 map.connect('atom_feed_home', '/{repo_name:.*}/feed/atom', |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
142 controller='feed', action='atom', |
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
143 conditions=dict(function=check_repo)) |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
144 |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
145 |
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
146 #REPOSITORY ROUTES |
248
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
147 map.connect('changeset_home', '/{repo_name:.*}/changeset/{revision}', |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
148 controller='changeset', revision='tip', |
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
149 conditions=dict(function=check_repo)) |
466
183cee110578
first implementation of #34 changeset raw diff based on udiff from python
Marcin Kuzminski <marcin@python-works.com>
parents:
459
diff
changeset
|
150 map.connect('raw_changeset_home', '/{repo_name:.*}/raw-changeset/{revision}', |
485
9836541b0509
added limit for showing pygemntized source codes larger than 250kb.
Marcin Kuzminski <marcin@python-works.com>
parents:
474
diff
changeset
|
151 controller='changeset', action='raw_changeset', revision='tip', |
466
183cee110578
first implementation of #34 changeset raw diff based on udiff from python
Marcin Kuzminski <marcin@python-works.com>
parents:
459
diff
changeset
|
152 conditions=dict(function=check_repo)) |
248
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
153 map.connect('summary_home', '/{repo_name:.*}/summary', |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
154 controller='summary', conditions=dict(function=check_repo)) |
248
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
155 map.connect('shortlog_home', '/{repo_name:.*}/shortlog', |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
156 controller='shortlog', conditions=dict(function=check_repo)) |
248
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
157 map.connect('branches_home', '/{repo_name:.*}/branches', |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
158 controller='branches', conditions=dict(function=check_repo)) |
248
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
159 map.connect('tags_home', '/{repo_name:.*}/tags', |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
160 controller='tags', conditions=dict(function=check_repo)) |
248
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
161 map.connect('changelog_home', '/{repo_name:.*}/changelog', |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
162 controller='changelog', conditions=dict(function=check_repo)) |
248
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
163 map.connect('files_home', '/{repo_name:.*}/files/{revision}/{f_path:.*}', |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
164 controller='files', revision='tip', f_path='', |
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
165 conditions=dict(function=check_repo)) |
248
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
166 map.connect('files_diff_home', '/{repo_name:.*}/diff/{f_path:.*}', |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
167 controller='files', action='diff', revision='tip', f_path='', |
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
168 conditions=dict(function=check_repo)) |
485
9836541b0509
added limit for showing pygemntized source codes larger than 250kb.
Marcin Kuzminski <marcin@python-works.com>
parents:
474
diff
changeset
|
169 map.connect('files_rawfile_home', '/{repo_name:.*}/rawfile/{revision}/{f_path:.*}', |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
170 controller='files', action='rawfile', revision='tip', f_path='', |
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
171 conditions=dict(function=check_repo)) |
485
9836541b0509
added limit for showing pygemntized source codes larger than 250kb.
Marcin Kuzminski <marcin@python-works.com>
parents:
474
diff
changeset
|
172 map.connect('files_raw_home', '/{repo_name:.*}/raw/{revision}/{f_path:.*}', |
9836541b0509
added limit for showing pygemntized source codes larger than 250kb.
Marcin Kuzminski <marcin@python-works.com>
parents:
474
diff
changeset
|
173 controller='files', action='raw', revision='tip', f_path='', |
9836541b0509
added limit for showing pygemntized source codes larger than 250kb.
Marcin Kuzminski <marcin@python-works.com>
parents:
474
diff
changeset
|
174 conditions=dict(function=check_repo)) |
248
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
175 map.connect('files_annotate_home', '/{repo_name:.*}/annotate/{revision}/{f_path:.*}', |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
176 controller='files', action='annotate', revision='tip', f_path='', |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
177 conditions=dict(function=check_repo)) |
248
fb7f066126cc
Added support for repository located in subdirectories.
Marcin Kuzminski <marcin@python-works.com>
parents:
230
diff
changeset
|
178 map.connect('files_archive_home', '/{repo_name:.*}/archive/{revision}/{fileformat}', |
300
8f7b8e965fe4
fixed 404s added extra validator for magic repo_name path in routes
Marcin Kuzminski <marcin@python-works.com>
parents:
299
diff
changeset
|
179 controller='files', action='archivefile', revision='tip', |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
180 conditions=dict(function=check_repo)) |
525
87d80c84df09
added search in specific repository
Marcin Kuzminski <marcin@python-works.com>
parents:
485
diff
changeset
|
181 map.connect('repo_settings_delete', '/{repo_name:.*}/settings', |
87d80c84df09
added search in specific repository
Marcin Kuzminski <marcin@python-works.com>
parents:
485
diff
changeset
|
182 controller='settings', action="delete", |
87d80c84df09
added search in specific repository
Marcin Kuzminski <marcin@python-works.com>
parents:
485
diff
changeset
|
183 conditions=dict(method=["DELETE"], function=check_repo)) |
320
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
306
diff
changeset
|
184 map.connect('repo_settings_update', '/{repo_name:.*}/settings', |
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
306
diff
changeset
|
185 controller='settings', action="update", |
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
306
diff
changeset
|
186 conditions=dict(method=["PUT"], function=check_repo)) |
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
306
diff
changeset
|
187 map.connect('repo_settings_home', '/{repo_name:.*}/settings', |
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
306
diff
changeset
|
188 controller='settings', action='index', |
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
306
diff
changeset
|
189 conditions=dict(function=check_repo)) |
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
306
diff
changeset
|
190 |
530
a08f610e545e
Implemented server side forks
Marcin Kuzminski <marcin@python-works.com>
parents:
525
diff
changeset
|
191 map.connect('repo_fork_create_home', '/{repo_name:.*}/fork', |
a08f610e545e
Implemented server side forks
Marcin Kuzminski <marcin@python-works.com>
parents:
525
diff
changeset
|
192 controller='settings', action='fork_create', |
a08f610e545e
Implemented server side forks
Marcin Kuzminski <marcin@python-works.com>
parents:
525
diff
changeset
|
193 conditions=dict(function=check_repo, method=["POST"])) |
525
87d80c84df09
added search in specific repository
Marcin Kuzminski <marcin@python-works.com>
parents:
485
diff
changeset
|
194 map.connect('repo_fork_home', '/{repo_name:.*}/fork', |
87d80c84df09
added search in specific repository
Marcin Kuzminski <marcin@python-works.com>
parents:
485
diff
changeset
|
195 controller='settings', action='fork', |
530
a08f610e545e
Implemented server side forks
Marcin Kuzminski <marcin@python-works.com>
parents:
525
diff
changeset
|
196 conditions=dict(function=check_repo)) |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
197 |
0 | 198 return map |