diff --git a/app/assets/javascripts/darkswarm/controllers/enterprises_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/enterprises_controller.js.coffee index fa11c0e92f..b60914bbd8 100644 --- a/app/assets/javascripts/darkswarm/controllers/enterprises_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/enterprises_controller.js.coffee @@ -30,7 +30,7 @@ Darkswarm.controller "EnterprisesCtrl", ($scope, $rootScope, $timeout, Enterpris # When filter settings change, this could change which name match is at the top, or even # result in no matches. This affects the reference point that the distance matches are # calculated from, so we need to recalculate distances. - $scope.$watch '[activeTaxons, shippingTypes, show_profiles]', -> + $scope.$watch '[activeTaxons, activeProperties, shippingTypes, show_profiles]', -> $timeout -> Enterprises.calculateDistance $scope.query, $scope.firstNameMatch() $rootScope.$broadcast 'enterprisesChanged' diff --git a/app/assets/javascripts/darkswarm/directives/single_line_selectors.coffee b/app/assets/javascripts/darkswarm/directives/single_line_selectors.coffee index ea5d8568d2..fca5366547 100644 --- a/app/assets/javascripts/darkswarm/directives/single_line_selectors.coffee +++ b/app/assets/javascripts/darkswarm/directives/single_line_selectors.coffee @@ -20,7 +20,7 @@ Darkswarm.directive 'singleLineSelectors', ($timeout, $filter) -> scope.emit = -> scope.activeSelectors = scope.allSelectors.filter (selector)-> selector.active - .map (selector)-> + .map (selector) -> selector.object.id # From: http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing diff --git a/app/views/producers/_filters.html.haml b/app/views/producers/_filters.html.haml index 97cc204cab..a7c8ccd134 100644 --- a/app/views/producers/_filters.html.haml +++ b/app/views/producers/_filters.html.haml @@ -12,4 +12,12 @@ = t :producers_filter = t :producers_filter_type %filter-selector.small-block-grid-2.medium-block-grid-4.large-block-grid-6{"selector-set" => "filterSelectors", objects: "producers_to_filter | searchEnterprises:query | taxonsOf", "active-selectors" => "activeTaxons"} + + %h5.tdhead + .light + = t :producers_filter + = t :producers_filter_property + .filter-shopfront.property-selectors + %single-line-selectors{ selectors: "filterSelectors", objects: "producers_to_filter | searchEnterprises:query | propertiesOf", "active-selectors" => "activeProperties"} + = render partial: 'shared/components/filter_box' diff --git a/app/views/producers/index.html.haml b/app/views/producers/index.html.haml index 8b7fd5695e..04048ef77e 100644 --- a/app/views/producers/index.html.haml +++ b/app/views/producers/index.html.haml @@ -16,7 +16,7 @@ .small-12.columns .active_table %producer.active_table_node.row.animate-repeat{id: "{{producer.path}}", - "ng-repeat" => "producer in filteredEnterprises = (Enterprises.producers | visible | searchEnterprises:query | taxons:activeTaxons)", + "ng-repeat" => "producer in filteredEnterprises = (Enterprises.producers | visible | searchEnterprises:query | taxons:activeTaxons | properties:activeProperties)", "ng-controller" => "ProducerNodeCtrl", "ng-class" => "{'closed' : !open(), 'open' : open(), 'inactive' : !producer.active}", id: "{{producer.hash}}"} diff --git a/config/locales/en.yml b/config/locales/en.yml index d5ed777e17..2d2e4bc3df 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -579,6 +579,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using producers_buy_at_html: "Shop for %{enterprise} products at:" producers_filter: Filter by producers_filter_type: Type + producers_filter_property: Property producers_title: Producers producers_headline: Find local producers producers_signup_title: Sign up as a producer