Files
myep-team/templates/teamer/check/driver_license.html.twig

72 lines
2.8 KiB
Twig

{% extends 'teamer/layout.html.twig' %}
{% block title %}Führerschein-Check{% endblock %}
{% block content %}
{% set formAttr = stimulus_controller('form-upload-guard')|stimulus_action('form-upload-guard', 'guard', 'submit') %}
{{ form_start(form, { 'attr': formAttr.toArray() }) }}
<div class="max-w-2xl">
<h1 class="text-2xl font-bold pb-2">
Führerschein-Check
</h1>
<p class="pb-6">
Bitte gib an, ob du einen Führerschein besitzt. Wenn ja, lade bitte einmalig ein Foto oder PDF deines
Führerscheins hoch.
</p>
{% if teamer.driverLicenseStatus == constant('App\\Entity\\Teamer::DRIVER_LICENSE_STATUS_DENIED') %}
{% embed '_partials/_alert.html.twig' with { 'type': 'warning' } %}
{% block message %}
Dein zuletzt hochgeladener Führerschein wurde abgelehnt.
{% if teamer.driverLicenseReviewComment %}
<br>
Begründung: {{ teamer.driverLicenseReviewComment }}
{% endif %}
{% endblock %}
{% endembed %}
{% endif %}
{% if not form.vars.valid %}
{% embed '_partials/_alert.html.twig' with { 'type': 'warning' } %}
{% block message %}
{% include '_partials/_form_errors.html.twig' with { 'form': form } %}
{% endblock %}
{% endembed %}
{% endif %}
<div class="flex flex-col space-y-4 pb-6">
{{ form_row(form.hasDriverLicense) }}
{% if teamer.driverLicenseUpload %}
<div class="text-sm">
Aktuell hochgeladen:
<a href="{{ path('app_common_download', { 'uuid': teamer.driverLicenseUpload.uuid, 'inline': true }) }}" target="_blank" class="font-bold underline">
{{ teamer.driverLicenseUpload.originalFilename }}
</a>
</div>
{% endif %}
<div>
<label class="block font-bold pb-2">
Führerschein hochladen (JPG, PNG, PDF)
</label>
{% include '_partials/_upload_collection_form.html.twig' with {
'endpoint_upload': path('_uploader_upload_driver_license'),
'upload_session_params': form.vars.upload_session_params,
'accepted_files': 'image/jpg,image/jpeg,image/png,application/pdf',
} %}
</div>
{{ form_row(form.confirmTermsOfUse) }}
</div>
<button type="submit" class="btn" {{ stimulus_target('form-upload-guard', 'submit') }}>
Speichern
</button>
</div>
{{ form_rest(form) }}
{{ form_end(form) }}
{% endblock %}