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.

49 lines
1.9 KiB

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