{# Applicant block, shown only when the applicant does not travel along. #} {% set isSubmitted = isSubmitted|default(false) %} {% set applicantErrors = applicantErrors|default([]) %} {% set isComplete = applicant is not null and applicant.firstName is not empty and applicant.lastName is not empty and applicant.email is not empty and applicant.mobile is not empty and applicant.dateOfBirth is not null and applicant.address is not null %} {% set showAsError = applicantErrors is not empty or (not isComplete and isSubmitted) %}
Anmelder:in
{% if applicantErrors is not empty %} {% endif %} {% if is_granted('IS_AUTHENTICATED_FULLY') %} {# Logged in: the data comes from the account. Editing it here would create a duplicate BusPro record, which is the same reason participant[0] is static when they travel. #}
{% if applicant is not null and applicant.firstName is not empty %}
{{ applicant.firstName }} {{ applicant.lastName }}
{% if applicant.address is not null %}
{{ applicant.address.street }}
{{ applicant.address.postCode }} {{ applicant.address.city }}
{% endif %}
{{ applicant.email }}
{% if applicant.mobile is not empty %}
{{ applicant.mobile }}
{% endif %} {% else %}
Deine Daten werden aus deinem Konto übernommen.
{% endif %}
{% else %}
{% if isComplete %}
{{ applicant.firstName }} {{ applicant.lastName }}
{{ applicant.address.postCode }} {{ applicant.address.city }}
{{ applicant.email }}
{% elseif showAsError %}
unvollständige/fehlerhafte Angaben
{% else %}
Bitte gib deine Kontaktdaten an.
{% endif %}
{{ isComplete ? 'Bearbeiten' : 'Angeben' }}
{% endif %}