feat: all-season assignments

This commit is contained in:
Björn Fromme authored and Björn Fromme committed 2026-09-26 12:13:16 +02:00
1 parent 675cec1b69
commit cf876ed224
119 files changed
+6194 -294

No files matched your search

@@ -0,0 +1,36 @@
{# Shared by both teamer lists. `scope` selects which list's filter the modal edits and
which list a mailing resolves its recipients from; it is null on the general one. #}
{% set scope = scope|default(null) %}
<div class="flex items-start justify-between pb-4">
<h1 class="text-2xl font-bold">
{{ title }}
</h1>
<div class="flex flex-col items-end space-y-2 md:flex-row md:items-center md:space-x-2 md:space-y-0">
<button type="button"
class="{{ html_classes('btn btn--small', { 'btn--secondary': filterDto.active }) }}"
title="Team filtern"
hx-get="{{ path('app_common_teamer_filter', { 'r': return_url(), 'scope': scope }) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('filter', 'w-4 h-4 shrink-0') }}
{% if filterDto.active %}
<span class="whitespace-nowrap">{{ filterDto.activeFiltersCount }} Filter aktiv</span>
{% else %}
<span>Filter</span>
{% endif %}
</button>
{% if filterDto.active %}
<a href="{{ path('app_common_teamer_filter_reset', { 'r': return_url(), 'scope': scope }) }}" class="btn btn--small btn--secondary">
Reset
</a>
{% endif %}
{% if is_granted('ROLE_TEAM_ADMIN') %}
<a href="{{ path('app_admin_teamer_mailing', { 'r': return_url(), 'scope': scope }) }}"
class="btn btn--small"
title="Mail an die gefilterte Liste schreiben">
{{ icon('mail', 'w-4 h-4 shrink-0') }}
<span>Mailing</span>
</a>
{% endif %}
</div>
</div>
@@ -0,0 +1,155 @@
<div class="data-table-wrapper">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th></th>
<th>
{{ knp_pagination_sortable(pagination, 'Name', 'teamer.lastName') }}
</th>
<th>
Vorname
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Status', 'teamer.status') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'E-Mail', 'teamer.communication.email') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Letzter Login', 'user.lastLoginAt') }}
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for teamer in pagination %}
<tr>
<td>
<div class="flex flex-col items-center space-y-2">
{% if teamer.photo %}
<img src="{{ asset(teamer.photo | upload_filename_full | imagine_filter('thumbnail')) }}"
class="object-cover w-12 h-12 rounded-full"
alt="{{ teamer.firstName }}">
{% else %}
<div class="flex flex-col items-center justify-center w-12 h-12 border-2 border-gray-200 rounded-full">
{{ icon('user', 'w-10 h-10 text-gray-200') }}
</div>
{% endif %}
<twig:RatingStars rating="{{ teamer.averageRating }}" :teamer="teamer" />
</div>
</td>
<td>
<a href="{{ path('app_administrative_teamer_profile', { 'uuid': teamer.uuid, 'r': return_url() }) }}">
<span class="whitespace-nowrap">{{ teamer.lastName }}</span>
</a>
</td>
<td>
<a href="{{ path('app_administrative_teamer_profile', { 'uuid': teamer.uuid, 'r': return_url() }) }}" class="whitespace-nowrap">
{{ teamer.firstName }}
</a>
</td>
<td>
{{ teamer|teamer_status_label(showAllSeason|default(true)) }}
</td>
<td>
{{ teamer.communication.email }}
</td>
<td>
{% if teamer.user is not null and teamer.user.lastLoginAt is not null %}
{{ teamer.user.lastLoginAt | date('d.m.Y') }}
{% else %}
-
{% endif %}
</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 }) }}"
title="Teamer als gesichtet markieren">
{{ icon('check') }}
</button>
{% endif %}
{% if teamer.deleted %}
{% if is_granted('ROLE_TEAM_ADMIN') %}
<button type="button"
role="menuitem"
tabindex="-1"
hx-get="{{ path('app_admin_teamer_restore_account', { 'uuid': teamer.uuid }) }}"
hx-target="body"
hx-swap="beforeend"
title="Account wiederherstellen">
{{ icon('refresh') }}
</button>
{% endif %}
{% elseif teamer.user is not null and teamer.user.disabled %}
{% if is_granted('ROLE_TEAM_ADMIN') %}
<button type="button"
role="menuitem"
tabindex="-1"
hx-get="{{ path('app_admin_teamer_enable_user', { 'uuid': teamer.uuid }) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('unlocked') }}
</button>
{% endif %}
{% else %}
{% if is_granted('ROLE_TEAM_ADMIN') %}
<button type="button"
class="text-red-500"
role="menuitem"
tabindex="-1"
hx-get="{{ path('app_admin_teamer_disable_user', { 'uuid': teamer.uuid }) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('locked') }}
</button>
{% endif %}
{% if is_granted('CAN_IMPERSONATE', teamer.user) %}
<a href="{{ path('app_teamer_index', { '_switch_user': teamer.user.email }) }}" title="Als Teamer:in maskieren">
{{ icon('mask') }}
</a>
{% endif %}
{% if is_granted('ROLE_TEAM_ADMIN') %}
<button type="button"
class="text-red-500"
role="menuitem"
tabindex="-1"
hx-get="{{ path('app_admin_teamer_delete_account', { 'uuid': teamer.uuid }) }}"
hx-target="body"
hx-swap="beforeend"
title="Account löschen">
{{ icon('delete') }}
</button>
{% endif %}
{% endif %}
<a href="{{ path('app_administrative_teamer_profile', { 'uuid': teamer.uuid, 'r': return_url() }) }}" title="Teamer:innenprofil {{ teamer }}">
{{ icon('user') }}
</a>
</div>
{% if teamer.deleted %}
<div class="py-1 px-2 mt-2 text-xs bg-gray-500 text-white">
gel. am {{ teamer.deletedAt | date('d.m.Y') }}
</div>
{% endif %}
{% if teamer.user is not null and teamer.user.disabled %}
<div class="py-1 px-2 mt-2 text-xs bg-red-500 text-white">
gesp. am {{ teamer.user.disabledAt | date('d.m.Y') }}
</div>
{% endif %}
</td>
</tr>
{% else %}
<td colspan="7">
Keine Daten...
</td>
{% endfor %}
</tbody>
</table>
{{ knp_pagination_render(pagination) }}
</div>
</div>
+2 -188
View File
@@ -3,192 +3,6 @@
{% block title %}Teamübersicht{% endblock %}
{% block content %}
<div class="flex items-start justify-between pb-4">
<h1 class="text-2xl font-bold">
Teamübersicht
</h1>
<div class="flex flex-col items-end space-y-2 md:flex-row md:items-center md:space-x-2 md:space-y-0">
<button type="button"
class="{{ html_classes('btn btn--small', { 'btn--secondary': filterDto.active }) }}"
title="Team filtern"
hx-get="{{ path('app_common_teamer_filter', { 'r': return_url() }) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('filter', 'w-4 h-4 shrink-0') }}
{% if filterDto.active %}
<span class="whitespace-nowrap">{{ filterDto.activeFiltersCount }} Filter aktiv</span>
{% else %}
<span>Filter</span>
{% endif %}
</button>
{% if filterDto.active %}
<a href="{{ path('app_common_teamer_filter_reset', { 'r': return_url() }) }}" class="btn btn--small btn--secondary">
Reset
</a>
{% endif %}
{% if is_granted('ROLE_TEAM_ADMIN') %}
<a href="{{ path('app_admin_teamer_mailing', { 'r': return_url() }) }}"
class="btn btn--small"
title="Mail an die gefilterte Liste schreiben">
{{ icon('mail', 'w-4 h-4 shrink-0') }}
<span>Mailing</span>
</a>
{% endif %}
</div>
</div>
<div class="data-table-wrapper">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th></th>
<th>
{{ knp_pagination_sortable(pagination, 'Name', 'teamer.lastName') }}
</th>
<th>
Vorname
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Status', 'teamer.status') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'E-Mail', 'teamer.communication.email') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Letzter Login', 'user.lastLoginAt') }}
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for teamer in pagination %}
<tr>
<td>
<div class="flex flex-col items-center space-y-2">
{% if teamer.photo %}
<img src="{{ asset(teamer.photo | upload_filename_full | imagine_filter('profile')) }}"
class="w-12 h-auto rounded-full"
alt="{{ teamer.firstName }}">
{% else %}
<div class="flex flex-col items-center justify-center w-12 h-12 border-2 border-gray-200 rounded-full">
{{ icon('user', 'w-10 h-10 text-gray-200') }}
</div>
{% endif %}
<twig:RatingStars rating="{{ teamer.averageRating }}" :teamer="teamer" />
</div>
</td>
<td>
<a href="{{ path('app_administrative_teamer_profile', { 'uuid': teamer.uuid, 'r': return_url() }) }}">
<span class="whitespace-nowrap">{{ teamer.lastName }}</span>
</a>
</td>
<td>
<a href="{{ path('app_administrative_teamer_profile', { 'uuid': teamer.uuid, 'r': return_url() }) }}" class="whitespace-nowrap">
{{ teamer.firstName }}
</a>
</td>
<td>
{{ teamer|teamer_status_label }}
</td>
<td>
{{ teamer.communication.email }}
</td>
<td>
{% if teamer.user is not null and teamer.user.lastLoginAt is not null %}
{{ teamer.user.lastLoginAt | date('d.m.Y') }}
{% else %}
-
{% endif %}
</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 }) }}"
title="Teamer als gesichtet markieren">
{{ icon('check') }}
</button>
{% endif %}
{% if teamer.deleted %}
{% if is_granted('ROLE_TEAM_ADMIN') %}
<button type="button"
role="menuitem"
tabindex="-1"
hx-get="{{ path('app_admin_teamer_restore_account', { 'uuid': teamer.uuid }) }}"
hx-target="body"
hx-swap="beforeend"
title="Account wiederherstellen">
{{ icon('refresh') }}
</button>
{% endif %}
{% elseif teamer.user is not null and teamer.user.disabled %}
{% if is_granted('ROLE_TEAM_ADMIN') %}
<button type="button"
role="menuitem"
tabindex="-1"
hx-get="{{ path('app_admin_teamer_enable_user', { 'uuid': teamer.uuid }) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('unlocked') }}
</button>
{% endif %}
{% else %}
{% if is_granted('ROLE_TEAM_ADMIN') %}
<button type="button"
class="text-red-500"
role="menuitem"
tabindex="-1"
hx-get="{{ path('app_admin_teamer_disable_user', { 'uuid': teamer.uuid }) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('locked') }}
</button>
{% endif %}
{% if is_granted('CAN_IMPERSONATE', teamer.user) %}
<a href="{{ path('app_teamer_index', { '_switch_user': teamer.user.email }) }}" title="Als Teamer:in maskieren">
{{ icon('mask') }}
</a>
{% endif %}
{% if is_granted('ROLE_TEAM_ADMIN') %}
<button type="button"
class="text-red-500"
role="menuitem"
tabindex="-1"
hx-get="{{ path('app_admin_teamer_delete_account', { 'uuid': teamer.uuid }) }}"
hx-target="body"
hx-swap="beforeend"
title="Account löschen">
{{ icon('delete') }}
</button>
{% endif %}
{% endif %}
<a href="{{ path('app_administrative_teamer_profile', { 'uuid': teamer.uuid, 'r': return_url() }) }}" title="Teamer:innenprofil {{ teamer }}">
{{ icon('user') }}
</a>
</div>
{% if teamer.deleted %}
<div class="py-1 px-2 mt-2 text-xs bg-gray-500 text-white">
gel. am {{ teamer.deletedAt | date('d.m.Y') }}
</div>
{% endif %}
{% if teamer.user is not null and teamer.user.disabled %}
<div class="py-1 px-2 mt-2 text-xs bg-red-500 text-white">
gesp. am {{ teamer.user.disabledAt | date('d.m.Y') }}
</div>
{% endif %}
</td>
</tr>
{% else %}
<td colspan="7">
Keine Daten...
</td>
{% endfor %}
</tbody>
</table>
{{ knp_pagination_render(pagination) }}
</div>
</div>
{% include 'administrative/teamer/_header.html.twig' with { 'title': 'Teamübersicht' } %}
{% include 'administrative/teamer/_table.html.twig' %}
{% endblock %}
@@ -244,6 +244,31 @@
</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>
@@ -0,0 +1,12 @@
{% extends 'administrative/layout.html.twig' %}
{% block title %}Saisonteamer{% endblock %}
{% block content %}
{% include 'administrative/teamer/_header.html.twig' with {
'title': 'Saisonteamer',
'scope': constant('App\\Service\\Common\\TeamerFilterHandler::SCOPE_ALL_SEASON')
} %}
{# every row here is an all-season teamer, so the marker would only add noise #}
{% include 'administrative/teamer/_table.html.twig' with { 'showAllSeason': false } %}
{% endblock %}