diff --git a/src/Enum/TaskCollectionState.php b/src/Enum/TaskCollectionState.php index e2fbaa2d55..1b0a39080b 100644 --- a/src/Enum/TaskCollectionState.php +++ b/src/Enum/TaskCollectionState.php @@ -38,4 +38,14 @@ function toLabel() { TaskCollectionState::CANCELLED => 'delivery.state.cancelled' }; } + + function toColor() { + return match ($this) { + TaskCollectionState::PENDING => 'grey', + TaskCollectionState::IN_DELIVERY => 'skyblue', + TaskCollectionState::DELIVERED => 'green', + TaskCollectionState::FAILED => 'orange', + TaskCollectionState::CANCELLED => 'red' + }; + } } diff --git a/templates/_partials/delivery/list.html.twig b/templates/_partials/delivery/list.html.twig index 6b456cdfd1..4bb023a5ec 100644 --- a/templates/_partials/delivery/list.html.twig +++ b/templates/_partials/delivery/list.html.twig @@ -66,7 +66,7 @@ {% set deliveryState = delivery.computeState() %} - +