- @no_container = true

= content_for :meta_tags do
  - if current_user
    = auto_discovery_link_tag(:atom, group_url(@group, format: :atom, private_token: current_user.private_token), title: "#{@group.name} activity")

.cover-block
  .cover-controls
    - if @group && can?(current_user, :admin_group, @group)
      = link_to icon('pencil'), edit_group_path(@group), class: 'btn'
    - if current_user
      = link_to icon('rss'), group_path(@group, { format: :atom, private_token: current_user.private_token }), title: "Feed", class: 'btn rss-btn'

  .avatar-holder
    = link_to group_icon(@group), target: '_blank' do
      = image_tag group_icon(@group), class: "avatar group-avatar s90"
  .cover-title
    %h1
      = @group.name
      %span.visibility-icon.has-tooltip{ data: { container: 'body' }, title: visibility_icon_description(@group) }
        = visibility_level_icon(@group.visibility_level, fw: false)

  .cover-desc.username
    @#{@group.path}

  - if @group.description.present?
    .cover-desc.description
      = markdown(@group.description, pipeline: :description)

%div{ class: container_class }
  .top-area
    %ul.nav-links
      %li.active
        = link_to "#projects", 'data-toggle' => 'tab' do
          All Projects
      - if @shared_projects.present?
        %li
          = link_to "#shared", 'data-toggle' => 'tab' do
            Shared Projects
    .nav-controls
      = form_tag request.original_url, method: :get, class: 'project-filter-form', id: 'project-filter-form' do |f|
        = search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control', spellcheck: false
      = render 'shared/projects/dropdown'
      - if can? current_user, :create_projects, @group
        = link_to new_project_path(namespace_id: @group.id), class: 'btn btn-new pull-right' do
          = icon('plus')
          New Project

  .tab-content
    .tab-pane.active#projects
      = render "projects", projects: @projects

    - if @shared_projects.present?
      .tab-pane#shared
        = render "shared_projects", projects: @shared_projects