aboutsummaryrefslogtreecommitdiff
path: root/views/_alerts_table_group.haml
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-06-15 19:47:24 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-06-15 19:47:24 +0100
commitfc0327f91fb134e1df994143a78c22df7d8f62e4 (patch)
tree9fb1161dbdece4428e6c65b1d555a67c7908fa9e /views/_alerts_table_group.haml
parent3576923edf788eecb4320e034f5afaaf625bd62e (diff)
Big interface clear up
Diffstat (limited to 'views/_alerts_table_group.haml')
-rw-r--r--views/_alerts_table_group.haml14
1 files changed, 14 insertions, 0 deletions
diff --git a/views/_alerts_table_group.haml b/views/_alerts_table_group.haml
new file mode 100644
index 0000000..f3af4b2
--- /dev/null
+++ b/views/_alerts_table_group.haml
@@ -0,0 +1,14 @@
+-# Sanity checking.
+- group, alerts = alerts_table_group unless alerts_table_group.nil?
+- hilight = cycle(nil,"hilight")
+- row_class = [ hilight, alerts.first.raised? && "triggered", alerts.first.acknowledged? && "acknowledged", alerts.first.level]
+=partial("alerts_table_alert_summary", :locals => {:alert => alerts.first, :row_class => row_class })
+- if alerts.length > 1
+ %tr{ :class => [ hilight, alerts.first.raised? && "triggered", alerts.first.acknowledged? && "acknowledged"]}
+ %td &nbsp;
+ %td{:colspan => 2}
+ - if alerts.length == 2
+ There is one more alert in this group.
+ - else
+ There is #{alerts.length - 1} more alerts in this group.
+ =partial("alerts_table_alert_summary", :collection => alerts[1..-1], :locals => { :row_class => row_class + ["hidden"] })