- page_title "Members"
= render 'groups/head'

.project-members-page.prepend-top-default
  %h4
    Members
  %hr
  - if can?(current_user, :admin_group_member, @group)
    .project-members-new.append-bottom-default
      %p.clearfix
        Add new member to
        %strong= @group.name
      = render "new_group_member"

    = render 'shared/members/requests', membership_source: @group, requesters: @requesters

  .append-bottom-default.clearfix
    %h5.member.existing-title
      Existing members
    = form_tag group_group_members_path(@group), method: :get, class: 'form-inline member-search-form'  do
      .form-group
        = 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")
        = render 'shared/members/sort_dropdown'
  .panel.panel-default
    .panel-heading
      Members with access to
      %strong= @group.name
      %span.badge= @members.total_count
    %ul.content-list
      = render partial: 'shared/members/member', collection: @members, as: :member
    = paginate @members, theme: 'gitlab'
