diff --git a/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb b/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb index 68fb686..95e2798 100644 --- a/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb +++ b/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb @@ -128,9 +128,10 @@ class MezuroPluginProfileController < ProfileController metric_name = params[:metric_name] content = profile.articles.find(params[:id]) module_history = content.result_history(params[:module_name]) - metric_history = module_history.collect { |x| (x.metric_results.select { |y| y.metric.name == metric_name })[0] } + date_history = module_history.collect { |x| x.date } + metric_history = module_history.collect { |x| (x.metric_results.select { |y| y.metric.name.delete("() ") == metric_name })[0] } #precisamos que uma variável receba um array com os valores da métrica passada a partir do result history - render :partial => 'content_viewer/metric_history', :locals => {:metric_history => metric_history } +render :partial => 'content_viewer/metric_history', :locals => {:metric_history => metric_history, :date_history => date_history } end end diff --git a/plugins/mezuro/views/content_viewer/_metric_history.rhtml b/plugins/mezuro/views/content_viewer/_metric_history.rhtml index 2c5beb5..4293aff 100644 --- a/plugins/mezuro/views/content_viewer/_metric_history.rhtml +++ b/plugins/mezuro/views/content_viewer/_metric_history.rhtml @@ -1,2 +1,14 @@ -
-
TESTANDO
+ + + <% date_history.each do |date| %> + + <% end %> + + + <% metric_history.each do |metric_result| %> + + <% end %> + +
<%= date %>
+ <%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_result.value) %> +
diff --git a/plugins/mezuro/views/content_viewer/_module_result.rhtml b/plugins/mezuro/views/content_viewer/_module_result.rhtml index 37f0473..93d3bf4 100644 --- a/plugins/mezuro/views/content_viewer/_module_result.rhtml +++ b/plugins/mezuro/views/content_viewer/_module_result.rhtml @@ -32,6 +32,7 @@ <%= range.nil? or range.comments.nil? ? 'comment empty' : range.comments %> +
" data-module-name="<%= the_module.name %>" data-metric-name="<%= metric_result.metric.name.delete("() ") %>">

Draw Historical Graphic

-- libgit2 0.21.2