Ruby update

This commit is contained in:
Phil Hughes 2016-09-08 10:45:53 +01:00
parent 2abbb0980f
commit 7cca8ffe60
3 changed files with 10 additions and 10 deletions

View file

@ -7,15 +7,15 @@ class Projects::ProjectMembersController < Projects::ApplicationController
def index
@groups = @project.project_group_links
project_members = @project.project_members
project_members = project_members.non_invite unless can?(current_user, :admin_project, @project)
@project_members = @project.project_members
@project_members = @project_members.non_invite unless can?(current_user, :admin_project, @project)
members_ids = project_members.pluck(:id)
if params[:search].present?
users = @project.users.search(params[:search]).to_a
@project_members = @project_members.where(user_id: users)
end
@members = Member.where(id: members_ids.flatten)
@members_size = @members.size
@members = @members.page(params[:page])
@project_members = @project_members.page(params[:page])
@requesters = @project.requesters if can?(current_user, :admin_project, @project)

View file

@ -2,7 +2,7 @@
.panel-heading
Users with access to
%strong #{@project.name}
%span.badge= @members_size
%span.badge= @project_members.total_count
%ul.content-list
- members.each do |member|
= render 'shared/members/member', member: member

View file

@ -25,5 +25,5 @@
- if @groups.size > 0
= render 'groups', groups: @groups
= render 'team', members: @members
= paginate @members, theme: "gitlab"
= render 'team', members: @project_members
= paginate @project_members, theme: "gitlab"