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'],
|
'choices' => $options['board_service_choices'],
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'required' => false,
|
'required' => true,
|
||||||
'placeholder' => 'Selbstversorgung',
|
|
||||||
])
|
])
|
||||||
->add('selectedAdditionalServiceIds', ChoiceType::class, [
|
->add('selectedAdditionalServiceIds', ChoiceType::class, [
|
||||||
'label' => false,
|
'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);
|
$event->setData($data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ class AccommodationBookingDto
|
|||||||
#[Assert\PositiveOrZero(message: 'invalid', groups: ['step_3'])]
|
#[Assert\PositiveOrZero(message: 'invalid', groups: ['step_3'])]
|
||||||
public int $childrenCount = 0;
|
public int $childrenCount = 0;
|
||||||
|
|
||||||
|
#[Assert\NotNull(message: 'required', groups: ['step_2'])]
|
||||||
public ?int $selectedBoardServiceId = null;
|
public ?int $selectedBoardServiceId = null;
|
||||||
|
|
||||||
/** @var list<int>*/
|
/** @var list<int>*/
|
||||||
|
|||||||
@@ -81,20 +81,6 @@
|
|||||||
Verpflegungsleistungen
|
Verpflegungsleistungen
|
||||||
</legend>
|
</legend>
|
||||||
<table class="w-full table-fixed border-collapse">
|
<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 %}
|
{% for service in ctx.boardServices %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="border border-primary-bg p-2 align-top">
|
<td class="border border-primary-bg p-2 align-top">
|
||||||
@@ -110,7 +96,9 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="border border-primary-bg p-2 align-top w-32 text-right">
|
<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>{% 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>
|
||||||
<td class="border border-primary-bg p-2 align-top w-12 text-center">
|
<td class="border border-primary-bg p-2 align-top w-12 text-center">
|
||||||
<input type="radio"
|
<input type="radio"
|
||||||
|
|||||||
Reference in New Issue
Block a user