Commit efbb3df738767183a21eab7170eef38022a5a0b7
Committed by
Paulo Meireles
1 parent
985de895
Exists in
staging
and in
42 other branches
Show metric weight on results
Showing
2 changed files
with
5 additions
and
6 deletions
Show diff stats
plugins/mezuro/lib/kalibro/entities/metric_result.rb
| 1 | class Kalibro::Entities::MetricResult < Kalibro::Entities::Entity | 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 | def metric=(value) | 5 | def metric=(value) |
| 6 | if value.kind_of?(Hash) | 6 | if value.kind_of?(Hash) |
| @@ -30,4 +30,4 @@ class Kalibro::Entities::MetricResult < Kalibro::Entities::Entity | @@ -30,4 +30,4 @@ class Kalibro::Entities::MetricResult < Kalibro::Entities::Entity | ||
| 30 | @descendent_result = descendent_results | 30 | @descendent_result = descendent_results |
| 31 | end | 31 | end |
| 32 | 32 | ||
| 33 | -end | ||
| 34 | \ No newline at end of file | 33 | \ No newline at end of file |
| 34 | +end |
plugins/mezuro/views/content_viewer/_module_result.rhtml
| 1 | -<!-- ToDo --> | ||
| 2 | <h5><%= _('Metric Result') %> </h5> | 1 | <h5><%= _('Metric Result') %> </h5> |
| 3 | <strong> | 2 | <strong> |
| 4 | <%= _('Module:') %> | 3 | <%= _('Module:') %> |
| @@ -11,7 +10,7 @@ | @@ -11,7 +10,7 @@ | ||
| 11 | <tr> | 10 | <tr> |
| 12 | <th>Metric</th> | 11 | <th>Metric</th> |
| 13 | <th>Value</th> | 12 | <th>Value</th> |
| 14 | - <!-- <th>Weight</th> --> | 13 | + <th>Weight</th> |
| 15 | <th>Threshold</th> | 14 | <th>Threshold</th> |
| 16 | </tr> | 15 | </tr> |
| 17 | </thead> | 16 | </thead> |
| @@ -20,7 +19,7 @@ | @@ -20,7 +19,7 @@ | ||
| 20 | <tr> | 19 | <tr> |
| 21 | <td><%= metric_result.metric.name %></td> | 20 | <td><%= metric_result.metric.name %></td> |
| 22 | <td><%= metric_result.value %></td> | 21 | <td><%= metric_result.value %></td> |
| 23 | - <!-- <td><%= metric_result.weight %></td> --> | 22 | + <td><%= metric_result.weight %></td> |
| 24 | <% range = metric_result.range %> | 23 | <% range = metric_result.range %> |
| 25 | <td style="background-color: #<%= range.color[2..-1] %>"><%= range.label %></td> | 24 | <td style="background-color: #<%= range.color[2..-1] %>"><%= range.label %></td> |
| 26 | </tr> | 25 | </tr> |
| @@ -28,7 +27,7 @@ | @@ -28,7 +27,7 @@ | ||
| 28 | </tbody> | 27 | </tbody> |
| 29 | <tfoot> | 28 | <tfoot> |
| 30 | <tr> | 29 | <tr> |
| 31 | - <td colspan = "3" align = "right"> | 30 | + <td colspan = "4" align = "right"> |
| 32 | <strong> | 31 | <strong> |
| 33 | <%= _('Grade:') %> | 32 | <%= _('Grade:') %> |
| 34 | <%= module_result.grade %> | 33 | <%= module_result.grade %> |