Files
myep-team/templates/administrative/teamer/modal_info.html.twig
T

111 lines
4.6 KiB
Twig

{% extends 'htmx_modal.html.twig' %}
{% block title %}
{# The profile is administrative only, house managers reach this modal but not it. #}
Teamer:inneninfo
{% if is_granted('ROLE_ADMINISTRATIVE') %}
<a href="{{ path('app_administrative_teamer_profile', { 'uuid': teamer.uuid, 'r': returnUrl }) }}">{{ teamer }}</a>
{% else %}
{{ teamer }}
{% endif %}
{% endblock %}
{% block content %}
<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">
Ernährungsweise
</h2>
<p class="pb-4">
{% if teamer.mealPreference %}
{{ teamer.mealPreference.label }}
{% else %}
_
{% endif %}
</p>
<h2 class="text-lg font-bold">
Zustiege
</h2>
<ul class="pb-4 divide-y divide-gray-200">
{% 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 class="py-2">
{{ label }}
</li>
{% else %}
<li class="py-2">
-
</li>
{% endfor %}
</ul>
<h2 class="text-lg font-bold">
Einsätze
</h2>
<ul class="pb-4 divide-y divide-gray-200">
{% for disposition in recentDispositions %}
{% set destination = disposition.assignment.destination %}
{% set calledOff = disposition.status == constant('App\\Entity\\Disposition::STATUS_CALLED_OFF')
or disposition.assignment.status == constant('App\\Entity\\Assignment::STATUS_CALLED_OFF') %}
<li class="py-1{% if calledOff %} line-through{% endif %}">
{{ destination.product }}
<br>
{{ destination.dateFrom|date('d.m.y') }} - {{ destination.dateTo|date('d.m.y') }}
</li>
{% else %}
<li class="py-2">
-
</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 %}
<img src="{{ asset(teamer.photo | upload_filename_full | 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 %}
<twig:RatingStars rating="{{ teamer.averageRating }}" :teamer="teamer"/>
<ul class="pb-8 divide-y divide-gray-200">
{% if teamer.communication.phone %}
<li class="py-2">
<a href="tel:{{ teamer.communication.phone }}" class="flex items-center space-x-2 hover:text-primary">
{{ icon('phone', 'w-4 h-4') }}
<span class="flex-shrink-0">{{ teamer.communication.phone }}</span>
</a>
</li>
{% endif %}
<li class="py-2">
<a href="tel:{{ teamer.communication.mobile }}" class="flex items-center space-x-2 hover:text-primary">
{{ icon('mobile', 'w-4 h-4') }}
<span class="flex-shrink-0">{{ teamer.communication.mobile }}</span>
</a>
</li>
<li class="py-2">
<a href="mailto:{{ teamer.communication.email }}" class="flex items-center space-x-2 hover:text-primary">
{{ icon('at', 'w-4 h-4') }}
<span class="flex-shrink-0">{{ teamer.communication.email }}</span>
</a>
</li>
</ul>
</div>
</div>
{% endblock %}