feat: link terms in confirmation checkbox label

This commit is contained in:
Björn Fromme
2026-01-06 11:56:03 +01:00
parent 2a13a62291
commit e021fc7570
3 changed files with 15 additions and 1 deletions
+1
View File
@@ -50,6 +50,7 @@ APP_BPN_STREAM_TIMEOUT=30
APP_BPN_TOTAL_TIMEOUT=45
APP_TRAVEL_INFO_BASE_URL="https://www.ep-reisen.de/reiseinformationen/"
APP_TERMS_AND_CONDITIONS_URL="https://www.ep-reisen.de/skireisen/infos/allgemeine-infos/agb/"
APP_CMS_API_BASE_URL="https://www.ep-reisen.de/"
APP_WEBSITE_BASE_URL="https://www.ep-reisen.de/"
+2
View File
@@ -5,6 +5,7 @@
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
parameters:
travel_info_base_url: '%env(APP_TRAVEL_INFO_BASE_URL)%'
terms_and_conditions_url: '%env(APP_TERMS_AND_CONDITIONS_URL)%'
path_to_keys: '%kernel.project_dir%/config/secret'
bpn_debug: '%env(APP_BPN_DEBUG)%'
@@ -39,6 +40,7 @@ services:
$xmlDump: '@xml_dump.storage'
$jsonExport: '@json_export.storage'
$travelInfoBaseUrl: '%env(APP_TRAVEL_INFO_BASE_URL)%'
$termsAndConditionsUrl: '%terms_and_conditions_url%'
$logger: '@monolog.logger.core'
$environment: '%kernel.environment%'
+12 -1
View File
@@ -13,8 +13,18 @@ use Symfony\Component\Validator\Constraints as Assert;
class BookingCreateStep4Type extends AbstractType
{
public function __construct(
private readonly string $termsAndConditionsUrl,
) {
}
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$termsLink = sprintf(
'<a href="%s" target="_blank" rel="noopener" class="underline">AGB</a>',
htmlspecialchars($this->termsAndConditionsUrl, ENT_QUOTES, 'UTF-8')
);
$builder
->add('confirmationAccepted', CheckboxType::class, [
'label' => 'Ich bestätige, dass alle Angaben korrekt sind und möchte verbindlich buchen.',
@@ -26,7 +36,8 @@ class BookingCreateStep4Type extends AbstractType
],
])
->add('termsAccepted', CheckboxType::class, [
'label' => 'Ich bestätige, dass ich die AGB akzeptiere',
'label' => sprintf('Ich bestätige, dass ich die %s akzeptiere', $termsLink),
'label_html' => true,
'mapped' => false,
'constraints' => [
new Assert\IsTrue(