diff --git a/.changes/unreleased/Feature-20251007-101949.yaml b/.changes/unreleased/Feature-20251007-101949.yaml new file mode 100644 index 000000000..a0ba84124 --- /dev/null +++ b/.changes/unreleased/Feature-20251007-101949.yaml @@ -0,0 +1,6 @@ +kind: Feature +body: Create environment banner that can be activated and configured depending on the image deployed +time: 2025-10-07T10:19:49.784462956+02:00 +custom: + Issue: "423" + SchemaChange: No schema change diff --git a/src/Bundle/ChillMainBundle/Resources/views/Layout/_top_banner.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Layout/_top_banner.html.twig index a7a74c1f8..0ad81cce1 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Layout/_top_banner.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Layout/_top_banner.html.twig @@ -3,7 +3,7 @@ {% set current_locale = app.request.locale %} {% if chill_main_config.top_banner.text[current_locale] is defined %} - {% set banner_text = chill_main_config.top_banner.text[nl] %} + {% set banner_text = chill_main_config.top_banner.text[current_locale] %} {% else %} {% set banner_text = chill_main_config.top_banner.text|first %} {% endif %} diff --git a/src/Bundle/ChillMainBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Bundle/ChillMainBundle/Tests/DependencyInjection/ConfigurationTest.php index 7f4baa119..27f4db512 100644 --- a/src/Bundle/ChillMainBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Bundle/ChillMainBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -1,5 +1,14 @@ [ 'text' => [ 'fr' => 'Vous travaillez actuellement avec la version de pré-production de Chill.', - 'nl' => 'Je werkte momenteel in de pré-productie versie van Chill.' + 'nl' => 'Je werkte momenteel in de pré-productie versie van Chill.', ], 'color' => 'white', - 'background-color' => 'red' - ] - ] + 'background-color' => 'red', + ], + ], ]; $processedConfig = $processor->processConfiguration($configuration, $config); @@ -47,7 +61,7 @@ class ConfigurationTest extends TestCase // Test without top_banner configuration $config = [ - 'chill_main' => [] + 'chill_main' => [], ]; $processedConfig = $processor->processConfiguration($configuration, $config); @@ -67,10 +81,10 @@ class ConfigurationTest extends TestCase 'chill_main' => [ 'top_banner' => [ 'text' => [ - 'fr' => 'Test message' - ] - ] - ] + 'fr' => 'Test message', + ], + ], + ], ]; $processedConfig = $processor->processConfiguration($configuration, $config);