users.blade.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. @extends('hello')
  2. @section('content')
  3. <div class="page-header"><h1>Benutzerverwaltung</h1></div>
  4. {{$users->links()}}
  5. <table class="table">
  6. <tr>
  7. <th>Name</th>
  8. <th>Email</th>
  9. <th>Filme</th>
  10. <th>Kommentare</th>
  11. <th>Aktion</th>
  12. </tr>
  13. @foreach($users as $user)
  14. <tr>
  15. <td>{{$user->name}}</td>
  16. <td>{{$user->email}}</td>
  17. <td>{{$user->films()->count()}}</td>
  18. <td>{{$user->comments()->count()}}</td>
  19. <td>
  20. @if($user->admin)
  21. @if($user->name != "Daniel")
  22. <button class="btn btn-primary btn-xs" type="button">Admin</button>
  23. <a class="btn btn-warning btn-xs" type="button" href="{{ url('users/rmadm/' . $user->id) }}">Rechte entziehen</a>
  24. @else
  25. &mdash;
  26. @endif
  27. @else
  28. <a class="btn btn-default btn-xs" type="button" href="{{ url('users/mkadm/' . $user->id) }}">Zum Admin machen</a>
  29. <a class="btn btn-danger btn-xs" type="button" href="{{ url('users/rmusr/' . $user->id) }}">Löschen</a>
  30. @endif
  31. </td>
  32. </tr>
  33. @endforeach
  34. </table>
  35. {{$users->links()}}
  36. @stop
  37. @section('title')
  38. Benutzerverwaltung ~
  39. @stop