lib/flapjack/web/views/check.haml in flapjack-0.6.36 vs lib/flapjack/web/views/check.haml in flapjack-0.6.37

- old
+ new

@@ -1,52 +1,17 @@ !!! 5 +- nav_haml = Haml::Engine.new(File.read(File.dirname(__FILE__) + '/_nav.haml')) +- nav = nav_haml.render +- css_haml = Haml::Engine.new(File.read(File.dirname(__FILE__) + '/_css.haml')) +- css = css_haml.render %html %head - :css - * { margin: 0; padding: 0; } - html { font-size: 62.5%; } - body { font-size: 16px; } - div#wrapper { - margin: 24px auto; - width: 1000px; - } - h1, h2, h3, h4, h5 { - font-family: Helvetica Neue, sans-serif; - margin-bottom: 12px; - } - table { - text-align: left; - width: 100%; - } - table th { - font-family: Helvetica Neue, sans-serif; - background-color: #eee; - } - table td, table th { - padding: 4px; - } - table td.critical { - background-color: #fb9a99; - } - table td.down { - background-color: #fb9a99; - } - table td.warning { - background-color: #f9bb34; - } - table td.ok { - background-color: #B2DF8A; - } - table td.up { - background-color: #B2DF8A; - } + %title Flapjack - Check: #{@entity}:#{@check} + = css %body %div#wrapper - %p - %a(title='Dashboard' href='/') All Checks - | - %a(title='Dashboard' href='/failing') Failing Checks + = nav %h1 #{@check} on #{@entity} %form{:action => "/acknowledgements/#{@entity}/#{@check}", :method => "post"} %h2 State: #{@check_state ? @check_state.upcase : ''} - if (['warning', 'critical'].include?(@check_state) and !(@current_unscheduled_maintenance || @current_scheduled_maintenance)) @@ -105,11 +70,11 @@ %tr %td Last acknowledgement notification: %td= last_ack_relative %td= last_ack %h3 Scheduled Maintenance Periods - - if @scheduled_maintenances && (@scheduled_maintenances.length > 0) + - if @scheduled_maintenances && !@scheduled_maintenances.empty? %table %tr %th Start %th End %th Duration @@ -163,6 +128,23 @@ %input{:type => 'text', :name => 'summary', :class => 'text', :size => '80', :maxlength => '160'} %tr %td %td %input{:type => 'submit', :value => 'Save', :class => 'button'} - + %h3 Contacts + - if @contacts && !@contacts.empty? + %table + %tr + %th Name + %th Media + - @contacts.sort_by {|c| [c.last_name, c.first_name] }.each do |contact| + %tr + %td + - link = "/contacts/#{contact.id}" + %a(title='contact details' href=link) #{contact.name} + %td + - if contact.media && !contact.media.empty? + %p= contact.media.keys.collect(&:capitalize).join(", ") + - else + %p No media + - else + %p No contacts