mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-09 03:20:21 +00:00
Do not display unit price value and unit until information is filled
- Display the field but with `null` value
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user