- @pagetitle = "Group #{@group.title}"
- @layouttype = "custom"
- @crumb_list = ['Group', @group.title]

.grid_16.alpha.omega.box.box-shadow
  .box-header.header-tabs
    %ul
      %li.selected
        %a#reviews-in-tab{data: { id: 'reviews-in' } }
          Incoming Reviews
        = sprite_tag('reload', title: 'Reload', class: 'result_reload', data: { table: 'reviews_in_table' })
        = image_tag('ajax-loader.gif', class: 'result_spinner hidden')
      %li
        %a#requests-in-tab{data: { id: 'requests-in' } }
          Incoming Requests
        = sprite_tag('reload', title: 'Reload', class: 'result_reload hidden', data: { table: 'requests_in_table' })
        = image_tag('ajax-loader.gif', class: 'result_spinner hidden')
      %li
        %a#all-requests-tab{data: { id: 'all-requests' } }
          All Requests
        = sprite_tag('reload', title: 'Reload', class: 'result_reload hidden', data: { table: 'all_requests_table' })
        = image_tag('ajax-loader.gif', class: 'result_spinner hidden')
      %li
        %a#group-members-tab{data: { id: 'group-members' } }
          Group Members
  .grid_16.alpha
    .table-container#reviews-in
      %h3 Incoming Reviews
      = render(partial: 'webui/shared/requests_table', locals: { id: 'reviews_in_table', source_url: group_requests_path(@group) })
    .table-container.hidden#requests-in
      %h3 Incoming Requests
      = render(partial: 'webui/shared/requests_table', locals: { id: 'requests_in_table', source_url: group_requests_path(@group) })
    .table-container.hidden#all-requests
      %h3 All Requests
      = render(partial: 'webui/shared/requests_table', locals: { id: 'all_requests_table', source_url: group_requests_path(@group) })
    .table-container.hidden#group-members
      %h3 Group Members
      - if User.current.is_admin? || @group.group_maintainers.where(user: User.current).exists?
        .grid_16{ style: "margin-bottom: 10px;" }
          = link_to(sprited_text('brick_edit', 'Update group members'), group_edit_title_path(title: @group.title))
      %table#group-members-table
        %thead
          %tr
            %th Login Name
        %tbody
          - if @group.users.any?
            - @group.users.each do |user|
              %tr
                %td= link_to(user.login, user_show_path(user))
          - else
            %tr
              %td This group does not contain users.
