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.

52 lines
1.9 KiB

3 years ago
3 years ago
  1. @extends('breweries')
  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> -> {{ __('Brewery 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('breweries.create') }}" class="btn btn-primary">Add Brewery</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">Name</th>
  20. <th scope="col">City\Region</th>
  21. <th scope="col">Country</th>
  22. @if (Auth::user()->isAdmin())<th colspan="2" scope="col">Admin</th>@endif
  23. </tr>
  24. </thead>
  25. <tbody>
  26. @foreach ($breweries as $brewery)
  27. <tr>
  28. <td><a href="/brewery/{{$brewery->id}}">{{$brewery->name}}</a> </td>
  29. <td>{{$brewery->place}} </td>
  30. <td>{{$brewery->country}} </td>
  31. @if (Auth::user()->isAdmin())
  32. <td><a href="{{ route('breweries.edit',$brewery->id)}}" class="btn btn-primary">Edit</a></td>
  33. <td><form action="{{ route('breweries.destroy', $brewery->id)}}" method="post">
  34. @csrf
  35. @method('DELETE')
  36. <button class="btn btn-danger" type="submit">Delete</button>
  37. </form></td>
  38. @endif
  39. </tr>
  40. @endforeach
  41. </tbody>
  42. </table>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. @endsection