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.

83 lines
2.8 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 Additions') }}<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 Addition
  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">Beer ID</th>
  22. <th scope="col">Hop ID</th>
  23. <th scope="col">Amount</th>
  24. <th scope="col">Timing</th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. @foreach ($hopadditions as $hopaddition)
  29. <tr>
  30. <td>{{$hopaddition->beer_id}} </td>
  31. <td>{{$hopaddition->hop_id}} </td>
  32. <td>{{$hopaddition->amount}} </td>
  33. <td>{{$hopaddition->timing}} </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 Addition</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('hopadditions.store')}}" method="post">
  55. {{csrf_field()}}
  56. <div class="form-group">
  57. <label for="">Beer ID</label>
  58. <input type="text" class="form-control" name="beer_id">
  59. </div>
  60. <div class="form-group">
  61. <label for="">Hop ID</label>
  62. <input type="text" class="form-control" name="hop_id" >
  63. </div>
  64. <div class="form-group">
  65. <label for="">Amount</label>
  66. <input type="text" class="form-control" name="amount">
  67. </div>
  68. <div class="form-group">
  69. <label for="">Timing</label>
  70. <input type="text" class="form-control" name="timing">
  71. </div>
  72. <input type="submit" name="submit" value="Submit" class="btn btn-success">
  73. </form>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. @endsection