feat: replace board service placeholder to avoid duplicate entries
This commit is contained in:
@@ -40,8 +40,7 @@ class AccommodationStep2Type extends AbstractType
|
||||
'choices' => $options['board_service_choices'],
|
||||
'expanded' => true,
|
||||
'multiple' => false,
|
||||
'required' => false,
|
||||
'placeholder' => 'Selbstversorgung',
|
||||
'required' => true,
|
||||
])
|
||||
->add('selectedAdditionalServiceIds', ChoiceType::class, [
|
||||
'label' => false,
|
||||
@@ -65,11 +64,6 @@ class AccommodationStep2Type extends AbstractType
|
||||
}
|
||||
}
|
||||
|
||||
// Board service rendered manually: empty string from the "Selbstversorgung" radio → null
|
||||
if (isset($data['selectedBoardServiceId']) && '' === $data['selectedBoardServiceId']) {
|
||||
unset($data['selectedBoardServiceId']);
|
||||
}
|
||||
|
||||
$event->setData($data);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ class AccommodationBookingDto
|
||||
#[Assert\PositiveOrZero(message: 'invalid', groups: ['step_3'])]
|
||||
public int $childrenCount = 0;
|
||||
|
||||
#[Assert\NotNull(message: 'required', groups: ['step_2'])]
|
||||
public ?int $selectedBoardServiceId = null;
|
||||
|
||||
/** @var list<int>*/
|
||||
|
||||
@@ -81,20 +81,6 @@
|
||||
Verpflegungsleistungen
|
||||
</legend>
|
||||
<table class="w-full table-fixed border-collapse">
|
||||
<tr>
|
||||
<td class="border border-primary-bg p-2 align-top">
|
||||
<label for="board_service_none" class="cursor-pointer">Selbstversorgung</label>
|
||||
</td>
|
||||
<td class="border border-primary-bg p-2 align-top w-32 text-right"></td>
|
||||
<td class="border border-primary-bg p-2 align-top w-12 text-center">
|
||||
<input type="radio"
|
||||
id="board_service_none"
|
||||
name="{{ form.selectedBoardServiceId.vars.full_name }}"
|
||||
value=""
|
||||
{% if dto.selectedBoardServiceId is null %}checked{% endif %}
|
||||
class="form-radio">
|
||||
</td>
|
||||
</tr>
|
||||
{% for service in ctx.boardServices %}
|
||||
<tr>
|
||||
<td class="border border-primary-bg p-2 align-top">
|
||||
@@ -110,7 +96,9 @@
|
||||
</td>
|
||||
<td class="border border-primary-bg p-2 align-top w-32 text-right">
|
||||
<div>{% if service.price == 0 %}inkl.{% else %}{{ (service.price / 100)|format_currency(ctx.accommodation.currency) }}{% endif %}</div>
|
||||
<div class="text-xs text-gray-500">pro Person und Nacht</div>
|
||||
{% if service.price != 0 %}
|
||||
<div class="text-xs text-gray-500">pro Person und Nacht</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="border border-primary-bg p-2 align-top w-12 text-center">
|
||||
<input type="radio"
|
||||
|
||||
Reference in New Issue
Block a user