Commit 76ebb50bf5ee70d893aa5dec5cdca1af6a67b044

Authored by Caio
Committed by Paulo Meireles
2 parents 410dee68 77d90f91

[Mezuro] Merge branch 'mezuro' into date_tests2

Conflicts:
	plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb
	plugins/mezuro/lib/mezuro_plugin/project_content.rb
plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb
... ... @@ -38,14 +38,13 @@ class MezuroPluginProfileController < ProfileController
38 38 source_tree = project_result.node_of(params[:module_name])
39 39 render :partial =>'content_viewer/source_tree', :locals => { :source_tree => source_tree, :project_name => content.project.name}
40 40 end
41   -
  41 +
42 42 def module_metrics_history
43 43 metric_name = params[:metric_name]
44 44 content = profile.articles.find(params[:id])
45 45 module_history = content.result_history(params[:module_name])
46   - date_history = module_history.collect { |x| x.date }
  46 + date_history = module_history.collect { |x| x.date }
47 47 metric_history = module_history.collect { |x| (x.metric_results.select { |y| y.metric.name.delete("() ") == metric_name })[0] }
48 48 render :partial => 'content_viewer/metric_history', :locals => {:metric_history => metric_history, :date_history => date_history }
49 49 end
50   -
51 50 end
... ...
plugins/mezuro/lib/mezuro_plugin/project_content.rb
... ... @@ -30,7 +30,7 @@ class MezuroPlugin::ProjectContent < Article
30 30 end
31 31  
32 32 def get_date_result(date)
33   - client = Kalibro::Client::ProjectResultClient.new
  33 + client = Kalibro::Client::ProjectResultClient.new
34 34 @project_result ||= client.has_results_before(name, date) ? client.last_result_before(name, date) : client.first_result_after(name, date)
35 35 end
36 36  
... ...
plugins/mezuro/views/content_viewer/_metric_history.rhtml
1 1 <table width="100%">
2   - <tr>
3   - <% date_history.each do |date| %>
4   - <td> <b> <%= date %> </b> </td>
5   - <% end %>
6   - </tr>
7   - <tr>
8   - <% metric_history.each do |metric_result| %>
9   - <td>
10   - <%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_result.value) %>
11   - </td>
12   - <% end %>
13   - </tr>
  2 + <% cont = 0 %>
  3 + <% date_history.each do |date| %>
  4 + <tr>
  5 + <td width="70%"> <b> <%= date %> </b> </td>
  6 + <td width="30%"> <%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_history[cont].value) %> </td>
  7 + </tr>
  8 + <% cont = cont + 1 %>
  9 + <% end %>
14 10 </table>
... ...
plugins/mezuro/views/content_viewer/_module_result.rhtml
... ... @@ -27,7 +27,7 @@
27 27 <tr class="<%= metric_result.metric.name.delete("() ")%>" style="display: none;">
28 28 <td colspan="4">
29 29 <div id='historical-<%= metric_result.metric.name.delete("() ") %>'>
30   - <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>
  30 + <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;"> Get Historical Values </p> </a>
31 31 </div>
32 32 </td>
33 33 <td colspan="3" align="right">
... ...