feat: streamlined teamer info modals, internal teamer remarks

This commit is contained in:
Björn Fromme
2025-02-10 18:14:19 +01:00
parent 0b743172e7
commit 9192e8220d
13 changed files with 201 additions and 86 deletions
+2 -1
View File
@@ -64,7 +64,8 @@
{% elseif item.extras.divider is defined %}
<hr class="my-4 h-px bg-gray-200">
{% else %}
<div class="hover:bg-gray-50 group flex gap-x-3 rounded-md p-2 text-sm leading-5 font-semibold text-gray-700" role="button">
<div class="hover:bg-gray-50 group flex gap-x-3 rounded-md p-2 text-sm leading-5 font-semibold text-gray-700"
role="button">
{{ block('label') }}
</div>
{% endif %}
@@ -1,50 +0,0 @@
{% extends 'htmx_modal.html.twig' %}
{% block title %}Teamer:inneninfo {{ application.teamer }}{% endblock %}
{% block content %}
<div class="flex items-start">
<div class="flex-1 pr-8">
{% include '_partials/_assignment_requirements_info.html.twig' with {
'assignment': application.assignment,
'teamer': application.teamer
} %}
<ul class="pb-8 divide-y divide-gray-200">
{% for type in ['ski', 'snowboard'] %}
<li class="py-2">
<div class="flex items-center justify-between">
<span class="flex-1">{{ type|license_label }}</span>
{% set license = application.teamer.licenseOfType(type) %}
{% if license %}
<div class="flex items-center space-x-2">
<span>{{ license.date|date('m/Y') }}</span>
{% if is_granted('DOWNLOAD', license.certificate) %}
<a href="{{ path('app_common_download', { 'uuid': license.certificate.uuid, 'inline': true }) }}"
target="_blank"
title="Download Nachweis">
{{ icon('download', 'w-4 h-4') }}
</a>
{% endif %}
</div>
{% else %}
{{ icon('minus', 'w-4 h-4') }}
{% endif %}
</div>
</li>
{% endfor %}
</ul>
</div>
<div>
{% set teamer = application.teamer %}
{% if teamer.photo %}
<img src="{{ asset(teamer.photo.filename | imagine_filter('profile')) }}"
class="w-32 h-auto border-2 border-primary"
alt="{{ teamer.firstName }}">
{% else %}
<div class="border-2 border-primary">
{{ icon('user', 'w-32 h-32 text-gray-200') }}
</div>
{% endif %}
</div>
</div>
{% endblock %}
@@ -0,0 +1,25 @@
{% extends 'admin/layout.html.twig' %}
{% block title %}Interne Anmerkungen zu {{ 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('admin_teamer')) }}
</div>
<div class="lg:col-span-2">
<h1 class="text-2xl font-bold pb-8">
Interne Anmerkungen zu {{ teamer }}
</h1>
{{ form_start(form) }}
<div class="pb-4">
{{ form_row(form.remarks) }}
</div>
<button type="submit" class="btn">
speichern
</button>
{{ form_rest(form) }}
{{ form_end(form) }}
</div>
</div>
{% endblock %}
+8 -2
View File
@@ -27,7 +27,9 @@
<button type="button"
class="text-red-500"
title="Ausbildung löschen"
hx-get="{{ path('app_admin_teamer_skills_training_attendance_delete', { 'uuid': attendance.uuid, 'r': return_url() }) }}"
hx-get="{{ path('app_admin_teamer_skills_training_attendance_delete', {
'uuid': attendance.uuid, 'r': return_url()
}) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('delete') }}
@@ -36,7 +38,11 @@
{% else %}
<button type="button"
title="Teilnahme hinzufügen"
hx-get="{{ path('app_admin_teamer_skills_training_attendance_create', { 'training_id': training.id, 'teamer_id': teamer.id, 'r': return_url() }) }}"
hx-get="{{ path('app_admin_teamer_skills_training_attendance_create', {
'training_id': training.id,
'teamer_id': teamer.id,
'r': return_url()
}) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('calendar', 'w-4 h-4') }}
@@ -41,7 +41,10 @@
<button type="button"
class="flex items-center space-x-1"
title="Teamer:inneninfo {{ application.teamer }}"
hx-get="{{ path('app_admin_application_info', { 'uuid': application.uuid }) }}"
hx-get="{{ path('app_administrative_teamer_info', {
'uuid': application.teamer.uuid,
'r': return_url()
}) }}"
hx-target="body"
hx-swap="beforeend">
<span>{{ application.teamer }}</span>
@@ -68,7 +71,9 @@
<button type="button"
class="text-green-500"
title="einteilen"
hx-get="{{ path('app_admin_application_dispose', { 'uuid': application.uuid }) }}"
hx-get="{{ path('app_admin_application_dispose', {
'uuid': application.uuid
}) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('check') }}
@@ -78,7 +83,9 @@
<button type="button"
class="text-primary"
title="Bewerbungsstatus bearbeiten"
hx-get="{{ path('app_admin_application_status', { 'uuid': application.uuid }) }}"
hx-get="{{ path('app_admin_application_status', {
'uuid': application.uuid
}) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('edit') }}
@@ -88,7 +95,9 @@
<button type="button"
class="text-red-500"
title="Bewerbung löschen"
hx-get="{{ path('app_admin_application_delete', { 'uuid': application.uuid }) }}"
hx-get="{{ path('app_admin_application_delete', {
'uuid': application.uuid
}) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('delete') }}
@@ -1,6 +1,8 @@
{% extends 'htmx_modal.html.twig' %}
{% block title %}Teamer:inneninfo {{ teamer }}{% endblock %}
{% block title %}
Teamer:inneninfo <a href="{{ path('app_administrative_teamer_profile', { 'uuid': teamer.uuid, 'r': returnUrl }) }}">{{ teamer }}</a>
{% endblock %}
{% block content %}
<div class="flex items-start">
@@ -10,7 +12,7 @@
<h2 class="text-lg font-bold">
Zustiege
</h2>
<ul class="pb-8 divide-y divide-gray-200">
<ul class="pb-4 divide-y divide-gray-200">
{% for pickup in teamer.pickups %}
<li class="py-2">
{{ pickup|bpn_pickup_label }}
@@ -22,7 +24,7 @@
{% endfor %}
</ul>
<h2 class="text-lg font-bold">
Letzte Einsätze
Einsätze
</h2>
<ul class="pb-4 divide-y divide-gray-200">
{% for disposition in recentDispositions %}
@@ -38,6 +40,12 @@
</li>
{% endfor %}
</ul>
{% if is_granted('ROLE_ADMIN') %}
<h2 class="text-lg font-bold">
Interne Anmerkungen
</h2>
{{ teamer.remarksInternal | default('-') | nl2br }}
{% endif %}
</div>
<div class="flex flex-col space-y-4">
{% if teamer.photo %}