From 3a52faec5c071369eefba8534d2020c06a662077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20L=C3=B8vgaard?= Date: Thu, 9 Jan 2025 09:45:16 +0100 Subject: [PATCH] Added good looking states --- .../SetonoSyliusCatalogPromotionExtension.php | 8 +++++++- .../label/state/completed.html.twig | 4 ++++ .../catalog_promotion_update/label/state/failed.html.twig | 4 ++++ .../label/state/pending.html.twig | 4 ++++ .../label/state/processing.html.twig | 4 ++++ 5 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/Resources/views/Admin/catalog_promotion_update/label/state/completed.html.twig create mode 100644 src/Resources/views/Admin/catalog_promotion_update/label/state/failed.html.twig create mode 100644 src/Resources/views/Admin/catalog_promotion_update/label/state/pending.html.twig create mode 100644 src/Resources/views/Admin/catalog_promotion_update/label/state/processing.html.twig diff --git a/src/DependencyInjection/SetonoSyliusCatalogPromotionExtension.php b/src/DependencyInjection/SetonoSyliusCatalogPromotionExtension.php index 2f96920..b8fc9fa 100644 --- a/src/DependencyInjection/SetonoSyliusCatalogPromotionExtension.php +++ b/src/DependencyInjection/SetonoSyliusCatalogPromotionExtension.php @@ -62,9 +62,15 @@ public function prepend(ContainerBuilder $container): void 'limits' => [100, 200, 500], 'fields' => [ 'state' => [ - 'type' => 'string', + 'type' => 'twig', 'label' => 'sylius.ui.state', 'sortable' => null, + 'options' => [ + 'template' => '@SyliusUi/Grid/Field/state.html.twig', + 'vars' => [ + 'labels' => '@SetonoSyliusCatalogPromotionPlugin/Admin/catalog_promotion_update/label/state', + ], + ], ], 'triggeredBy' => [ 'type' => 'string', diff --git a/src/Resources/views/Admin/catalog_promotion_update/label/state/completed.html.twig b/src/Resources/views/Admin/catalog_promotion_update/label/state/completed.html.twig new file mode 100644 index 0000000..895532a --- /dev/null +++ b/src/Resources/views/Admin/catalog_promotion_update/label/state/completed.html.twig @@ -0,0 +1,4 @@ + + + {{ value|trans }} + diff --git a/src/Resources/views/Admin/catalog_promotion_update/label/state/failed.html.twig b/src/Resources/views/Admin/catalog_promotion_update/label/state/failed.html.twig new file mode 100644 index 0000000..7425343 --- /dev/null +++ b/src/Resources/views/Admin/catalog_promotion_update/label/state/failed.html.twig @@ -0,0 +1,4 @@ + + + {{ value|trans }} + diff --git a/src/Resources/views/Admin/catalog_promotion_update/label/state/pending.html.twig b/src/Resources/views/Admin/catalog_promotion_update/label/state/pending.html.twig new file mode 100644 index 0000000..03626be --- /dev/null +++ b/src/Resources/views/Admin/catalog_promotion_update/label/state/pending.html.twig @@ -0,0 +1,4 @@ + + + {{ value|trans }} + diff --git a/src/Resources/views/Admin/catalog_promotion_update/label/state/processing.html.twig b/src/Resources/views/Admin/catalog_promotion_update/label/state/processing.html.twig new file mode 100644 index 0000000..e4e168b --- /dev/null +++ b/src/Resources/views/Admin/catalog_promotion_update/label/state/processing.html.twig @@ -0,0 +1,4 @@ + + + {{ value|trans }} +