Commit 3cdc22b2c074539738091514d3e6a05d4ac2b4e5
Committed by
Rafael Manzo
1 parent
0b587c59
Exists in
master
and in
29 other branches
[Mezuro] Created helper for slicing numbers
Showing
2 changed files
with
9 additions
and
2 deletions
Show diff stats
plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb
0 → 100644
plugins/mezuro/views/content_viewer/_module_result.rhtml
| 1 | +<% require "#{RAILS_ROOT}/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb" %> | |
| 2 | + | |
| 1 | 3 | <% the_module = module_result.module %> |
| 2 | 4 | <% module_label = "#{the_module.name} (#{the_module.granularity})" %> |
| 3 | 5 | |
| ... | ... | @@ -19,7 +21,7 @@ |
| 19 | 21 | <% range = metric_result.range %> |
| 20 | 22 | <tr> |
| 21 | 23 | <td><a href="#" data-show=".<%= metric_result.metric.name.delete("() ")%>"><%= metric_result.metric.name %></a></td> |
| 22 | - <td><%= metric_result.value.slice(/[0-9]+\.[0-9]{1,2}/) %></td> <!--FIXME: Move to helper eventually--> | |
| 24 | + <td><%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_result.value) %></td> <!--FIXME: Move to helper eventually--> | |
| 23 | 25 | <td><%= metric_result.weight %></td> |
| 24 | 26 | <% if range.nil? %> |
| 25 | 27 | <td></td> |
| ... | ... | @@ -39,7 +41,7 @@ |
| 39 | 41 | <td colspan = "4" align = "right"> |
| 40 | 42 | <strong> |
| 41 | 43 | <%= _('Grade:') %> |
| 42 | - <%= module_result.grade.slice(/[0-9]+\.[0-9]{1,2}/) %> <!--FIXME: Move to helper eventually --> | |
| 44 | + <%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(module_result.grade) %> <!--FIXME: Move to helper eventually --> | |
| 43 | 45 | </strong> |
| 44 | 46 | </td> |
| 45 | 47 | </tr> | ... | ... |