ldc-supportweb/resources/views/bo/pages/users/index.blade.php
2023-08-14 09:23:39 +00:00

70 lines
2.9 KiB
PHP

@extends('layout.app')
@section('title', __('models.classes.users'))
@section('description', __('Liste de tous les :model', ['model' => __('models.classes.users')]))
@section('content')
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center">
@include('breadcrumbs.breadcrumb-body')
<a href="{{ route('bo.users.create') }}"
class="btn btn-primary float-right"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="{{ __('crud.helpers.create_model', ['model' => Str::singular(__('models.classes.users'))]) }}">
<i class="fa-solid fa-plus"></i>
</a>
</div>
@include('bo.modules.search-bar')
<table class="table table-hover">
@if (count($userModels) > 0)
<thead>
@include('bo.modules.table-col-sorter', [
'cols' => [
'name' => Str::ucfirst(__('validation.attributes.name')),
'email' => Str::ucfirst(__('validation.attributes.email')),
'role' => Str::ucfirst(__('validation.attributes.role')),
'sites' => Str::ucfirst(__('validation.attributes.sites'))
],
])
</thead>
<tbody>
@foreach ($userModels as $userModel)
<tr class="list-item border-bottom">
<td class="text-center align-middle">{{ $userModel->name }}</td>
<td class="text-center align-middle">{{ $userModel->email }}</td>
<td class="text-center align-middle">{{ $userModel->role->label() }}</td>
<td class="text-center align-middle">{{ collect(json_decode($userModel->sites))->implode('name', ', ') }}</td>
<td class="text-end align-middle">
<form action="{{ route('bo.users.destroy', $userModel->id) }}"
method="POST"
class="btn-group confirmDeleteTS"
novalidate>
<a class="btn btn-sm btn-primary"
href="{{ route('bo.users.edit', ['user' => $userModel->id]) }}"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="{{ __('crud.actions.update') }}">
<i class="fa-solid fa-pencil"></i>
</a>
@csrf
@method('DELETE')
<button type="submit"
class="btn btn-sm btn-danger"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="{{ __('crud.actions.delete') }}">
<i class="fa-solid fa-trash"></i>
</button>
</form>
</td>
</tr>
@endforeach
</tbody>
@else
<tr>
<td class="text-center fw-bold border-0">{{ __('crud.other.no_model_found', ['model' => Str::singular(__('models.classes.users'))]) }}</td>
</tr>
@endif
</table>
{!! $userModels->links() !!}
@endsection