aboutsummaryrefslogtreecommitdiff
path: root/views/_get_list.haml
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-04-13 17:03:16 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-04-13 17:03:16 +0100
commit89a67770e66d11740948e90a41db6cee0482cf8e (patch)
treebe858515fb789a89d68f94975690ab019813726c /views/_get_list.haml
new version.
Diffstat (limited to 'views/_get_list.haml')
-rw-r--r--views/_get_list.haml40
1 files changed, 40 insertions, 0 deletions
diff --git a/views/_get_list.haml b/views/_get_list.haml
new file mode 100644
index 0000000..cc8fb9b
--- /dev/null
+++ b/views/_get_list.haml
@@ -0,0 +1,40 @@
+//- alerts.each_pair do |subject, alerts|
+- alertsList.keys.sort.each do |subject|
+ - alerts = alertsList[subject]
+ - if 1 < alerts.length()
+ %li{:id=>"firstAlert#{alerts[0].id}"}
+ - if "urgent" == level
+ %span.levelUrgent Urgent
+ - elsif "normal" == level
+ %span.levelNormal Normal
+ -else
+ %span.levelLow Low
+ .conglomerate
+ %span.subject= alerts[0].subject
+ - if alerts[0].acknowledged?
+ There are <strong>#{alerts.length}</strong> alerts in this conglomerate.
+ - else
+ - shortestAckTime = 9223372036854775807
+ - lst = Array.new
+ - alerts.each do |alert|
+ - shortestAckTime = alert.get_default_acknowledge_time() if alert.get_default_acknowledge_time() < shortestAckTime
+ - lst << alert.id
+ %a{:href=>"javascript:", :onClick=>"showBulkAcknowledgeStatus(event, #{"['#{lst.join('\',\'')}']"}, #{shortestAckTime});"}
+ [Bulk acknowledge <strong>#{alerts.length}</strong> alerts for
+ - hrs = shortestAckTime / 3600
+ - if 1 == hrs
+ one hour.
+ - elsif 24 > hrs and 1 > hrs
+ #{hrs} hours
+ - elsif 24 == hrs
+ one day.
+ - elsif 24 < hrs and 168 > hrs
+ #{hrs/24} days.
+ - elsif 168 == hrs
+ one week
+ - else
+ #{hrs/168} weeks
+ ]
+ %ul= partial("get_alerts", :locals => {:level => level, :alerts => alerts})
+ - else
+ = partial("get_alerts", :locals => {:level => level, :alerts => alerts})