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 | 12 | end |
| 13 | 13 | |
| 14 | 14 | def self.processing_with_date_of(repository_id, date) |
| 15 | + date = date.is_a?(String) ? DateTime.parse(date) : date | |
| 15 | 16 | if has_processing_after(repository_id, date) |
| 16 | 17 | first_processing_after(repository_id, date) |
| 17 | 18 | elsif has_processing_before(repository_id, date) | ... | ... |
plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb
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 | 17 | //TODO review for project history |
| 18 | 18 | function display_metric_history() { |
| 19 | 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 | 24 | callAction('module_result', 'metric_result_history', {metric_name: metric_name, module_result_id: module_result_id}, show_metrics); |
| 24 | 25 | return false; |
| 25 | 26 | } | ... | ... |
plugins/mezuro/views/mezuro_plugin_module_result/_metric_results.rhtml
| ... | ... | @@ -10,10 +10,11 @@ |
| 10 | 10 | <% @metric_results.each do |metric_result| %> |
| 11 | 11 | <% metric_configuration_snapshot = metric_result.metric_configuration_snapshot%> |
| 12 | 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 | 15 | <% if !range_snapshots.nil? %> |
| 15 | 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 | 18 | <td><%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_result.value) %></td> |
| 18 | 19 | <td><%= metric_configuration_snapshot.weight %></td> |
| 19 | 20 | <% range_snapshots.each do |range_snapshot| %> | ... | ... |
plugins/mezuro/views/mezuro_plugin_module_result/_source_tree.rhtml
| 1 | 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 | 4 | <% module_label = "#{module_name} (#{module_result.module.granularity})" %> |
| 4 | 5 | |
| 5 | 6 | <p> |
| 6 | 7 | <h2 class="path"> |
| 7 | 8 | <% module_result.parents.each do |parent| %> |
| 8 | 9 | /<a href="#" class="source-tree-link" data-module-id="<%= parent.id %>"> |
| 9 | - <%= parent.module.name %> | |
| 10 | + <%= helper.module_name parent.module.name %> | |
| 10 | 11 | </a> |
| 11 | - <% end %> | |
| 12 | + <% end %>/ <%= helper.module_name module_name %> | |
| 12 | 13 | </h2> |
| 13 | 14 | </p> |
| 14 | 15 | |
| ... | ... | @@ -17,14 +18,14 @@ |
| 17 | 18 | <% if child.module.granularity=='PACKAGE' %> |
| 18 | 19 | <tr> |
| 19 | 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 | 22 | </tr> |
| 22 | 23 | <% else %> |
| 23 | 24 | <tr> |
| 24 | 25 | <td class="icon"><%= image_tag('/plugins/mezuro/images/file.png') %></td> |
| 25 | 26 | <td class="source-tree-text"> |
| 26 | 27 | <a href='#' class="source-tree-link" data-module-id="<%= child.id %>"> |
| 27 | - <%= child.module.name %> | |
| 28 | + <%= helper.module_name child.module.name %> | |
| 28 | 29 | </a> |
| 29 | 30 | </td> |
| 30 | 31 | </tr> | ... | ... |
plugins/mezuro/views/mezuro_plugin_processing/_processing.rhtml
| ... | ... | @@ -25,7 +25,7 @@ |
| 25 | 25 | jQuery(document).ready(function($) { |
| 26 | 26 | $("#datepicker").datepicker({ |
| 27 | 27 | onSelect: function(dateText, inst) { |
| 28 | - reloadProjectWithDate(dateText) } }); | |
| 28 | + reloadProcessingWithDate(dateText) } }); | |
| 29 | 29 | $("#datepicker").toggle(); |
| 30 | 30 | var date = jQuery("#current_processing_date").attr('data-date').substr(0,10); |
| 31 | 31 | $("#datepicker").datepicker( "setDate" , date ); | ... | ... |
plugins/mezuro/views/mezuro_plugin_repository/show.html.erb