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:
@@ -46,12 +46,12 @@ class CustomerOrdersDataTable 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->isoFormat('DD/MM/YY HH:mm');
|
||||
})
|
||||
->rawColumns(['action']);
|
||||
->rawColumns(['status', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user