diff --git a/changelog/62_UNRELEASED_xxxx-xx-xx.md b/changelog/62_UNRELEASED_xxxx-xx-xx.md index 73266155..371ed59b 100644 --- a/changelog/62_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/62_UNRELEASED_xxxx-xx-xx.md @@ -1,3 +1,7 @@ - Fixed that tracking chores with "Done by" a different user was not possible - Fixed that editing stock entries was not possible -- Some night mode style improvements (thanks @BlizzWave) +- Fixed that shopping list prints had a grey background (thanks @Forceu) +- Improved/fixed the form validation on the shopping list item page (thanks @Forceu) +- Fixed that consuming with Scan Mode was not possible +- Some night mode style improvements (thanks @BlizzWave and @KTibow) +- Recipe printing improvements (thanks @Ape) diff --git a/public/css/grocy_night_mode.css b/public/css/grocy_night_mode.css index 18f76e4f..819efd8a 100644 --- a/public/css/grocy_night_mode.css +++ b/public/css/grocy_night_mode.css @@ -1,8 +1,12 @@ -body.night-mode { +body.night-mode { color: #c1c1c1; background-color: #333131; } +.night-mode .navbar-brand img { + filter: invert(0.9) hue-rotate(176deg); +} + .night-mode .table-info, .night-mode .table-info > td, .night-mode .table-info > th, @@ -12,7 +16,7 @@ } .night-mode .table { - color: #6c757d; + color: #c1c1c1; } .night-mode table.dataTable tr.dtrg-group td, @@ -24,6 +28,7 @@ .night-mode .btn, .night-mode .nav-link, .night-mode #mainNav.navbar-light .navbar-collapse .navbar-nav > .nav-item.dropdown > .nav-link::after, +.night-mode #mainNav.navbar-light .navbar-collapse .navbar-sidenav .nav-link-collapse::after, .night-mode .dropdown-item { color: #c1c1c1 !important; } @@ -32,6 +37,11 @@ border-color: #c1c1c1; } +.night-mode .btn-outline-info { + color: #1ed1ee !important; + border-color: #1ed1ee !important; +} + .night-mode .btn-info { color: #c1c1c1; background-color: #07373f; @@ -46,14 +56,14 @@ .night-mode .btn-danger { color: #c1c1c1; - background-color: #471116; - border-color: #471116; + background-color: #6f1b23; + border-color: #6f1b23; } .night-mode .btn-success { color: #c1c1c1; - background-color: #0d3a18; - border-color: #0d3a18; + background-color: #17642a; + border-color: #17642a; } .night-mode .btn-light, @@ -71,6 +81,10 @@ border: 1px solid #ced4da; } +.night-mode ::placeholder { + color: #b1bac4; +} + .night-mode .content-wrapper { background: #333131; } @@ -110,6 +124,11 @@ border-color: #80bdff; } +.night-mode select { + color: #ced4da; + background-color: #333131; +} + .night-mode .dropdown-item:focus, .night-mode .dropdown-item:hover { color: #16181b; @@ -139,13 +158,13 @@ } .night-mode a.discrete-link:hover { - color: #16354f !important; + color: #83c6ff !important; text-decoration: none !important; background-color: #333131; } .night-mode a.discrete-link:focus { - color: #3a0b0f !important; + color: #ffa8af !important; background-color: #333131; } @@ -204,7 +223,7 @@ } .night-mode .active-page { - box-shadow: inset 5px 0 0 #350a0f !important; + box-shadow: inset 5px 0 0 #ff7585 !important; background-color: #383838 !important; } @@ -241,3 +260,20 @@ .night-mode .dropdown-menu { background-color: #333131; } + +.night-mode .table-secondary td, +.night-mode .table-secondary th { + background-color: #4c4e50; +} + +.night-mode .secondary-message { + border-top-color: #4c4e50; +} + +.night-mode .normal-message { + border-top-color: #07373f; +} + +.night-mode .text-muted { + color: #8f9ba5 !important; +} diff --git a/public/viewjs/consume.js b/public/viewjs/consume.js index 5a3ea2f4..25196b51 100644 --- a/public/viewjs/consume.js +++ b/public/viewjs/consume.js @@ -265,6 +265,11 @@ $("#location_id").on('change', function(e) console.error(xhr); } ); + + if (document.getElementById("product_id").getAttribute("barcode") == "null") + { + ScanModeSubmit(); + } }, function(xhr) { @@ -369,10 +374,9 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e) $(".input-group-productamountpicker").trigger("change"); Grocy.FrontendHelpers.ValidateForm('consume-form'); RefreshLocaleNumberInput(); + ScanModeSubmit(false); } } - - ScanModeSubmit(false); }, function(xhr) { @@ -380,10 +384,6 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e) } ); } - else - { - ScanModeSubmit(); - } }, function(xhr) { @@ -612,6 +612,11 @@ var current_productDetails; function RefreshForm() { var productDetails = current_productDetails; + if (!productDetails) + { + return; + } + if (productDetails.product.enable_tare_weight_handling == 1) { $("#consume-exact-amount-group").removeClass("d-none"); @@ -650,12 +655,10 @@ function ScanModeSubmit(singleUnit = true) if (singleUnit) { $("#display_amount").val(1); + $(".input-group-productamountpicker").trigger("change"); } - RefreshLocaleNumberInput(); - $(".input-group-productamountpicker").trigger("change"); Grocy.FrontendHelpers.ValidateForm("consume-form"); - if (document.getElementById("consume-form").checkValidity() === true) { $('#save-consume-button').click(); diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js index 6a377e3a..4cb2c093 100644 --- a/public/viewjs/shoppinglist.js +++ b/public/viewjs/shoppinglist.js @@ -483,6 +483,7 @@ $(document).on("click", "#print-shopping-list-button", function(e) callback: function () { bootbox.hideAll(); + $('.modal-backdrop').remove(); $(".print-timestamp").text(moment().format("l LT")); $("#description-for-print").html($("#description").val()); @@ -500,7 +501,8 @@ $(document).on("click", "#print-shopping-list-button", function(e) shoppingListPrintShadowTable.draw(); } - $("." + $("input[name='print-layout-type']:checked").val()).removeClass("d-none"); + $(".print-layout-container").addClass("d-none"); + $("." + $("input[name='print-layout-type']:checked").val()).removeClass("d-none"); window.print(); } diff --git a/public/viewjs/shoppinglistitemform.js b/public/viewjs/shoppinglistitemform.js index fc8dacac..b373cbc4 100644 --- a/public/viewjs/shoppinglistitemform.js +++ b/public/viewjs/shoppinglistitemform.js @@ -244,17 +244,14 @@ if (GetUriParam("embedded") !== undefined) } var eitherRequiredFields = $("#product_id,#product_id_text_input,#note"); -eitherRequiredFields.on("input", function() +eitherRequiredFields.prop('required',""); +eitherRequiredFields.on('input', function () { - eitherRequiredFields.attr("required", ""); - if (!$(this).val().isEmpty()) - { - eitherRequiredFields.not(this).removeAttr("required"); - } - + eitherRequiredFields.not(this).prop('required', !$(this).val().length); Grocy.FrontendHelpers.ValidateForm('shoppinglist-form'); }); + if (GetUriParam("product-name") != null) { Grocy.Components.ProductPicker.GetPicker().trigger('change'); diff --git a/views/recipes.blade.php b/views/recipes.blade.php index 48f04547..06c04187 100644 --- a/views/recipes.blade.php +++ b/views/recipes.blade.php @@ -311,14 +311,14 @@
@if(!empty($calories) && intval($calories) > 0)
- +

{{ $calories }}

@endif @if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
-

{{ $costs }}

@@ -410,8 +410,10 @@ @endif {{ $__n($selectedRecipePosition->recipe_amount, FindObjectInArrayByPropertyValue($quantityUnits, 'id', $selectedRecipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityUnits, 'id', $selectedRecipePosition->qu_id)->name_plural) }} {{ FindObjectInArrayByPropertyValue($products, 'id', $selectedRecipePosition->product_id)->name }} @if(GROCY_FEATURE_FLAG_STOCK) - @if($selectedRecipePosition->need_fulfilled == 1)@elseif($selectedRecipePosition->need_fulfilled_with_shopping_list == 1)@else@endif - @if(FindObjectInArrayByPropertyValue($recipePositionsResolved, 'recipe_pos_id', $selectedRecipePosition->id)->need_fulfilled == 1) {{ $__t('Enough in stock') }} @else {{ $__t('Not enough in stock (not included in costs), %1$s missing, %2$s already on shopping list', round($selectedRecipePosition->missing_amount, 2), round($selectedRecipePosition->amount_on_shopping_list, 2)) }} @endif + + @if($selectedRecipePosition->need_fulfilled == 1)@elseif($selectedRecipePosition->need_fulfilled_with_shopping_list == 1)@else@endif + @if(FindObjectInArrayByPropertyValue($recipePositionsResolved, 'recipe_pos_id', $selectedRecipePosition->id)->need_fulfilled == 1) {{ $__t('Enough in stock') }} @else {{ $__t('Not enough in stock (not included in costs), %1$s missing, %2$s already on shopping list', round($selectedRecipePosition->missing_amount, 2), round($selectedRecipePosition->amount_on_shopping_list, 2)) }} @endif + @endif @if($selectedRecipePosition->need_fulfilled == 1 && GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) {{ $selectedRecipePosition->costs }} @endif {{ $selectedRecipePosition->calories }} {{ $__t('Calories') }} diff --git a/views/shoppinglist.blade.php b/views/shoppinglist.blade.php index d6fe522c..22d1123c 100644 --- a/views/shoppinglist.blade.php +++ b/views/shoppinglist.blade.php @@ -339,7 +339,7 @@
-