improvements
This commit is contained in:
@@ -15,18 +15,36 @@
|
||||
@if(session('status'))<div class="hd-alert hd-alert-success">{{ session('status') }}</div>@endif
|
||||
@if($errors->any())<div class="hd-alert hd-alert-danger"><ul>@foreach($errors->all() as $error)<li>{{ $error }}</li>@endforeach</ul></div>@endif
|
||||
|
||||
<section class="hd-panel overflow-x-auto">
|
||||
<section class="hd-panel overflow-hidden">
|
||||
<div class="p-5 border-b border-zinc-700"><h2 class="text-xl font-semibold">Roles</h2></div>
|
||||
<table class="w-full min-w-[760px]">
|
||||
<thead><tr><th>Name</th><th>Slug</th><th>Users</th><th>Permissions</th><th class="text-right">Actions</th></tr></thead>
|
||||
<tbody>
|
||||
<div class="overflow-x-auto"><table class="w-full min-w-[820px] border-collapse">
|
||||
<thead class="bg-zinc-900/55 text-left text-xs uppercase tracking-[0.12em] text-zinc-400">
|
||||
<tr>
|
||||
<th class="px-6 py-4 font-semibold">Name</th>
|
||||
<th class="px-6 py-4 font-semibold">Slug</th>
|
||||
<th class="px-6 py-4 text-center font-semibold">Users</th>
|
||||
<th class="px-6 py-4 text-center font-semibold">Permissions</th>
|
||||
<th class="px-6 py-4 text-right font-semibold">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-zinc-800/90">
|
||||
@forelse($roles as $role)
|
||||
<tr>
|
||||
<td><strong>{{ $role->name }}</strong>@if($role->is_system) <span class="hd-badge">System</span>@endif</td>
|
||||
<td><code>{{ $role->slug }}</code></td>
|
||||
<td>{{ $role->users_count }}</td>
|
||||
<td>{{ $role->permissions_count }}</td>
|
||||
<td><div class="flex justify-end gap-2">
|
||||
<td class="px-6 py-4">
|
||||
<div class="flex items-center gap-2">
|
||||
<strong class="text-sm font-semibold text-zinc-100">{{ $role->name }}</strong>
|
||||
@if($role->is_system)
|
||||
<span class="rounded-full border border-blue-500/30 bg-blue-500/10 px-2 py-0.5 text-[10px] font-bold uppercase tracking-wide text-blue-300">System</span>
|
||||
@endif
|
||||
</div>
|
||||
@if($role->description)
|
||||
<div class="mt-1 max-w-xl text-xs leading-5 text-zinc-500">{{ $role->description }}</div>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-6 py-4"><code class="rounded-md bg-black/25 px-2 py-1 text-xs text-zinc-300">{{ $role->slug }}</code></td>
|
||||
<td class="px-6 py-4 text-center text-sm text-zinc-300">{{ $role->users_count }}</td>
|
||||
<td class="px-6 py-4 text-center text-sm text-zinc-300">{{ $role->permissions_count }}</td>
|
||||
<td class="px-6 py-4"><div class="flex justify-end gap-2">
|
||||
<a class="hd-action hd-action-blue" href="{{ route('user-management.roles.edit', $role) }}">Edit</a>
|
||||
@unless($role->is_system)
|
||||
<form method="POST" action="{{ route('user-management.roles.destroy', $role) }}" onsubmit="return confirm('Delete this role?')">@csrf @method('DELETE')
|
||||
@@ -39,20 +57,32 @@
|
||||
<tr><td colspan="5" class="p-5">No roles created.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</table></div>
|
||||
</section>
|
||||
|
||||
<section class="hd-panel overflow-x-auto">
|
||||
<section class="hd-panel overflow-hidden">
|
||||
<div class="p-5 border-b border-zinc-700"><h2 class="text-xl font-semibold">Permissions</h2></div>
|
||||
<table class="w-full min-w-[760px]">
|
||||
<thead><tr><th>Name</th><th>Slug</th><th>Roles</th><th class="text-right">Actions</th></tr></thead>
|
||||
<tbody>
|
||||
<div class="overflow-x-auto"><table class="w-full min-w-[820px] border-collapse">
|
||||
<thead class="bg-zinc-900/55 text-left text-xs uppercase tracking-[0.12em] text-zinc-400">
|
||||
<tr>
|
||||
<th class="px-6 py-4 font-semibold">Name</th>
|
||||
<th class="px-6 py-4 font-semibold">Slug</th>
|
||||
<th class="px-6 py-4 text-center font-semibold">Roles</th>
|
||||
<th class="px-6 py-4 text-right font-semibold">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-zinc-800/90">
|
||||
@forelse($permissions as $permission)
|
||||
<tr>
|
||||
<td><strong>{{ $permission->name }}</strong></td>
|
||||
<td><code>{{ $permission->slug }}</code></td>
|
||||
<td>{{ $permission->roles_count }}</td>
|
||||
<td><div class="flex justify-end gap-2">
|
||||
<td class="px-6 py-4">
|
||||
<strong class="text-sm font-semibold text-zinc-100">{{ $permission->name }}</strong>
|
||||
@if($permission->description)
|
||||
<div class="mt-1 max-w-xl text-xs leading-5 text-zinc-500">{{ $permission->description }}</div>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-6 py-4"><code class="rounded-md bg-black/25 px-2 py-1 text-xs text-zinc-300">{{ $permission->slug }}</code></td>
|
||||
<td class="px-6 py-4 text-center text-sm text-zinc-300">{{ $permission->roles_count }}</td>
|
||||
<td class="px-6 py-4"><div class="flex justify-end gap-2">
|
||||
<a class="hd-action hd-action-blue" href="{{ route('user-management.permissions.edit', $permission) }}">Edit</a>
|
||||
<form method="POST" action="{{ route('user-management.permissions.destroy', $permission) }}" onsubmit="return confirm('Delete this permission?')">@csrf @method('DELETE')
|
||||
<button class="hd-action hd-action-red" type="submit">Delete</button>
|
||||
@@ -63,7 +93,7 @@
|
||||
<tr><td colspan="4" class="p-5">No permissions created.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</table></div>
|
||||
</section>
|
||||
</div>
|
||||
</x-layouts::app>
|
||||
|
||||
Reference in New Issue
Block a user