aboutsummaryrefslogtreecommitdiff
path: root/views/_get_alerts.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_alerts.haml
new version.
Diffstat (limited to 'views/_get_alerts.haml')
-rw-r--r--views/_get_alerts.haml43
1 files changed, 43 insertions, 0 deletions
diff --git a/views/_get_alerts.haml b/views/_get_alerts.haml
new file mode 100644
index 0000000..8abff2e
--- /dev/null
+++ b/views/_get_alerts.haml
@@ -0,0 +1,43 @@
+- alerts.each do |alert|
+ %li{:id=>"alert#{alert.id}"}
+ .alert
+ - if "urgent" == level
+ .levelUrgent
+ %a{:href=>"javascript:", :onClick=>"showAcknowledgeStatus(event, #{alert.id}, #{alert.get_default_acknowledge_time()});"}
+ Urgent
+ - elsif "normal" == level
+ .levelNormal
+ %a{:href=>"javascript:", :onClick=>"showAcknowledgeStatus(event, #{alert.id}, #{alert.get_default_acknowledge_time()});"}
+ Normal
+ -else
+ .levelLow
+ %a{:href=>"javascript:", :onClick=>"showAcknowledgeStatus(event, #{alert.id}, #{alert.get_default_acknowledge_time()});"}
+ Low
+ .subject= alert.get_safe_html_subject
+ .summary= alert.get_safe_html_summary
+ %a{:href=>"/alert/#{alert.id}"}
+ History
+ //%a{:href=>"javascript:", :onClick=>"$(furtherInformation#{alert.id}).toggle();"}
+ %a{:href=>"javascript:", :onClick=>"$(\"#furtherInformation#{alert.id}.furtherInformation\").toggle();"}
+ Extra
+ //%a{:href=>"javascript:", :onClick=>"$(inlineDetails#{alert.id}).toggle();"}
+ %a{:href=>"javascript:", :onClick=>"$(\"#inlineDetails#{alert.id}.inlineDetails\").toggle();"}
+ Details
+ .inlineDetails{:id=>"inlineDetails#{alert.id}", :style=>"display: none"}
+ %h5 Alert details
+ #{alert.get_details}
+ //.furtherInformation{:id=>"furtherInformation#{alert.id}"}
+ .furtherInformation{:id=>"furtherInformation#{alert.id}", :style=>"display: none"}
+ Alert group is '#{AlertGroup.matches(alert)[0].name}'.
+ - if alert.source != alert.subject
+ .source= "Source is '#{alert.get_safe_html_source}'."
+ - if alert.acknowledged?
+ .ackDetails
+ Acknowledged by user
+ %strong= "#{alert.get_acknowledged_by()} "
+ and will #{alert.get_unacknowledge_at_string()}.
+ - else
+ .time
+ Last updated on
+ %em= "#{alert.get_updated_at()}."
+