Hide incompatible and non-winner investments by default

This commit is contained in:
Bertocq
2017-07-10 19:41:04 +02:00
parent 49f48ddf4b
commit 11a793d63f
3 changed files with 22 additions and 18 deletions

View File

@@ -1,4 +1,6 @@
<div class="small-12 medium-9 column <%= results_type == :compatible ? 'success' : 'js-discarded' %>" id="<%= results_type %>-container">
<div class="small-12 medium-9 column <%= results_type == :compatible ? 'success' : 'js-discarded' %>"
style="<%= results_type != :compatible ? 'display: none' : '' %>"
id="<%= results_type %>-container">
<h3 class="inline-block">
<%= title %>
@@ -28,7 +30,9 @@
<tbody>
<% amount_available = heading_price %>
<% investments.each do |investment| %>
<tr id="<%= dom_id(investment) %>" class="budget-investments <%= investment.winner? ? 'success' : 'js-discarded' %>">
<tr id="<%= dom_id(investment) %>"
class="budget-investments <%= investment.winner? ? 'success' : 'js-discarded' %>"
style="<%= investment.winner? ? '' : 'display: none' %>">
<td>
<% if investment.winner? %>
<span class="icon-check">

View File

@@ -35,7 +35,7 @@
</ul>
</div>
<span class="float-right"><%= link_to t("budgets.results.hide_discarded_link"), "#", class: "js-toggle-link button hollow margin-bottom", data: {'toggle-selector' => '.js-discarded', 'toggle-text' => t("budgets.results.show_all_link")} %></span>
<span class="float-right"><%= link_to t("budgets.results.show_all_link"), "#", class: "js-toggle-link button hollow margin-bottom", data: {'toggle-selector' => '.js-discarded', 'toggle-text' => t("budgets.results.hide_discarded_link")} %></span>
<%= render 'results_table', results_type: :compatible,