From 543798d35d7c456e9755f6e92883192929e94baa Mon Sep 17 00:00:00 2001 From: jk Date: Wed, 23 Jun 2021 11:27:56 +0100 Subject: [PATCH] trying to add dropdowns to edit blades - fermentations mkI --- .../Controllers/FermentationController.php | 8 +++++- .../views/adjunctadditions/create.blade.php | 2 +- .../views/adjunctadditions/edit.blade.php | 2 +- resources/views/adjuncts/create.blade.php | 2 +- resources/views/adjuncts/edit.blade.php | 2 +- resources/views/beers/create.blade.php | 2 +- resources/views/beers/edit.blade.php | 2 +- resources/views/breweries/create.blade.php | 2 +- resources/views/breweries/edit.blade.php | 2 +- .../views/fermentations/create.blade.php | 2 +- resources/views/fermentations/edit.blade.php | 25 ++++++++++++++----- resources/views/grainbills/create.blade.php | 2 +- resources/views/grainbills/edit.blade.php | 2 +- resources/views/grains/create.blade.php | 2 +- resources/views/grains/edit.blade.php | 2 +- resources/views/hopadditions/create.blade.php | 2 +- resources/views/hopadditions/edit.blade.php | 2 +- 17 files changed, 41 insertions(+), 22 deletions(-) diff --git a/app/Http/Controllers/FermentationController.php b/app/Http/Controllers/FermentationController.php index ba21082..da486cd 100644 --- a/app/Http/Controllers/FermentationController.php +++ b/app/Http/Controllers/FermentationController.php @@ -55,7 +55,13 @@ class FermentationController extends Controller } public function edit($id){ $fermentation = Fermentation::where('id', (int)$id)->first(); - return view('fermentations.edit')->with('fermentation', $fermentation); + $beers = Summarie::orderBy('name')->get(); + $selected_beer = $fermentation->beer_id; + $yeasts = Yeast::orderBy('name')->get(); + $selected_yeast = $fermentation->yeast_id; + $selected_alt = $fermenation->alternative; + $data = array('fermentation'=>$fermentation, 'beers'=>$beers, 'yeasts'=>$yeasts, 'selected_beer'=>$selected_beer, 'selected_yeast'=>$selected_yeast, 'selected_alt'=>$selected_alt); + return view('fermentations.edit')->with($data); } public function update(Request $request, $id){ diff --git a/resources/views/adjunctadditions/create.blade.php b/resources/views/adjunctadditions/create.blade.php index b353a6c..da009f2 100644 --- a/resources/views/adjunctadditions/create.blade.php +++ b/resources/views/adjunctadditions/create.blade.php @@ -2,7 +2,7 @@ @section('main')
-
+

Add an Adjunct Addition

@if ($errors->any()) diff --git a/resources/views/adjunctadditions/edit.blade.php b/resources/views/adjunctadditions/edit.blade.php index 6ea6d45..e0504bf 100644 --- a/resources/views/adjunctadditions/edit.blade.php +++ b/resources/views/adjunctadditions/edit.blade.php @@ -1,6 +1,6 @@ @extends('adjunctadditions') @section('main')
-
+
Update Adjunct Addition @if ($errors->any()) diff --git a/resources/views/adjuncts/create.blade.php b/resources/views/adjuncts/create.blade.php index c7fec5c..9fc0267 100644 --- a/resources/views/adjuncts/create.blade.php +++ b/resources/views/adjuncts/create.blade.php @@ -2,7 +2,7 @@ @section('main')
-
+

Add an Adjunct

@if ($errors->any()) diff --git a/resources/views/adjuncts/edit.blade.php b/resources/views/adjuncts/edit.blade.php index ec3d9a9..13c2a77 100644 --- a/resources/views/adjuncts/edit.blade.php +++ b/resources/views/adjuncts/edit.blade.php @@ -1,6 +1,6 @@ @extends('adjuncts') @section('main')
-
+

Update Adjunct

@if ($errors->any()) diff --git a/resources/views/beers/create.blade.php b/resources/views/beers/create.blade.php index 6524d0b..6e6a056 100644 --- a/resources/views/beers/create.blade.php +++ b/resources/views/beers/create.blade.php @@ -2,7 +2,7 @@ @section('main')
-
+

Add a Beer

@if ($errors->any()) diff --git a/resources/views/beers/edit.blade.php b/resources/views/beers/edit.blade.php index 79c0f35..44c2b08 100644 --- a/resources/views/beers/edit.blade.php +++ b/resources/views/beers/edit.blade.php @@ -1,6 +1,6 @@ @extends('beers') @section('main')
-
+

Update Beer

@if ($errors->any()) diff --git a/resources/views/breweries/create.blade.php b/resources/views/breweries/create.blade.php index 154297a..1a965ad 100644 --- a/resources/views/breweries/create.blade.php +++ b/resources/views/breweries/create.blade.php @@ -2,7 +2,7 @@ @section('main')
-
+

Add a brewery

@if ($errors->any()) diff --git a/resources/views/breweries/edit.blade.php b/resources/views/breweries/edit.blade.php index 9b6cb97..19993e7 100644 --- a/resources/views/breweries/edit.blade.php +++ b/resources/views/breweries/edit.blade.php @@ -1,6 +1,6 @@ @extends('breweries') @section('main')
-
+

Update Brewery

@if ($errors->any()) diff --git a/resources/views/fermentations/create.blade.php b/resources/views/fermentations/create.blade.php index 0a50175..9645009 100644 --- a/resources/views/fermentations/create.blade.php +++ b/resources/views/fermentations/create.blade.php @@ -2,7 +2,7 @@ @section('main')
-
+

Add a Fermentation Step

@if ($errors->any()) diff --git a/resources/views/fermentations/edit.blade.php b/resources/views/fermentations/edit.blade.php index 4055bc4..44fde0d 100644 --- a/resources/views/fermentations/edit.blade.php +++ b/resources/views/fermentations/edit.blade.php @@ -1,6 +1,6 @@ @extends('fermentations') @section('main')
-
+

Update Fermentation Step

@if ($errors->any()) @@ -17,12 +17,20 @@ @method('PATCH') @csrf
- - + +
- - + +
@@ -34,7 +42,12 @@
- +
diff --git a/resources/views/grainbills/create.blade.php b/resources/views/grainbills/create.blade.php index cd2047a..f3548e8 100644 --- a/resources/views/grainbills/create.blade.php +++ b/resources/views/grainbills/create.blade.php @@ -2,7 +2,7 @@ @section('main')
-
+

Add a Grain

@if ($errors->any()) diff --git a/resources/views/grainbills/edit.blade.php b/resources/views/grainbills/edit.blade.php index f032863..5483352 100644 --- a/resources/views/grainbills/edit.blade.php +++ b/resources/views/grainbills/edit.blade.php @@ -1,6 +1,6 @@ @extends('grainbills') @section('main')
-
+

Update Grain Bill

@if ($errors->any()) diff --git a/resources/views/grains/create.blade.php b/resources/views/grains/create.blade.php index b322f53..f0388ee 100644 --- a/resources/views/grains/create.blade.php +++ b/resources/views/grains/create.blade.php @@ -2,7 +2,7 @@ @section('main')
-
+

Add a Grain

@if ($errors->any()) diff --git a/resources/views/grains/edit.blade.php b/resources/views/grains/edit.blade.php index 776d18f..65c4dc7 100644 --- a/resources/views/grains/edit.blade.php +++ b/resources/views/grains/edit.blade.php @@ -1,6 +1,6 @@ @extends('grains') @section('main')
-
+

Update Grain

@if ($errors->any()) diff --git a/resources/views/hopadditions/create.blade.php b/resources/views/hopadditions/create.blade.php index 5283213..9aff9e4 100644 --- a/resources/views/hopadditions/create.blade.php +++ b/resources/views/hopadditions/create.blade.php @@ -2,7 +2,7 @@ @section('main')
-
+

Add a Hop Addition

@if ($errors->any()) diff --git a/resources/views/hopadditions/edit.blade.php b/resources/views/hopadditions/edit.blade.php index 3e43c85..eb5ca80 100644 --- a/resources/views/hopadditions/edit.blade.php +++ b/resources/views/hopadditions/edit.blade.php @@ -1,6 +1,6 @@ @extends('hopadditions') @section('main')
-
+

Update Hop Addition

@if ($errors->any())