{% from 'utils.html.twig' import ico, imgUpload %}
{% for teacher in teachers %}
{% if layout == 'slider' %}<div>{% endif %}
<div class="item-professor item-professor--{{ layout }}">
<header>
{% if layout == 'lista' %}
<div class="capa">
{# USER #}
{% if teacher.cover %}
{{ imgUpload(teacher.cover, enum('AbstractEnum::PATH_COVERS_PROFILE'), 'user-profile-cover-box') }}
{# DEFAULT #}
{% else %}
<img src="{{ cdn }}img/cover_default.jpg" alt="" onerror="imgError(this)">
{% endif %}
</div>
{% endif %}
<div class="foto">
{{ imgUpload(teacher.photo, enum('AbstractEnum::PATH_PROFILES'), 'profile', teacher.name) }}
</div>
<h3 class="title">{{ teacher.name }}</h3>
{% if layout == 'slider' %}
{% if teacher.occupation %}
<p class="cargo">{{ ico('briefcase') }}{{ teacher.occupation }}</p>
{% endif %}
{% endif %}
</header>
<div class="content">
<div class="desc">
{% if teacher.biography is not empty %}
{{ teacher.biography|raw }}
{% else %}
<p>{{ getLanguage('teacher_biogaphy', 'teachers') }}</p>
{% endif %}
</div>
<footer>
{% include 'website/includes/sociais.html.twig' with { profile: teacher } %}
<a href="{{ path('teacherProfile', { username: teacher.username }) }}" class="link-perfil">{{ getLanguage('view_profile', 'teachers') }} {{ ico('log-in') }}</a>
</footer>
</div>
</div>
{% if layout == 'slider' %}</div>{% endif %}
{% endfor %}