From 9e824e18451ec1fd8c7eac92347accb83e5fb390 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Fri, 24 Apr 2020 17:51:48 +0200 Subject: [PATCH] Little adjustments and changelog for #788 --- changelog/60_UNRELEASED_2020-xx-xx.md | 1 + localization/strings.pot | 3 +++ public/viewjs/quantityunitconversionform.js | 2 +- views/quantityunitconversionform.blade.php | 4 ++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/changelog/60_UNRELEASED_2020-xx-xx.md b/changelog/60_UNRELEASED_2020-xx-xx.md index bcf5c688..e28a97a2 100644 --- a/changelog/60_UNRELEASED_2020-xx-xx.md +++ b/changelog/60_UNRELEASED_2020-xx-xx.md @@ -1,4 +1,5 @@ ### Stock improvements/fixes +- When creating a quantity unit conversion it's now possible to automatically create the inverse conversion (thanks @kriddles) - Optimized/clarified what the total/unit price is on the purchase page (thanks @kriddles) - On the purchase page the amount field is now displayed above/before the best before date for better `TAB` handling (thanks @kriddles) - Changed that when `FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING` is disabled, products now get internally a best before of "never expires" (aka `2999-12-31`) instead of today (thanks @kriddles) diff --git a/localization/strings.pot b/localization/strings.pot index 6127c1a3..2f4dc585 100644 --- a/localization/strings.pot +++ b/localization/strings.pot @@ -1798,3 +1798,6 @@ msgstr "" msgid "means %1$s per %2$s" msgstr "" + +msgid "Create inverse QU conversion" +msgstr "" diff --git a/public/viewjs/quantityunitconversionform.js b/public/viewjs/quantityunitconversionform.js index 6072fbbf..a21e74ed 100644 --- a/public/viewjs/quantityunitconversionform.js +++ b/public/viewjs/quantityunitconversionform.js @@ -152,7 +152,7 @@ $('.input-group-qu').on('change', function(e) if (Grocy.EditMode === 'create') { - $('#qu-conversion-inverse-info').text(__t('This means the inverse of 1 %1$s is the same as %2$s %3$s will also be created', $("#to_qu_id option:selected").text(), (1 / factor).toString(), __n((1 / factor).toString(), $("#from_qu_id option:selected").text(), $("#from_qu_id option:selected").data("plural-form")))); + $('#qu-conversion-inverse-info').text('(' + __t('This means 1 %1$s is the same as %2$s %3$s', $("#to_qu_id option:selected").text(), (1 / factor).toString(), __n((1 / factor).toString(), $("#from_qu_id option:selected").text(), $("#from_qu_id option:selected").data("plural-form"))) + ')'); $('#qu-conversion-inverse-info').removeClass('d-none'); } } diff --git a/views/quantityunitconversionform.blade.php b/views/quantityunitconversionform.blade.php index 8e54e7ca..40ddda8d 100644 --- a/views/quantityunitconversionform.blade.php +++ b/views/quantityunitconversionform.blade.php @@ -72,9 +72,9 @@
-

@include('components.userfieldsform', array(