auditionadmin/resources/views/admin/users/edit.blade.php

107 lines
4.6 KiB
PHP

<x-layout.app>
<x-card.card class="mx-auto max-w-lg">
<x-card.heading>
Edit User
<x-slot:right_side>
@if($user->id != Auth::user()->id)
<x-delete-resource-modal
action="{{ route('admin.users.destroy',['user' => $user->id]) }}"
title="Delete user {{$user->full_name()}}">
Confirm you would like to delete the user {{ $user->full_name() }} having
email {{ $user->email }}.
This action cannot be undone.
</x-delete-resource-modal>
@endif
</x-slot:right_side>
</x-card.heading>
<x-form.form method="PATCH" action="{{ route('admin.users.update', $user) }}">
<x-form.body-grid>
<x-form.field name="first_name" label_text="First Name" colspan="3" value="{{ $user->first_name }}"/>
<x-form.field name="last_name" label_text="Last Name" colspan="3" value="{{ $user->last_name }}"/>
<x-form.field name="email" label_text="Email Address" colspan="3" value="{{ $user->email }}"/>
<x-form.field name="cell_phone" label_text="Cell Phone" colspan="3" value="{{ $user->cell_phone }}"/>
<x-form.field name="judging_preference" label_text="Judging Preference" colspan="6"
value="{{ $user->judging_preference }}"/>
<x-form.select name="school_id" colspan="4">
<x-slot:label>School</x-slot:label>
<option value="">No School</option>
@foreach ($schools as $school)
<option value="{{ $school->id }}"
@if ($user->school_id == $school->id) selected @endif>{{ $school->name }}</option>
@endforeach
</x-form.select>
<div class="col-span-2 pt-7">
<x-form.checkbox name="is_head" :checked="$user->hasFlag('head_director')">
<x-slot:label>Head Director</x-slot:label>
</x-form.checkbox>
</div>
<div class="col-span-3">
<x-form.checkbox name="is_admin" :checked="$user->is_admin">
<x-slot:label>Administrator</x-slot:label>
</x-form.checkbox>
</div>
<div class="col-span-3">
<x-form.checkbox name="is_tab" :checked="$user->is_tab">
<x-slot:label>Tabulator</x-slot:label>
</x-form.checkbox>
</div>
</x-form.body-grid>
<x-form.footer class="py-5">
<x-form.button>Update User</x-form.button>
</x-form.footer>
</x-form.form>
</x-card.card>
<x-card.card class="mt-5">
<x-card.heading>User Actions</x-card.heading>
<x-table.table>
<thead>
<tr>
<x-table.th>Timestamp</x-table.th>
<x-table.th>IP</x-table.th>
<x-table.th>User</x-table.th>
<x-table.th>Message</x-table.th>
</tr>
</thead>
<x-table.body>
@foreach($userActions as $logEntry)
<tr>
<x-table.td>{{ $logEntry->created_at }}</x-table.td>
<x-table.td>{{ $logEntry->ip_address }}</x-table.td>
<x-table.td>{{ $logEntry->user }}</x-table.td>
<x-table.td>{!! $logEntry->message !!}</x-table.td>
</tr>
@endforeach
</x-table.body>
</x-table.table>
</x-card.card>
<x-card.card class="mt-5">
<x-card.heading>Log Entries Affecting User</x-card.heading>
<x-table.table>
<thead>
<tr>
<x-table.th>Timestamp</x-table.th>
<x-table.th>IP</x-table.th>
<x-table.th>User</x-table.th>
<x-table.th>Message</x-table.th>
</tr>
</thead>
<x-table.body>
@foreach($logEntries as $logEntry)
<tr>
<x-table.td>{{ $logEntry->created_at }}</x-table.td>
<x-table.td>{{ $logEntry->ip_address }}</x-table.td>
<x-table.td>{{ $logEntry->user }}</x-table.td>
<x-table.td>{!! $logEntry->message !!}</x-table.td>
</tr>
@endforeach
</x-table.body>
</x-table.table>
</x-card.card>
</x-layout.app>