Enable admin setting user for a system

This commit is contained in:
2023-12-19 11:16:08 +11:00
parent ac2ee7df0c
commit 90206f2bb5
5 changed files with 320 additions and 242 deletions

View File

@@ -6,12 +6,12 @@
@section('content')
<div class="row">
<div class="row">
<div class="col-9">
<div class="col-12">
<h2>System Users</h2>
</div>
</div>
<div class="col-9">
<div class="col-12">
<p>This system is aware of the following users @can('admin',(new \App\Models\User))(you can <a href="{{ url('user/addedit') }}">add</a> more)@endcan:</p>
<table class="table monotable" id="user">
<thead>
@@ -22,11 +22,12 @@
<th>Active</th>
<th>Verified</th>
<th>Last On</th>
<th class="text-end">Systems</th>
</tr>
</thead>
<tbody>
@foreach (\App\Models\User::orderBy('email')->cursor() as $oo)
@foreach (\App\Models\User::orderBy('email')->with(['systems'])->get() as $oo)
<tr class="{{ $oo->admin ? 'admin' : '' }}">
<td><a href="{{ url('user/addedit',[$oo->id]) }}">{{ $oo->id }}</a> @if($user->admin && ($user->id !== $oo->id))<span class="float-end"><a href="{{ url('admin/switch/start',[$oo->id]) }}"><i class="bi bi-person-bounding-box"></i></a></span>@endif</td>
<td>{{ $oo->email }}</td>
@@ -34,6 +35,7 @@
<td>{{ $oo->active ? 'YES' : 'NO' }}</td>
<td>{{ $oo->email_verified_at ? $oo->email_verified_at->format('Y-m-d') : '-' }}</td>
<td>{{ $oo->last_on ? $oo->last_on->toDateTimeString() : 'Unknown' }}</td>
<td class="text-end">{{ number_format($oo->systems->count()) }}</td>
</tr>
@endforeach
</tbody>