Skip to content

Commit

Permalink
Added filter to taxons frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Willianvdv committed Dec 7, 2013
1 parent c4a83f2 commit 7ca30e3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/overrides/add_filters_to_taxon_show.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Deface::Override.new(:virtual_path => "spree/shared/_filters",
:name => "add_filters_to_taxon_show",
:insert_top => '[data-hook="navigation"]',
:partial => "spree/taxons/filters")
18 changes: 18 additions & 0 deletions app/views/spree/taxons/_filters.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<% @filterables_with_values.each do |property, values| %>
<div class="submenu navigation taxonfilter" data-hook="navigation">
<h4 class="filter-title"> <%= property.presentation %> </h4>
<ul class="checkboxes">
<% values.each do |value| %>
<li>
<label class="checkbox-label" for="<%= value.parameterize %>">
<input type="checkbox"
id="<%= value.parameterize %>"
name="<%= property.name %>[]"
value="<%= value %>"
<%= ' checked' if params[property.name].try(:include?, value) %>/>
<span><%= value %></span>
</li>
<% end %>
</ul>
</div>
<% end %>

0 comments on commit 7ca30e3

Please sign in to comment.