2016-12-22 17:38:27 -05:00
|
|
|
module Projects
|
|
|
|
module Settings
|
|
|
|
class MembersController < Projects::ApplicationController
|
|
|
|
include SortingHelper
|
2016-12-23 17:29:00 -05:00
|
|
|
|
2016-12-22 17:38:27 -05:00
|
|
|
def show
|
|
|
|
@sort = params[:sort].presence || sort_value_name
|
|
|
|
@group_links = @project.project_group_links
|
|
|
|
|
2016-12-23 17:29:00 -05:00
|
|
|
@skip_groups = @group_links.pluck(:group_id)
|
2016-12-26 11:12:24 -05:00
|
|
|
@skip_groups << @project.namespace_id unless @project.personal?
|
2017-03-15 10:09:53 -04:00
|
|
|
@skip_groups += @project.group.ancestors.pluck(:id) if @project.group
|
2016-12-23 17:29:00 -05:00
|
|
|
|
2017-03-07 06:58:14 -05:00
|
|
|
@project_members = MembersFinder.new(@project, current_user).execute
|
2016-12-22 17:38:27 -05:00
|
|
|
|
|
|
|
if params[:search].present?
|
2017-03-07 06:58:14 -05:00
|
|
|
@project_members = @project_members.joins(:user).merge(User.search(params[:search]))
|
|
|
|
@group_links = @group_links.where(group_id: @project.invited_groups.search(params[:search]).select(:id))
|
2016-12-22 17:38:27 -05:00
|
|
|
end
|
|
|
|
|
2017-03-07 06:58:14 -05:00
|
|
|
@project_members = @project_members.sort(@sort).page(params[:page])
|
2016-12-22 17:38:27 -05:00
|
|
|
@requesters = AccessRequestsFinder.new(@project).execute(current_user)
|
|
|
|
@project_member = @project.project_members.new
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|