new: show active/inactive status toggle on offer edit form

This commit is contained in:
Valentin Lab
2026-03-16 16:24:44 +01:00
parent 55051334ef
commit 39572c9ea2

View File

@@ -73,7 +73,7 @@
</a>
</div>
</div>
<div class="col-4">
<div class="col-2">
@include('components.form.input', [
'name' => 'weight',
'value' => $offer['weight'] ?? null,
@@ -81,6 +81,15 @@
'required' => true,
])
</div>
<div class="col-2">
<input type="hidden" name="status_id" value="0">
@include('components.form.toggle', [
'name' => 'status_id',
'value' => $offer['status_id'] ?? 0,
'label' => 'Actif',
'size' => 'md',
])
</div>
</div>
@component('components.card', ['title' => 'Disponibilité', 'class' => 'mt-5'])
@@ -143,6 +152,8 @@
initChevron();
initSaveForm('#offer-form');
initSelect2();
$('#status_id').bootstrapToggle();
function updateEditLink(selectId, linkId, routeTemplate) {
var val = $('#' + selectId).val();
var $link = $('#' + linkId);