Commit 37109e0211d3602fcbc8867a903f0b40c3dd9df7

Authored by Rafael Manzo
1 parent 649789d2

A little refactoring for module results table on repository show

app/controllers/repositories_controller.rb
... ... @@ -13,7 +13,7 @@ class RepositoriesController < ApplicationController
13 13 @processing = @repository.last_processing
14 14 if @processing.ready?
15 15 @metric_results = @processing.metric_results
16   - @module_results = @processing.root_module_result
  16 + @root_module_result = @processing.root_module_result
17 17 end
18 18 end
19 19  
... ...
app/views/repositories/_module_result.html.erb
1 1 <tr>
2 2 <td><%= module_result.module.name %></td>
3 3 <td><%= module_result.module.granularity %></td>
4   - <td><%= module_result.grade %></td>
  4 + <td><%= format_grade(module_result.grade) %></td>
5 5 </tr>
6 6 \ No newline at end of file
... ...
app/views/repositories/show.html.erb
... ... @@ -34,27 +34,29 @@
34 34 </p>
35 35 <% end %>
36 36 <% end %>
  37 +
37 38 <hr/>
  39 +
38 40 <% if @processing.ready? %>
39   - <h2>Source Tree</h2>
40   - <h3><%= @module_results.module.name %></h3>
41   - <h3><%= @module_results.grade %> </h3>
42   - <% children = @module_results.children %>
  41 + <h2>Modules Tree</h2>
  42 + <h3><%= @root_module_result.module.name %></h3>
  43 + <h3><%= format_grade(@root_module_result.grade) %> </h3>
  44 + <% children = @root_module_result.children %>
43 45 <% unless children.empty? %>
44   - <table class="table table-hover">
45   - <thead>
46   - <th>Name</th>
47   - <th>Granularity</th>
48   - <th>Grade</th>
49   - </thead>
50   - <tbody>
51   - <%= render partial: 'module_result', collection: children %>
52   - </tbody>
53   - </table>
  46 + <table class="table table-hover">
  47 + <thead>
  48 + <th>Name</th>
  49 + <th>Granularity</th>
  50 + <th>Grade</th>
  51 + </thead>
  52 + <tbody>
  53 + <%= render partial: 'module_result', collection: children %>
  54 + </tbody>
  55 + </table>
54 56 <% end %>
55   -<% end %>
56 57  
57   -<% if @processing.ready? %>
  58 + <hr/>
  59 +
58 60 <table class="table table-hover">
59 61 <thead>
60 62 <th>Metric</th>
... ...