feat: show the teamer record sections as tabs and the profile as cards

This commit is contained in:
fromme committed 2026-11-12 11:13:30 +01:00
1 parent ec3fd68695
commit 5ca9b812c3
8 files changed
+425 -569

No files matched your search

+111 -254
View File
@@ -3,273 +3,130 @@
{% block title %}Stammdaten und Foto {{ teamer }}{% endblock %}
{% block content %}
<div class="grid lg:grid-cols-3 gap-y-8 lg:gap-y-0 lg:gap-x-8">
<div>
{{ knp_menu_render(knp_menu_get('default_teamer', [], { 'return_url': returnUrl })) }}
{{ knp_menu_render(knp_menu_get('default_teamer', [], { 'return_url': returnUrl }), { 'template': '_partials/_tabs.html.twig' }) }}
<div>
<h1 class="text-2xl font-bold pb-8">
Stammdaten und Foto {{ teamer }}
</h1>
<div class="grid md:grid-cols-2 gap-6 items-start">
</div>
<div class="lg:col-span-2">
<h1 class="text-2xl font-bold pb-8">
Stammdaten und Foto {{ teamer }}
</h1>
<div class="grid grid-cols-2 gap-4">
<div>
<h2 class="text-lg font-bold pb-2">
Persönliche Daten
</h2>
<div class="flex flex-col space-y-3">
<div>
<div class="font-bold">
Gender:
</div>
<div>
{{ teamer.gender }}
</div>
</div>
<div>
<div class="font-bold">
Titel:
</div>
<div>
{{ teamer.academicTitle|default('-') }}
</div>
</div>
<div>
<div class="font-bold">
Vorname:
</div>
<div>
{{ teamer.firstName }}
</div>
</div>
<div>
<div class="font-bold">
Nachname:
</div>
<div>
{{ teamer.lastName }}
</div>
</div>
<div>
<div class="font-bold">
Geburtsdatum:
</div>
<div>
{{ teamer.dateOfBirth|date('d.m.Y') }}
</div>
</div>
<div>
<div class="font-bold">
Staatsangehörigkeit:
</div>
<div>
{{ teamer.nationality|bpn_country_label('nationality') }}
</div>
</div>
<section class="card p-5">
<div class="flex items-start justify-between gap-x-4">
<div class="flex-1">
<h2 class="section-title pb-4">
Persönliche Daten
</h2>
{{ _self.fields({
'Gender': teamer.gender,
'Titel': teamer.academicTitle|default('-'),
'Vorname': teamer.firstName,
'Nachname': teamer.lastName,
'Geburtsdatum': teamer.dateOfBirth|date('d.m.Y'),
'Staatsangehörigkeit': teamer.nationality|bpn_country_label('nationality'),
}) }}
</div>
</div>
<div>
{% if teamer.photo %}
<div class="pb-8">
<img src="{{ asset(teamer.photo | upload_filename_full | imagine_filter('profile')) }}"
class="w-48 h-auto border-2 border-primary"
alt="{{ teamer.firstName }}">
</div>
<img src="{{ asset(teamer.photo | upload_filename_full | imagine_filter('profile')) }}"
class="w-32 h-auto border border-line"
alt="{{ teamer.firstName }}">
{% endif %}
</div>
</section>
<div>
<h2 class="text-lg font-bold pb-2">
Adressdaten
</h2>
<div class="flex flex-col space-y-3">
<div>
<div class="font-bold">
Straße, Hausnummer:
</div>
<div>
{{ teamer.address.street }}
</div>
</div>
<div>
<div class="font-bold">
PLZ:
</div>
<div>
{{ teamer.address.postCode }}
</div>
</div>
<div>
<div class="font-bold">
Ort:
</div>
<div>
{{ teamer.address.city }}
</div>
</div>
<div>
<div class="font-bold">
Land:
</div>
<div>
{{ teamer.address.country|bpn_country_label }}
</div>
</div>
<div>
<div class="font-bold">
E-Mail:
</div>
<div>
{{ teamer.communication.email|default('-') }}
</div>
</div>
<div>
<div class="font-bold">
Mobilnummer:
</div>
<div>
{{ teamer.communication.mobile|default('-') }}
</div>
</div>
</div>
</div>
<section class="card p-5">
<h2 class="section-title pb-4">
Adressdaten
</h2>
{{ _self.fields({
'Straße, Hausnummer': teamer.address.street,
'PLZ': teamer.address.postCode,
'Ort': teamer.address.city,
'Land': teamer.address.country|bpn_country_label,
'E-Mail': teamer.communication.email|default('-'),
'Mobilnummer': teamer.communication.mobile|default('-'),
}) }}
</section>
<div>
<h2 class="text-lg font-bold pb-2">
Buszustiege
<section class="card p-5">
<h2 class="section-title pb-4">
Honorardaten
</h2>
{{ _self.fields({
'Steuer-ID': teamer.taxId|default('-'),
'IBAN': teamer.bankAccount.iban|default('-'),
'BIC': teamer.bankAccount.bic|default('-'),
'Bank/Kreditinstitut': teamer.bankAccount.bank|default('-'),
'Krankenversicherung': teamer.healthInsuranceCompany|default('-'),
}) }}
</section>
<section class="card p-5">
<h2 class="section-title pb-4">
Sonstiges
</h2>
{{ _self.fields({
'Sprache(n)': teamer.language|default('-'),
'Klamottengröße': teamer.size|default('-'),
'Ernährungsweise': teamer.mealPreference ? teamer.mealPreference.label : '-',
}) }}
</section>
<section class="card p-5">
<h2 class="section-title pb-4">
Buszustiege
</h2>
{% set pickupLabels = [] %}
{% for pickup in teamer.pickups %}
{% set label = pickup|bpn_pickup_label %}
{% if label is not empty %}
{% set pickupLabels = pickupLabels|merge([label]) %}
{% endif %}
{% endfor %}
<ul class="divide-y divide-line">
{% for label in pickupLabels %}
<li class="py-1.5 first:pt-0 last:pb-0">
{{ label }}
</li>
{% else %}
<li class="text-muted">Keine Daten</li>
{% endfor %}
</ul>
</section>
{% if teamer.allSeason %}
<section class="card p-5">
<h2 class="section-title pb-4">
Saisoneinsätze
</h2>
<ul class="list-disc pl-4">
{% set pickupLabels = [] %}
{% for pickup in teamer.pickups %}
{% set label = pickup|bpn_pickup_label %}
{% if label is not empty %}
{% set pickupLabels = pickupLabels|merge([label]) %}
{% endif %}
{% endfor %}
{% for label in pickupLabels %}
<li>
{{ label }}
<ul class="divide-y divide-line">
{% for seasonAssignment in teamer.seasonAssignments|filter(seasonAssignment => not seasonAssignment.deleted) %}
<li class="py-1.5 first:pt-0 last:pb-0">
<a href="{{ path('app_administrative_season_assignment_detail', { 'uuid': seasonAssignment.uuid, 'r': return_url() }) }}"
class="font-bold text-brand underline underline-offset-2 hover:text-brand-dark">
{{ seasonAssignment.hotelCode | house_label }}
</a>
<span class="text-sm text-muted block">
{{ seasonAssignment.dateFrom | date('d.m.Y') }} - {{ seasonAssignment.dateTo | date('d.m.Y') }},
{{ seasonAssignment.jobProfile.name }}
</span>
</li>
{% else %}
<li>
<span class="text-sm">Keine Daten</span>
</li>
<li class="text-muted">Keine Daten</li>
{% endfor %}
</ul>
</div>
</section>
{% endif %}
<div>
<h2 class="text-lg font-bold pb-2">
Honorardaten
</h2>
<div class="flex flex-col space-y-3">
<div>
<div class="font-bold">
Steuer-ID:
</div>
<div>
{{ teamer.taxId|default('-') }}
</div>
</div>
<div>
<div class="font-bold">
IBAN:
</div>
<div>
{{ teamer.bankAccount.iban|default('-') }}
</div>
</div>
<div>
<div class="font-bold">
BIC:
</div>
<div>
{{ teamer.bankAccount.bic|default('-') }}
</div>
</div>
<div>
<div class="font-bold">
Bank/Kreditinstitut:
</div>
<div>
{{ teamer.bankAccount.bank|default('-') }}
</div>
</div>
<div>
<div class="font-bold">
Krankenversicherung:
</div>
<div>
{{ teamer.healthInsuranceCompany|default('-') }}
</div>
</div>
</div>
</div>
<div>
<h2 class="text-lg font-bold pb-2">
Sonstiges
</h2>
<div class="flex flex-col space-y-3">
<div>
<div class="font-bold">
Sprache(n):
</div>
<div>
{{ teamer.language|default('-') }}
</div>
</div>
<div>
<div class="font-bold">
Klamottengröße:
</div>
<div>
{{ teamer.size|default('-') }}
</div>
</div>
<div>
<div class="font-bold">
Ernährungsweise:
</div>
<div>
{% if teamer.mealPreference %}
{{ teamer.mealPreference.label }}
{% else %}
_
{% endif %}
</div>
</div>
</div>
</div>
{% if teamer.allSeason %}
<div>
<h2 class="text-lg font-bold pb-2">
Saisoneinsätze
</h2>
<ul class="list-disc pl-4">
{% for seasonAssignment in teamer.seasonAssignments|filter(seasonAssignment => not seasonAssignment.deleted) %}
<li>
<a href="{{ path('app_administrative_season_assignment_detail', { 'uuid': seasonAssignment.uuid, 'r': return_url() }) }}">
{{ seasonAssignment.hotelCode | house_label }}
</a>
<span class="text-sm block">
{{ seasonAssignment.dateFrom | date('d.m.Y') }} - {{ seasonAssignment.dateTo | date('d.m.Y') }},
{{ seasonAssignment.jobProfile.name }}
</span>
</li>
{% else %}
<li>
<span class="text-sm">Keine Daten</span>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}
{# Label and value pairs of one card, the labels muted beside their values. #}
{% macro fields(fields) %}
<dl class="grid grid-cols-[minmax(0,10rem)_minmax(0,1fr)] gap-x-4 gap-y-2">
{% for label, value in fields %}
<dt class="text-muted">{{ label }}</dt>
<dd class="break-words">{{ value }}</dd>
{% endfor %}
</dl>
{% endmacro %}