Commit f49af0dd65da26b24aff6ea8e2f18ee8866a36c6
Committed by
Paulo Meireles
1 parent
8260f5ec
Exists in
master
and in
29 other branches
loading results by module
Showing
2 changed files
with
13 additions
and
28 deletions
Show diff stats
plugins/mezuro/views/content_viewer/_source_tree.rhtml
@@ -9,7 +9,9 @@ | @@ -9,7 +9,9 @@ | ||
9 | alt='-' src='/plugins/mezuro/images/minus.png' class='link' | 9 | alt='-' src='/plugins/mezuro/images/minus.png' class='link' |
10 | /> | 10 | /> |
11 | </td> | 11 | </td> |
12 | - <td><%= source_tree.module_name %> (<%= source_tree.granularity %>)</td> | 12 | + <td> |
13 | + <a href="#" class='mezuro-display-metrics' data-module-name='<%= source_tree.module_name %>'><%= source_tree.module_name %> (<%= source_tree.granularity %>)</a> | ||
14 | + </td> | ||
13 | </tr> | 15 | </tr> |
14 | <tr id='<%= source_tree.module_name %>_hidden'> | 16 | <tr id='<%= source_tree.module_name %>_hidden'> |
15 | <td></td> | 17 | <td></td> |
@@ -24,7 +26,9 @@ | @@ -24,7 +26,9 @@ | ||
24 | <table> | 26 | <table> |
25 | <tr> | 27 | <tr> |
26 | <td width='1'></td> | 28 | <td width='1'></td> |
27 | - <td><%= source_tree.module_name %> (<%= source_tree.granularity %>)</td> | 29 | + <td> |
30 | + <a href="#" class='mezuro-display-metrics' data-module-name='<%= source_tree.module_name %>'><%= source_tree.module_name %> (<%= source_tree.granularity %>)</a> | ||
31 | + </td> | ||
28 | </tr> | 32 | </tr> |
29 | </table> | 33 | </table> |
30 | <% end %> | 34 | <% end %> |
plugins/mezuro/views/content_viewer/show_project.rhtml
@@ -68,29 +68,10 @@ | @@ -68,29 +68,10 @@ | ||
68 | </table> | 68 | </table> |
69 | <h5><%= _('Source tree') %></h5> | 69 | <h5><%= _('Source tree') %></h5> |
70 | <%= render :partial => 'source_tree', :locals => { :source_tree => @project_result.source_tree } %> | 70 | <%= render :partial => 'source_tree', :locals => { :source_tree => @project_result.source_tree } %> |
71 | - | ||
72 | - <% @module_result = @page.module_result(@project.name) %> | ||
73 | - | ||
74 | - <h5><%= _('Metric Result') %> </h5> | ||
75 | - <strong> | ||
76 | - <%= _('Module:') %> | ||
77 | - <%= @module_result.module.name %> | ||
78 | - <br/> | ||
79 | - <%= _('Grade:') %> | ||
80 | - <%= @module_result.grade %> | ||
81 | - </strong> | ||
82 | - <br/> | ||
83 | - <hr/> | ||
84 | - <table id="project_metric_result"> | ||
85 | - <% @module_result.metric_results.each do |metric_result| %> | ||
86 | - <tr> | ||
87 | - <td><%= metric_result.metric.name %></td> | ||
88 | - <td><%= metric_result.value %></td> | ||
89 | - <% range = metric_result.range %> | ||
90 | - <td style="background-color: #<%= range.color[2..-1] %>"><%= range.label %></td> | ||
91 | - </tr> | ||
92 | - | ||
93 | - <% end %> | ||
94 | - </table> | ||
95 | - | ||
96 | -<% end %> | 71 | + <div id='module-result' data-project-id='<%= @page.id %>'> |
72 | + <%= render :partial => 'module_result', :locals => { :module_result => @page.module_result(@project.name) } %> | ||
73 | + </div> | ||
74 | + <script> | ||
75 | + jQuery(results); | ||
76 | + </script> | ||
77 | +<% end %> | ||
97 | \ No newline at end of file | 78 | \ No newline at end of file |