Commit efbb3df738767183a21eab7170eef38022a5a0b7

Authored by Diego Camarinha
Committed by Paulo Meireles
1 parent 985de895

Show metric weight on results

plugins/mezuro/lib/kalibro/entities/metric_result.rb
1 1 class Kalibro::Entities::MetricResult < Kalibro::Entities::Entity
2 2  
3   - attr_accessor :metric, :value, :range, :descendent_result
  3 + attr_accessor :metric, :value, :range, :descendent_result, :weight
4 4  
5 5 def metric=(value)
6 6 if value.kind_of?(Hash)
... ... @@ -30,4 +30,4 @@ class Kalibro::Entities::MetricResult &lt; Kalibro::Entities::Entity
30 30 @descendent_result = descendent_results
31 31 end
32 32  
33   -end
34 33 \ No newline at end of file
  34 +end
... ...
plugins/mezuro/views/content_viewer/_module_result.rhtml
1   -<!-- ToDo -->
2 1 <h5><%= _('Metric Result') %> </h5>
3 2 <strong>
4 3 <%= _('Module:') %>
... ... @@ -11,7 +10,7 @@
11 10 <tr>
12 11 <th>Metric</th>
13 12 <th>Value</th>
14   - <!-- <th>Weight</th> -->
  13 + <th>Weight</th>
15 14 <th>Threshold</th>
16 15 </tr>
17 16 </thead>
... ... @@ -20,7 +19,7 @@
20 19 <tr>
21 20 <td><%= metric_result.metric.name %></td>
22 21 <td><%= metric_result.value %></td>
23   - <!-- <td><%= metric_result.weight %></td> -->
  22 + <td><%= metric_result.weight %></td>
24 23 <% range = metric_result.range %>
25 24 <td style="background-color: #<%= range.color[2..-1] %>"><%= range.label %></td>
26 25 </tr>
... ... @@ -28,7 +27,7 @@
28 27 </tbody>
29 28 <tfoot>
30 29 <tr>
31   - <td colspan = "3" align = "right">
  30 + <td colspan = "4" align = "right">
32 31 <strong>
33 32 <%= _('Grade:') %>
34 33 <%= module_result.grade %>
... ...