{% block communaute %}
{% if communityCollection is not empty %}
{# afficher les image de profil en fonction des utilisateur qui ont commenté la plateforme #}
<aside class="container mt-5 mb-5" id="communaute">
{# <div class="d-flex justify-content-center align-items-center">
<img class="logo-title pr-3" src="../img/faviconBookpresta.png"
alt="logo">
<h2 class="title">Communauté</h2>
</div>#}
<div class="justify-content-center align-items-center mx-0 px-0 my-0 py-0 title-section">
<h2 class="title text-right mr-2 py-lg-2 py-0 my-lg-2 my-0">Communauté</h2>
</div>
{% for comment in communityCollection %}
<div class="comment">
<div class="row mt-5">
{% if is_granted('ROLE_SUPER_ADMIN') %}
{% if comment.userId.profilPicture is not null %}
<div class="col-lg-2 col-md-3 col-sm-4 col-3 align-self-center">
<img class="img-fluid" src="{{ absolute_url(asset('img/profil/superAdmin/' ~ comment.userId.id ~ '/' ~ comment.userId.profilPicture.pictureProfil)) }}" alt="{{ comment.userId.firstname }} {{ comment.userId.name }}" id="imgProfil"/>
</div>
{% else %}
<div class="col-lg-2 col-md-3 col-sm-4 col-3 align-self-center">
<img class="logo-comment img-fluid" src="/img/profil/imgProfilDefault.jpg">
</div>
{% endif %}
{% elseif is_granted('ROLE_ADMIN') %}
{% if comment.userId.profilPicture is not null %}
<div class="col-lg-2 col-md-3 col-sm-4 col-3 align-self-center">
<img class="img-fluid" src="{{ absolute_url(asset('img/profil/admin/' ~ comment.userId.id ~ '/' ~ comment.userId.profilPicture.pictureProfil)) }}" alt="{{ comment.userId.firstname }} {{ comment.userId.name }}" id="imgProfil"/>
</div>
{% else %}
<div class="col-lg-2 col-md-3 col-sm-4 col-3 align-self-center">
<img class="logo-comment img-fluid" src="/img/profil/imgProfilDefault.jpg">
</div>
{% endif %}
{% elseif is_granted('ROLE_FOURNISSEUR') %}
{% if comment.userId.profilPicture is not null %}
<div class="col-lg-2 col-md-3 col-sm-4 col-3 align-self-center">
<img class="img-fluid" src="{{ absolute_url(asset('img/profil/professionnal/' ~ comment.userId.id ~ '/' ~ comment.userId.profilPicture.pictureProfil)) }}" alt="{{ comment.userId.firstname }} {{ comment.userId.name }}" id="imgProfil"/>
</div>
{% else %}
<div class="col-lg-2 col-md-3 col-sm-4 col-3 align-self-center">
<img class="logo-comment img-fluid" src="/img/profil/imgProfilDefault.jpg">
</div>
{% endif %}
{% elseif is_granted('ROLE_USER') %}
{% if comment.userId.profilPicture is not null %}
<div class="col-lg-2 col-md-3 col-sm-4 col-3 align-self-center">
<img class="img-fluid" src="{{ absolute_url(asset('img/profil/client/' ~ comment.userId.id ~ '/' ~ comment.userId.profilPicture.pictureProfil)) }}" alt="{{ comment.userId.firstname }} {{ comment.userId.name }}" id="imgProfil"/>
</div>
{% else %}
<div class="col-lg-2 col-md-3 col-sm-4 col-3 align-self-center">
<img class="logo-comment img-fluid" src="/img/profil/imgProfilDefault.jpg">
</div>
{% endif %}
{% else %}
<div class="col-lg-2 col-md-3 col-sm-4 col-3 align-self-center">
<img class="logo-comment img-fluid" src="/img/profil/imgProfilDefault.jpg">
</div>
{% endif %}
<div class="col">
<h4 class="comment-title">{{ comment.userId.pseudonym }}</h4>
<p class="text my-0 py-0">Posté le {{ comment.datePostComment|date("d/m/Y") }}</p>
<p>{{ comment.comment |u.truncate(200, '...', false) |raw }}</p>
<div class="btn-comment text-right">
<a href="{{ path('community') }}" class="btn-plus text-light">Lire la suite</a>
</div>
</div>
</div>
</div>
<hr>
{% endfor %}
</aside>
{% endif %}
{% endblock %}