diff --git a/plugins/mezuro/controllers/mezuro_plugin_myprofile_controller.rb b/plugins/mezuro/controllers/mezuro_plugin_myprofile_controller.rb index 1b470c8..47427c0 100644 --- a/plugins/mezuro/controllers/mezuro_plugin_myprofile_controller.rb +++ b/plugins/mezuro/controllers/mezuro_plugin_myprofile_controller.rb @@ -99,14 +99,6 @@ class MezuroPluginMyprofileController < ProfileController redirect_to "/#{profile.identifier}/#{configuration_name.downcase.gsub(/\s/, '-')}" end - def module_metrics_history - metric_name = params[:metric_name] - content = profile.articles.find(params[:id]) - module_history = content.result_history(params[:module_name]) - 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] } - render :partial => 'content_viewer/metric_history', :locals => {:metric_history => metric_history, :date_history => date_history } - end private def new_metric_configuration_instance diff --git a/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb b/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb index 1adb57b..e51fa22 100644 --- a/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb +++ b/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb @@ -40,5 +40,13 @@ class MezuroPluginProfileController < ProfileController source_tree = project_result.node_of(params[:module_name]) render :partial =>'content_viewer/source_tree', :locals => { :source_tree => source_tree, :project_name => content.project.name} end - + + def module_metrics_history + metric_name = params[:metric_name] + content = profile.articles.find(params[:id]) + module_history = content.result_history(params[:module_name]) + 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] } + 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 4293aff..9e155a3 100644 --- a/plugins/mezuro/views/content_viewer/_metric_history.rhtml +++ b/plugins/mezuro/views/content_viewer/_metric_history.rhtml @@ -1,14 +1,10 @@
<%= date %> | - <% end %> -|
- <%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_result.value) %> - | - <% end %> -|
<%= date %> | +<%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_history[cont].value) %> | +