Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
cee98f22
Commit
cee98f22
authored
Apr 10, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reference project members by id instead of user_id.
parent
629fa7fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
9 deletions
+5
-9
app/controllers/projects/project_members_controller.rb
app/controllers/projects/project_members_controller.rb
+2
-6
app/views/admin/projects/show.html.haml
app/views/admin/projects/show.html.haml
+1
-1
app/views/projects/project_members/_project_member.html.haml
app/views/projects/project_members/_project_member.html.haml
+2
-2
No files found.
app/controllers/projects/project_members_controller.rb
View file @
cee98f22
...
...
@@ -41,12 +41,12 @@ class Projects::ProjectMembersController < Projects::ApplicationController
end
def
update
@project_member
=
@project
.
project_members
.
find
_by
(
user_id:
member
)
@project_member
=
@project
.
project_members
.
find
(
params
[
:id
]
)
@project_member
.
update_attributes
(
member_params
)
end
def
destroy
@project_member
=
@project
.
project_members
.
find
_by
(
user_id:
member
)
@project_member
=
@project
.
project_members
.
find
(
params
[
:id
]
)
@project_member
.
destroy
respond_to
do
|
format
|
...
...
@@ -78,10 +78,6 @@ class Projects::ProjectMembersController < Projects::ApplicationController
protected
def
member
@member
||=
User
.
find_by
(
username:
params
[
:id
])
end
def
member_params
params
.
require
(
:project_member
).
permit
(
:user_id
,
:access_level
)
end
...
...
app/views/admin/projects/show.html.haml
View file @
cee98f22
...
...
@@ -131,7 +131,7 @@
%span
.light
Owner
-
else
%span
.light
=
project_member
.
human_access
=
link_to
namespace_project_project_member_path
(
@project
.
namespace
,
@project
,
us
er
),
data:
{
confirm:
remove_from_project_team_message
(
@project
,
user
)},
method: :delete
,
remote:
true
,
class:
"btn btn-sm btn-remove"
do
=
link_to
namespace_project_project_member_path
(
@project
.
namespace
,
@project
,
project_memb
er
),
data:
{
confirm:
remove_from_project_team_message
(
@project
,
user
)},
method: :delete
,
remote:
true
,
class:
"btn btn-sm btn-remove"
do
%i
.fa.fa-times
.panel-footer
=
paginate
@project_members
,
param_name:
'project_members_page'
,
theme:
'gitlab'
app/views/projects/project_members/_project_member.html.haml
View file @
cee98f22
...
...
@@ -25,12 +25,12 @@
=
link_to
leave_namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
data:
{
confirm:
"Leave project?"
},
method: :delete
,
class:
"btn-xs btn btn-remove"
,
title:
'Leave project'
do
%i
.fa.fa-minus.fa-inverse
-
else
=
link_to
namespace_project_project_member_path
(
@project
.
namespace
,
@project
,
us
er
),
data:
{
confirm:
remove_from_project_team_message
(
@project
,
user
)
},
method: :delete
,
remote:
true
,
class:
"btn-xs btn btn-remove"
,
title:
'Remove user from team'
do
=
link_to
namespace_project_project_member_path
(
@project
.
namespace
,
@project
,
memb
er
),
data:
{
confirm:
remove_from_project_team_message
(
@project
,
user
)
},
method: :delete
,
remote:
true
,
class:
"btn-xs btn btn-remove"
,
title:
'Remove user from team'
do
%i
.fa.fa-minus.fa-inverse
.edit-member.hide.js-toggle-content
%br
=
form_for
member
,
as: :project_member
,
url:
namespace_project_project_member_path
(
@project
.
namespace
,
@project
,
member
.
user
),
remote:
true
do
|
f
|
=
form_for
member
,
as: :project_member
,
url:
namespace_project_project_member_path
(
@project
.
namespace
,
@project
,
member
),
remote:
true
do
|
f
|
.prepend-top-10
=
f
.
select
:access_level
,
options_for_select
(
ProjectMember
.
access_roles
,
member
.
access_level
),
{},
class:
'form-control'
.prepend-top-10
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment