{% for conversacion in aConversaciones %}
{% set activeChat = (numTelefonoSelected is defined and numTelefonoSelected is not empty)
? (numTelefonoSelected == conversacion.num_telefono) ? 'active-chat' : '':'' %}
<li class="listado-conversaciones clearfix {{ activeChat }}" data-centroid="{{ conversacion.centroId }}" data-numtelefono="{{ conversacion.num_telefono }}">
<div class="row chat-list-item">
{% set imageUrls = [] %}
{% for paciente in conversacion.pacientes|slice(0, 4) %}
{% set imageUrl = (paciente.imagen is not empty) ? paciente.imagen : asset('assets/img/user.png') %}
{% set imageUrls = imageUrls|merge([imageUrl]) %}
{% endfor %}
{% if imageUrls|length == 0 %}
{% set imageUrls = [asset('assets/img/user.png')] %}
{% endif %}
{% set imageCount = imageUrls|length %}
{# {% set compositeImageData = create_composite_image(imageUrls) %} #}
{# {% set imagen = (paciente.imagen is not empty) ? paciente.imagen : asset('assets/img/user.png') %} #}
<div class="col-10 patient-list-data"> <div class="composite-image image-count-{{ imageCount }}">
{% for imageUrl in imageUrls %}
<img src="{{ imageUrl }}" alt="avatar"/>
{% endfor %}
</div>
<div class="about">
<div class="name">
{% for paciente in conversacion.pacientes|slice(0, 2) %}
<div>
<b>{{ paciente.nombre_paciente }}</b>
{{ paciente.nombre_familia }}
<span class="status">{{ getTipoContacto(conversacion.num_telefono, paciente.vcId, conversacion.centroId) }}</span>
</div>
{% endfor %}
{% if conversacion.pacientes|length == 0 %}
<div>
<b>{{ conversacion.num_telefono }}</b>
</div>
{% endif %}
{% if conversacion.pacientes|length >= 3 %}
{% set num_extra_patients = conversacion.pacientes|length - 2 %}
<div class="more-than-two-patients">
y
{{ num_extra_patients }}
más
</div>
{% endif %}
</div>
</div>
</div>
<div class="col-2">
{% if conversacion.total_notificaciones > 0 %}
<span class="badge badge-coorporativo badge-{{ conversacion.num_telefono }}-{{ conversacion.centroId }}">{{ conversacion.total_notificaciones }}</span>
{% endif %}
</div>
</div>
</li>
{% endfor %}