improve filament trans + user profile actions

This commit is contained in:
xiaomlove
2022-06-30 21:08:25 +08:00
parent 459d7462de
commit 579351c0eb
27 changed files with 966 additions and 178 deletions
@@ -5,83 +5,83 @@
<tbody>
<tr>
<th>UID</th>
<td>{{$user->id}}</td>
<td>{{$record->id}}</td>
<td></td>
</tr>
<tr>
<th>Username</th>
<td>{{$user->username}}</td>
<td>{{$record->username}}</td>
<td></td>
</tr>
<tr>
<th>Email</th>
<td>{{$user->email}}</td>
<td>{{$record->email}}</td>
<td></td>
</tr>
<tr>
<th>Status</th>
<td>{{$user->status}}</td>
<td>{{$record->status}}</td>
<td></td>
</tr>
<tr>
<th>Enabled</th>
<td>{{$user->enabled}}</td>
<td><button class="border px-1 rounded">Disable</button></td>
<td>{{$record->enabled}}</td>
<td></td>
</tr>
<tr>
<th>Added</th>
<td>{{$user->added}}</td>
<td>{{$record->added}}</td>
<td></td>
</tr>
<tr>
<th>Last access</th>
<td>{{$user->last_access}}</td>
<td>{{$record->last_access}}</td>
<td></td>
</tr>
<tr>
<th>Class</th>
<td>{{$user->classText}}</td>
<td>{{$record->classText}}</td>
<td></td>
</tr>
<tr>
<th>Invite by</th>
<td>{{$user->inviter->username ?? ''}}</td>
<td><button class="border px-1 rounded">View</button></td>
<td>{{$record->inviter->username ?? ''}}</td>
<td></td>
</tr>
<tr>
<th>Tow-step authentication</th>
<td>{{$user->two_step_secret ? 'Enabled' : 'Disabled'}}</td>
<td><button class="border px-1 rounded">Disable</button></td>
<td>{{$record->two_step_secret ? 'Enabled' : 'Disabled'}}</td>
<td></td>
</tr>
<tr>
<th>Seed points</th>
<td>{{$user->seed_points}}</td>
<td><button class="border px-1 rounded">Change</button></td>
<td>{{$record->seed_points}}</td>
<td></td>
</tr>
<tr>
<th>Attendance card</th>
<td>{{$user->attendance_card}}</td>
<td><button class="border px-1 rounded">Change</button></td>
<td>{{$record->attendance_card}}</td>
<td></td>
</tr>
<tr>
<th>Invites</th>
<td>{{$user->invites}}</td>
<td><button class="border px-1 rounded">Change</button></td>
<td>{{$record->invites}}</td>
<td></td>
</tr>
<tr>
<th>Uploaded</th>
<td>{{$user->uploadedText}}</td>
<td><button class="border px-1 rounded">Change</button></td>
<td>{{$record->uploadedText}}</td>
<td></td>
</tr>
<tr>
<th>Downloaded</th>
<td>{{$user->downloadedText}}</td>
<td><button class="border px-1 rounded">Change</button></td>
<td>{{$record->downloadedText}}</td>
<td></td>
</tr>
<tr>
<th>Bonus</th>
<td>{{$user->seedbonus}}</td>
<td><button class="border px-1 rounded">Change</button></td>
<td>{{$record->seedbonus}}</td>
<td></td>
</tr>
</tbody>
</table>
@@ -91,4 +91,10 @@
</div>
</div>
@if (count($relationManagers = $this->getRelationManagers()))
<x-filament::hr />
<x-filament::resources.relation-managers :active-manager="$activeRelationManager" :managers="$relationManagers" :owner-record="$record" />
@endif
</x-filament::page>
@@ -1,40 +1,36 @@
<x-filament::widget>
<x-filament::card>
<div class="p-2 space-y-2 bg-white rounded-xl shadow">
<div class="space-y-2">
<div class="px-4 py-2 space-y-4">
<div class="flex items-center justify-between gap-8">
<h2 class="text-xl font-semibold tracking-tight filament-card-heading">
{{$header}}
</h2>
</div>
<div aria-hidden="true" class="border-t filament-hr"></div>
<div>
<table class="w-full text-left rtl:text-right divide-y table-auto filament-tables-table">
<tbody class="divide-y whitespace-nowrap">
@foreach(array_chunk($data, 2) as $chunk)
<tr class="filament-tables-row">
@foreach($chunk as $item)
<th class="filament-tables-cell"><div class="px-4 py-3 filament-tables-text-column">{{$item['text']}}</div></th>
<td class="filament-tables-cell"
@if($loop->count == 1)
colspan="3"
@endif
>
<div class="px-4 py-3 filament-tables-text-column">{{$item['value']}}</div>
</td>
@endforeach
</tr>
<x-filament::widget class="filament-widgets-table-widget">
<div class="p-2 space-y-2 bg-white rounded-xl shadow">
<div class="space-y-2">
<div class="px-4 py-2 space-y-4">
<div class="flex items-center justify-between gap-8">
<h2 class="text-xl font-semibold tracking-tight filament-card-heading">
{{$header}}
</h2>
</div>
<div aria-hidden="true" class="border-t filament-hr"></div>
<div class="overflow-y-auto relative">
<table class="w-full text-left rtl:text-right divide-y table-auto filament-tables-table">
<tbody class="divide-y whitespace-nowrap">
@foreach(array_chunk($data, 2) as $chunk)
<tr class="filament-tables-row">
@foreach($chunk as $item)
<th class="filament-tables-cell"><div class="px-4 py-3 filament-tables-text-column">{{$item['text']}}</div></th>
<td class="filament-tables-cell"
@if($loop->count == 1)
colspan="3"
@endif
>
<div class="px-4 py-3 filament-tables-text-column">{{$item['value']}}</div>
</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
</tbody>
</table>
</div>
</div>
</div>
</div>
</x-filament::card>
</div>
</x-filament::widget>