feat: driver license check for teamers
closes #869bup9vf
This commit is contained in:
@@ -2,6 +2,11 @@
|
||||
Lizenzen
|
||||
</h3>
|
||||
<ul class="pb-4 divide-y divide-gray-200">
|
||||
{% if teamer.driverLicenseVerified %}
|
||||
<li class="py-2">
|
||||
Führerschein
|
||||
</li>
|
||||
{% endif %}
|
||||
{% for license in teamer.licenses %}
|
||||
<li class="py-2">
|
||||
<div class="flex items-center justify-between">
|
||||
@@ -18,9 +23,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{% else %}
|
||||
{% endfor %}
|
||||
{% if not teamer.driverLicenseVerified and teamer.licenses | length == 0 %}
|
||||
<li class="py-2">
|
||||
-
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
@@ -121,6 +121,37 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-gray-100 border border-gray-200 rounded-md px-4 py-2">
|
||||
<h2 class="flex justify-between pb-2">
|
||||
<span class="font-bold text-lg">Neue Führerscheine</span>
|
||||
{% if newDriverLicensesCount > 0 %}
|
||||
<span>{{ newDriverLicensesCount }} neu</span>
|
||||
{% endif %}
|
||||
</h2>
|
||||
<div class="max-h-64 overflow-y-scroll overflow-x-hidden">
|
||||
<ul class="divide-y divide-gray-200">
|
||||
{% for document in newDriverLicenses %}
|
||||
<li class="py-2 first:pt-0 last:pb-0">
|
||||
<button type="button"
|
||||
class="flex items-center space-x-1 truncate"
|
||||
hx-get="{{ path('app_administrative_teamer_driver_license_check', { 'uuid': document.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('download', 'w-4 h-4 shrink-0') }}
|
||||
<span>{{ document.owner.teamer.fullName(true) }}</span>
|
||||
{% include '_partials/_dot.html.twig' %}
|
||||
<span class="whitespace-nowrap">{{ document.createdAt|date('d.m.y') }}</span>
|
||||
</button>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="py-2 first:pt-0 last:pb-0">
|
||||
-
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-gray-100 border border-gray-200 rounded-md px-4 py-2">
|
||||
<h2 class="font-bold text-lg pb-2">
|
||||
Neue Einsätze
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{% extends 'htmx_modal.html.twig' %}
|
||||
|
||||
{% block title %}Führerschein prüfen{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ form_start(form, { 'attr': { 'hx-post': app.request.uri, 'hx-target': '#htmx-modal', 'hx-swap': 'outerHTML' } }) }}
|
||||
<a href="{{ path('app_common_download', { 'uuid': document.uuid, 'inline': true }) }}"
|
||||
target="_blank"
|
||||
class="flex justify-between items-center pb-4"
|
||||
title="Dokument öffnen">
|
||||
<h2 class="font-bold text-lg">
|
||||
Führerschein {{ teamer }} vom {{ document.createdAt|date('d.m.Y') }}
|
||||
</h2>
|
||||
{{ icon('eye') }}
|
||||
</a>
|
||||
<div class="flex flex-col space-y-4 pb-4">
|
||||
{{ form_row(form.status) }}
|
||||
{{ form_row(form.comment) }}
|
||||
</div>
|
||||
<button type="submit" class="btn">
|
||||
Aktualisieren
|
||||
</button>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
@@ -94,6 +94,9 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="flex items-center space-x-1 justify-end">
|
||||
{% if teamer.driverLicenseVerified %}
|
||||
{{ icon('car', 'w-5 h-5 text-green-500') }}
|
||||
{% endif %}
|
||||
{% if not teamer.viewed %}
|
||||
<button type="button"
|
||||
hx-post="{{ path('app_administrative_teamer_viewed', { 'uuid': teamer.uuid }) }}"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
{{ form_row(filterForm.pickupId) }}
|
||||
{{ form_row(filterForm.skiLicense) }}
|
||||
{{ form_row(filterForm.snowboardLicense) }}
|
||||
{{ form_row(filterForm.driverLicenseVerified) }}
|
||||
{{ form_row(filterForm.noTrainings) }}
|
||||
</div>
|
||||
<div class="flex items-center space-x-2">
|
||||
@@ -19,4 +20,4 @@
|
||||
</div>
|
||||
{{ form_rest(filterForm) }}
|
||||
{{ form_end(filterForm) }}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
{% 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 not form.vars.valid %}
|
||||
<div class="border border-red-500 rounded-md p-4 text-red-500 mb-6">
|
||||
{% include '_partials/_form_errors.html.twig' with { 'form': form } %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if teamer.driverLicenseStatus == constant('App\\Entity\\Teamer::DRIVER_LICENSE_STATUS_DENIED') %}
|
||||
<div class="border border-red-500 rounded-md p-4 text-red-500 mb-6">
|
||||
Dein zuletzt hochgeladener Führerschein wurde abgelehnt.
|
||||
{% if teamer.driverLicenseReviewComment %}
|
||||
<br>
|
||||
Begründung: {{ teamer.driverLicenseReviewComment }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% 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>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn" {{ stimulus_target('form-upload-guard', 'submit') }}>
|
||||
Speichern
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
@@ -127,6 +127,27 @@
|
||||
{{ form_row(form.healthInsuranceCompany) }}
|
||||
{{ form_row(form.language) }}
|
||||
{{ form_row(form.size) }}
|
||||
<div>
|
||||
<div class="font-bold pb-2">Führerschein</div>
|
||||
<div class="pb-2">
|
||||
{% if teamer.driverLicenseDeclaration is same as(null) %}
|
||||
noch nicht angegeben
|
||||
{% elseif teamer.driverLicenseDeclaration %}
|
||||
{% if teamer.driverLicenseVerified %}
|
||||
bestätigt
|
||||
{% elseif teamer.driverLicenseStatus == constant('App\\Entity\\Teamer::DRIVER_LICENSE_STATUS_DENIED') %}
|
||||
abgelehnt
|
||||
{% else %}
|
||||
in Prüfung
|
||||
{% endif %}
|
||||
{% else %}
|
||||
nicht vorhanden
|
||||
{% endif %}
|
||||
</div>
|
||||
<a href="{{ path('app_teamer_check_driver_license') }}" class="btn btn--small btn--secondary">
|
||||
Führerscheinstatus bearbeiten
|
||||
</a>
|
||||
</div>
|
||||
<div {{ stimulus_controller('form-collection', { 'prototype': _self.collectionRow(form.pickups.vars.prototype)|json_encode }) }}>
|
||||
<h4 class="font-bold pb-2">
|
||||
Buszustiege
|
||||
|
||||
Reference in New Issue
Block a user