ldc-crm/resources/views/bo/pages/users/index-list.blade.php
2023-10-06 16:37:30 +02:00

70 lines
4 KiB
PHP

<table class="table-hover table-fix-action m-0 table">
@if (count($userModels) > 0)
<thead>
@include('bo.modules.table-col-sorter', [
'cols' => [
'role' => Str::ucfirst(__('validation.attributes.role')),
'first_name' => Str::ucfirst(__('validation.attributes.first_name')),
'last_name' => Str::ucfirst(__('validation.attributes.last_name')),
'email' => Str::ucfirst(__('validation.attributes.email')),
'published' => Str::ucfirst(__('validation.custom.activated')),
'updated_at' => Str::ucfirst(__('validation.attributes.updated_at')),
],
])
</thead>
<tbody>
@foreach ($userModels as $userModel)
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ $userModel->role->label() }}</td>
<td class="text-center align-middle">{{ $userModel->first_name }}</td>
<td class="text-center align-middle">{{ $userModel->last_name }}</td>
<td class="text-center align-middle">{{ $userModel->email }}</td>
@include('bo.modules.change-published-status', [
'routeName' => 'users',
'model' => $userModel,
])
<td class="text-center align-middle">
<span class="badge bg-secondary text-bg-secondary">{{ $userModel->updated_at->isoFormat('LLLL') }}</span>
</td>
<td class="text-end align-middle">
@canAny(['delete', 'duplicate', 'update'], $userModel)
<form class="btn-group confirmDeleteTS" action="{{ route('bo.users.destroy', $userModel) }}" method="POST"
novalidate>
@can('duplicate', $userModel)
<a class="btn btn-sm btn-secondary" data-bs-toggle="tooltip"
href="{{ route('bo.users.duplicate', ['user' => $userModel]) }}"
title="{{ Str::ucfirst(__('crud.actions.duplicate')) }}">
<i class="fa-solid fa-copy"></i>
</a>
@endcan
@can('update', $userModel)
<a class="btn btn-sm btn-primary" data-bs-toggle="tooltip"
href="{{ route('bo.users.edit', ['user' => $userModel]) }}"
title="{{ Str::ucfirst(__('crud.actions.update')) }}">
<i class="fa-solid fa-pencil"></i>
</a>
@endcan
@can('delete', $userModel)
@csrf
@method('DELETE')
<button class="btn btn-sm btn-danger" data-bs-toggle="tooltip" type="submit"
title="{{ Str::ucfirst(__('crud.actions.delete')) }}">
<i class="fa-solid fa-trash"></i>
</button>
@endcan
</form>
@else
<span class="text-danger" data-bs-toggle="tooltip" title="{{ __('list.right') }}">
<i class="fa-solid fa-ban"></i>
</span>
@endcan
</td>
</tr>
@endforeach
</tbody>
@else
<tr>
<td class="border-0">{{ __('crud.other.no_model_found', ['model' => __('models.classes.user')]) }}</td>
</tr>
@endif
</table>