Mercurial > kallithea
comparison rhodecode/config/routing.py @ 3629:802c94bdfc85 beta
#749 and #516 Removed dupliciting of repo settings for rhodecode admins and repo admins
- repo admin now is allowed the same set of operations as the rhodecode admin
- single logic for forms/validations/permissions
- fixes #805 update external repo via webinterface
-
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 28 Mar 2013 02:57:05 +0100 |
parents | c734686b3cf2 |
children | 10b4e34841a4 |
comparison
equal
deleted
inserted
replaced
3628:c734686b3cf2 | 3629:802c94bdfc85 |
---|---|
104 m.connect("formatted_repos", "/repos.{format}", | 104 m.connect("formatted_repos", "/repos.{format}", |
105 action="index", | 105 action="index", |
106 conditions=dict(method=["GET"])) | 106 conditions=dict(method=["GET"])) |
107 m.connect("new_repo", "/repos/new", | 107 m.connect("new_repo", "/repos/new", |
108 action="new", conditions=dict(method=["GET"])) | 108 action="new", conditions=dict(method=["GET"])) |
109 #TODO: refactor the name | |
110 m.connect("admin_settings_create_repository", "/create_repository", | |
111 action="create_repository", conditions=dict(method=["GET"])) | |
109 m.connect("formatted_new_repo", "/repos/new.{format}", | 112 m.connect("formatted_new_repo", "/repos/new.{format}", |
110 action="new", conditions=dict(method=["GET"])) | 113 action="new", conditions=dict(method=["GET"])) |
111 m.connect("/repos/{repo_name:.*?}", | 114 m.connect("/repos/{repo_name:.*?}", |
112 action="update", conditions=dict(method=["PUT"], | 115 action="update", conditions=dict(method=["PUT"], |
113 function=check_repo)) | 116 function=check_repo)) |
114 m.connect("/repos/{repo_name:.*?}", | 117 m.connect("/repos/{repo_name:.*?}", |
115 action="delete", conditions=dict(method=["DELETE"], | 118 action="delete", conditions=dict(method=["DELETE"], |
116 function=check_repo)) | 119 function=check_repo)) |
117 # no longer used: | |
118 m.connect("edit_repo_admin", "/repos/{repo_name:.*?}/edit", | |
119 action="edit", conditions=dict(method=["GET"], | |
120 function=check_repo)) | |
121 m.connect("formatted_edit_repo", "/repos/{repo_name:.*?}.{format}/edit", | 120 m.connect("formatted_edit_repo", "/repos/{repo_name:.*?}.{format}/edit", |
122 action="edit", conditions=dict(method=["GET"], | 121 action="edit", conditions=dict(method=["GET"], |
123 function=check_repo)) | 122 function=check_repo)) |
124 m.connect("repo", "/repos/{repo_name:.*?}", | 123 m.connect("repo", "/repos/{repo_name:.*?}", |
125 action="show", conditions=dict(method=["GET"], | 124 action="show", conditions=dict(method=["GET"], |
160 action="repo_as_fork", conditions=dict(method=["PUT"], | 159 action="repo_as_fork", conditions=dict(method=["PUT"], |
161 function=check_repo)) | 160 function=check_repo)) |
162 m.connect('repo_locking', "/repo_locking/{repo_name:.*?}", | 161 m.connect('repo_locking', "/repo_locking/{repo_name:.*?}", |
163 action="repo_locking", conditions=dict(method=["PUT"], | 162 action="repo_locking", conditions=dict(method=["PUT"], |
164 function=check_repo)) | 163 function=check_repo)) |
164 m.connect('toggle_locking', "/locking_toggle/{repo_name:.*?}", | |
165 action="toggle_locking", conditions=dict(method=["GET"], | |
166 function=check_repo)) | |
167 | |
165 #repo fields | 168 #repo fields |
166 m.connect('create_repo_fields', "/repo_fields/{repo_name:.*?}/new", | 169 m.connect('create_repo_fields', "/repo_fields/{repo_name:.*?}/new", |
167 action="create_repo_field", conditions=dict(method=["PUT"], | 170 action="create_repo_field", conditions=dict(method=["PUT"], |
168 function=check_repo)) | 171 function=check_repo)) |
169 | 172 |
332 action="show", conditions=dict(method=["GET"])) | 335 action="show", conditions=dict(method=["GET"])) |
333 m.connect("admin_settings_my_account", "/my_account", | 336 m.connect("admin_settings_my_account", "/my_account", |
334 action="my_account", conditions=dict(method=["GET"])) | 337 action="my_account", conditions=dict(method=["GET"])) |
335 m.connect("admin_settings_my_account_update", "/my_account_update", | 338 m.connect("admin_settings_my_account_update", "/my_account_update", |
336 action="my_account_update", conditions=dict(method=["PUT"])) | 339 action="my_account_update", conditions=dict(method=["PUT"])) |
337 m.connect("admin_settings_create_repository", "/create_repository", | |
338 action="create_repository", conditions=dict(method=["GET"])) | |
339 m.connect("admin_settings_my_repos", "/my_account/repos", | 340 m.connect("admin_settings_my_repos", "/my_account/repos", |
340 action="my_account_my_repos", conditions=dict(method=["GET"])) | 341 action="my_account_my_repos", conditions=dict(method=["GET"])) |
341 m.connect("admin_settings_my_pullrequests", "/my_account/pull_requests", | 342 m.connect("admin_settings_my_pullrequests", "/my_account/pull_requests", |
342 action="my_account_my_pullrequests", conditions=dict(method=["GET"])) | 343 action="my_account_my_pullrequests", conditions=dict(method=["GET"])) |
343 | 344 |
464 | 465 |
465 rmap.connect('changeset_home', '/{repo_name:.*?}/changeset/{revision}', | 466 rmap.connect('changeset_home', '/{repo_name:.*?}/changeset/{revision}', |
466 controller='changeset', revision='tip', | 467 controller='changeset', revision='tip', |
467 conditions=dict(function=check_repo)) | 468 conditions=dict(function=check_repo)) |
468 | 469 |
469 rmap.connect("edit_repo", "/{repo_name:.*?}/edit", | 470 # no longer user, but kept for routes to work |
471 rmap.connect("_edit_repo", "/{repo_name:.*?}/edit", | |
472 controller='admin/repos', action="edit", | |
473 conditions=dict(method=["GET"], function=check_repo) | |
474 ) | |
475 | |
476 rmap.connect("edit_repo", "/{repo_name:.*?}/settings", | |
470 controller='admin/repos', action="edit", | 477 controller='admin/repos', action="edit", |
471 conditions=dict(method=["GET"], function=check_repo) | 478 conditions=dict(method=["GET"], function=check_repo) |
472 ) | 479 ) |
473 | 480 |
474 #still working url for backward compat. | 481 #still working url for backward compat. |
633 rmap.connect('files_nodelist_home', | 640 rmap.connect('files_nodelist_home', |
634 '/{repo_name:.*?}/nodelist/{revision}/{f_path:.*}', | 641 '/{repo_name:.*?}/nodelist/{revision}/{f_path:.*}', |
635 controller='files', action='nodelist', | 642 controller='files', action='nodelist', |
636 conditions=dict(function=check_repo)) | 643 conditions=dict(function=check_repo)) |
637 | 644 |
638 rmap.connect('repo_settings_delete', '/{repo_name:.*?}/settings', | |
639 controller='settings', action="delete", | |
640 conditions=dict(method=["DELETE"], function=check_repo)) | |
641 | |
642 rmap.connect('repo_settings_update', '/{repo_name:.*?}/settings', | |
643 controller='settings', action="update", | |
644 conditions=dict(method=["PUT"], function=check_repo)) | |
645 | |
646 rmap.connect('repo_settings_home', '/{repo_name:.*?}/settings', | |
647 controller='settings', action='index', | |
648 conditions=dict(function=check_repo)) | |
649 | |
650 rmap.connect('toggle_locking', "/{repo_name:.*?}/locking_toggle", | |
651 controller='settings', action="toggle_locking", | |
652 conditions=dict(method=["GET"], function=check_repo)) | |
653 | |
654 rmap.connect('repo_fork_create_home', '/{repo_name:.*?}/fork', | 645 rmap.connect('repo_fork_create_home', '/{repo_name:.*?}/fork', |
655 controller='forks', action='fork_create', | 646 controller='forks', action='fork_create', |
656 conditions=dict(function=check_repo, method=["POST"])) | 647 conditions=dict(function=check_repo, method=["POST"])) |
657 | 648 |
658 rmap.connect('repo_fork_home', '/{repo_name:.*?}/fork', | 649 rmap.connect('repo_fork_home', '/{repo_name:.*?}/fork', |