From 94cbac00a579c9783be8cee54d653cd29686a8d2 Mon Sep 17 00:00:00 2001 From: Masha Date: Sun, 5 May 2019 12:13:56 +0100 Subject: [PATCH 1/4] & replaced by OR when multiple property filters are selected --- .../darkswarm/controllers/products_controller.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee index 34b65aa405..c42c31bd65 100644 --- a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee @@ -50,7 +50,7 @@ Darkswarm.controller "ProductsCtrl", ($scope, $filter, $rootScope, Products, Ord $scope.appliedPropertiesList = -> $scope.activeProperties.map( (property_id) -> Properties.properties_by_id[property_id].name - ).join(" & ") if $scope.activeProperties? + ).join(" OR ") if $scope.activeProperties? $scope.clearAll = -> $scope.query = "" From 5470f8d758dd90ab8a3bc5cd18fa76f52796123d Mon Sep 17 00:00:00 2001 From: Masha Date: Sun, 5 May 2019 13:23:45 +0100 Subject: [PATCH 2/4] new translation key for products_or created --- .../darkswarm/controllers/products_controller.js.coffee | 4 ++-- config/locales/en.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee index c42c31bd65..0de9cedbf8 100644 --- a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee @@ -45,12 +45,12 @@ Darkswarm.controller "ProductsCtrl", ($scope, $filter, $rootScope, Products, Ord $scope.appliedTaxonsList = -> $scope.activeTaxons.map( (taxon_id) -> Taxons.taxons_by_id[taxon_id].name - ).join(" & ") if $scope.activeTaxons? + ).join(t('products_or')) if $scope.activeTaxons? $scope.appliedPropertiesList = -> $scope.activeProperties.map( (property_id) -> Properties.properties_by_id[property_id].name - ).join(" OR ") if $scope.activeProperties? + ).join(t('products_or')) if $scope.activeProperties? $scope.clearAll = -> $scope.query = "" diff --git a/config/locales/en.yml b/config/locales/en.yml index a6609f2f5a..c18fb36438 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1573,6 +1573,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using products_clear_all: Clear all products_showing: "Showing:" + products_or: " OR " products_with: with products_search: "Search by product or producer" products_loading: "Loading products..." From d5ff733f0bfe27b99716b7b7146d962757721b11 Mon Sep 17 00:00:00 2001 From: Masha Date: Sun, 5 May 2019 14:01:41 +0100 Subject: [PATCH 3/4] spaces location swapped --- .../darkswarm/controllers/products_controller.js.coffee | 4 ++-- config/locales/en.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee index 0de9cedbf8..729064988a 100644 --- a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee @@ -45,12 +45,12 @@ Darkswarm.controller "ProductsCtrl", ($scope, $filter, $rootScope, Products, Ord $scope.appliedTaxonsList = -> $scope.activeTaxons.map( (taxon_id) -> Taxons.taxons_by_id[taxon_id].name - ).join(t('products_or')) if $scope.activeTaxons? + ).join(t(' products_or ')) if $scope.activeTaxons? $scope.appliedPropertiesList = -> $scope.activeProperties.map( (property_id) -> Properties.properties_by_id[property_id].name - ).join(t('products_or')) if $scope.activeProperties? + ).join(t(' products_or ')) if $scope.activeProperties? $scope.clearAll = -> $scope.query = "" diff --git a/config/locales/en.yml b/config/locales/en.yml index c18fb36438..7a5129a9d6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1573,7 +1573,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using products_clear_all: Clear all products_showing: "Showing:" - products_or: " OR " + products_or: "OR" products_with: with products_search: "Search by product or producer" products_loading: "Loading products..." From 5eacf05a45d4adb3ba4acd70e185941e8be088c3 Mon Sep 17 00:00:00 2001 From: Masha Date: Sun, 5 May 2019 14:10:21 +0100 Subject: [PATCH 4/4] used string interpolation for clarity --- .../darkswarm/controllers/products_controller.js.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee index 729064988a..3c32c83875 100644 --- a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee @@ -45,12 +45,12 @@ Darkswarm.controller "ProductsCtrl", ($scope, $filter, $rootScope, Products, Ord $scope.appliedTaxonsList = -> $scope.activeTaxons.map( (taxon_id) -> Taxons.taxons_by_id[taxon_id].name - ).join(t(' products_or ')) if $scope.activeTaxons? + ).join(" #{t('products_or')} ") if $scope.activeTaxons? $scope.appliedPropertiesList = -> $scope.activeProperties.map( (property_id) -> Properties.properties_by_id[property_id].name - ).join(t(' products_or ')) if $scope.activeProperties? + ).join(" #{t('products_or')} ") if $scope.activeProperties? $scope.clearAll = -> $scope.query = ""