Commit df4312de7badb6be1f918856b7bc27f8eb864de5
Exists in
master
and in
28 other branches
Merge branch 'refactoring_js' of gitorious.org:+mezuro/noosfero/mezuro into refactoring_js
Showing
8 changed files
with
23 additions
and
13 deletions
Show diff stats
plugins/mezuro/lib/kalibro/processing.rb
@@ -12,6 +12,7 @@ class Kalibro::Processing < Kalibro::Model | @@ -12,6 +12,7 @@ class Kalibro::Processing < Kalibro::Model | ||
12 | end | 12 | end |
13 | 13 | ||
14 | def self.processing_with_date_of(repository_id, date) | 14 | def self.processing_with_date_of(repository_id, date) |
15 | + date = date.is_a?(String) ? DateTime.parse(date) : date | ||
15 | if has_processing_after(repository_id, date) | 16 | if has_processing_after(repository_id, date) |
16 | first_processing_after(repository_id, date) | 17 | first_processing_after(repository_id, date) |
17 | elsif has_processing_before(repository_id, date) | 18 | elsif has_processing_before(repository_id, date) |
plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb
@@ -43,7 +43,6 @@ class MezuroPlugin::Helpers::ContentViewerHelper | @@ -43,7 +43,6 @@ class MezuroPlugin::Helpers::ContentViewerHelper | ||
43 | ) | 43 | ) |
44 | end | 44 | end |
45 | 45 | ||
46 | - | ||
47 | def self.format_name(metric_configuration_snapshot) | 46 | def self.format_name(metric_configuration_snapshot) |
48 | metric_configuration_snapshot.metric.name.delete("() ") | 47 | metric_configuration_snapshot.metric.name.delete("() ") |
49 | end | 48 | end |
plugins/mezuro/lib/mezuro_plugin/helpers/module_result_helper.rb
0 → 100644
plugins/mezuro/public/javascripts/processing.js
@@ -17,9 +17,10 @@ function showProcessing() { | @@ -17,9 +17,10 @@ function showProcessing() { | ||
17 | //TODO review for project history | 17 | //TODO review for project history |
18 | function display_metric_history() { | 18 | function display_metric_history() { |
19 | var module_result_id = jQuery(this).attr('data-module-id'); | 19 | var module_result_id = jQuery(this).attr('data-module-id'); |
20 | - var metric_name = jQuery(this).attr('show-metric-history'); | ||
21 | - toggle_mezuro("." + metric_name); | ||
22 | - metricName = metric_name; | 20 | + var formatted_name = jQuery(this).attr('show-metric-history'); |
21 | + var metric_name = jQuery(this).attr('data-metric-name'); | ||
22 | + toggle_mezuro("." + formatted_name); | ||
23 | + metricName = formatted_name; | ||
23 | callAction('module_result', 'metric_result_history', {metric_name: metric_name, module_result_id: module_result_id}, show_metrics); | 24 | callAction('module_result', 'metric_result_history', {metric_name: metric_name, module_result_id: module_result_id}, show_metrics); |
24 | return false; | 25 | return false; |
25 | } | 26 | } |
plugins/mezuro/views/mezuro_plugin_module_result/_metric_results.rhtml
@@ -10,10 +10,11 @@ | @@ -10,10 +10,11 @@ | ||
10 | <% @metric_results.each do |metric_result| %> | 10 | <% @metric_results.each do |metric_result| %> |
11 | <% metric_configuration_snapshot = metric_result.metric_configuration_snapshot%> | 11 | <% metric_configuration_snapshot = metric_result.metric_configuration_snapshot%> |
12 | <% range_snapshots = metric_configuration_snapshot.range_snapshot %> | 12 | <% range_snapshots = metric_configuration_snapshot.range_snapshot %> |
13 | - <% formatted_name = MezuroPlugin::Helpers::ContentViewerHelper.format_name(metric_configuration_snapshot) %> | 13 | + <% metric_name = metric_configuration_snapshot.metric.name %> |
14 | + <% formatted_name = metric_name.delete("() ") %> | ||
14 | <% if !range_snapshots.nil? %> | 15 | <% if !range_snapshots.nil? %> |
15 | <tr> | 16 | <tr> |
16 | - <td style="width: 74%"><a href="#" show-metric-history="<%= formatted_name %>" data-module-id="<%= @module_result.id %>"><%= metric_configuration_snapshot.metric.name %></a></td> | 17 | + <td style="width: 74%"><a href="#" show-metric-history="<%= formatted_name %>" data-metric-name="<%= metric_name %>" data-module-id="<%= @module_result.id %>"><%= metric_name %></a></td> |
17 | <td><%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_result.value) %></td> | 18 | <td><%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_result.value) %></td> |
18 | <td><%= metric_configuration_snapshot.weight %></td> | 19 | <td><%= metric_configuration_snapshot.weight %></td> |
19 | <% range_snapshots.each do |range_snapshot| %> | 20 | <% range_snapshots.each do |range_snapshot| %> |
plugins/mezuro/views/mezuro_plugin_module_result/_source_tree.rhtml
1 | <h4><%= _('Source tree') %></h4> | 1 | <h4><%= _('Source tree') %></h4> |
2 | -<% module_name = module_result.module.name %> | 2 | +<% helper = MezuroPlugin::Helpers::ModuleResultHelper %> |
3 | +<% module_name = helper.module_name(module_result.module.name) %> | ||
3 | <% module_label = "#{module_name} (#{module_result.module.granularity})" %> | 4 | <% module_label = "#{module_name} (#{module_result.module.granularity})" %> |
4 | 5 | ||
5 | <p> | 6 | <p> |
6 | <h2 class="path"> | 7 | <h2 class="path"> |
7 | <% module_result.parents.each do |parent| %> | 8 | <% module_result.parents.each do |parent| %> |
8 | /<a href="#" class="source-tree-link" data-module-id="<%= parent.id %>"> | 9 | /<a href="#" class="source-tree-link" data-module-id="<%= parent.id %>"> |
9 | - <%= parent.module.name %> | 10 | + <%= helper.module_name parent.module.name %> |
10 | </a> | 11 | </a> |
11 | - <% end %> | 12 | + <% end %>/ <%= helper.module_name module_name %> |
12 | </h2> | 13 | </h2> |
13 | </p> | 14 | </p> |
14 | 15 | ||
@@ -17,14 +18,14 @@ | @@ -17,14 +18,14 @@ | ||
17 | <% if child.module.granularity=='PACKAGE' %> | 18 | <% if child.module.granularity=='PACKAGE' %> |
18 | <tr> | 19 | <tr> |
19 | <td class="icon"><%= image_tag('/plugins/mezuro/images/folder.png')%></td> | 20 | <td class="icon"><%= image_tag('/plugins/mezuro/images/folder.png')%></td> |
20 | - <td class="source-tree-text"><a href='#' class="source-tree-link" data-module-id="<%= child.id %>"><%= child.module.name %></a></td> | 21 | + <td class="source-tree-text"><a href='#' class="source-tree-link" data-module-id="<%= child.id %>"><%= helper.module_name child.module.name %></a></td> |
21 | </tr> | 22 | </tr> |
22 | <% else %> | 23 | <% else %> |
23 | <tr> | 24 | <tr> |
24 | <td class="icon"><%= image_tag('/plugins/mezuro/images/file.png') %></td> | 25 | <td class="icon"><%= image_tag('/plugins/mezuro/images/file.png') %></td> |
25 | <td class="source-tree-text"> | 26 | <td class="source-tree-text"> |
26 | <a href='#' class="source-tree-link" data-module-id="<%= child.id %>"> | 27 | <a href='#' class="source-tree-link" data-module-id="<%= child.id %>"> |
27 | - <%= child.module.name %> | 28 | + <%= helper.module_name child.module.name %> |
28 | </a> | 29 | </a> |
29 | </td> | 30 | </td> |
30 | </tr> | 31 | </tr> |
plugins/mezuro/views/mezuro_plugin_processing/_processing.rhtml
@@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
25 | jQuery(document).ready(function($) { | 25 | jQuery(document).ready(function($) { |
26 | $("#datepicker").datepicker({ | 26 | $("#datepicker").datepicker({ |
27 | onSelect: function(dateText, inst) { | 27 | onSelect: function(dateText, inst) { |
28 | - reloadProjectWithDate(dateText) } }); | 28 | + reloadProcessingWithDate(dateText) } }); |
29 | $("#datepicker").toggle(); | 29 | $("#datepicker").toggle(); |
30 | var date = jQuery("#current_processing_date").attr('data-date').substr(0,10); | 30 | var date = jQuery("#current_processing_date").attr('data-date').substr(0,10); |
31 | $("#datepicker").datepicker( "setDate" , date ); | 31 | $("#datepicker").datepicker( "setDate" , date ); |
plugins/mezuro/views/mezuro_plugin_repository/show.html.erb
1 | <script src="/plugins/mezuro/javascripts/processing.js" type="text/javascript"></script> | 1 | <script src="/plugins/mezuro/javascripts/processing.js" type="text/javascript"></script> |
2 | -<h3><%= @project_name %></h3> | 2 | +<h3><a href="/<%= @data_profile %>/<%= @project_name %>"><%= @project_name %></a></h3> |
3 | 3 | ||
4 | <table> | 4 | <table> |
5 | <tr> | 5 | <tr> |