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.

89 lines
3.1 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> -> {{ __('Grain 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 Grain
  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. <tbody>
  20. @foreach ($grains as $grain)
  21. <tr>
  22. <td><a href="/grain/{{$grain->id}}">{{$grain->name}}</a> </td>
  23. </tr>
  24. @endforeach
  25. </tbody>
  26. </table>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. <!-- this code if for the modal -->
  33. <div class="modal fade bg-primary text-dark" tabindex="-1" role="dialog" id="addModal">
  34. <div class="modal-dialog" role="document">
  35. <div class="modal-content">
  36. <div class="modal-header">
  37. <h5 class="modal-title">Add Grain</h5>
  38. <button type="button" class="close" data-dismiss="modal" aria-label="Close" >
  39. <span aria-hidden="true">x</span>
  40. </button>
  41. </div>
  42. <div class="modal-body">
  43. <form class="" action="{{route('grains.store')}}" method="post">
  44. {{csrf_field()}}
  45. <div class="form-group">
  46. <label for="">Name</label>
  47. <input type="text" class="form-control" name="name">
  48. </div>
  49. <div class="form-group">
  50. <label for="">Flavour</label>
  51. <textarea type="text" class="form-control" name="flavour" ></textarea>
  52. </div>
  53. <div class="form-group">
  54. <label for="">Colour</label>
  55. <input type="text" class="form-control" name="colour">
  56. </div>
  57. <div class="form-group">
  58. <label for="">Lovibond</label>
  59. <input type="text" class="form-control" name="lovibond">
  60. </div>
  61. <div class="form-group">
  62. <label for="">Windisch-Kolbach</label>
  63. <input type="text" class="form-control" name="winkol">
  64. </div>
  65. <div class="form-group">
  66. <label for="">Lintner</label>
  67. <input type="text" class="form-control" name="lintner">
  68. </div>
  69. <div class="form-group">
  70. <label for="">EBC</label>
  71. <input type="text" class="form-control" name="ebc">
  72. </div>
  73. <div class="form-group">
  74. <label for="">Alternative Grain(s)</label>
  75. <input type="text" class="form-control" name="alternative">
  76. </div>
  77. <input type="submit" name="submit" value="Submit" class="btn btn-success">
  78. </form>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. @endsection