templates/web/person/people_list.html.twig line 1

  1. {% block body %}
        {% set managers = [] %}
        {% set employees = [] %}
        {% set hasManager = false %}
        {% set hasEmployee = false %}
    
    
    
        {% for categoryPerson in category.persons %}
            {% set person = categoryPerson.person %}
            {% if person_exists(person.id) %}
                {% if categoryPerson.isManager %}
                    {% set managers = managers|merge([person]) %}
                    {% set hasManager = true %}
                {% else %}
                    {% set hasEmployee = true %}
                    {% set employees = employees|merge([person]) %}
                {% endif %}
            {% endif %}
        {% endfor %}
        {% if hasManager %}
            <section>
                <div class="container">
                    <div class="content">
                        <h3 class="mb-7">{% trans %}vedouci{% endtrans %}</h3>
                        {% for person in managers %}
                            <div class="member member--lead">
                                {% if person.personUploadGroups|length > 0 %}
                                    {% if person.personUploadGroups[0].UploadGroup.upload|length > 0 %}
                                        <img alt="Member photo" src="{{ asset(person.personUploadGroups[0].UploadGroup.upload[0].path) }}" class="member__photo">
                                    {% else %}
                                        <img alt="Member photo" src="{{ asset('build/img/person.png') }}" class="member__photo">
                                    {% endif %}
                                {% else %}
                                    <img alt="Member photo" src="{{ asset('build/img/person.png') }}" class="member__photo">
                                {% endif %}
                                <div class="member__info">
                                    <div class="member__name"><a href="{{ path('app_web_person_detail', {slug:person.slug}) }}">{{ person.titleBefore }} {{ person.name }} {{ person.surname }}{% if person.titleAfter %}, {% endif %}{{ person.titleAfter }}</a></div>
                                    <div class="member__place">{{ person.department }}</div>
                                </div>
                            </div>
                        {% endfor %}
                    </div>
                </div>
            </section>
        {% endif %}
        {% if hasEmployee %}
            <section>
                <div class="container">
                    <h3 class="mb-7">{% trans %}clenove{% endtrans %}</h3>
                    <div class="members">
                        {% for person in  employees %}
                            <a href="{{ path('app_web_person_detail', { 'slug': person.slug }) }}" class="member">
                                {% if person.personUploadGroups|length > 0 %}
                                    {% if person.personUploadGroups[0].UploadGroup.upload|length > 0 %}
                                        <img alt="Member photo" src="{{ asset(person.personUploadGroups[0].UploadGroup.upload[0].path) }}" class="member__photo">
                                    {% else %}
                                        <img alt="Member photo" src="{{ asset('build/img/person.png') }}" class="member__photo">
                                    {% endif %}
                                {% else %}
                                    <img alt="Member photo" src="{{ asset('build/img/person.png') }}" class="member__photo">
                                {% endif %}
                                <div class="member__info">
                                    <div class="member__name">
                                        {{ person.titleBefore }} {{person.name}} {{ person.surname }}{% if person.titleAfter %}, {% endif %}{{ person.titleAfter }}
                                    </div>
                                    <div class="member__place">
                                        {% for categoryPerson in get_person_departments(person)  %}
                                            {{ categoryPerson.category.name }}<br>
                                        {% endfor %}
                                    </div>
                                </div>
                            </a>
                        {% endfor %}
                    </div>
                </div>
            </section>
        {% endif %}
    {% endblock %}