49 lines
3.0 KiB
Twig
49 lines
3.0 KiB
Twig
{# Compact participant card with name, room, price, and edit button #}
|
|
{% set isCanceled = cardData.isCanceled is defined ? cardData.isCanceled : false %}
|
|
{% set isValid = cardData.isValid is defined ? cardData.isValid : true %}
|
|
{% set errorMessages = cardData.errorMessages|default([]) %}
|
|
{% set mode = mode|default('create') %}
|
|
|
|
<div class="py-4" id="participant-card-{{ index }}">
|
|
<div class="flex items-start space-x-4">
|
|
<div class="{{ html_classes('w-12 h-12 inline-flex flex-shrink-0 items-center justify-center rounded-full text-white text-2xl font-bold', { 'bg-primary-dark': isValid, 'bg-red-500': not isValid }) }}">
|
|
{{ participantNumber }}
|
|
</div>
|
|
<div class="flex-1 leading-5">
|
|
<div class="font-semibold mb-1">
|
|
{{ cardData.name }}
|
|
</div>
|
|
{% if isCanceled %}
|
|
<div class="text-xs font-medium text-gray-700" {{ qa_attribute('participant-canceled', index) }}>
|
|
storniert
|
|
</div>
|
|
{% elseif not isValid %}
|
|
<div class="text-xs font-medium text-red-500" {{ qa_attribute('participant-invalid', index) }}>
|
|
unvollständige/fehlerhafte Daten
|
|
</div>
|
|
{% else %}
|
|
<div class="text-gray-600" {{ qa_attribute('participant-room-name', index) }}>
|
|
{{ cardData.roomName }}
|
|
<br>
|
|
{{ cardData.price }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
<div class="flex flex-col justify-center">
|
|
{% if not isCanceled %}
|
|
{% if mode == 'edit' %}
|
|
{% set url = path('app_booking_edit_participant', {id: bookingId, index: index}) %}
|
|
{% else %}
|
|
{% set url = path('app_booking_create_step_2_participant', {index: index}) %}
|
|
{% endif %}
|
|
<a href="{{ url }}"
|
|
class="button button--small button--primary"
|
|
data-action="click->loading#show"
|
|
{{ qa_attribute('btn-edit-participant', index) }}>
|
|
<svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><path d="M92.69,216H48a8,8,0,0,1-8-8V163.31a8,8,0,0,1,2.34-5.65L165.66,34.34a8,8,0,0,1,11.31,0L221.66,79a8,8,0,0,1,0,11.31L98.34,213.66A8,8,0,0,1,92.69,216Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="136" y1="64" x2="192" y2="120" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="164" y1="92" x2="68" y2="188" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="95.49" y1="215.49" x2="40.51" y2="160.51" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|