Skip to content

Commit

Permalink
Dont always show filter button
Browse files Browse the repository at this point in the history
  • Loading branch information
Willianvdv committed May 7, 2014
1 parent e248b62 commit a48a925
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions app/views/spree/taxons/_filters.html.erb
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<%= form_tag '', :method => :get, :id => 'sidebar_products_search' do %>
<% @filters.each do |filter| %>
<div class="submenu navigation taxonfilter" data-hook="navigation">
<h4 class="filter-title"> <%= filter.property.presentation %> </h4>
<ul class="checkboxes">
<% filter.options.each do |filter_option| %>
<li>
<label class="checkbox-label" for="<%= filter_option.value.parameterize %>">
<input type="checkbox"
id="<%= filter_option.value.parameterize %>"
name="<%= filter_option.property.name %>[]"
value="<%= filter_option.value %>"
<%= ' checked' if params[filter_option.property.name].try(:include?, filter_option.value) %>/>
<span>
<%= filter_option.value %>
<span class="amount"> (<%= filter_option.number_of_products %>)</span>
</span>
</li>
<% end %>
</ul>
</div>
<% unless @filters.empty? %>
<%= form_tag '', :method => :get, :id => 'sidebar_products_search' do %>
<% @filters.each do |filter| %>
<div class="submenu navigation taxonfilter" data-hook="navigation">
<h4 class="filter-title"> <%= filter.property.presentation %> </h4>
<ul class="checkboxes">
<% filter.options.each do |filter_option| %>
<li>
<label class="checkbox-label" for="<%= filter_option.value.parameterize %>">
<input type="checkbox"
id="<%= filter_option.value.parameterize %>"
name="<%= filter_option.property.name %>[]"
value="<%= filter_option.value %>"
<%= ' checked' if params[filter_option.property.name].try(:include?, filter_option.value) %>/>
<span>
<%= filter_option.value %>
<span class="amount"> (<%= filter_option.number_of_products %>)</span>
</span>
</li>
<% end %>
</ul>
</div>
<% end %>
<%= button_tag t(:filter), :class => 'button button-filter' %>
<% end %>
<%= button_tag t(:filter), :class => 'button button-filter' %>
<% end %>
<% end %>

0 comments on commit a48a925

Please sign in to comment.