Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kumanyaev <me@zzet.org>2013-01-25 21:20:15 +0400
committerAndrey Kumanyaev <me@zzet.org>2013-01-25 21:20:15 +0400
commit6efda51cc5caad07b6a01d293daf913eec01901f (patch)
tree49affd28c1320345630bd4303956968f8f27e197
parent5ee8c132a540973c6726bfb99b2050dccc390449 (diff)
fix edit project members access link and page fixes refs #2745
-rw-r--r--app/controllers/admin/projects/application_controller.rb2
-rw-r--r--app/controllers/admin/projects/members_controller.rb2
-rw-r--r--app/views/admin/users/show.html.haml4
-rw-r--r--config/routes.rb2
4 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/admin/projects/application_controller.rb b/app/controllers/admin/projects/application_controller.rb
index 0f3da998666..b3f1539f387 100644
--- a/app/controllers/admin/projects/application_controller.rb
+++ b/app/controllers/admin/projects/application_controller.rb
@@ -6,6 +6,6 @@ class Admin::Projects::ApplicationController < Admin::ApplicationController
protected
def project
- @project ||= Project.find_by_path(params[:project_id])
+ @project ||= Project.find_with_namespace(params[:project_id])
end
end
diff --git a/app/controllers/admin/projects/members_controller.rb b/app/controllers/admin/projects/members_controller.rb
index 5c20c0717ed..d9c0d572bb1 100644
--- a/app/controllers/admin/projects/members_controller.rb
+++ b/app/controllers/admin/projects/members_controller.rb
@@ -22,7 +22,7 @@ class Admin::Projects::MembersController < Admin::Projects::ApplicationControlle
private
def team_member
- @member ||= project.users.find(params[:id])
+ @member ||= project.users.find_by_username(params[:id])
end
def team_member_relation
diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml
index a3be6614136..a69a8ca9afe 100644
--- a/app/views/admin/users/show.html.haml
+++ b/app/views/admin/users/show.html.haml
@@ -123,5 +123,5 @@
%tr
%td= link_to project.name_with_namespace, admin_project_path(project)
%td= tm.project_access_human
- %td= link_to 'Edit Access', edit_admin_team_member_path(tm), class: "btn small"
- %td= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn small danger"
+ %td= link_to 'Edit Access', edit_admin_project_member_path(project.path_with_namespace, tm.user.username), class: "btn small"
+ %td= link_to 'Remove from team', admin_project_member_path(project.path_with_namespace, tm.user.username), confirm: 'Are you sure?', method: :delete, class: "btn small danger"
diff --git a/config/routes.rb b/config/routes.rb
index d67f0a47a00..4a66e9f11bf 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -84,7 +84,7 @@ Gitlab::Application.routes.draw do
get :team
put :team_update
end
- scope module: :projects, constraints: { id: /[^\/]+/ } do
+ scope module: :projects, constraints: { id: /[a-zA-Z.\/0-9_\-]+/ } do
resources :members, only: [:edit, :update, :destroy]
end
end