From 625f988066b1344f94cbc86a31cd1a631d24359c Mon Sep 17 00:00:00 2001 From: Carlos Morais Date: Wed, 15 Feb 2012 21:20:53 -0200 Subject: [PATCH] Adjustments --- plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb | 6 +++--- plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb | 4 ++-- plugins/mezuro/views/content_viewer/_module_result.rhtml | 22 +++++++++++++--------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb b/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb index 9888679..990a28b 100644 --- a/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb +++ b/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb @@ -2,10 +2,10 @@ class MezuroPluginProfileController < ProfileController append_view_path File.join(File.dirname(__FILE__) + '/../views') - def metrics + def module_result project_content = profile.articles.find(params[:id]) - module_name = params[:module_name] - render :partial => 'content_viewer/module_result', :locals => { :module_result => project_content.module_result(module_name) } + module_result = project_content.module_result(params[:module_name]) + render :partial => 'content_viewer/module_result', :locals => { :module_result => module_result} end def autoreload diff --git a/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb b/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb index 47622f0..cafd637 100644 --- a/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb +++ b/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb @@ -1,11 +1,11 @@ require 'test_helper' -class MezuroPluginProfileControllerTest < ActiveSupport::TestCase +class MezuroPluginProfileControllerTest < ActionController::TestCase def setup @controller = MezuroPluginProfileController.new @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new + @response = ActionController::TestResponse.new @profile = fast_create(Community) @profile_id = @profile.identifier end diff --git a/plugins/mezuro/views/content_viewer/_module_result.rhtml b/plugins/mezuro/views/content_viewer/_module_result.rhtml index 39f7657..cf4ec24 100644 --- a/plugins/mezuro/views/content_viewer/_module_result.rhtml +++ b/plugins/mezuro/views/content_viewer/_module_result.rhtml @@ -1,11 +1,11 @@ -
<%= _('Metric Result') %>
- - <%= _('Module:') %> - <%= module_result.module.name %> - -
+<% the_module = module_result.module %> +<% module_label = "#{the_module.name} (#{the_module.granularity})" %> + +
<%= _('Metric results for: ') + module_label %>
+
- + +
@@ -17,11 +17,15 @@ <% module_result.metric_results.each do |metric_result| %> <% range = metric_result.range %> - + - + <% if range.nil? %> + + <% else %> + + <% end %> <% end %> -- libgit2 0.21.2
Metric
<%= metric_result.metric.name %> <%= metric_result.value %> <%= metric_result.weight %><%= range.label %><%= range.label %>