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.

41 lines
1.5 KiB

  1. @extends('grains')
  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> -> {{ __('Grain 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('grains.create') }}" class="btn btn-primary">Add Grain</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. <tbody>
  18. @foreach ($grains as $grain)
  19. <tr>
  20. <td><a href="/grain/{{$grain->id}}">{{$grain->name}}</a> </td>
  21. @if (Auth::user()->isAdmin())
  22. <td><a href="{{ route('grains.edit',$grain->id)}}" class="btn btn-primary">Edit</a></td>
  23. <td><form action="{{ route('grains.destroy', $grain->id)}}" method="post">
  24. @csrf
  25. @method('DELETE')
  26. <button class="btn btn-danger" type="submit">Delete</button>
  27. </form></td>
  28. @endif
  29. </tr>
  30. @endforeach
  31. </tbody>
  32. </table>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. @endsection