new: add colored status badges in order lists

Add ``getStatusBadge()`` to ``Orders`` returning Bootstrap badge HTML
per status: warning (En attente), info (Préparation), primary
(Expédié), success (Livré), danger (Annulé). Applied to all four
order DataTables (admin, admin customer, shop, shop customer).
This commit is contained in:
Valentin Lab
2026-02-20 11:55:33 +01:00
parent 5325fa1f06
commit fa4aea7358
5 changed files with 29 additions and 9 deletions

View File

@@ -29,7 +29,7 @@ class OrdersDataTable extends DataTable
{
$datatables
->editColumn('status', function (Order $order) {
return Orders::getStatus($order->status);
return Orders::getStatusBadge($order->status);
})
->editColumn('created_at', function (Order $order) {
return $order->created_at->toDateTimeString();
@@ -40,7 +40,7 @@ class OrdersDataTable extends DataTable
->editColumn('payment_type', function (Order $order) {
return InvoicePayments::getPaymentType($order->payment_type);
})
->rawColumns(['action']);
->rawColumns(['status', 'action']);
return parent::modifier($datatables);
}