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
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-12">
  6. <div class="card">
  7. @include('inc.navbar')
  8. @include('search.index')
  9. <div class="card-header"><a href="/home">Home</a> -> {{ __('Beer List') }}<span class="backlink"><a href="{{url()->previous()}}">Go Back</a></span></div>
  10. <div class="card-body">
  11. @if (Auth::user()->isAdmin())
  12. <a href="{{ route('beers.create') }}" class="btn btn-primary">Add Beer</a>
  13. <hr />
  14. @endif
  15. <table class="table table-striped table-dark" id="table-programs">
  16. <!-- This piece of code is for error messages display purposes -->
  17. @include('inc.messages')
  18. <thead>
  19. <tr>
  20. <th scope="col">Name</th>
  21. <th scope="col">Brewery</th>
  22. <th scope="col" class="hideable">Style</th>
  23. @if (Auth::user()->isAdmin())<th scope="col">Admin</th>@endif
  24. </tr>
  25. </thead>
  26. <tbody>
  27. @foreach ($beers as $beer)
  28. <tr>
  29. <td><a href="/beer/{{$beer->beer_id}}">{{$beer->name}}</a> </td>
  30. <td><a href="/brewery/{{$beer->brewery_id}}">{{$beer->brewery}}</a> </td>
  31. <td class="hideable">{{$beer->type}} </td>
  32. @if (Auth::user()->isAdmin())
  33. <td><span id="buttons"><a href="{{ route('beers.edit',$beer->beer_id)}}" class="btn btn-primary editbutton">Edit</a>
  34. <form action="{{ route('beers.destroy', $beer->beer_id)}}" method="post">
  35. @csrf
  36. @method('DELETE')
  37. <button class="btn btn-danger deletebutton" type="submit">Delete</button>
  38. </form></span></td>
  39. @endif
  40. </tr>
  41. @endforeach
  42. </tbody>
  43. </table>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. @endsection