%h3.page-title
  Group: #{@group.name}

  = link_to edit_admin_group_path(@group), class: "btn btn-small pull-right" do
    %i.icon-edit
    Edit
%hr
.row
  .col-md-6
    .ui-box
      .title
        Group info:
      %ul.well-list
        %li
          %span.light Name:
          %strong= @group.name
        %li
          %span.light Path:
          %strong
            = @group.path

        %li
          %span.light Description:
          %strong
            = @group.description

        %li
          %span.light Created on:
          %strong
            = @group.created_at.stamp("March 1, 1999")

    .ui-box
      .title
        Projects
        %small
          (#{@group.projects.count})
      %ul.well-list
        - @group.projects.sort_by(&:name).each do |project|
          %li
            %strong
              = link_to project.name_with_namespace, [:admin, project]
              %span.label.label-gray
                = repository_size(project)
            %span.pull-right.light
              %span.monospace= project.path_with_namespace + ".git"

  .col-md-6
    .ui-box
      .title
        Add user(s) to the group:
      .body.form-holder
        %p.light
          Read more about project permissions
          %strong= link_to "here", help_permissions_path, class: "vlink"

        = form_tag project_teams_update_admin_group_path(@group), id: "new_team_member", class: "bulk_import", method: :put  do
          %div
            = users_select_tag(:user_ids, multiple: true)
          %div.prepend-top-10
            = select_tag :group_access, options_for_select(UsersGroup.group_access_roles), class: "project-access-select select2"
          %hr
          = submit_tag 'Add users into group', class: "btn btn-create"
    .ui-box
      .title
        %strong #{@group.name}
        Group Members
        %small
          (#{@group.users_groups.count})
      %ul.well-list.group-users-list
        - @group.users_groups.order('group_access DESC').each do |member|
          - user = member.user
          %li{class: dom_class(user)}
            .list-item-name
              %strong
                = link_to user.name, admin_user_path(user)
            %span.pull-right.light
              = member.human_access
              = link_to group_users_group_path(@group, member), data: { confirm: remove_user_from_group_message(@group, user) }, method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do
                %i.icon-minus.icon-white