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.

87 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> -> {{ __('Yeast 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 Yeast
  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">Name</th>
  22. <th scope="col">Profile</th>
  23. </tr>
  24. </thead>
  25. <tbody>
  26. @foreach ($yeasts as $yeast)
  27. <tr>
  28. <td><a href="/yeast/{{$yeast->id}}">{{$yeast->name}}</a> </td>
  29. <td>{{str_replace(' ,',',',str_replace('"',' ',str_replace(',',', ',str_replace('}', '', str_replace('{','',$yeast->profile)))))}} </td>
  30. </tr>
  31. @endforeach
  32. </tbody>
  33. </table>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. <!-- this code if for the modal -->
  40. <div class="modal fade bg-primary text-dark" tabindex="-1" role="dialog" id="addModal">
  41. <div class="modal-dialog" role="document">
  42. <div class="modal-content">
  43. <div class="modal-header">
  44. <h5 class="modal-title">Add yeast</h5>
  45. <button type="button" class="close" data-dismiss="modal" aria-label="Close" >
  46. <span aria-hidden="true">x</span>
  47. </button>
  48. </div>
  49. <div class="modal-body">
  50. <form class="" action="{{route('yeasts.store')}}" method="post">
  51. {{csrf_field()}}
  52. <div class="form-group">
  53. <label for="">Name</label>
  54. <input type="text" class="form-control" name="name">
  55. </div>
  56. <div class="form-group">
  57. <label for="">Profile</label>
  58. <textarea type="text" class="form-control" name="profile" ></textarea>
  59. </div>
  60. <div class="form-group">
  61. <label for="">Attenuation</label>
  62. <input type="text" class="form-control" name="attenuation">
  63. </div>
  64. <div class="form-group">
  65. <label for="">Flocculation</label>
  66. <input type="text" class="form-control" name="flocculation">
  67. </div>
  68. <div class="form-group">
  69. <label for="">Alcohol Tolerance</label>
  70. <input type="text" class="form-control" name="tolerance">
  71. </div>
  72. <div class="form-group">
  73. <label for="">Temperature Range °C</label>
  74. <input type="text" class="form-control" name="temp_range">
  75. </div>
  76. <input type="submit" name="submit" value="Submit" class="btn btn-success">
  77. </form>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. @endsection