From 0c0febed6c69056f6a80549adc58871e8cdebea2 Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Thu, 21 Jan 2021 07:06:43 -0800 Subject: [PATCH] Add support frontend support for removing steps (WIP) Step numbers not working. No backend support yet. --- resources/views/recipes/edit.blade.php | 20 +++++-------------- .../recipes/partials/step-input.blade.php | 9 +++++++++ 2 files changed, 14 insertions(+), 15 deletions(-) create mode 100644 resources/views/recipes/partials/step-input.blade.php diff --git a/resources/views/recipes/edit.blade.php b/resources/views/recipes/edit.blade.php index 552eead..f400770 100644 --- a/resources/views/recipes/edit.blade.php +++ b/resources/views/recipes/edit.blade.php @@ -100,29 +100,19 @@

Steps

- @php($step_number = 0) -
+
@if(old('steps')) - @foreach(old('steps') as $i => $step) + @foreach(old('steps') as $i => $step_default) @if (empty($step)) @continue @endif -
-
{{ $step_number++ }}
- -
+ @include('recipes.partials.step-input') @endforeach @else @foreach($recipe->steps as $step) -
-
{{ $step_number++ }}
- -
+ @include('recipes.partials.step-input', ['step_default' => $step->step]) @endforeach @endif diff --git a/resources/views/recipes/partials/step-input.blade.php b/resources/views/recipes/partials/step-input.blade.php new file mode 100644 index 0000000..16a9e29 --- /dev/null +++ b/resources/views/recipes/partials/step-input.blade.php @@ -0,0 +1,9 @@ +
+
#
+ + + + + + +