diff --git a/contao/templates/frontend/event_edit.html.twig b/contao/templates/frontend/event_edit.html.twig index e3e9cd6..ea5e1e4 100644 --- a/contao/templates/frontend/event_edit.html.twig +++ b/contao/templates/frontend/event_edit.html.twig @@ -41,6 +41,12 @@ background: #f7f7f7; } + .module-event-edit .filepond--root .filepond--panel-root, + .module-event-edit .filepond--root .filepond--item-panel, + .module-event-edit .filepond--root .filepond--image-preview { + background-color: #f7f7f7 !important; + } + .module-event-edit .filepond--root .filepond--image-preview-overlay-idle, .module-event-edit .filepond--root .filepond--image-preview-overlay-success, .module-event-edit .filepond--root .filepond--image-preview-overlay-failure { diff --git a/contao/templates/frontend/organization_edit.html.twig b/contao/templates/frontend/organization_edit.html.twig index ba4d6bb..0296408 100644 --- a/contao/templates/frontend/organization_edit.html.twig +++ b/contao/templates/frontend/organization_edit.html.twig @@ -39,6 +39,12 @@ background: #f7f7f7; } + .module-organization-edit .filepond--root .filepond--panel-root, + .module-organization-edit .filepond--root .filepond--item-panel, + .module-organization-edit .filepond--root .filepond--image-preview { + background-color: #f7f7f7 !important; + } + .module-organization-edit .filepond--root .filepond--image-preview-overlay-idle, .module-organization-edit .filepond--root .filepond--image-preview-overlay-success, .module-organization-edit .filepond--root .filepond--image-preview-overlay-failure { diff --git a/src/Controller/Frontend/OrganizationEditController.php b/src/Controller/Frontend/OrganizationEditController.php index c241774..a8cabcc 100644 --- a/src/Controller/Frontend/OrganizationEditController.php +++ b/src/Controller/Frontend/OrganizationEditController.php @@ -76,7 +76,7 @@ class OrganizationEditController extends AbstractFrontendModuleController 'phone' => (string) ($organization['phone'] ?? ''), 'email' => (string) ($organization['email'] ?? ''), 'website' => (string) ($organization['website'] ?? ''), - 'description' => (string) ($organization['description'] ?? ''), + 'description' => $this->normalizeTextareaDescription((string) ($organization['description'] ?? '')), 'tags' => $this->organizationRepository->getTagIdsForOrganization($organizationId), ]; @@ -218,4 +218,14 @@ class OrganizationEditController extends AbstractFrontendModuleController return $page instanceof PageModel ? $this->generateContentUrl($page) : '/'; } + + private function normalizeTextareaDescription(string $value): string + { + $decoded = html_entity_decode($value, ENT_QUOTES | ENT_HTML5, 'UTF-8'); + $decoded = preg_replace('/<\s*br\s*\/?>/i', "\n", $decoded) ?? $decoded; + $decoded = preg_replace('/<\s*\/p\s*>\s*<\s*p[^>]*>/i', "\n\n", $decoded) ?? $decoded; + $decoded = strip_tags($decoded); + + return trim($decoded); + } }