diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2016-12-14 15:09:54 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2016-12-14 15:09:54 +0000 |
commit | b70b962892b2428557d95a9639fbcead4fe546fd (patch) | |
tree | b39badaaa7809f5f25aca1e5d411f527c814b7f0 /config | |
parent | 278baa5b618c5595045415a55d863daf9a15d792 (diff) | |
parent | d8b7df3cbcfd4fcdf204fdcba01720e60fb598bf (diff) | |
download | gitlab-ce-b70b962892b2428557d95a9639fbcead4fe546fd.tar.gz |
Merge branch 'dz-fix-admin-routes' into 'master'
Add support for nested groups to admin routing
See merge request !8008
Diffstat (limited to 'config')
-rw-r--r-- | config/routes/admin.rb | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/config/routes/admin.rb b/config/routes/admin.rb index 5ae985da561..0dd2c8f7aef 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -28,9 +28,19 @@ namespace :admin do resources :applications - resources :groups, constraints: { id: /[^\/]+/ } do - member do + resources :groups, only: [:index, :new, :create] + + scope(path: 'groups/*id', + controller: :groups, + constraints: { id: Gitlab::Regex.namespace_route_regex }) do + + scope(as: :group) do put :members_update + get :edit, action: :edit + get '/', action: :show + patch '/', action: :update + put '/', action: :update + delete '/', action: :destroy end end @@ -50,14 +60,13 @@ namespace :admin do resource :system_info, controller: 'system_info', only: [:show] resources :requests_profiles, only: [:index, :show], param: :name, constraints: { name: /.+\.html/ } - resources :namespaces, path: '/projects', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only: [] do - root to: 'projects#index', as: :projects + resources :projects, only: [:index] + scope(path: 'projects/*namespace_id', as: :namespace) do resources(:projects, path: '/', - constraints: { id: /[a-zA-Z.0-9_\-]+/ }, - only: [:index, :show]) do - root to: 'projects#show' + constraints: { id: Gitlab::Regex.project_route_regex }, + only: [:show]) do member do put :transfer |