templates/clientWeb/community.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block section %}
  3. <section class="container-fluid p-0 mb-0">
  4. {% block slider %}
  5.     {% include('clientWeb/slider/slider.html.twig') %}
  6. {% endblock  %}
  7.     
  8.     <aside class="container py-0 my-3">
  9.         <div class="justify-content-center align-items-center mx-0 px-0 my-2 py-0 title-section">
  10.             <h2 class="title text-right mr-2 py-lg-2 py-0 my-lg-2 my-0">Livre d'or</h2>
  11.         </div>
  12.         <div class="row  mx-0 px-0 justify-content-center" id="presentationCard">
  13.                 
  14.             <div class="col-12" id="postList">
  15.                 <div class="row justify-content-center" id="accordion">
  16.                     {% if listComment is not null %}
  17.                     {% set index =1 %}
  18.                         {% for groupsComment in listComment %}
  19.                         <div class="col-12 card postGroup" id="postGroup">
  20.                             <div class="row justify-content-center">
  21.                                 <div class="col-12 card-header" id="postTitle{{ index }}">
  22.                                     <div class="row justify-content-center mx-0 px-0" >
  23.                                         <a class="btn btn-link btnCommunityPost col-md-10 col-8 text-left" data-toggle="collapse" data-target="#postContent{{ index }}" aria-expanded="true" aria-controls="postContent{{ index }}">
  24.                                             <p class="text my-0 py-0">Post&eacute; par <span class="text-dark">{{ groupsComment.userId.pseudonym }}</span> - date de publication {{ groupsComment.datePostComment|date("d/m/Y") }}</p>
  25.                                         </a>
  26.                                         <div class="col-md-2 col-4 text-right">
  27.                                             {% if groupsComment.notation == 5 %}
  28.                                                 {% set imgNotation = '5etoile.png' %}
  29.                                             {% elseif groupsComment.notation > 4.5 and groupsComment.notation < 5 or groupsComment.notation == 4.5 %}
  30.                                                 {% set imgNotation = '4_5etoile.png' %}
  31.                                             {% elseif groupsComment.notation > 4 and groupsComment.notation < 4.49 or groupsComment.notation == 4 %}
  32.                                                 {% set imgNotation = '4etoile.png' %}
  33.                                             {% elseif groupsComment.notation > 3.5 and groupsComment.notation < 4 or groupsComment.notation == 3.5 %}
  34.                                                 {% set imgNotation = '3_5etoile.png' %}
  35.                                             {% elseif groupsComment.notation > 3 and groupsComment.notation < 3.5 or groupsComment.notation == 3 %}
  36.                                                 {% set imgNotation = '3etoile.png' %}
  37.                                             {% elseif groupsComment.notation > 2.5 and groupsComment.notation < 3 or groupsComment.notation == 2.5 %}
  38.                                                 {% set imgNotation = '2_5etoile.png' %}
  39.                                             {% elseif groupsComment.notation > 2 and groupsComment.notation < 2.5 or groupsComment.notation == 2 %}
  40.                                                 {% set imgNotation = '2etoile.png' %}
  41.                                             {% elseif groupsComment.notation > 1.5 and groupsComment.notation < 2 or groupsComment.notation == 1.5 %}
  42.                                                 {% set imgNotation = '1_5etoile.png' %}
  43.                                             {% elseif groupsComment.notation > 1 and groupsComment.notation < 1.5 or groupsComment.notation == 1 %}
  44.                                                 {% set imgNotation = '1etoile.png' %}
  45.                                             {% elseif groupsComment.notation > 0.5 and groupsComment.notation < 1 or groupsComment.notation == 0.5 %}
  46.                                                 {% set imgNotation = '0_5etoile.png' %}
  47.                                             {% else %}
  48.                                                 {% set imgNotation = 'aucuneEtoile.png' %}
  49.                                             {% endif %}
  50.                                             <img class="img-fluid py-0 my-0" src="{{ absolute_url(asset('img/profil/' ~ imgNotation)) }}" />
  51.                                         </div>
  52.                                     </div>
  53.                                 </div>
  54.                                 <div class="collapse" aria-labelledby="postTitle{{ index }}" data-parent="#accordion" id="postContent{{ index }}">
  55.                                     <div class="card-body">
  56.                                         {{ groupsComment.comment|raw }}
  57.                                     </div>
  58.                                 </div>
  59.                             </div>
  60.                         </div>
  61.                         {% set index=index+1 %}
  62.                         {% endfor %}
  63.                     {% else %}
  64.                     <p class="text col-12">Aucun commentaires post&eacute;s</p>
  65.                     {% endif %}
  66.                 </div>
  67.             </div>
  68.         </div>
  69.     </aside>
  70.     {% if is_granted('ROLE_USER') %}
  71.     <aside class="container-fluid p-0 mx-0 my-5">
  72.         <div class="row justify-content-center">
  73.             {{ form_start(formPost, {'attr': {'class':'col-12 px-0'}}) }}
  74.                         
  75.                 
  76.                 <div class="row justify-content-center mx-0 px-0">
  77.                     
  78.                     <div class="col-md-10 col-sm-12 col-12 mx-0 px-0">
  79.                         <div class="row justify-content-center mb-2">
  80.                             {{ form_widget(formPost.comment) }}                
  81.                         </div>
  82.                     </div>
  83.                     <div class="col-md-10 col-sm-12 col-12 mx-0 px-0 my-3">
  84.                         <div class="row justify-content-center mb-2 form-check text-center">
  85.                             <h5 class="col-12 my-2 px-0 mx-0">Notez nous !</h5>
  86.                             <div class="col-12 my-2 px-0 mx-0">
  87.                                 <div class="row justify-content-center mx-0 px-0">
  88.                                     <div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-12 mx-0 px-0">
  89.                                         <div class="row justify-content-center mx-0 px-0 iconRow">
  90.                                             <i class="col-1 px-0 mx-0 fa fa-star"></i><i class="col-1 px-0 mx-0 fa fa-star"></i><i class="col-1 px-0 mx-0 fa fa-star"></i><i class="col-1 px-0 mx-0 fa fa-star"></i><i class="col-1 px-0 mx-0 fa fa-star"></i>
  91.                                         </div>
  92.                                     </div>
  93.                                 </div>
  94.                             </div>
  95.                             <div class="col-12 px-0 mx-0 my-2">
  96.                                 <div class="row justify-content-center">
  97.                                     {{ form_widget(formPost.notation) }}         
  98.                                 </div>
  99.                             </div>       
  100.                         </div>
  101.                     </div>
  102.                     <div class="col-12 text-center mx-0 px-0">
  103.                         <button class="btn btn-lg my-2 font-weight-bold col-md-2 col-12" id="loginButton" type="submit">
  104.                             Publier
  105.                         </button>
  106.                     </div>
  107.                 </div>
  108.                 
  109.             {{ form_end(formPost) }}
  110.         </div>
  111.     </aside>
  112.     {% endif %}
  113. </section>
  114. {% endblock %}