Browse Source

first iteration of search functionality - likely to fail hard

master
jk 3 years ago
parent
commit
eef5dd9c85
  1. 2
      app/Http/Controllers/SearchController.php
  2. 2
      resources/views/search/results.blade.php

2
app/Http/Controllers/SearchController.php

@ -108,7 +108,7 @@ class SearchController extends Controller
foreach ($fermentations as $fermentation){ foreach ($fermentations as $fermentation){
$j = $i + 1; $j = $i + 1;
if ($i == 0){ if ($i == 0){
$fermentarr = array('stage'=>$j, 'temp'=>$fermentation->temperature, 'duration'=>$fermentation->duration);
$fermentarr[] = array('stage'=>$j, 'temp'=>$fermentation->temperature, 'duration'=>$fermentation->duration);
} else { } else {
array_push($fermentarr, array('stage'=>$j, 'temp'=>$fermentation->temperature, 'duration'=>$fermentation->duration)); array_push($fermentarr, array('stage'=>$j, 'temp'=>$fermentation->temperature, 'duration'=>$fermentation->duration));
}; };

2
resources/views/search/results.blade.php

@ -115,7 +115,7 @@
<td><a href="/beer/{{$result->beer_id}}">{{$result->name}}</a> </td> <td><a href="/beer/{{$result->beer_id}}">{{$result->name}}</a> </td>
<td class="hideable">@foreach($result->mashes as $mash)Stage: {{$mash['stage']}} at {{$mash['temp']}}°C @if($mash['duration']) for {{$mash['duration']}}m @endif<br/> @endforeach</td> <td class="hideable">@foreach($result->mashes as $mash)Stage: {{$mash['stage']}} at {{$mash['temp']}}°C @if($mash['duration']) for {{$mash['duration']}}m @endif<br/> @endforeach</td>
<td class="hideable">{{$result->boil}}m boil with hop additions at: <br/> @foreach($result->hopadditions as $hopaddition) {{$hopaddition->timing}} @endforeach</td> <td class="hideable">{{$result->boil}}m boil with hop additions at: <br/> @foreach($result->hopadditions as $hopaddition) {{$hopaddition->timing}} @endforeach</td>
<td class="hideable">@foreach($result->fermentations as $fermentation)Stage: {{$fermentation->stage}}, {{$fermentation->temp}}°C @if($fermentation->duration)note: {{$fermentation->duration}}@endif @endforeach </td>
<td class="hideable">@foreach($result->fermentations as $fermentation)Stage: {{$fermentation['stage']}}, {{$fermentation['temp']}}°C @if($fermentation['duration'])note: {{$fermentation['duration']}}@endif @end </td>
</tr> </tr>
@endforeach @endforeach
</div> </div>

Loading…
Cancel
Save