Commit 8f41190ea335e83dc56f3a14bef150dc83ec03b6

Authored by Renan Teruo + Diego Araujo
Committed by Paulo Meireles
1 parent 230c1aa5

[Mezuro] Partial is now rendered at the right place. Also, partial is in repository.

plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb
@@ -126,9 +126,6 @@ class MezuroPluginProfileController < ProfileController @@ -126,9 +126,6 @@ class MezuroPluginProfileController < ProfileController
126 126
127 def module_metrics_history 127 def module_metrics_history
128 metric_name = params[:metric_name] 128 metric_name = params[:metric_name]
129 - for i in 1..50 do  
130 - puts metric_name  
131 - end  
132 content = profile.articles.find(params[:id]) 129 content = profile.articles.find(params[:id])
133 module_history = content.result_history(params[:module_name]) 130 module_history = content.result_history(params[:module_name])
134 metric_history = module_history.collect { |x| (x.metric_results.select { |y| y.metric.name == metric_name })[0] } 131 metric_history = module_history.collect { |x| (x.metric_results.select { |y| y.metric.name == metric_name })[0] }
plugins/mezuro/public/javascripts/project_content.js
1 var processingTree = false; 1 var processingTree = false;
  2 +var metricName;
2 jQuery(function (){ 3 jQuery(function (){
3 jQuery('.source-tree-link').live("click", reloadModule); 4 jQuery('.source-tree-link').live("click", reloadModule);
4 jQuery('[data-show]').live("click", toggle_mezuro); 5 jQuery('[data-show]').live("click", toggle_mezuro);
5 - //alert('AAAASDFAGSGDRSAFGHADFGSDFGSD');  
6 jQuery('[show-metric-history]').live("click", display_metric_history); 6 jQuery('[show-metric-history]').live("click", display_metric_history);
7 showLoadingProcess(true); 7 showLoadingProcess(true);
8 showProjectContent(); 8 showProjectContent();
@@ -15,14 +15,13 @@ function showProjectContent() { @@ -15,14 +15,13 @@ function showProjectContent() {
15 function display_metric_history() { 15 function display_metric_history() {
16 var module_name = jQuery(this).attr('data-module-name'); 16 var module_name = jQuery(this).attr('data-module-name');
17 var metric_name = jQuery(this).attr('data-metric-name'); 17 var metric_name = jQuery(this).attr('data-metric-name');
18 - alert (metric_name);  
19 - callAction('module_metrics_history', {module_name: module_name, metric_name: metric_name}, show_metrics)//metric_name, module_name}, show_metrics); 18 + metricName = metric_name;
  19 + callAction('module_metrics_history', {module_name: module_name, metric_name: metric_name}, show_metrics);
  20 + return false;
20 } 21 }
21 22
22 function show_metrics(content) { 23 function show_metrics(content) {
23 - alert('SSSSSSSSSSS');  
24 - jQuery('#historical').html(content);  
25 - 24 + jQuery('#historical-' + metricName).html(content);
26 } 25 }
27 26
28 function toggle_mezuro(){ 27 function toggle_mezuro(){
plugins/mezuro/views/content_viewer/_metric_history.rhtml 0 → 100644
@@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
  1 +<br>
  2 +<h5> TESTANDO </h5>
plugins/mezuro/views/content_viewer/_module_result.rhtml
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 <%= range.nil? or range.comments.nil? ? 'comment empty' : range.comments %> 32 <%= range.nil? or range.comments.nil? ? 'comment empty' : range.comments %>
33 </td> 33 </td>
34 <td> 34 <td>
35 - <div id='historical'> 35 + <div id='historical-<%= metric_result.metric.name.delete("() ") %>'>
36 <a href="#" show-metric-history="<%= metric_result.metric.name.delete("() ") %>" data-module-name="<%= the_module.name %>" data-metric-name="<%= metric_result.metric.name.delete("() ") %>"> <p style="text-indent: 3em;"> Draw Historical Graphic </p> </a> 36 <a href="#" show-metric-history="<%= metric_result.metric.name.delete("() ") %>" data-module-name="<%= the_module.name %>" data-metric-name="<%= metric_result.metric.name.delete("() ") %>"> <p style="text-indent: 3em;"> Draw Historical Graphic </p> </a>
37 </div> 37 </div>
38 </td> 38 </td>