aboutsummaryrefslogtreecommitdiff
path: root/views/_alert_strips_group.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/_alert_strips_group.haml
new version.
Diffstat (limited to 'views/_alert_strips_group.haml')
-rw-r--r--views/_alert_strips_group.haml37
1 files changed, 37 insertions, 0 deletions
diff --git a/views/_alert_strips_group.haml b/views/_alert_strips_group.haml
new file mode 100644
index 0000000..0a6f3bf
--- /dev/null
+++ b/views/_alert_strips_group.haml
@@ -0,0 +1,37 @@
+//- alerts.each_pair do |subject, alerts|
+// .grouped_folder{:id=>subject}
+// - lst = Array.new()
+// - count = 0
+// - alerts.sort.each do |alert|
+// - if count > 0
+// - displayFolding = (false == session[:display_folding][subject])? 'display:none' : ''
+// - else
+// - count += 1
+// - lst.push("whole_alert_#{alert.id}")
+// .alert_whole{:id=>"whole_alert_#{alert.id}", :style => "#{displayFolding}"}
+// .alert_strip{:id => "alert_#{alert.id}"}
+// %a.acknowledge{:href => "javascript:toggleAcknowledge(#{alert.id});", :onClick => "toggleDetailView(#{alert.id});"}
+// - if alert.acknowledged?
+// //%img.acknowledged.auto_hover{:src => "/images/acknowledge_acknowledged.png" :title=>"Unacknowledge alert"}
+// %img.acknowledged{:src => "/images/acknowledge_acknowledged.png" :title=>"Unacknowledge alert"}
+// - else
+// //%img.unacknowledged.auto_hover{:src => "/images/acknowledge_unacknowledged.png" :title=>"Acknowledge alert"}
+// %img.unacknowledged{:src => "/images/acknowledge_unacknowledged.png" :title=>"Acknowledge alert"}
+// - if alert.source != alert.subject
+// .source= alert.source
+// .subject= alert.subject + ": "
+// .summary= alert.summary
+// //- if alert.detail
+// %a.expand{:href => "javascript:", :onClick => "toggleDetailView(#{alert.id}); $('alert_#{alert.id}').next().toggle();"}
+// %img.zoom{:src => "/images/zoom.png" :title => "Show details"}
+// %a.full{:href => "/alert/#{alert.id}"}
+// %img.hourglass{:src => "/images/hourglass.png" :title => "Show history"}
+// - displayDetails = (false == session[:display_alerts][alert.id])? 'display:none' : ''
+// .detail_strip{:id => "detail_#{alert.id}", :style => "#{displayDetails}"}
+// = alert.detail
+// - lst.shift()
+// - displaySummary = (1 > lst.size())? 'display:none' : ''
+// .control{:id=>subject, :style=>"#{displaySummary}"}
+// There are #{lst.size() + 1} alarms in this block...
+// %a.expand{:href => "javascript:", :onClick => "toggleFoldingView('#{subject}'); [$('#{lst.join("'), $('")}')].invoke('toggle');"}
+// %img.toggle{:src => "/images/toggle_alerts.png" :title => "toggle display of alerts"}