<h2>{% trans %}title_informations{% endtrans %}</h2>
{% if document.content %}
{{ document.content | raw }}
{% else %}
{{ 'no_data'|trans}}
{% endif %}
<hr>
<div class="row my-5">
    <div class="col">
        <h3>{% trans %}title_documents_into_folder{% endtrans %}{% if shared is not defined %} <a href="{{ path('folder_document', {id: document.id}) }}"><span class="badge rounded-pill bg-success"><i class="fa fa-plus"></i> {% trans %}button_add{% endtrans %}</span></a>{% endif %}</h3>
        <hr>
        {% if document.documents|length > 0 %}
            <ul class="list-group">
                {% for i in document.documents %}
                    <li class="list-group-item list-group-flush">

                        <div class="row">
                            <div class="col-2">
                                {% set groupLogo = 'img/nologo.png' %}
                                {% if i.mainGroup %}
                                    {% if i.mainGroup.imageSize != 0 %}
                                        {% set groupLogo = 'uploads/groups/' ~ i.mainGroup.imageName %}
                                    {% endif %}
                                {% endif %}
                                <img src="{{ asset(groupLogo) }}" alt="{{  i.mainGroup.name }} " class="img-fluid">
                            </div>
                            <div class="col">
                                {% if i.AllowShare %}<a href="{{ path('share', {'share': i.share}) }}" target="_blank">{% endif %}
                                    <h4>#{{i.id}} {{i.classShort}} - {{i.title }} {% if i.archive %}<small>({% trans %}title_archived{% endtrans %})</small>{% endif %}{% if i.AllowShare %} <i class="fa fa-link text-success" data-bs-toggle="tooltip" data-placement="top"  title="{% trans %}tooltip_document_shared{% endtrans %}" ></i>{% endif %}</h4>
                                {% if i.AllowShare %}</a>{% endif %}
                                {% if i.directory is defined %}<p>#{{i.directory.id}} - {{i.directory.fullName}} {{i.directory.gender}} {{i.directory.phone}}</p>{% endif %}
                                {% if i.status is defined %} 
                                    <p>{% trans %}title_status{% endtrans %}: {{ i.status|trans }}</p>                        
                                {% endif %}
                                {% if i.removingDate is defined %} 
                                    <p>{% trans %}title_can_be_removed_at{% endtrans %}: {{ i.removingDate|date('_datetime.format'|trans) }}</p>
                                {% endif %}
                                {% if i.numberplate is defined %}
                                    <p>{% trans %}title_numberplate{% endtrans %}: {{ i.numberplate }}</p>                       
                                {% endif %}
                                <p>{% trans %}title_created_by{% endtrans %}: {{i.creator.firstname | u.truncate(2, '.')}} {{i.creator.lastname}}, {{i.creator.mainGroup ? i.creator.mainGroup.shortname : 'No Group'}}, {% trans %}title_created_at{% endtrans %}: {{i.createdAt |date('_datetime.format'|trans)}}</p>
                            </div>
                            {% if shared is not defined %}
                            <div class="col-3">                                
                                {% include '_cells/documentActions.html.twig' with {'document': i} %}
                            </div>
                            {% endif %}
                        </div>

                    </li>
                {% endfor %}
            </ul>
        {% else %}
            {{ 'no_data'|trans}}
        {% endif %}
    </div>
</div>
<div class="row my-5">
    <div class="col">
        <h3>{% trans %}title_directories_into_folder{% endtrans %}{% if shared is not defined %} <a
                href="{{ path('folder_directory', {id: document.id}) }}"><span class="badge rounded-pill bg-success"><i
                        class="fa fa-plus"></i> {% trans %}button_add{% endtrans %}</span></a>{% endif %}</h3>
        <hr>
        {% if document.directories|length > 0 %}
        {% set path_directories_uploads  = 'uploads/directories/'  %}
            <ul class="list-group">
                {% for i in document.directories %}
                    <li class="list-group-item list-group-flush">
                        <div class="row">
                            <div class="col-2">
                                {% if i.faceImageSize != 0 %}{% set faceImage = path_directories_uploads ~ '/' ~ i.faceImageName %}{% else %}{% set faceImage = 'img/nophoto.jpg' %}{% endif %}
                                <a data-toggle="lightbox" data-gallery="report" href="{{ asset(faceImage) }}"><img class="img-fluid" style="max-height: 200px;" src="{{ asset(faceImage) }}" alt="{{ i.fullname}}"></a>
                            </div>
                            <div class="col">
                                <h4>#{{i.id}} {{i.fullName}}</h4>
                                <p>{% trans %}title_created_at{% endtrans %}: {{i.createdAt |date('_datetime.format'|trans)}}</p>
                                {% if i.wanted %}<p class="text-danger">{% trans %}title_directory_wanted_light{% endtrans %}</p>{% endif %}
                                {% if i.dead %}<p class="text-warning">{% trans %}title_directory_dead{% endtrans %}</p>{% endif %}
                            </div>
                            {% if shared is not defined %}
                            <div class="col-3">
                                {% include '_cells/directoryActions.html.twig' with {'directory': i} %}
                            </div>
                            {% endif %}
                        </div>                    
                    </li>
                {% endfor %}
            </ul>
        {% else %}
            {{ 'no_data'|trans}}
        {% endif %}
    </div>
</div>