Do not display unit price value and unit until information is filled

- Display the field but with `null` value
This commit is contained in:
Jean-Baptiste Bellet
2021-03-09 14:03:54 +01:00
parent fa4974ddb2
commit c8099dc2a4
2 changed files with 4 additions and 2 deletions

View File

@@ -39,6 +39,8 @@ angular.module("admin.products")
unit_type = $scope.product.variant_unit
unit_value = $scope.product.master.unit_value
variant_unit_name = $scope.product.variant_unit_name
$scope.product.unit_price_value = null
$scope.product.unit_price_unit = null
if price && unit_type && unit_value
$scope.product.unit_price_value = localizeCurrencyFilter(UnitPrices.price(price, scale, unit_type, unit_value, variant_unit_name))
$scope.product.unit_price_unit = UnitPrices.unit(scale, unit_type, variant_unit_name)

View File

@@ -63,9 +63,9 @@
key: "'js.shopfront.unit_price_tooltip.admin'"}
%br/
= f.text_field :price, {"class" => '', "disabled" => true, "ng-model" => "product.unit_price_value"}
%span
%span{ style: "color: #757575", "ng-show": "product.unit_price_unit !== null" }
 / 
%span{style: "color: #757575", "ng-bind" => "product.unit_price_unit" }
%span{ "ng-bind" => "product.unit_price_unit" }
%div{style: "color: black"}
= t(".unit_price_legend")
.sixteen.columns.alpha