My beer compendium
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

130 lines
8.6 KiB

  1. @extends('search')
  2. @section('main')
  3. <div class="container">
  4. <div class="row justify-content-center">
  5. <div class="col-md-12">
  6. <div class="card">
  7. @include('inc.navbar')
  8. <div class="card-header"><a href="/home">Home</a> -> {{ __('Search Results') }}<span class="backlink"><a href="{{url()->previous()}}">Go Back</a></span></div>
  9. <div class="card-body">
  10. @if ($table == "summarie")
  11. <div role="tabpanel">
  12. <div class="nav nav-tabs" role="tablist" id="nav-tab">
  13. <a href="#overview" class="nav-link active" aria-controls="nav-overview" role="tab" data-toggle="tab" aria-selected="true">Overview</a>
  14. <a href="#stats" class="nav-link" aria-controls="nav-stats" role="nav-stats" data-toggle="tab" aria-selected="false">Stats</a>
  15. <a href="#ingredients" class="nav-link" aria-controls="nav-ingredients" role="nav-ingredients" data-toggle="tab" aria-selected="false">Ingredients</a>
  16. <a href="#processes" class="nav-link" aria-controls="nav-processes" role="nav-processes" data-toggle="tab" aria-selected="false">Processes</a>
  17. </div>
  18. <div class="tab-content">
  19. <div role="tabpanel" class="tab-pane fade show active" id="overview" aria-labelledby="overview-tab">
  20. <table class="table table-striped table-dark" id="table-programs">
  21. <!-- This piece of code is for error messages display purposes -->
  22. @include('inc.messages')
  23. <thead>
  24. <tr>
  25. <th scope="col">@sortablelink('name', 'Beer')</th>
  26. <th scope="col">Brewery</th>
  27. <th scope="col" class="hideable">Style</th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. @foreach ($results as $result)
  32. <tr>
  33. <td><a href="/beer/{{$result->beer_id}}">{{$result->name}}</a> </td>
  34. <td><a href="/brewery/{{$result->brewery_id}}">{{$result->brewery}}</a> </td>
  35. <td class="hideable">{{$result->type}} </td>
  36. </tr>
  37. @endforeach
  38. </tbody>
  39. </table>
  40. </div>
  41. <div role="tabpanel" class="tab-pane fade" id="stats" aria-labelledby="stats-tab">
  42. <table class="table table-striped table-dark" id="table-programs">
  43. <!-- This piece of code is for error messages display purposes -->
  44. @include('inc.messages')
  45. <thead>
  46. <tr>
  47. <th scope="col">@sortablelink('name', 'Beer')</th>
  48. <th scope="col">ABV</th>
  49. <th scope="col" class="hideable">OG</th>
  50. <th scope="col" class="hideable">FG</th>
  51. <th scope="col" class="hideable">IBU</th>
  52. <th scope="col" class="hideable">EBC</th>
  53. <th scope="col" class="hideable">SRM</th>
  54. <th scope="col" class="hideable">pH</th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. @foreach ($results as $result)
  59. <tr>
  60. <td><a href="/beer/{{$result->beer_id}}">{{$result->name}}</a> </td>
  61. <td>{{$result->abv}} </td>
  62. <td class="hideable">{{$result->og}} </td>
  63. <td class="hideable">{{$result->fg}} </td>
  64. <td class="hideable">{{$result->ibu}} </td>
  65. <td class="hideable">{{$result->ebc}} </td>
  66. <td class="hideable">{{$result->srm}} </td>
  67. <td class="hideable">{{$result->ph}} </td>
  68. </tr>
  69. @endforeach
  70. </tbody>
  71. </table>
  72. </div>
  73. <div role="tabpanel" class="tab-pane fade" id="ingredients" aria-labelledby="ingredients-tab">
  74. <table class="table table-striped table-dark" id="table-programs">
  75. <!-- This piece of code is for error messages display purposes -->
  76. @include('inc.messages')
  77. <thead>
  78. <tr>
  79. <th scope="col">@sortablelink('name', 'Beer')</th>
  80. <th scope="col">Grains</th>
  81. <th scope="col" class="hideable">Hops</th>
  82. <th scope="col" class="hideable">Yeast</th>
  83. <th scope="col" class="hideable">Adjuncts</th>
  84. </tr>
  85. </thead>
  86. <tbody>
  87. @foreach ($results as $result)
  88. <tr>
  89. <td><a href="/beer/{{$result->beer_id}}">{{$result->name}}</a> </td>
  90. <td class="hideable">@foreach($result->grains as $grain)<a href="/grain/{{$grain['id']}}">{{$grain['name']}}</a><span style="float:right;">({{$grain['grain_bill']}}%)</span><br/> @endforeach</td>
  91. <td class="hideable">@foreach($result->hops as $hop)<a href="/hop/{{$hop['id']}}">{{$hop['name']}}</a><br/>@endforeach </td>
  92. <td class="hideable">@foreach($result->yeasts as $yeast)<a href="/yeast/{{$yeast['id']}}">{{$yeast['name']}}</a><br/>@endforeach </td>
  93. <td class="hideable">@foreach($result->adjuncts as $adjunct)<a href="/adjunct/{{$adjunct['id']}}">{{$adjunct['name']}}</a><br/>@endforeach </td>
  94. </tr>
  95. @endforeach
  96. </tbody>
  97. </table>
  98. </div>
  99. <div role="tabpanel" class="tab-pane fade" id="processes" aria-labelledby="processes-tab">
  100. <table class="table table-striped table-dark" id="table-programs">
  101. <!-- This piece of code is for error messages display purposes -->
  102. @include('inc.messages')
  103. <thead>
  104. <tr>
  105. <th scope="col">@sortablelink('name', 'Beer')</th>
  106. <th scope="col">Mash</th>
  107. <th scope="col" class="hideable">Hop Additions</th>
  108. <th scope="col" class="hideable">Fermentation</th>
  109. </tr>
  110. </thead>
  111. <tbody>
  112. @foreach ($results as $result)
  113. <tr>
  114. <td><a href="/beer/{{$result->beer_id}}">{{$result->name}}</a> </td>
  115. <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>
  116. <td class="hideable">{{$result->boil}}m boil + hops at: <br/> @foreach($result->hopadditions as $hopaddition) {{$hopaddition->timing}} @endforeach</td>
  117. <td class="hideable">@foreach($result->fermentations as $fermentation)Stage {{$fermentation['stage']}}: {{$fermentation['temp']}}°C @if($fermentation['duration'])- {{$fermentation['duration']}}@endif <br />@endforeach </td>
  118. </tr>
  119. @endforeach
  120. </div>
  121. </div>
  122. @endif
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. @endsection