#sidebar= render 'shared/node_manager_sidebar'
#main
  .header
    %h2
      Group:
      = h @node_group.name
    %ul.actions
      - unless SETTINGS.enable_read_only_mode || session['ACCESS_CONTROL_ROLE'] == 'READ_ONLY'
        %li= link_to 'Edit', edit_node_group_path(@node_group), :class => "edit button", :rel => 'inspect'
        %li= link_to 'Delete', @node_group, :confirm => 'Are you sure?', :method => :delete, :class => "delete button"

  .item
    - if SETTINGS.use_external_node_classification
      = render 'shared/parameters', :resource => @node_group
    = render 'shared/groups', :resource => @node_group
    - if SETTINGS.use_external_node_classification
      = render 'shared/classes', :resource => @node_group

    .section.half
      %h3 Derived groups
      - unless @node_group.node_group_children_with_sources.empty?
        %table.inspector
          %thead
            %tr
              %th{:scope => :col} Group
              %th{:scope => :col} Source
          %tbody
            - @node_group.node_group_children_with_sources.sort.each do |group,sources|
              %tr
                %td
                  %strong= link_to(h(group.name), group)
                %td
                  - if sources.include?(@node_group)
                    = h group.name
                  - else
                    = sources.map{|p| link_to(h(p.name), p)}.join(", ")
      - else
        = describe_no_matches_as 'No child groups'
    .clearfix{:style => 'clear: both'}
  - if @node_group.all_nodes.present?
    .item
      .section
        = render 'statuses/run_failure', :nodes => @node_group.all_nodes
  .header
    %h2 Nodes for this group
  .item
    .section
      - Registry.each_callback :core, :node_group_view_widgets do |thing|
        = thing.call self, @node_group
      - if @node_group.all_nodes.present?
        = render 'nodes/nodes', :nodes => @node_group.all_nodes, :container => @node_group
      - else
        = describe_no_matches_for :nodes, :group
