Adding ponies and filtering

This commit is contained in:
Will Marshall
2014-06-20 17:14:05 +10:00
parent 1eaf2c3bc5
commit 3fc337299b
2 changed files with 8 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
Darkswarm.filter 'products', (Matcher)->
(products, text)->
products ||= []
text ?= ""
products.filter (product)=>
propertiesToMatch = [product.name, product.supplier.name, product.primary_taxon.name]
Matcher.match propertiesToMatch, text

View File

@@ -13,7 +13,7 @@
%div{bindonce: true}
%product{"ng-controller" => "ProductNodeCtrl",
"ng-repeat" => "product in Product.products | filter:query | orderBy:ordering.order | limitTo: limit track by product.id"}
"ng-repeat" => "product in Product.products | products:query | orderBy:ordering.order | limitTo: limit track by product.id"}
%div
= render partial: "shop/products/summary"
%div{"bo-if" => "hasVariants"}