Commit a0eaff14 authored by Phil Hughes's avatar Phil Hughes

Updated Ruby variable name

Fixed Ruby code based on review feedback
parent c2602aaf
......@@ -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_links = @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])
......
......@@ -2,8 +2,8 @@
.panel-heading
Groups with access to
%strong #{@project.name}
%span.badge= groups.size
%span.badge= group_links.size
%ul.content-list
- @groups.each do |group_link|
- group_links.each do |group_link|
- group = group_link.group
= render 'shared/members/group', group_link: group_link, group: group
......@@ -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', groups: @groups
- if @group_links.size > 0
= render 'groups', group_links: @group_links
= render 'team', members: @project_members
= paginate @project_members, theme: "gitlab"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment