<% slugged_id = control.id.tr(" ", "_") %> <% # Determine status of control status = "passed" if control.results.any? { |r| r.status == "failed" } status = "failed" elsif control.results.any? { |r| r.status == "skipped" } status = "skipped" end %>
<% # Determine range of impact i = control.impact || 0.0 impact_level = "none" if i < 0.3 impact_level = "low" elsif i < 0.7 impact_level = "medium" else impact_level = "high" end %>

Control <%= control.id %>

<% if control.title %> <% end %> <% if control.desc %> <% end %> <% if control.impact %> <% end %> <% unless control.tags.empty? %> <% end %> <% unless control.refs.empty? %> <% end %>
Status:
<%= status.capitalize %>
Title:<%= control.title %>
Description:<%= control.desc %>
Impact:<%= control.impact %>
Tags: <% control.tags.each do |tag_name, tag_text| %> <% end %>
<%= tag_name %><%= tag_text %>
References:
Source Code:
<% control.results.each do |result| %> <%= ERB.new(File.read(template_path + "/result.html.erb"), nil, nil, "_rslt").result(binding) %> <% end %>