Feat: Add teamer info popup

This commit is contained in:
Björn Fromme
2023-10-20 11:08:23 +02:00
parent 67cc7bf4ed
commit 2d657611fa
9 changed files with 137 additions and 34 deletions
+20 -6
View File
@@ -34,9 +34,16 @@
{% for application in applications %}
<tr>
<td>
<a href="{{ path('app_admin_teamer_profile', { 'uuid': application.teamer.uuid, 'r': return_url() }) }}">
{{ application.teamer }}
</a>
<button type="button"
class="flex items-center space-x-1"
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
{{ stimulus_action('modal-button', 'ajax', null, {
'title': 'Teamerinfo ' ~ application.teamer,
'url': path('app_admin_teamer_info', { 'uuid': application.teamer.uuid })
}) }}>
<span>{{ application.teamer }}</span>
{{ icon('info', 'w-4 h-4') }}
</button>
</td>
<td>
{{ application.requests|nl2br|default('-') }}
@@ -117,9 +124,16 @@
{% for disposition in dispositions %}
<tr>
<td>
<a href="{{ path('app_admin_teamer_profile', { 'uuid': disposition.teamer.uuid, 'r': return_url() }) }}">
{{ disposition.teamer }}
</a>
<button type="button"
class="flex items-center space-x-1"
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
{{ stimulus_action('modal-button', 'ajax', null, {
'title': 'Teamerinfo ' ~ disposition.teamer,
'url': path('app_admin_teamer_info', { 'uuid': disposition.teamer.uuid })
}) }}>
<span>{{ disposition.teamer }}</span>
{{ icon('info', 'w-4 h-4') }}
</button>
</td>
<td>
{{ disposition.remarks|nl2br|default('-') }}
+43
View File
@@ -0,0 +1,43 @@
<div class="flex items-start">
<div class="flex-1 pr-8">
{% include '_partials/_teamer_training_info.html.twig' %}
{% include '_partials/_teamer_license_info.html.twig' %}
<h2 class="text-lg font-bold">
Zustiege
</h2>
<ul class="pb-8 divide-y divide-gray-200">
{% for pickup in teamer.pickups %}
<li class="py-2">
{{ pickup|bpn_pickup_label }}
</li>
{% endfor %}
</ul>
<h2 class="text-lg font-bold">
Letzte Einsätze
</h2>
<ul class="pb-4 divide-y divide-gray-200">
{% for disposition in recentDispositions %}
{% set destination = disposition.assignment.destination %}
<li class="py-2 flex items-start">
<span class="flex-1">{{ destination.product }}</span>
<span>{{ destination.dateFrom|date('d.m.y') }} -<br>{{ destination.dateTo|date('d.m.y') }}</span>
</li>
{% else %}
<li class="py-2">
-
</li>
{% endfor %}
</ul>
</div>
<div>
{% 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>
+2 -24
View File
@@ -50,30 +50,8 @@
</li>
{% endfor %}
</ul>
<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 = 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 }) }}"
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>
{% include '_partials/_teamer_license_info.html.twig' %}
<div class="grid grid-cols-2 gap-8">
<div>