aboutsummaryrefslogtreecommitdiff
path: root/views/_alert_strips_group.haml
blob: 0a6f3bf9e2e6b42cc9b010a4b5466418ccc3d63a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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"}