delete id call on routable model + add somes translations
This commit is contained in:
parent
b7cb4c0ab4
commit
176040f96b
10 changed files with 71 additions and 68 deletions
|
|
@ -38,7 +38,8 @@ return [
|
|||
'has_been_updated' => ':model has been updated',
|
||||
'cannot_be_updated' => ':model cannot be updated',
|
||||
'has_been_deleted' => ':model has been deleted',
|
||||
'cannot_be_deleted' => ':model cannot be deleted'
|
||||
'cannot_be_deleted' => ':model cannot be deleted',
|
||||
'cannot_be_deleted_relation' => ':model cannot be deleted because some :relations are attached to it',
|
||||
],
|
||||
|
||||
'minicrud' => [
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ return [
|
|||
'crm_password' => 'CRM Password',
|
||||
'type' => 'Type',
|
||||
'status' => 'Status',
|
||||
'brand_id' => 'Brand id',
|
||||
'brand_id' => 'Linked brand',
|
||||
'updated_at' => 'Updated at',
|
||||
'process_code' => 'Process code',
|
||||
'amount' => 'Amount',
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ return [
|
|||
'cannot_be_updated' => ':model ne peut être mis à jour',
|
||||
'has_been_deleted' => ':model a été supprimé',
|
||||
'cannot_be_deleted' => ':model ne peut être supprimé',
|
||||
"cannot_be_deleted_relation" => ':model ne peut être supprimé car des :relations lui sont attaché(e)s',
|
||||
'order_changed' => 'L\'ordre a été changé !',
|
||||
'order_not_changed' => 'L\'ordre n\'a pas été changé !',
|
||||
'publish_status_saved' => 'Changement de l\'état de publication réussi !',
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ return [
|
|||
'crm_password' => 'Mot de passe CRM',
|
||||
'type' => 'Type',
|
||||
'status' => 'Status',
|
||||
'brand_id' => 'ID de la marque',
|
||||
'brand_id' => 'Marque associée',
|
||||
'updated_at' => 'Date de modification',
|
||||
'process_code' => 'Code de processus',
|
||||
'amount' => 'Montant',
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<td class="text-center align-middle">
|
||||
<form action="{{ route('bo.' . $routeName . '.change-published', $model->id) }}" method="POST">
|
||||
<form action="{{ route('bo.' . $routeName . '.change-published', $model) }}" method="POST">
|
||||
@csrf
|
||||
<button type="submit"
|
||||
class="btn btn-sm @if($model->status) btn-primary @else btn-danger @endif"
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-light">
|
||||
<form id="formSubmit" action="{{ route('bo.brands.update', $brandModel->id) }}" method="POST" enctype="multipart/form-data">
|
||||
<form id="formSubmit" action="{{ route('bo.brands.update', $brandModel) }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('bo.pages.brands.form-inputs', ['model' => $brandModel])
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@
|
|||
class="badge bg-warning text-dark text-wrap">{{ $brandModel->updated_at->formatLocalized('%d/%m/%Y à %H:%M') }}</span>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<form class="btn-group confirmDeleteJS" action="{{ route('bo.brands.destroy', $brandModel->id) }}"
|
||||
<form class="btn-group confirmDeleteJS" action="{{ route('bo.brands.destroy', $brandModel) }}"
|
||||
method="POST" novalidate>
|
||||
<a class="btn btn-sm btn-primary" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.brands.edit', $brandModel->id) }}"
|
||||
href="{{ route('bo.brands.edit', $brandModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => Str::singular(__('models.classes.brands'))]) }}">
|
||||
<i class="fa-solid fa-pencil"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-light">
|
||||
<form id="formSubmit" action="{{ route('bo.coupons.update', $couponModel->id) }}" method="POST" enctype="multipart/form-data">
|
||||
<form id="formSubmit" action="{{ route('bo.coupons.update', $couponModel) }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('bo.pages.coupons.form-inputs', ['model' => $couponModel])
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
'model' => $couponModel ?? null,
|
||||
'associatedModels' => $brandModels,
|
||||
'foreignLabel' => 'name',
|
||||
'helper' => __('Chose one :model among this list.', [
|
||||
'helper' => __('Choisissez une :model dans la liste.', [
|
||||
'model' => Str::singular(trans('models.classes.brands')),
|
||||
]),
|
||||
])
|
||||
|
|
@ -330,66 +330,67 @@
|
|||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
{{-- END DIFFUSION DATE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border bg-white p-3">
|
||||
<legend>{{ __('validation.attributes.end_diffusion_date') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
@include('bo.partials.inputs.timestamp-date', [
|
||||
'id' => 'couponEndDiffusionDate',
|
||||
'label' => __('Date de fin de diffusion du :model', ['model' => Str::singular(__('models.classes.coupons'))]),
|
||||
'name' => 'end_diffusion_date',
|
||||
'required' => false,
|
||||
'model' => $couponModel ?? null,
|
||||
'helper' => __('validation.date', [
|
||||
'attribute' => __('Date de fin de diffusion du :model', [
|
||||
'model' => Str::singular(__('models.classes.coupons')),
|
||||
{{-- END DIFFUSION DATE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border bg-white p-3">
|
||||
<legend>{{ __('validation.attributes.end_diffusion_date') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
@include('bo.partials.inputs.timestamp-date', [
|
||||
'id' => 'couponEndDiffusionDate',
|
||||
'label' => __('Date de fin de diffusion du :model', ['model' => Str::singular(__('models.classes.coupons'))]),
|
||||
'name' => 'end_diffusion_date',
|
||||
'required' => false,
|
||||
'model' => $couponModel ?? null,
|
||||
'helper' => __('validation.date', [
|
||||
'attribute' => __('Date de fin de diffusion du :model', [
|
||||
'model' => Str::singular(__('models.classes.coupons')),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- END VALIDITY DATE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border bg-white p-3">
|
||||
<legend>{{ __('validation.attributes.end_validity_date') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
@include('bo.partials.inputs.timestamp-date', [
|
||||
'id' => 'couponEndDiffusionDate',
|
||||
'label' => __('Date de fin de validité du :model', ['model' => Str::singular(__('models.classes.coupons'))]),
|
||||
'name' => 'end_validity_date',
|
||||
'required' => false,
|
||||
'disabled' => true,
|
||||
'model' => $couponModel ?? null,
|
||||
'helper' => __('validation.date', [
|
||||
'attribute' => __('Date de fin de validité du :model', [
|
||||
'model' => Str::singular(__('models.classes.coupons')),
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- END VALIDITY DATE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border bg-white p-3">
|
||||
<legend>{{ __('validation.attributes.end_validity_date') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
@include('bo.partials.inputs.timestamp-date', [
|
||||
'id' => 'couponEndDiffusionDate',
|
||||
'label' => __('Date de fin de validité du :model', ['model' => Str::singular(__('models.classes.coupons'))]),
|
||||
'name' => 'end_validity_date',
|
||||
'required' => false,
|
||||
'disabled' => true,
|
||||
'model' => $couponModel ?? null,
|
||||
'helper' => __('validation.date', [
|
||||
'attribute' => __('Date de fin de validité du :model', [
|
||||
'model' => Str::singular(__('models.classes.coupons')),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- STATUS --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border bg-white p-3">
|
||||
<legend>{{ __('validation.attributes.status') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
@include('bo.partials.inputs.tinyint-boolean', [
|
||||
'id' => 'couponStatus',
|
||||
'name' => 'status',
|
||||
'label' => __('crud.minicrud.visibility_label'),
|
||||
'helper' => __('crud.minicrud.visibility_helper'),
|
||||
'model' => $couponModel ?? null,
|
||||
])
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- STATUS --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border bg-white p-3">
|
||||
<legend>{{ __('validation.attributes.status') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
@include('bo.partials.inputs.tinyint-boolean', [
|
||||
'id' => 'couponStatus',
|
||||
'name' => 'status',
|
||||
'label' => __('crud.minicrud.visibility_label'),
|
||||
'helper' => __('crud.minicrud.visibility_helper'),
|
||||
'model' => $couponModel ?? null,
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -56,10 +56,10 @@
|
|||
class="badge bg-warning text-dark text-wrap">{{ $couponModel->updated_at->formatLocalized('%d/%m/%Y à %H:%M') }}</span>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<form class="btn-group confirmDeleteJS" action="{{ route('bo.coupons.destroy', $couponModel->id) }}"
|
||||
<form class="btn-group confirmDeleteJS" action="{{ route('bo.coupons.destroy', $couponModel) }}"
|
||||
method="POST" novalidate>
|
||||
<a class="btn btn-sm btn-primary" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.coupons.edit', $couponModel->id) }}"
|
||||
href="{{ route('bo.coupons.edit', $couponModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => Str::singular(__('models.classes.coupons'))]) }}">
|
||||
<i class="fa-solid fa-pencil"></i>
|
||||
</a>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue