Compare commits

..

2 Commits

Author SHA1 Message Date
Jürgen Mummert 76be3bcd09 Fix textarea HTML rendering and enforce light FilePond panels 2026-03-01 12:11:08 +01:00
Jürgen Mummert 84a6f118dc Adjust organization address fields and brighten FilePond preview 2026-03-01 12:00:46 +01:00
5 changed files with 46 additions and 7 deletions
@@ -36,6 +36,22 @@
.module-event-edit .filepond--root .filepond--file-action-button { .module-event-edit .filepond--root .filepond--file-action-button {
pointer-events: auto; pointer-events: auto;
} }
.module-event-edit .filepond--root .filepond--image-preview-wrapper {
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 {
background: rgba(255, 255, 255, 0.65);
}
</style> </style>
<script src="https://cdn.jsdelivr.net/npm/choices.js/public/assets/scripts/choices.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/choices.js/public/assets/scripts/choices.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script> <script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
@@ -34,6 +34,22 @@
.module-organization-edit .filepond--root .filepond--file-action-button { .module-organization-edit .filepond--root .filepond--file-action-button {
pointer-events: auto; pointer-events: auto;
} }
.module-organization-edit .filepond--root .filepond--image-preview-wrapper {
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 {
background: rgba(255, 255, 255, 0.65);
}
</style> </style>
<script src="https://cdn.jsdelivr.net/npm/choices.js/public/assets/scripts/choices.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/choices.js/public/assets/scripts/choices.min.js"></script>
<script src="https://unpkg.com/filepond/dist/filepond.min.js"></script> <script src="https://unpkg.com/filepond/dist/filepond.min.js"></script>
@@ -70,14 +70,13 @@ class OrganizationEditController extends AbstractFrontendModuleController
$formData = [ $formData = [
'title' => (string) ($organization['title'] ?? ''), 'title' => (string) ($organization['title'] ?? ''),
'street' => (string) ($organization['street'] ?? ''), 'street' => (string) ($organization['street'] ?? ''),
'street2' => (string) ($organization['street2'] ?? ''),
'postal' => (string) ($organization['postal'] ?? ''), 'postal' => (string) ($organization['postal'] ?? ''),
'city' => (string) ($organization['city'] ?? ''), 'city' => (string) ($organization['city'] ?? ''),
'state' => (string) ($organization['state'] ?? ''),
'country' => (string) ($organization['country'] ?? ''),
'phone' => (string) ($organization['phone'] ?? ''), 'phone' => (string) ($organization['phone'] ?? ''),
'email' => (string) ($organization['email'] ?? ''), 'email' => (string) ($organization['email'] ?? ''),
'website' => (string) ($organization['website'] ?? ''), 'website' => (string) ($organization['website'] ?? ''),
'description' => (string) ($organization['description'] ?? ''), 'description' => $this->normalizeTextareaDescription((string) ($organization['description'] ?? '')),
'tags' => $this->organizationRepository->getTagIdsForOrganization($organizationId), 'tags' => $this->organizationRepository->getTagIdsForOrganization($organizationId),
]; ];
@@ -219,4 +218,14 @@ class OrganizationEditController extends AbstractFrontendModuleController
return $page instanceof PageModel ? $this->generateContentUrl($page) : '/'; 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);
}
} }
+1 -2
View File
@@ -20,10 +20,9 @@ class OrganizationType extends AbstractType
$builder $builder
->add('title', TextType::class, ['label' => 'Titel', 'required' => true]) ->add('title', TextType::class, ['label' => 'Titel', 'required' => true])
->add('street', TextType::class, ['label' => 'Straße', 'required' => false]) ->add('street', TextType::class, ['label' => 'Straße', 'required' => false])
->add('street2', TextType::class, ['label' => 'Weitere Adressangaben', 'required' => false])
->add('postal', TextType::class, ['label' => 'PLZ', 'required' => false]) ->add('postal', TextType::class, ['label' => 'PLZ', 'required' => false])
->add('city', TextType::class, ['label' => 'Ort', 'required' => false]) ->add('city', TextType::class, ['label' => 'Ort', 'required' => false])
->add('state', TextType::class, ['label' => 'Bundesland', 'required' => false])
->add('country', TextType::class, ['label' => 'Land', 'required' => false])
->add('phone', TextType::class, ['label' => 'Telefon', 'required' => false]) ->add('phone', TextType::class, ['label' => 'Telefon', 'required' => false])
->add('email', EmailType::class, ['label' => 'E-Mail', 'required' => false]) ->add('email', EmailType::class, ['label' => 'E-Mail', 'required' => false])
->add('website', TextType::class, ['label' => 'Webseite', 'required' => false]) ->add('website', TextType::class, ['label' => 'Webseite', 'required' => false])
+1 -2
View File
@@ -71,10 +71,9 @@ class OrganizationRepository
[ [
'title' => $data['title'] ?? '', 'title' => $data['title'] ?? '',
'street' => $data['street'] ?? '', 'street' => $data['street'] ?? '',
'street2' => $data['street2'] ?? '',
'postal' => $data['postal'] ?? '', 'postal' => $data['postal'] ?? '',
'city' => $data['city'] ?? '', 'city' => $data['city'] ?? '',
'state' => $data['state'] ?? '',
'country' => $data['country'] ?? '',
'phone' => $data['phone'] ?? '', 'phone' => $data['phone'] ?? '',
'email' => $data['email'] ?? '', 'email' => $data['email'] ?? '',
'website' => $data['website'] ?? '', 'website' => $data['website'] ?? '',