@extends('layouts.dashboard') @section('content') @php /** * Admin → Roles. What each role in the platform may do, and how many accounts hold it. * * @var array $roles role rows in display order * @var array $permCounts role id => privileges held * @var array $userCounts role slug => live accounts */ $roles = $roles ?? []; $permCounts = $permCounts ?? []; $userCounts = $userCounts ?? []; $catalogueTotal = count(\App\Models\Role::catalogueSlugs()); @endphp @php /* .qm-d2: the dashboard density standard (app.css §35) */ @endphp
| {{ t_raw('admin.roles.col_role') }} | {{ t_raw('admin.roles.col_permissions') }} | {{ t_raw('admin.roles.col_users') }} | {{ t_raw('common.actions') }} |
|---|---|---|---|
|
{{ role_label($slug) }}
@if (!empty($r['description'])){{ $r['description'] }}@endif
{!! role_pill($slug) !!}
@if ($system){{ t_raw('admin.roles.pill_system') }}@endif
|
@if ($staff) {{ number_format($shown) }} @elseif ($shown > 0) {{ number_format($shown) }} @else {!! dash() !!} @endif | @if ($users > 0) {{ number_format($users) }} @else{!! dash() !!}@endif | @php $rowActions = [ $staff ? [ 'label' => t_raw('common.edit'), 'icon' => 'fa-pen', 'href' => '/admin/roles/' . $rid, 'primary' => true, ] : [ // Nothing to grant or revoke on a platform identity, so the row // says so rather than offering a control that does nothing. 'label' => t_raw('admin.roles.action_structural'), 'icon' => 'fa-lock', 'primary' => true, 'disabled' => true, ], $system ? null : [ 'label' => t_raw('common.delete'), 'icon' => 'fa-trash-alt', 'danger' => true, 'form' => [ 'action' => '/admin/roles/delete', 'fields' => ['id' => $rid], 'confirm' => t_raw('admin.roles.confirm_delete', [':name' => role_label($slug)]), ], ], ]; @endphp @partial('row-actions', ['actions' => array_values(array_filter($rowActions))]) |