-# Sanity checking.
- group, alerts = alerts_table_group unless alerts_table_group.nil?
- if alerts.length <= 2
  =partial("alerts_table_alert_summary", :collection => alerts)
- else
  =partial("alerts_table_alert_summary", :collection => [alerts.first])
  =partial("alerts_table_alert_summary", :collection => alerts[1..-1], :locals => {:row_class => ["hidden"]})
  %tr{:id => ["tr","group",group]}
    %td &nbsp;
    %td{:colspan => 2}
      There are 
      %a{:onclick => alerts[1..-1].collect{|a| "$('#tr_summary_#{a.id}').toggle();"}.join + " return false;", :href => "#"}
        =alerts.length - 1
        more alerts 
      for the #{@group_by} <em>#{group}</em>.