+
+
{_all_environments}
{else}
{var $environments = $item->environments}
{var $maxBadges = min([2, count($environments)])}
-
+
{for $i = 0; $i < $maxBadges; $i++}
{include #environment-badge, environment: array_shift($environments), vertical: false}
+ ,
{/for}
{if 0 < count($environments)}
@@ -128,7 +132,7 @@
'x-tooltip.interactive.theme.light-border.placement.right.html.raw' => $tooltip
]}
- {_and_more_projects, count($environments)}
+ {_and_more_projects, count($environments)}
{/if}
{/if}
@@ -156,16 +160,26 @@
{define #environment-badge, string|null $environment, bool $vertical = false}
{if null === $environment}
-
{_//layout.default_environment}
+
+
+ {_//layout.default_environment}
+
{elseif null !== $_globalEnvironments->getByCode($environment)}
{var $globalEnvironment = $_globalEnvironments->getByCode($environment)}
-
+
+
{$globalEnvironment->name}
{else}
- {$environment}
+
+
+ {$environment}
+
{/if}
{/define}
diff --git a/src/Web/AdminModule/Presenter/DashboardPresenter.php b/src/Web/AdminModule/Presenter/DashboardPresenter.php
index d28a1fa..101a90f 100644
--- a/src/Web/AdminModule/Presenter/DashboardPresenter.php
+++ b/src/Web/AdminModule/Presenter/DashboardPresenter.php
@@ -47,13 +47,12 @@ protected function beforeRender(): void
'name' => $project->name->value(),
'color' => $project->color->value(),
'fontColor' => Color::resolveFontColor($project->color->value()),
- 'environments' => array_merge(
+ 'environments' => 1 < count($projectEnvironments = array_merge(
[
[
'code' => '//default//',
'name' => $this->getTranslator()->translate('//layout.default_environment'),
- 'color' => '#e5e7eb',
- 'fontColor' => '#000000',
+ 'color' => '#ffffff',
],
],
array_values(
@@ -62,7 +61,6 @@ protected function beforeRender(): void
'code' => $environment->code,
'name' => $environment->name,
'color' => $environment->color->value(),
- 'fontColor' => Color::resolveFontColor($environment->color->value()),
],
EnabledEnvironmentsResolver::resolveProjectEnvironments(
globalSettingsEnvironments: $globalEnvironments,
@@ -70,7 +68,7 @@ protected function beforeRender(): void
),
),
),
- ),
+ )) ? $projectEnvironments : [],
'links' => [
'consents' => $this->getUser()->isAllowed(ProjectConsentResource::class, ProjectConsentResource::READ)
? $this->link(':Admin:Project:Consents:', ['project' => $project->code->value()])
diff --git a/src/Web/AdminModule/Presenter/templates/Dashboard.default.latte b/src/Web/AdminModule/Presenter/templates/Dashboard.default.latte
index 014280f..7c66764 100644
--- a/src/Web/AdminModule/Presenter/templates/Dashboard.default.latte
+++ b/src/Web/AdminModule/Presenter/templates/Dashboard.default.latte
@@ -79,31 +79,49 @@
-
-
-
-
- {{_all_environments}}
+
+
+
+
+
+ {{_all_environments}}
+
-
-
-
+
+
+
+
+
+
diff --git a/src/Web/AdminModule/ProjectModule/Control/ConsentHistory/templates/consentHistoryControl.latte b/src/Web/AdminModule/ProjectModule/Control/ConsentHistory/templates/consentHistoryControl.latte
index f8ffce4..eca7efa 100644
--- a/src/Web/AdminModule/ProjectModule/Control/ConsentHistory/templates/consentHistoryControl.latte
+++ b/src/Web/AdminModule/ProjectModule/Control/ConsentHistory/templates/consentHistoryControl.latte
@@ -96,23 +96,29 @@
{/if}
-
+
{_environment} |
-
+
- {if null === $environment}
- {_//layout.default_environment}
- {elseif isset($environments[$environment->value()])}
-
- {else}
- {$environment->value()}
- {/if}
+ {else}
+ {**}
+ {$environment->value()}
+ {/if}
+
|
diff --git a/src/Web/AdminModule/ProjectModule/Control/ConsentList/ConsentListControl.php b/src/Web/AdminModule/ProjectModule/Control/ConsentList/ConsentListControl.php
index 1b620f9..ce95df5 100644
--- a/src/Web/AdminModule/ProjectModule/Control/ConsentList/ConsentListControl.php
+++ b/src/Web/AdminModule/ProjectModule/Control/ConsentList/ConsentListControl.php
@@ -80,17 +80,19 @@ protected function createComponentGrid(): DataGrid
$grid->addColumnText('settings_short_identifier', 'settings_short_identifier', 'settingsShortIdentifier')
->setAlign('center');
- $grid->addColumnText('environment', 'environment', 'environment')
- ->setAlign('center')
- ->setFilterSelect(
- options: FilterHelper::all($translator)
- + [ConsentsDataGridQueryHandler::FILTER_ENVIRONMENT_DEFAULT_ENV_VALUE => $this->getTranslator()->translate('//layout.default_environment')]
- + array_map(
- static fn (Environment $environment): string => $environment->name,
- $environments,
- ),
- column: 'environment',
- );
+ if (0 < count($environments)) {
+ $grid->addColumnText('environment', 'environment', 'environment')
+ ->setAlign('center')
+ ->setFilterSelect(
+ options: FilterHelper::all($translator)
+ + [ConsentsDataGridQueryHandler::FILTER_ENVIRONMENT_DEFAULT_ENV_VALUE => $this->getTranslator()->translate('//layout.default_environment')]
+ + array_map(
+ static fn (Environment $environment): string => $environment->name,
+ $environments,
+ ),
+ column: 'environment',
+ );
+ }
$grid->addColumnDateTimeTz('created_at', 'created_at', 'createdAt')
->setFormat('j.n.Y H:i:s')
diff --git a/src/Web/AdminModule/ProjectModule/Control/ConsentList/templates/datagrid.latte b/src/Web/AdminModule/ProjectModule/Control/ConsentList/templates/datagrid.latte
index 76f9430..22a3508 100644
--- a/src/Web/AdminModule/ProjectModule/Control/ConsentList/templates/datagrid.latte
+++ b/src/Web/AdminModule/ProjectModule/Control/ConsentList/templates/datagrid.latte
@@ -26,16 +26,26 @@
{/define}
{define col-environment}
- {if null === $item->environment}
- {_//layout.default_environment}
- {elseif isset($environments[$item->environment])}
-
- {$environments[$item->environment]->name}
-
- {else}
- {$item->environment}
- {/if}
+ {include #environment-badge, code: $item->environment}
+{/define}
+
+{define #environment-badge, string|null $code}
+
+ {if null === $code}
+
+ {_//layout.default_environment}
+ {elseif isset($environments[$code])}
+
+ {$environments[$code]->name}
+ {else}
+
+ {$code}
+ {/if}
+
{/define}
diff --git a/src/Web/AdminModule/ProjectModule/Control/ProjectForm/templates/form.imports.latte b/src/Web/AdminModule/ProjectModule/Control/ProjectForm/templates/form.imports.latte
index 005f085..607bd02 100644
--- a/src/Web/AdminModule/ProjectModule/Control/ProjectForm/templates/form.imports.latte
+++ b/src/Web/AdminModule/ProjectModule/Control/ProjectForm/templates/form.imports.latte
@@ -13,23 +13,17 @@
{if '' === $k}
-
-
{_text_including}
+
{_text_including}
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+