_module_result.rhtml
2.06 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<% module_name = @module_result.module.name
<h5><%= _('Metric results for: #{module_name} (#{@module_result.module.granularity}) ') %> </h5>
<hr/>
<div class="zoomable-image">
<table style="width: 100%">
<thead>
<tr>
<th style="width: 74%">Metric</th>
<th>Value</th>
<th>Weight</th>
<th>Threshold</th>
</tr>
</thead>
<tbody>
<% @metric_results.each do |metric_result| %>
<% metric_configuration_snapshot = metric_result.metric_configuration_snapshot%>
<% range_snapshot = metric_configuration_snapshot.range_snapshot %>
<% formatted_name = MezuroPlugin::Helpers::ContentViewerHelper.format_name(metric_configuration_snapshot) %>
<% if !range_snapshot.nil? %>
<tr>
<td style="width: 74%"><a href="#" show-metric-history="<%= formatted_name %>" data-module-name="<%= module_name %>"><%= metric_configuration_snapshot.metric.name %></a></td>
<td><%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_result.value) %></td>
<td><%= metric_configuration_snapshot.weight %></td>
<td style="background-color: #<%= range_snapshot.color %>">
<span title="<%= range_snapshot.comments %>" >
<%= range_snapshot.label %>
</span>
</td>
</tr>
<tr class="<%= formatted_name %>" style="display: none;">
<td colspan="3">
<div id='historical-<%= formatted_name %>'>
</div>
</td>
<td align="right">
<%= range_snapshot.comments.nil? ? '' : range_snapshot.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_name %>" data-module-name="<%= module_name%>" >
<strong>
<%= _('Grade:') %>
<%= "%.02f" % @module_result.grade %>
</strong>
</a>
</td>
</tr>
</tfoot>
</table>
</div>