diff --git a/public/css/grocy.css b/public/css/grocy.css index 937d1586..3ddb9d27 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 */ @@ -498,3 +499,18 @@ canvas.drawingBuffer { 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/recipeform.blade.php b/views/recipeform.blade.php index 3a71ac30..f9b8d63b 100644 --- a/views/recipeform.blade.php +++ b/views/recipeform.blade.php @@ -47,11 +47,26 @@
{{ $__t('A name is required') }}
- +
- - -
+ +
+
+ + + +
+
+ +
+
+ @php if($mode == 'edit') { $value = $recipe->base_servings; } else { $value = 1; } @endphp @include('components.numberpicker', array( @@ -64,25 +79,18 @@ ))
-
+
- 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 +104,12 @@ 'entity' => 'recipes' )) - +
+ + +
+ +
@@ -104,12 +117,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 +204,16 @@
-

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

+
@@ -215,19 +247,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..0c303223 100644 --- a/views/recipes.blade.php +++ b/views/recipes.blade.php @@ -143,42 +143,35 @@ @if($selectedRecipe !== null)
-
- {{ $selectedRecipe->name }}   - - - - - -    - - - - - - - - - +
+ +
{{ $selectedRecipe->name }}
+
+ + + +
-
- @include('components.numberpicker', array( - 'id' => 'servings-scale', - 'label' => 'Desired servings', - 'min' => 1, - 'value' => $selectedRecipe->desired_servings, - 'invalidFeedback' => $__t('This cannot be lower than %s', '1'), - 'additionalAttributes' => 'data-recipe-id="' . $selectedRecipe->id . '"', - 'hint' => $__t('Base: %s', $selectedRecipe->base_servings) - )) -
@if(!empty($selectedRecipeTotalCalories) && intval($selectedRecipeTotalCalories) > 0)
- +

{{ $selectedRecipeTotalCalories }}

@@ -196,6 +189,20 @@ @endif
+
+
+ @include('components.numberpicker', array( + 'id' => 'servings-scale', + 'label' => 'Desired servings', + 'min' => 1, + 'value' => $selectedRecipe->desired_servings, + 'invalidFeedback' => $__t('This cannot be lower than %s', '1'), + 'additionalAttributes' => 'data-recipe-id="' . $selectedRecipe->id . '"', + 'hint' => $__t('Base: %s', $selectedRecipe->base_servings) + )) +
+
+ @foreach($selectedRecipeSubRecipes as $selectedRecipeSubRecipe)

{{ $selectedRecipeSubRecipe->name }}

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

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

    {{ $__t('Ingredients') }}

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

      {{ $__t('Preparation') }}

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