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.

55 lines
1.8 KiB

  1. @extends('beers')
  2. @section('main')
  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> -> {{ __('Beer 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 Beer
  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">Brewery</th>
  23. <th scope="col">Style</th>
  24. @if (Auth::user()->isAdmin())<th colspan="2" scope="col">Admin</th>@endif
  25. </tr>
  26. </thead>
  27. <tbody>
  28. @foreach ($beers as $beer)
  29. <tr>
  30. <td><a href="/beer/{{$beer->beer_id}}">{{$beer->name}}</a> </td>
  31. <td><a href="/brewery/{{$beer->brewery_id}}">{{$beer->brewery}}</a> </td>
  32. <td>{{$beer->type}} </td>
  33. @if (Auth::user()->isAdmin())
  34. <td><a href="{{ route('beers.edit',$beer->beer_id)}}" class="btn btn-primary">Edit</a></td>
  35. <td><form action="{{ route('beers.destroy', $beer->beer_id)}}" method="post">
  36. @csrf
  37. @method('DELETE')
  38. <button class="btn btn-danger" type="submit">Delete</button>
  39. </form></td>
  40. @endif
  41. </tr>
  42. @endforeach
  43. </tbody>
  44. </table>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. @endsection