<div class="card user-card user-card-1">
    <div class="card-header">{{ directory.fullname}} <span class="float-end">{% include '_cells/directoryActions.html.twig' with {'directory': directory} %}</span></div>
    <div class="card-body pb-0">
        {% if directory.dead %}<p class="text-danger">{% trans %}title_directory_dead{% endtrans %}</p>{% endif %}
        {% if directory.wanted %}<p class="text-danger">{% trans %}title_directory_wanted{% endtrans %}</p>{% endif %}

        <div class="row">
            {% set path_directories_uploads  = 'uploads/directories' %}
            {% if directory.faceImageSize != 0 %}{% set faceImage = path_directories_uploads ~ '/' ~ directory.faceImageName %}{% else %}{% set faceImage = 'img/nophoto.jpg' %}{% endif %}
            <div class="col-2  col-xs-4">
                <a data-toggle="lightbox" data-gallery="directory" data-bs-toggle="tooltip" data-placement="top"  title="{% trans %}title_faceImage{% endtrans %}: {{ directory.faceImageDate ? directory.faceImageDate|date('_datetime.format'|trans) : 'value_no_picture'|trans }}" data-caption="{{ directory.fullname}} | {% trans %}title_faceImage{% endtrans %}: {{ directory.faceImageDate ? directory.faceImageDate|date('_datetime.format'|trans) : 'value_no_picture'|trans }}" href="{{ asset(faceImage) }}"><img class="img-fluid m-1" src="{{ asset(faceImage) }}" alt="{{ directory.fullname}}"></a>             
            </div>
            {% if directory.backImageSize != 0 %}{% set backImage = path_directories_uploads ~ '/' ~ directory.backImageName %}{% else %}{% set backImage = 'img/nophoto.jpg' %}{% endif %}
            <div class="col-2  col-xs-4">
                <a data-toggle="lightbox" data-gallery="directory" data-bs-toggle="tooltip" data-placement="top"  title="{% trans %}title_backImage{% endtrans %}: {{ directory.backImageDate ? directory.backImageDate|date('_datetime.format'|trans) : 'value_no_picture'|trans }}" data-caption="{{ directory.fullname}} | {% trans %}title_backImage{% endtrans %}: {{ directory.backImageDate ? directory.backImageDate|date('_datetime.format'|trans) : 'value_no_picture'|trans }}" href="{{ asset(backImage) }}"><img class="img-fluid m-1" src="{{ asset(backImage) }}" alt="{{ directory.fullname}}"></a>                  
            </div>
            {% if directory.rightImageSize != 0 %}{% set rightImage = path_directories_uploads ~ '/' ~ directory.rightImageName %}{% else %}{% set rightImage = 'img/nophoto.jpg' %}{% endif %}
            <div class="col-2  col-xs-4">
                <a data-toggle="lightbox" data-gallery="directory" data-bs-toggle="tooltip" data-placement="top"  title="{% trans %}title_rightImage{% endtrans %}: {{ directory.rightImageDate ? directory.rightImageDate|date('_datetime.format'|trans) : 'value_no_picture'|trans }}" data-caption="{{ directory.fullname}} | {% trans %}title_rightImage{% endtrans %}: {{ directory.rightImageDate ? directory.rightImageDate|date('_datetime.format'|trans) : 'value_no_picture'|trans }}" href="{{ asset(rightImage) }}"><img class="img-fluid m-1" src="{{ asset(rightImage) }}" alt="{{ directory.fullname}}"></a>                  
            </div>
            {% if directory.leftImageSize != 0 %}{% set leftImage = path_directories_uploads ~ '/' ~ directory.leftImageName %}{% else %}{% set leftImage = 'img/nophoto.jpg' %}{% endif %}
            <div class="col-2  col-xs-4">
                <a data-toggle="lightbox" data-gallery="directory" data-bs-toggle="tooltip" data-placement="top"  title="{% trans %}title_leftImage{% endtrans %}: {{ directory.leftImageDate ? directory.leftImageDate|date('_datetime.format'|trans) : 'value_no_picture'|trans }}" data-caption="{{ directory.fullname}} | {% trans %}title_leftImage{% endtrans %}: {{ directory.leftImageDate ? directory.leftImageDate|date('_datetime.format'|trans) : 'value_no_picture'|trans }}" href="{{ asset(leftImage) }}"><img class="img-fluid m-1" src="{{ asset(leftImage) }}" alt="{{ directory.fullname}}"></a>                  
            </div>
        
            {% if directory.idCardImageSize != 0 %}
            <div class="col-2  col-xs-4">
                <a data-toggle="lightbox" data-gallery="directory" href="{{ asset(path_directories_uploads ~ '/' ~ directory.idCardImageName) }}"><img class="img-fluid m-1" src="{{ asset(path_directories_uploads ~ '/' ~ directory.idCardImageName) }}" alt="{% trans %}tooltip_id_card{% endtrans %}"></a>
            </div>
            {% endif %}
            {% if app.user.hasPermission('general_legal_view') %}
                {% if directory.carLicenceImageSize != 0 %}
                <div class="col-2  col-xs-4">
                    <a data-toggle="lightbox" data-gallery="directory" href="{{ asset(path_directories_uploads ~ '/' ~ directory.carLicenceImageName) }}"><img class="img-fluid m-1" src="{{ asset(path_directories_uploads ~ '/' ~ directory.carLicenceImageName) }}" alt="{% trans %}tooltip_car_licence{% endtrans %}"></a>
                </div>
                {% endif %}
                {% if directory.motorcycleLicenceImageSize != 0 %}
                <div class="col-2  col-xs-4">
                    <a data-toggle="lightbox" data-gallery="directory" href="{{ asset(path_directories_uploads ~ '/' ~ directory.motorcycleLicenceImageName) }}"><img class="img-fluid m-1" src="{{ asset(path_directories_uploads ~ '/' ~ directory.motorcycleLicenceImageName) }}" alt="{% trans %}tooltip_motorcycle_licence{% endtrans %}"></a>
                </div>
                {% endif %}
                {% if directory.truckLicenceImageSize != 0 %}
                <div class="col-2  col-xs-4">
                    <a data-toggle="lightbox" data-gallery="directory" href="{{ asset(path_directories_uploads ~ '/' ~ directory.truckLicenceImageName) }}"><img class="img-fluid m-1" src="{{ asset(path_directories_uploads ~ '/' ~ directory.truckLicenceImageName) }}" alt="{% trans %}tooltip_truck_licence{% endtrans %}"></a>
                </div>
                {% endif %}
                {% if directory.boatLicenceImageSize != 0 %}
                <div class="col-2  col-xs-4">
                    <a data-toggle="lightbox" data-gallery="directory" href="{{ asset(path_directories_uploads ~ '/' ~ directory.boatLicenceImageName) }}"><img class="img-fluid m-1" src="{{ asset(path_directories_uploads ~ '/' ~ directory.boatLicenceImageName) }}" alt="{% trans %}tooltip_boat_licence{% endtrans %}"></a>
                </div>
                {% endif %}
            {% endif %}
        </div>

        <ul class="list-group list-group-flush fa-ul">
            <li class="list-group-item"><span class="fa-li"><i class="fas fa-birthday-cake"></i></span>{% trans %}title_birthdate{% endtrans %} : {{ directory.birthdate ? directory.birthdate | date("d/m/Y") : 'value_no_value'|trans }}{% if directory.dead %}, {% trans %}title_dead{% endtrans %}{% endif %}</li>
            <li class="list-group-item"><span class="fa-li"><i class="fas fa-phone"></i></span>{% trans %}title_phone{% endtrans %} : {{ directory.phone | default('value_no_value'|trans) }}</li>
            <li class="list-group-item"><span class="fa-li"><i class="fas fa-transgender-alt"></i></span>{% trans %}title_gender{% endtrans %} : {{ directory.gender | default('value_no_value'|trans) }}</li>
            <li class="list-group-item"><span class="fa-li"><i class="fas fa-arrows-alt-v"></i></span>{% trans %}title_height{% endtrans %} : {{ directory.height | default('value_no_value'|trans) }}</li>
            <li class="list-group-item"><span class="fa-li"><i class="fas fa-weight"></i></span>{% trans %}title_weight{% endtrans %} : {{ directory.weight | default('value_no_value'|trans) }}</li>
            {% if app.user.hasPermission('general_legal_view') %}            
            <li class="list-group-item"><span class="fa-li"><i class="fas fa-wheelchair"></i></span>{% trans %}title_gang{% endtrans %} :  {% if directory.gang %} <a href="{{ path('document_view', {id: directory.gang.id}) }}">{{ directory.gang.title }}</a> {% endif %}{% if directory.gangInfo %}( {{ directory.gangInfo }} ){% endif %}</li>
                {% if directory.hasnopapers %}
                    <li class="list-group-item"><span class="fa-li"><i class="fas fa-scroll"></i></span>{% trans %}title_hasnopapers{% endtrans %}</li>
                {% endif %}
                {% if directory.wanted %}
                    <li class="list-group-item text-danger"><span class="fa-li"><i class="far fa-id-badge"></i></span>{% trans %}title_directory_wanted_light{% endtrans %} : {{ directory.wantedReason | default('value_no_value'|trans) }}</li>
                {% endif %}
            {% endif %}
        </ul>        
        <div class="card">
            <div class="card-header"><i class="fas fa-home"></i> {% trans %}title_address{% endtrans %}</div>
            <div class="card-body">
                {{ directory.address | default('value_no_value'|trans) | raw }}
            </div>
          </div>
    </div>    
</div>
{% if app.user.hasPermission('general_medical_view') %}
    {% include '_cells/directoryCardMedical.html.twig' with {'directory': directory} %}
{% endif %}