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.

117 lines
4.3 KiB

3 years ago
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="container">
  4. <div class="row justify-content-center">
  5. <div class="col-md-8">
  6. <div class="card">
  7. @include('inc.navbar')
  8. <div class="card-header"><a href="/home">Home</a> -> {{ __('Hop List') }}<span class="backlink"><a href="{{url()->previous()}}">Go Back</a></span></div>
  9. <div class="card-body">
  10. @if (Auth::user()->isAdmin())
  11. <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#addModal" type="button" name="button" >
  12. Add Hop
  13. </button>
  14. <hr />
  15. @endif
  16. <table class="table table-striped table-dark" id="table-programs">
  17. <!-- This piece of code is for error messages display purposes -->
  18. @include('inc.messages')
  19. <thead>
  20. <tr>
  21. <th scope="col">Hop Name</th>
  22. <th scope="col">Profile</th>
  23. <th scope="col">Bittering?</th>
  24. <th scope="col">Aroma?</th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. @foreach ($hops as $hop)
  29. <tr>
  30. <td><a href="/hop/{{$hop->id}}">{{$hop->name}}</a> </td>
  31. <td>{{str_replace(' ,',',',str_replace('"',' ',str_replace(',',', ',str_replace('}', '', str_replace('{','',$hop->profile)))))}} </td>
  32. <td>@if($hop->bitter == 1) yes @else no @endif </td>
  33. <td>@if($hop->aroma == 1) yes @else no @endif </td>
  34. </tr>
  35. @endforeach
  36. </tbody>
  37. </table>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. <!-- this code if for the modal -->
  44. <div class="modal fade bg-primary text-dark" tabindex="-1" role="dialog" id="addModal">
  45. <div class="modal-dialog" role="document">
  46. <div class="modal-content">
  47. <div class="modal-header">
  48. <h5 class="modal-title">Add Hop</h5>
  49. <button type="button" class="close" data-dismiss="modal" aria-label="Close" >
  50. <span aria-hidden="true">x</span>
  51. </button>
  52. </div>
  53. <div class="modal-body">
  54. <form class="" action="{{route('hops.store')}}" method="post">
  55. {{csrf_field()}}
  56. <div class="form-group">
  57. <label for="">Name</label>
  58. <input type="text" class="form-control" name="name">
  59. </div>
  60. <div class="form-group">
  61. <label for="">Bittering?</label>
  62. <input type="checkbox" class="form-control" name="bitter">
  63. </div>
  64. <div class="form-group">
  65. <label for="">Aroma?</label>
  66. <input type="checkbox" class="form-control" name="aroma">
  67. </div>
  68. <div class="form-group">
  69. <label for="">Profile</label>
  70. <textarea type="text" class="form-control" name="profile" ></textarea>
  71. </div>
  72. <div class="form-group">
  73. <label for="">Alpha-Acid %</label>
  74. <input type="text" class="form-control" name="alpha_acid">
  75. </div>
  76. <div class="form-group">
  77. <label for="">Beta-Acid %</label>
  78. <input type="text" class="form-control" name="beta_acid">
  79. </div>
  80. <div class="form-group">
  81. <label for="">Total Oil %</label>
  82. <input type="text" class="form-control" name="total_oil">
  83. </div>
  84. <div class="form-group">
  85. <label for="">Cohumulone %</label>
  86. <input type="text" class="form-control" name="cohumulone">
  87. </div>
  88. <div class="form-group">
  89. <label for="">Myrcene %</label>
  90. <input type="text" class="form-control" name="myrcene">
  91. </div>
  92. <div class="form-group">
  93. <label for="">Humulene %</label>
  94. <input type="text" class="form-control" name="humulene">
  95. </div>
  96. <div class="form-group">
  97. <label for="">Farnesene %</label>
  98. <input type="text" class="form-control" name="farnesene">
  99. </div>
  100. <div class="form-group">
  101. <label for="">Caryophyllene</label>
  102. <input type="text" class="form-control" name="caryophyllene">
  103. </div>
  104. <input type="submit" name="submit" value="Submit" class="btn btn-success">
  105. </form>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. @endsection