#sidebar= render 'nodes_sidebar'
#main
  .header
    %h2= h resource.name
    %ul.actions
      %li= link_to 'Edit', edit_node_path(@node), :class => "edit button", :rel => 'inspect'
      %li= link_to 'Destroy', @node, :confirm => 'Are you sure?', :method => :delete, :class => "delete button"
  #item
    - unless resource.description.blank?
      .description= simple_format h(resource.description)

    - begin
      - unless resource.compiled_parameters.blank?
        = inspector_table resource.compiled_parameters, :key, :value, :link => false, :caption => 'Parameters'
    - rescue NodeGroupCycleError => error
      %h3 All Parameters
      %p.error
        %strong Warning:
        There appears to be a problem with your node groups.
        = error.message
        

    .section.half
      %h3 Groups
      - unless resource.node_groups.empty?
        = inspector_table resource.node_groups, :link => true
      - else
        No Groups

    .section.half
      %h3 Classes
      - unless resource.node_classes.empty?
        = inspector_table resource.node_classes, :link => true
      - else
        No Classes

    - unless resource.inherited_classes.empty?
      = inspector_table resource.inherited_classes, :link => true, :caption => 'Inherited Classes'


    .clear

    - reports = @node.reports.limit(30).order('time ASC')
    - unless reports.empty?
      .section
        %h3 Daily Run Status
        = render :partial => 'statuses/run_failure', :locals => { :statuses => Status.by_interval(:limit => 30, :node => @node) }

      .section
        %h3 Run Time (ms)
        = render 'statuses/run_time', :reports => reports.reverse

      .section
        %h3
          Recent Reports
          %span.count== (#{@node.reports.size})
        %table.inspector
          %thead
            %tr
              %th.status
                %span{:alt => "Status", :title => "Status"} &bull;
              %th Reported at
              %th Total
              %th Failed
              %th Runtime
          %tbody
            - @node.reports.limit(10).each do |report|
              %tr
                %td.status{:class => report.status, :alt => report.status.titleize, :title => report.status.titleize}
                  %span &bull;
                %td= link_to report.time.to_s, report
                %td= report.total_resources
                %td= report.failed_resources
                %td= report.total_time
          %tfoot
            %tr
              %td{:colspan => @node ? 8 : 7}
                .actionbar
                  = link_to "View More &raquo;", reports_node_path(@node), :class => 'button'

    .section
      %h3 Activity
      - unless resource.timeline_events.empty?
        %ol.timeline= render resource.timeline_events.recent(10)
      - else
        No Activity

    .clear
