diff --git a/localization/strings.pot b/localization/strings.pot index 3292c1bd..8664ed79 100644 --- a/localization/strings.pot +++ b/localization/strings.pot @@ -1789,3 +1789,9 @@ msgstr "" msgid "Show an icon if the product is already on the shopping list" msgstr "" + +msgid "Calories" +msgstr "" + +msgid "By default the amount to be added to the shopping list is `needed amount - stock amount - shopping list amount` - when this is enabled, it is only checked against the stock amount, not against what is already on the shopping list" +msgstr "" diff --git a/public/css/grocy.css b/public/css/grocy.css index 937d1586..90652da6 100644 --- a/public/css/grocy.css +++ b/public/css/grocy.css @@ -61,6 +61,7 @@ a.discrete-link:focus { left: 0; overflow: auto; background-color: #ffffff; + width: 100%; } /* Fixes smooth scrolling on iOS */ @@ -487,14 +488,34 @@ canvas.drawingBuffer { flex-wrap: wrap; } -.custom-control-label { +.form-control-lg .custom-control-label { padding-top: 7px; padding-left: 10px; } +.custom-control-label { + padding-top: 13px; + padding-left: 10px; +} + .custom-control-label::before, .custom-control-label::after { top: 0.8rem; width: 1.25rem; height: 1.25rem; } + +.recipe-card-name { + font-size: 16px; + text-align: center; + width: 100%; +} + +.recipe-expand { + right: 1.25rem; + top: .75rem; +} + +.recipe-servings-input { + width: 125px; +} \ No newline at end of file diff --git a/public/viewjs/recipeform.js b/public/viewjs/recipeform.js index f6e6eb2a..ae2d4e33 100644 --- a/public/viewjs/recipeform.js +++ b/public/viewjs/recipeform.js @@ -326,13 +326,21 @@ $('#save-recipe-include-button').on('click', function(e) } }); +$("#recipe-picture").on("change", function (e) { + $("#recipe-picture-label").removeClass("d-none"); + $("#recipe-picture-label-none").addClass("d-none"); + $("#delete-current-recipe-picture-on-save-hint").addClass("d-none"); + $("#current-recipe-picture").addClass("d-none"); + Grocy.DeleteRecipePictureOnSave = false; +}); + Grocy.DeleteRecipePictureOnSave = false; -$('#delete-current-recipe-picture-button').on('click', function (e) -{ - Grocy.DeleteRecipePictureOnSave = true; - $("#current-recipe-picture").addClass("d-none"); - $("#delete-current-recipe-picture-on-save-hint").removeClass("d-none"); - $("#delete-current-recipe-picture-button").addClass("disabled"); +$("#delete-current-recipe-picture-button").on("click", function (e) { + Grocy.DeleteRecipePictureOnSave = true; + $("#current-recipe-picture").addClass("d-none"); + $("#delete-current-recipe-picture-on-save-hint").removeClass("d-none"); + $("#recipe-picture-label").addClass("d-none"); + $("#recipe-picture-label-none").removeClass("d-none"); }); Grocy.Components.UserfieldsForm.Load(); diff --git a/views/components/numberpicker.blade.php b/views/components/numberpicker.blade.php index d74e80af..623e0103 100644 --- a/views/components/numberpicker.blade.php +++ b/views/components/numberpicker.blade.php @@ -17,7 +17,9 @@ @php if(!isset($noNameAttribute)) { $noNameAttribute = false; } @endphp
- +
diff --git a/views/components/productpicker.blade.php b/views/components/productpicker.blade.php index 4cf715e0..99998514 100644 --- a/views/components/productpicker.blade.php +++ b/views/components/productpicker.blade.php @@ -13,7 +13,11 @@ @php if(empty($nextInputSelector)) { $nextInputSelector = ''; } @endphp
- +
{{ $__t('A name is required') }}
- +
- - -
+ +
+
+ + + +
+
+ +
+
+
@php if($mode == 'edit') { $value = $recipe->base_servings; } else { $value = 1; } @endphp @include('components.numberpicker', array( @@ -64,25 +79,19 @@ ))
-
+
- not_check_shoppinglist == 1) checked @endif class="form-check-input" type="checkbox" id="not_check_shoppinglist" name="not_check_shoppinglist" value="1"> -
-
- -
- - -
-
- @include('components.productpicker', array( 'products' => $products, 'isRequired' => false, @@ -96,7 +105,12 @@ 'entity' => 'recipes' )) - +
+ + +
+ +
@@ -104,12 +118,27 @@
-

- {{ $__t('Ingredients list') }} - - {{ $__t('Add') }} - -

+ @if(!empty($recipe->picture_file_name)) + +

{{ $__t('The current picture will be deleted when you save the recipe') }}

+ @else +

{{ $__t('No picture available') }}

+ @endif +
+
+ +
+
+ @@ -176,12 +205,16 @@
-

- {{ $__t('Included recipes') }} - - {{ $__t('Add') }} - -

+
@@ -215,19 +248,6 @@
- -
-
- - - @if(!empty($recipe->picture_file_name)) -

-

{{ $__t('The current picture will be deleted when you save the recipe') }}

- @else -

{{ $__t('No picture available') }}

- @endif -
-
diff --git a/views/recipes.blade.php b/views/recipes.blade.php index 26397f37..5d1e08ec 100644 --- a/views/recipes.blade.php +++ b/views/recipes.blade.php @@ -143,28 +143,52 @@ @if($selectedRecipe !== null)
-
- {{ $selectedRecipe->name }}   - - - - - -    - - - - - - - - - +
+ +
{{ $selectedRecipe->name }}
+
+ + + +
+ @if(!empty($selectedRecipeTotalCalories) && intval($selectedRecipeTotalCalories) > 0) +
+ +

+

{{ $selectedRecipeTotalCalories }}

+

+
+ @endif + @if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) +
+ + +

+

{{ $selectedRecipeTotalCosts }}

+

+
+ @endif +
+ +
@include('components.numberpicker', array( 'id' => 'servings-scale', @@ -176,24 +200,6 @@ 'hint' => $__t('Base: %s', $selectedRecipe->base_servings) ))
- @if(!empty($selectedRecipeTotalCalories) && intval($selectedRecipeTotalCalories) > 0) -
- -

-

{{ $selectedRecipeTotalCalories }}

-

-
- @endif - @if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) -
- -

-

{{ $selectedRecipeTotalCosts }}

-

-
- @endif
@@ -265,12 +271,13 @@ @if(!empty($selectedRecipe->picture_file_name)) -

+ @endif @if($selectedRecipePositionsResolved->count() > 0) -
{{ $__t('Ingredients') }}
-
    +

    {{ $__t('Ingredients') }}

    +
      @php $lastIngredientGroup = 'undefined'; $lastProductGroup = 'undefined'; @@ -321,7 +328,7 @@ @endif @if(!empty($selectedRecipe->description)) -
      {{ $__t('Preparation') }}
      +

      {{ $__t('Preparation') }}

      {!! $selectedRecipe->description !!} @endif