templates/common/seealso.html.twig line 1

Open in your IDE?
  1. {% if listWithThumbnails is not defined %}
  2.     {% set listWithThumbnails = true %}
  3. {% endif %}
  4. {% if entity.seealsoStructures is not empty or entity.seealsoQuestionAnswers is not empty %}
  5.     {% import "common/listWithImages.html.twig" as listWithImages %}
  6.     <div class="see-also mt-3">
  7.         <h2>À voir aussi</h2>
  8.         {% if is_granted('ROLE_EDITOR') %}<p class="text-center">(liste des structures et questionAnswers spécifiées comme seealso)</p>{% endif %}
  9.         
  10.         {% if entity.seealsoQuestionAnswers is not empty %}
  11.             <h3 class="">Des questions-réponses</h3>
  12.             {% set questionAnswers = entity.seealsoQuestionAnswers %}
  13.             {% if listWithThumbnails %}
  14.                 <div class="row questionAnswers-list with-images">
  15.                     {% for questionAnswer in questionAnswers %}
  16.                         <div class="col-sm-6 col-md-4 col-lg-3 article with-image 
  17.                             {% if type is defined %}{{ type }}{% endif %}
  18.                         ">
  19.                             <a style="display:block" href="{{ path('showQuestionAnswerBySlug', {slug:questionAnswer.slug}) }}">
  20.                                 <div class="post-medias">
  21.                                     {{ listWithImages.showOneImage(questionAnswer) }}
  22.                                 </div>
  23.                                 <p>
  24.                                     {# <span class="date">{{ questionAnswer.createdAt|date("d/m/Y") }}</span>
  25.                                     <span class="tags">{{ questionAnswer.tags|join(', ') }}</span>
  26.                                     <br/> #}
  27.                                     <span class="title">
  28.                                         {{ questionAnswer.title }}
  29.                                         {# {{ questionAnswer.title|raw|striptags|slice(0,30) }}
  30.                                         {% if questionAnswer.title|raw|striptags|length > 30 %}...{% endif %} #}
  31.                                     </span>
  32.                                 </p>
  33.                             </a>
  34.                         </div>
  35.                     {% endfor %}
  36.                 </div>            
  37.             {% else %}
  38.                 <ul class="questionAnswersList">
  39.                     {% for key, questionAnswer in questionAnswers %}
  40.                         <li>
  41.                             <a href="{{ path('showQuestionAnswerBySlug', { 'slug':questionAnswer.slug }) }}">
  42.                                 {{ questionAnswer.title}} {% if is_granted('ROLE_EDITOR') %}(priorité : {{ questionAnswer.priority }}){% endif %} 
  43.                             </a>
  44.                         </li>
  45.                     {% endfor %}
  46.                 </ul>
  47.             {% endif %}
  48.         {% endif %}
  49.         {% if entity.seealsoStructures is not empty %}
  50.             <h3 class="">Des lieux, associations, institutions ou entreprises</h3>
  51.             {% set structures = entity.seealsoStructures %}
  52.             {% if listWithThumbnails %}
  53.                 <div class="row structures-list with-images">
  54.                     {% for structure in structures %}
  55.                         <div class="col-sm-6 col-md-4 col-lg-3 article with-image 
  56.                             {% if type is defined %}{{ type }}{% endif %}
  57.                         ">
  58.                             <a style="display:block" href="{{ path('showStructureBySlug', {slug:structure.slug}) }}">
  59.                                 <div class="post-medias">
  60.                                     {{ listWithImages.showOneImage(structure) }}
  61.                                 </div>
  62.                                 <p>
  63.                                     {# <span class="date">{{ structure.createdAt|date("d/m/Y") }}</span>
  64.                                     <span class="tags">{{ structure.tags|join(', ') }}</span>
  65.                                     <br/> #}
  66.                                     <span class="title">
  67.                                         {{ structure.title }}
  68.                                         {# {{ structure.title|raw|striptags|slice(0,30) }}
  69.                                         {% if structure.title|raw|striptags|length > 30 %}...{% endif %} #}
  70.                                     </span>
  71.                                 </p>
  72.                             </a>
  73.                         </div>
  74.                     {% endfor %}
  75.                 </div>            
  76.             {% else %}
  77.                 <ul class="structuresList">
  78.                     {% for key, structure in structures %}
  79.                         <li>
  80.                             <a href="{{ path('showStructureBySlug', { 'slug':structure.slug }) }}">
  81.                                 {{ structure.title}} {% if is_granted('ROLE_EDITOR') %}(priorité : {{ structure.priority }}){% endif %} 
  82.                             </a>
  83.                         </li>
  84.                     {% endfor %}
  85.                 </ul>
  86.             {% endif %}
  87.         {% endif %}
  88.     </div>
  89. {% endif %}