diff --git a/src/Form/ParticipantType.php b/src/Form/ParticipantType.php index 93b3cbb..56fadd5 100644 --- a/src/Form/ParticipantType.php +++ b/src/Form/ParticipantType.php @@ -256,12 +256,14 @@ class ParticipantType extends AbstractType 'choices' => $options['selectable_parking'], ]); - // Rental Insurance - single checkbox (always add, JS will show/hide when rentals selected) - $form->add('rentalInsurance', ChoiceType::class, [ - ...$commonChoiceFieldOptions, - 'label' => 'Leihausrüstungsversicherung', - 'choices' => $options['selectable_rental_insurance'], - ]); + // Rental Insurance - single checkbox (only add if available, JS will show/hide when rentals selected) + if (0 < count($options['selectable_rental_insurance'])) { + $form->add('rentalInsurance', ChoiceType::class, [ + ...$commonChoiceFieldOptions, + 'label' => false, + 'choices' => $options['selectable_rental_insurance'], + ]); + } // Transportation $transportationChoiceAttributes = function (?Service $service) use ($options) { diff --git a/templates/booking/edit.html.twig b/templates/booking/edit.html.twig index d2fa295..aa780fb 100644 --- a/templates/booking/edit.html.twig +++ b/templates/booking/edit.html.twig @@ -210,14 +210,16 @@ {% if child.rentals is defined %}
{{ form_row(child.rentals) }} + {% if child.rentalInsurance is defined %} +
+ {{ form_row(child.rentalInsurance) }} +
+ {% endif %}
{% endif %}
{{ form_row(child.parking) }}
-
- {{ form_row(child.rentalInsurance) }} -
{% if not travelData.additionalServicesMutable %}