84 lines
4.3 KiB
PHP
84 lines
4.3 KiB
PHP
@extends('layout.app')
|
|
|
|
@section('title', __('models.classes.packages'))
|
|
@section('description', __('Liste de tous les :model', ['model' => __('models.classes.packages')]))
|
|
|
|
@section('content')
|
|
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
|
@include('breadcrumbs.breadcrumb-body')
|
|
<form id="packageStatus" action="{{ route('bo.packages.index') }}">
|
|
<div class="input-group justify-content-end">
|
|
<select class="form-select w-fit" id="selectpackageStatus" name="status">
|
|
<option value="-1" @if ($status === '-1') selected @endif>
|
|
{{ __('validation.custom.all') }}
|
|
</option>
|
|
<option value="1" @if ($status === null || $status === '1') selected @endif>
|
|
{{ __('crud.other.publish') }}
|
|
</option>
|
|
<option value="0" @if ($status === '0') selected @endif>
|
|
{{ __('crud.other.unpublish') }}
|
|
</option>
|
|
</select>
|
|
@push('scripts')
|
|
<script nonce="{{ $nonce }}">
|
|
document.getElementById('selectpackageStatus').addEventListener('change', function(e) {
|
|
document.getElementById('packageStatus').submit();
|
|
});
|
|
</script>
|
|
@endpush
|
|
<a class="btn btn-primary float-right" data-bs-toggle="tooltip" data-bs-placement="top" href="{{ route('bo.packages.create') }}"
|
|
title="{{ __('crud.helpers.create_model', ['model' => Str::singular(__('models.classes.packages'))]) }}">
|
|
<i class="fa-solid fa-plus"></i>
|
|
</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
@include('bo.modules.search-bar')
|
|
<table class="table-hover table">
|
|
@if (count($packageModels) > 0)
|
|
<thead>
|
|
@include('bo.modules.table-col-sorter', [
|
|
'cols' => [
|
|
'name' => Str::ucfirst(__('validation.attributes.name')),
|
|
'amount' => Str::ucfirst(__('validation.attributes.day')),
|
|
'published' => Str::ucfirst(__('validation.custom.published')),
|
|
],
|
|
])
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($packageModels as $packageModel)
|
|
<tr class="border-bottom list-item">
|
|
<td class="text-center align-middle">{{ $packageModel->name }}</td>
|
|
<td class="text-center align-middle">{{ $packageModel->amount }}</td>
|
|
@include('bo.modules.change-published-status', [
|
|
'routeName' => 'packages',
|
|
'model' => $packageModel,
|
|
])
|
|
<td class="text-end align-middle">
|
|
<form class="btn-group confirmDeleteTS" action="{{ route('bo.packages.destroy', $packageModel->id) }}"
|
|
method="POST" novalidate>
|
|
<a class="btn btn-sm btn-primary" data-bs-toggle="tooltip" data-bs-placement="top"
|
|
href="{{ route('bo.packages.edit', ['package' => $packageModel->id]) }}"
|
|
title="{{ __('crud.actions.update') }}">
|
|
<i class="fa-solid fa-pencil"></i>
|
|
</a>
|
|
@csrf
|
|
@method('DELETE')
|
|
<button class="btn btn-sm btn-danger" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
|
title="{{ __('crud.actions.delete') }}">
|
|
<i class="fa-solid fa-trash"></i>
|
|
</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
@else
|
|
<tr>
|
|
<td class="fw-bold border-0 text-center">
|
|
{{ __('crud.other.no_model_found', ['model' => Str::singular(__('models.classes.packages'))]) }}</td>
|
|
</tr>
|
|
@endif
|
|
</table>
|
|
{!! $packageModels->links() !!}
|
|
@endsection
|