Display property filters for producers

This commit is contained in:
Rohan Mitchell
2016-06-24 12:13:29 +10:00
parent 6f947380cb
commit 0b84afd67a
5 changed files with 12 additions and 3 deletions

View File

@@ -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'

View File

@@ -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

View File

@@ -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'

View File

@@ -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}}"}

View File

@@ -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