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.

50 lines
1.7 KiB

  1. @extends('grainbills')
  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> -> {{ __('Grain Bills') }}<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('grainbills.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. <thead>
  18. <tr>
  19. <th scope="col">Grain</th>
  20. <th scope="col">Beer</th>
  21. <th scope="col">Amount</th>
  22. <th scope="col">% of Grain Bill</th>
  23. @if (Auth::user()->isAdmin())<th colspan="2" scope="col">Admin</th>@endif
  24. <tbody>
  25. @foreach ($grainbills as $grainbill)
  26. <tr>
  27. <td><a href="/grain/{{$grainbill->grain_id}}">{{$grainbill->name}}</a> </td>
  28. <td><a href="/beer/{{$grainbill->beer_id}}">{{$grainbill->beer}}</a> </td>
  29. <td>{{$grainbill->amount}} </td>
  30. <td>{{$grainbill->grain_bill}} </td>
  31. @if (Auth::user()->isAdmin())
  32. <td><a href="{{ route('grainbills.edit',$grainbill->id)}}" class="btn btn-primary">Edit</a></td>
  33. <td><form action="{{ route('grainbills.destroy', $grainbill->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