app/views/index.html.erb in attractor-0.3.4 vs app/views/index.html.erb in attractor-0.4.0
- old
+ new
@@ -17,20 +17,25 @@
<div class="row mt-4">
<div class="col-12">
<div class="card">
<div class="card-body">
<h5 class="card-title">Churn vs Complexity</h5>
- <div class="d-flex justify-items-center">
- <div id="graph"></div>
- </div>
+ <% if@serve_static %>
+ <div class="d-flex justify-items-center">
+ <div id="graph"></div>
+ </div>
+ <% else %>
+ <div id="react-graph"></div>
+ <% end %>
</div>
</div>
</div>
</div>
<div class="row mt-3">
<div class="col-12">
+ <% if @serve_static %>
<div class="card">
<div class="card-body">
<h5 class="card-title">Refactoring Candidates</h5>
<h6 class="card-subtitle text-muted">Top 95 Percentile of Churn * Complexity</h6>
<table class="table mt-4">
@@ -41,28 +46,30 @@
<th scope="col">Complexity</th>
<th scope="col">Churn * Complexity</th>
</tr>
</thead>
<tbody id="suggestions-table">
- <% if @serve_static %>
- <% @suggestions.sort_by { |val| val.churn * val.complexity }.reverse.each do |val| %>
- <tr>
- <td><%= val.file_path %></td>
- <td><%= val.churn %></td>
- <td><%= val.complexity %></td>
- <td><%= val.churn * val.complexity %></td>
- </tr>
+ <% @suggestions.each do |val| %>
+ <tr>
+ <td><%= val.file_path %></td>
+ <td><%= val.churn %></td>
+ <td><%= val.complexity %></td>
+ <td><%= val.churn * val.complexity %></td>
<% end %>
- <% end %>
+ </tr>
<tbody>
</table>
</div>
</div>
+ <% else %>
+ <div id="react-suggestions"></div>
+ <% end %>
</div>
</div>
</div>
<footer class="footer mt-auto py-3 fixed-bottom">
<div class="container d-flex justify-content-end">
+ <span class="mx-3"><a target="_blank" href="https://www.patreon.com/user?u=24747270">Patreon</a></span>
<span class="mx-3"><a target="_blank" href="https://github.com/julianrubisch/attractor">Github</a></span>
<span class="mx-3"><a target="_blank" href="https://twitter.com/AttractorGem">Twitter</a></span>
</div>
</footer>
</body>