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.

54 lines
2.1 KiB

  1. @extends('hops')
  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> -> {{ __('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. <a href="{{ route('hops.create') }}" class="btn btn-primary">Add Hop</a>
  12. <hr />
  13. @endif
  14. <table class="table table-striped table-dark" id="table-programs">
  15. <!-- This piece of code is for error messages display purposes -->
  16. @include('inc.messages')
  17. <thead>
  18. <tr>
  19. <th scope="col">Hop Name</th>
  20. <th scope="col" class="hideable">Profile</th>
  21. <th scope="col" class="hideable">Bittering?</th>
  22. <th scope="col" class="hideable">Aroma?</th>
  23. @if (Auth::user()->isAdmin())<th scope="col">Admin</th>@endif
  24. </tr>
  25. </thead>
  26. <tbody>
  27. @foreach ($hops as $hop)
  28. <tr>
  29. <td><a href="/hop/{{$hop->id}}">{{$hop->name}}</a> </td>
  30. <td class="hideable">{{str_replace(' ,',',',str_replace('"',' ',str_replace(',',', ',str_replace('}', '', str_replace('{','',$hop->profile)))))}} </td>
  31. <td class="hideable">@if($hop->bitter == 1) yes @else no @endif </td>
  32. <td class="hideable">@if($hop->aroma == 1) yes @else no @endif </td>
  33. @if (Auth::user()->isAdmin())
  34. <td><span id="buttons"><a href="{{ route('hops.edit',$hop->id)}}" class="btn btn-primary editbutton">Edit</a>
  35. <form action="{{ route('hops.destroy', $hop->id)}}" method="post">
  36. @csrf
  37. @method('DELETE')
  38. <button class="btn btn-danger deletebutton" type="submit">Delete</button>
  39. </form></span></td>
  40. @endif
  41. </tr>
  42. @endforeach
  43. </tbody>
  44. </table>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. @endsection