{% set constUserTypeInge = constant('AppBundle\\Enum\\UserType::ENGINEER') %}

<div class="module module-lastusers module-{{ module.id }} {{ module.customClass }}">
    {% if module.params.title is not empty and module.params.title_tag is not empty %}
        <{{ module.params.title_tag|striptags }} class="module-title">
            {{ module.params.title|striptags }}
        </{{ module.params.title_tag|striptags }}>
    {% endif %}
    <div class="list-users">
        {% for user in users %}
            <div>
                <p>{{ user.firstname }} {{ user.lastname|truncate(1, false, '') }}, {% if user.jobOther is not empty %}{{ user.jobOther }}{% else %}{% if constUserTypeInge == user.type %}{{ user.job|transconst('AppBundle\\Enum\\UserJobEngineer') }} {{ user.jobOther }}{% else %}{% if user.categoryJob is not empty %}{{ user.categoryJob|transconst('AppBundle\\Enum\\UserJobTeacherCategory') }} / {% endif %}{% if user.jobOther is not empty %}{{ user.jobOther }}{% else %}{{ user.job|transconst('AppBundle\\Enum\\UserJobTeacher') }}{% endif %}{% endif %}{% endif %}{% if constUserTypeInge == user.type %}, {{ user.establishmentname}}{% endif %}</p>
                <p><time class="date" datetime="{{ user.created|date('Y-m-d') }}">{{ user.created|date("d/m/Y") }}</time> {{ user.establishmentCity }}</p>
            </div>
        {% endfor %}
    </div>
</div>