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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
a0eaff14
Commit
a0eaff14
authored
Oct 05, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated Ruby variable name
Fixed Ruby code based on review feedback
parent
c2602aaf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
9 deletions
+7
-9
app/controllers/projects/project_members_controller.rb
app/controllers/projects/project_members_controller.rb
+3
-5
app/views/projects/project_members/_groups.html.haml
app/views/projects/project_members/_groups.html.haml
+2
-2
app/views/projects/project_members/index.html.haml
app/views/projects/project_members/index.html.haml
+2
-2
No files found.
app/controllers/projects/project_members_controller.rb
View file @
a0eaff14
...
...
@@ -5,7 +5,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
before_action
:authorize_admin_project_member!
,
except:
[
:index
,
:leave
,
:request_access
]
def
index
@groups
=
@project
.
project_group_links
@group
_link
s
=
@project
.
project_group_links
@project_members
=
@project
.
project_members
@project_members
=
@project_members
.
non_invite
unless
can?
(
current_user
,
:admin_project
,
@project
)
...
...
@@ -14,9 +14,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
users
=
@project
.
users
.
search
(
params
[
:search
]).
to_a
@project_members
=
@project_members
.
where
(
user_id:
users
)
group_ids
=
@groups
.
pluck
(
:group_id
)
group_ids
=
Group
.
where
(
id:
group_ids
).
search
(
params
[
:search
]).
to_a
@groups
=
@project
.
project_group_links
.
where
(
group_id:
group_ids
)
@group_links
=
@project
.
project_group_links
.
where
(
group_id:
@project
.
invited_groups
.
search
(
params
[
:search
]).
select
(
:id
))
end
@project_members
=
@project_members
.
order
(
access_level: :desc
).
page
(
params
[
:page
])
...
...
@@ -40,7 +38,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
groups
.
each
do
|
group
|
next
unless
can?
(
current_user
,
:read_group
,
group
)
project
.
project_group_links
.
create
(
group:
group
,
group_access:
params
[
:access_level
],
...
...
app/views/projects/project_members/_groups.html.haml
View file @
a0eaff14
...
...
@@ -2,8 +2,8 @@
.panel-heading
Groups with access to
%strong
#{
@project
.
name
}
%span
.badge
=
groups
.
size
%span
.badge
=
group
_link
s
.
size
%ul
.content-list
-
@group
s
.
each
do
|
group_link
|
-
group_link
s
.
each
do
|
group_link
|
-
group
=
group_link
.
group
=
render
'shared/members/group'
,
group_link:
group_link
,
group:
group
app/views/projects/project_members/index.html.haml
View file @
a0eaff14
...
...
@@ -21,8 +21,8 @@
=
search_field_tag
:search
,
params
[
:search
],
{
placeholder:
'Find existing members by name'
,
class:
'form-control'
,
spellcheck:
false
}
%button
.member-search-btn
{
type:
"submit"
,
"aria-label"
=>
"Submit search"
}
=
icon
(
"search"
)
-
if
@groups
.
size
>
0
=
render
'groups'
,
group
s:
@group
s
-
if
@group
_link
s
.
size
>
0
=
render
'groups'
,
group
_links:
@group_link
s
=
render
'team'
,
members:
@project_members
=
paginate
@project_members
,
theme:
"gitlab"
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