<% nav = render_erb('_nav.html.erb', binding) %> <% head = render_erb('_head.html.erb', binding) %> <% foot = render_erb('_foot.html.erb', binding) %> Flapjack - <%= h @contact.name %> (contact) <%= head %>

Contact Media

<% if !@contact.media || @contact.media.empty? %>

No media

<% else %> <% @contact.media.each_pair do |mk, mv| %> <% if 'pagerduty'.eql?(mk) %> <% else %> <% end %> <% end %>
Media Address Interval
PagerDuty <% @pagerduty_credentials.each_pair do |pk, pv| %>

<%= 'password'.eql?(pk) ? h("#{pk}: ...") : h("#{pk}: #{pv}") %>

<% end %>
-<%= h mk.capitalize %> <%= h mv %> <% if @contact.media_intervals[mk] %> <%= h @contact.media_intervals[mk] %> seconds <% else %> no custom interval <% end %>
<% end %>

Entities and Checks

<% if !@entities_and_checks || @entities_and_checks.empty? %>

No entities

<% else %> <% @entities_and_checks.each do |ec| %> <% entity = ec[:entity] checks = ec[:checks] %> <% end %>
Entity Checks
<%= h entity.name %> <% checks.each do |check| %> <%= h check %> <% end %>
<% end %>

Notification Rules

<% rules = @contact.notification_rules %> <% if !rules || rules.empty? %>

No notification rules

<% else %> <% rules.each do |rule| %> <% end %>
ID Entities Tags Warning Media Critical Media Time Restrictions
<%= h rule.id %> <%= h( (rule.entities && !rule.entities.empty?) ? rule.entities.join(', ') : '-') %> <%= h( (rule.tags && !rule.tags.empty?) ? rule.tags.to_a.join(', ') : '-') %> <%= h( (rule.warning_media && !rule.warning_media.empty?) ? rule.warning_media.join(', ') : '-')%> <%= h( (rule.critical_media && !rule.critical_media.empty?) ? rule.critical_media.join(', ') : '-') %> <%= h(rule.time_restrictions) %>
<% end %>