aboutsummaryrefslogtreecommitdiff
path: root/views/_search_table_row.haml
blob: bb13298413f83980da54107527758961eb11b18a (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
38
39
40
41
- alert = search_table_row if defined? search_table_row
- row_class = (row_class || []) + [ cycle(nil, "hilight"), alert.raised? && "raised", alert.acknowledged? && "acknowledged", alert.level]
%tr{ :class => row_class, :id => ["tr", "summary", alert.id] }
  %td
    %input{ :type => "checkbox", :id => "alerts[#{alert.id}]", :name => "alerts[#{alert.id}]", :class => 'alert' }
  %td
    %label{ :for => "alerts[#{alert.id}]" }
      %strong= alert.subject
      = alert.summary
    - if alert.suppressed?
      (suppressed)
    %a{ :id => ["a","detail", alert.id], | 
        :href => "/alert/#{alert.id}",   |
        :onclick => "fetchDetail('#{alert.id}'); return false;"} 
      Details ↓
  %td
    - case alert.update_type
      - when "cleared"
        - if alert.will_raise_at
          Will raise at
          = alert.will_raise_at.to_s_human
        - else
          Cleared at
          = alert.cleared_at.to_s_human
      - when /(re-)?raised/
        - if alert.will_clear_at
          Will clear at
          = alert.will_clear_at.to_s_human
        - else
          = alert.update_type.capitalize
          at
          = alert.raised_at.to_s_human
      - when /acknowledged/
        Ack'd at
        = alert.acknowledged_at.to_s_human
        until
        = alert.will_unacknowledge_at.to_s_human
      - else
        = alert.update_type.capitalize
        at
        = alert.updated_at