- @no_container = true
- breadcrumb_title "Details"
- can_create_subgroups = can?(current_user, :create_subgroup, @group)

= content_for :meta_tags do
  = auto_discovery_link_tag(:atom, group_url(@group, rss_url_options), title: "#{@group.name} activity")

= render 'groups/home_panel'

.groups-header{ class: container_class }
  .group-nav-container
    .nav-controls.clearfix
      = render "shared/groups/search_form"
      = render "shared/groups/dropdown", show_archive_options: true
      - if can? current_user, :create_projects, @group
        - new_project_label = _("New project")
        - new_subgroup_label = _("New subgroup")
        - if can_create_subgroups
          .btn-group.new-project-subgroup.droplab-dropdown.js-new-project-subgroup{ data: { project_path: new_project_path(namespace_id: @group.id), subgroup_path: new_group_path(parent_id: @group.id) } }
            %input.btn.btn-success.dropdown-primary.js-new-group-child{ type: "button", value: new_project_label, data: { action: "new-project" } }
            %button.btn.btn-success.dropdown-toggle.js-dropdown-toggle{ type: "button", data: { "dropdown-trigger" => "#new-project-or-subgroup-dropdown" } }
              = icon("caret-down", class: "dropdown-btn-icon")
            %ul#new-project-or-subgroup-dropdown.dropdown-menu.dropdown-menu-align-right{ data: { dropdown: true } }
              %li.droplab-item-selected{ role: "button", data: { value: "new-project", text: new_project_label } }
                .menu-item
                  .icon-container
                    = icon("check", class: "list-item-checkmark")
                  .description
                    %strong= new_project_label
                    %span= s_("GroupsTree|Create a project in this group.")
              %li.divider.droplap-item-ignore
              %li{ role: "button", data: { value: "new-subgroup", text: new_subgroup_label } }
                .menu-item
                  .icon-container
                    = icon("check", class: "list-item-checkmark")
                  .description
                    %strong= new_subgroup_label
                    %span= s_("GroupsTree|Create a subgroup in this group.")
        - else
          = link_to new_project_label, new_project_path(namespace_id: @group.id), class: "btn btn-success"

  - if params[:filter].blank? && !@has_children
    = render "shared/groups/empty_state"
  - else
    = render "children", children: @children, group: @group
