Merge branch 'master' into master

This commit is contained in:
Marc Ole Bulling 2021-02-14 19:15:39 +01:00 committed by GitHub
commit 2b0bbc34c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 77 additions and 33 deletions

View File

@ -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)

View File

@ -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;
}

View File

@ -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();

View File

@ -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();
}

View File

@ -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');

View File

@ -311,14 +311,14 @@
<div class="row ml-1">
@if(!empty($calories) && intval($calories) > 0)
<div class="col-6 col-xl-3">
<label>{{ $__t('Calories') }}</label>
<label>{{ $__t('Energy (kcal)') }}</label>
<h3 class="locale-number locale-number-generic pt-0">{{ $calories }}</h3>
</div>
@endif
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
<div class="col-5">
<label>{{ $__t('Costs') }}&nbsp;</label>
<i class="fas fa-question-circle text-muted"
<i class="fas fa-question-circle text-muted d-print-none"
data-toggle="tooltip"
title="{{ $__t('Based on the prices of the default consume rule which is "Opened first, then first due first, then first in first out"') }}"></i>
<h3 class="locale-number locale-number-currency pt-0">{{ $costs }}</h3>
@ -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)<i class="fas fa-check text-success"></i>@elseif($selectedRecipePosition->need_fulfilled_with_shopping_list == 1)<i class="fas fa-exclamation text-warning"></i>@else<i class="fas fa-times text-danger"></i>@endif
<span class="timeago-contextual">@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</span>
<span class="d-print-none">
@if($selectedRecipePosition->need_fulfilled == 1)<i class="fas fa-check text-success"></i>@elseif($selectedRecipePosition->need_fulfilled_with_shopping_list == 1)<i class="fas fa-exclamation text-warning"></i>@else<i class="fas fa-times text-danger"></i>@endif
<span class="timeago-contextual">@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</span>
</span>
@endif
@if($selectedRecipePosition->need_fulfilled == 1 && GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) <span class="float-right font-italic ml-2 locale-number locale-number-currency">{{ $selectedRecipePosition->costs }}</span> @endif
<span class="float-right font-italic"><span class="locale-number locale-number-quantity-amount">{{ $selectedRecipePosition->calories }} {{ $__t('Calories') }}</span></span>

View File

@ -339,7 +339,7 @@
<span class="d-inline print-timestamp"></span>
</h6>
</div>
<div class="w-75 print-layout-type-table d-none">
<div class="w-75 print-layout-container print-layout-type-table d-none">
<div>
<table id="shopping-list-print-shadow-table"
class="table table-sm table-striped nowrap">
@ -386,7 +386,7 @@
</table>
</div>
</div>
<div class="w-75 print-layout-type-list d-none">
<div class="w-75 print-layout-container print-layout-type-list d-none">
@foreach($listItems as $listItem)
<div class="py-0">
<span class="locale-number locale-number-quantity-amount">{{ $listItem->amount }}</span> @if(!empty($listItem->product_id)){{ $__n($listItem->amount, $listItem->qu_name, $listItem->qu_name_plural) }}@endif