_module_result.rhtml 1.71 KB
<h5><%= _('Metric results for: ') + @module_label %> </h5>

<hr/>
<div class="zoomable-image">
<table>
  <thead>
    <tr>
      <th>Metric</th>
      <th>Value</th>
      <th>Weight</th>
      <th>Threshold</th>
    </tr>
  </thead>
  <tbody>
    <% @module_result.metric_results.each do |metric_result|  %>
      <% range = metric_result.range %>
      <% if !range.nil? %>
        <tr>
          <td><a href="#" show-metric-history="<%= MezuroPlugin::Helpers::ContentViewerHelper.format_name(metric_result) %>" data-module-name="<%= @module.name %>"><%= metric_result.metric.name %></a></td>
          <td><%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_result.value) %></td>
          <td><%= metric_result.weight %></td>
          <td style="background-color: #<%= range.color[2..-1] %>"><%= range.label %></td>
        </tr>	  
        <tr class="<%= MezuroPlugin::Helpers::ContentViewerHelper.format_name(metric_result) %>" style="display: none;">
          <td colspan="3">
            <div id='historical-<%= MezuroPlugin::Helpers::ContentViewerHelper.format_name(metric_result) %>'>
            </div>
          </td>
          <td align="right">
            <%= range.comments.nil? ? '' : range.comments %>
          </td> 
        </tr>
      <% end %>
    <% end %>
  </tbody>
  <tfoot>
    <tr>
      <td colspan = "3">
        <div id='historical-grade' style="display: none;"></div>
      </td>
      <td align = "right">
        <a href="#" show-grade-history="<%= @module_result.module.name %>" data-module-name="<%= @module.name%>" >
          <strong>
            <%= _('Grade:') %>
            <%= "%.02f" % @module_result.grade %>
          </strong>
        </a>
      </td>
    </tr>
  </tfoot>
</table>
</div>