index.blade.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="row mb-2">
  4. <div class="col-md-6">
  5. <h3>Роли и права</h3>
  6. </div>
  7. <div class="col-md-6 text-end">
  8. <a href="{{ route('admin.roles.create') }}" class="btn btn-sm btn-primary">Добавить роль</a>
  9. </div>
  10. </div>
  11. <div class="table-responsive">
  12. <table class="table table-sm table-hover align-middle">
  13. <thead>
  14. <tr>
  15. <th>Роль</th>
  16. <th>Код</th>
  17. <th>Тип</th>
  18. <th>Активна</th>
  19. <th>Пользователей</th>
  20. <th></th>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. @foreach($roles as $role)
  25. <tr>
  26. <td>
  27. <a href="{{ route('admin.roles.edit', $role) }}">{{ $role->name }}</a>
  28. @if($role->description)
  29. <div class="text-muted small">{{ $role->description }}</div>
  30. @endif
  31. </td>
  32. <td><code>{{ $role->slug }}</code></td>
  33. <td>{{ $role->is_system ? 'Базовая' : 'Пользовательская' }}</td>
  34. <td>{{ $role->is_active ? 'Да' : 'Нет' }}</td>
  35. <td>{{ $role->users_count }}</td>
  36. <td class="text-end">
  37. <a href="{{ route('admin.roles.edit', $role) }}" class="btn btn-sm btn-outline-primary">Открыть</a>
  38. <form action="{{ route('admin.roles.copy', $role) }}" method="post" class="d-inline">
  39. @csrf
  40. <button type="submit" class="btn btn-sm btn-outline-secondary">Копировать</button>
  41. </form>
  42. </td>
  43. </tr>
  44. @endforeach
  45. </tbody>
  46. </table>
  47. </div>
  48. @endsection