Licitator 1.0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.5 KiB

5 years ago
  1. {% block sala %}
  2. {% set userSala = sala.getDestinatario(userId) %}
  3. {% if userSala is not null %}
  4. {% set image = userSala.photo ? userSala.photo : asset(sonata_user.defaultAvatar) %}
  5. {% endif %}
  6. {% if is_granted('ROLE_TRAINER') and sala.denominacion == "My trainer" and userSala is not empty%}
  7. {% set salaName = userSala.getNombreCompleto() %}
  8. {% elseif sala.denominacion == "Contacto" and userSala is not empty%}
  9. {% set salaName = userSala.getNombreCompleto() %}
  10. {% else %}
  11. {% set salaName = sala.denominacion %}
  12. {% endif %}
  13. <div class="sala_item" id="{{ 'sala-' ~ sala.id }}" role="button" data-load-path="{{ path('carga_mensajes_sala', {'id':sala.id}) }}" data-publish-url="{{ url('publisher', {'topic': 'sala-' ~ sala.id}) }}">
  14. <div class="sala_img">
  15. {% if unreaded is defined and unreaded > 0 %}
  16. <span class="unreaded">{{ unreaded }}</span>
  17. {% endif %}
  18. {% if image is defined %}
  19. {% if image is null %}
  20. <img src="/images/user-profile.png" alt="{{ salaName }}">
  21. {% else %}
  22. <img src="{{ image }}" alt="{{ salaName }}">
  23. {% endif %}
  24. {% else %}
  25. <span class="sala_logo">{{ salaName|slice(0,1)|upper }}</span>
  26. {% endif %}
  27. </div>
  28. <div class="sala_desc">
  29. {{ include('dashboard/chat/_sala_element_desc.html.twig', {salaName: salaName, lastMsg:sala.lastMessage}) }}
  30. </div>
  31. </div>
  32. {% endblock %}