_module_result.rhtml
1.87 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
<% the_module = module_result.module %>
<% module_label = "#{the_module.name} (#{the_module.granularity})" %>
<h5><%= _('Metric results for: ') + module_label %> </h5>
<hr/>
<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="#" data-show=".<%= metric_result.metric.name.delete("() ")%>"><%= 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="<%= metric_result.metric.name.delete("() ")%>" style="display: none;">
<td colspan="4">
<div id='historical-<%= metric_result.metric.name.delete("() ") %>'>
<a href="#" show-metric-history="<%= metric_result.metric.name.delete("() ") %>" data-module-name="<%= the_module.name %>" data-metric-name="<%= metric_result.metric.name.delete("() ") %>"> <p style="text-indent: 3em;"> Get Historical Values </p> </a>
</div>
</td>
<td colspan="3" align="right">
<%= range.comments.nil? ? '' : range.comments %>
</td>
</tr>
<% end %>
<% end %>
</tbody>
<tfoot>
<tr>
<td colspan = "1">
<div id='historical-grade'>
</td>
<td colspan = "4" align = "right">
<a href="#" show-grade-history="<%= module_result.module.name %>" >
<strong>
<%= _('Grade:') %>
<%= "%.02f" % module_result.grade %>
</strong>
</a>
</td>
</tr>
</tfoot>
</table>