refactors investment filters

This commit is contained in:
rgarcia
2017-05-06 03:37:29 +02:00
parent fa825185f5
commit c0488c3b3c
12 changed files with 85 additions and 59 deletions

View File

@@ -7,13 +7,13 @@
</div>
</div>
<% if params[:unfeasible] %>
<% if @current_filter == "unfeasible" %>
<div class="row margin-top">
<div class="small-12 column">
<h3><%= t("budgets.groups.show.unfeasible_title") %></h3>
</div>
</div>
<% elsif params[:unselected] %>
<% elsif @current_filter == "unselected" %>
<div class="row margin-top">
<div class="small-12 column">
<h3><%= t("budgets.groups.show.unselected_title") %></h3>
@@ -31,8 +31,7 @@
class="<%= css_for_ballot_heading(heading) %>">
<%= link_to heading.name,
budget_investments_path(heading_id: heading.id,
unfeasible: params[:unfeasible],
unselected: params[:unselected]),
filter: @current_filter),
data: { no_turbolink: true } %><br>
</span>
<% end %>
@@ -46,20 +45,24 @@
</div>
</div>
<% if params[:unfeasible].blank? %>
<% unless @current_filter == "unfeasible" %>
<div class="row">
<div class="small-12 column">
<small><%= link_to t("budgets.groups.show.unfeasible"),
budget_path(@budget, unfeasible: 1) %></small>
<small>
<%= link_to t("budgets.groups.show.unfeasible"),
budget_path(@budget, filter: "unfeasible") %>
</small>
</div>
</div>
<% end %>
<% if params[:unselected].blank? %>
<% unless @current_filter == "unselected" %>
<div class="row">
<div class="small-12 column">
<small><%= link_to t("budgets.groups.show.unselected"),
budget_path(@budget, unselected: 1) %></small>
<small>
<%= link_to t("budgets.groups.show.unselected"),
budget_path(@budget, filter: "unselected") %>
</small>
</div>
</div>
<% end %>