projet_card.html.twig 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. {% switch p.parent.title %}
  2. {% case 'Publique' %}
  3. <div class="publique-card card-displayed">
  4. {% case 'Sociale' %}
  5. <div class="sociale-card card-displayed">
  6. {% case 'Culturelle' %}
  7. <div class="culturelle-card card-displayed">
  8. {% endswitch %}
  9. {% set url = p.media.videos|first.url %}
  10. {% if url != null %}
  11. <figure class="projet-card loaded">
  12. <a href="{{ p.url }}">
  13. {# <video autoplay muted loop src="{{ url('theme://images/loader/circle.mp4') }}" data-src="{{ p.media.videos|first.url }}" type="video/mp4" class="lazy loader"> #}
  14. <video autoplay muted loop src="{{ p.media.videos|first.url }}" type="video/mp4">
  15. {% else %}
  16. <figure class="projet-card">
  17. <a href="{{ p.url }}">
  18. <img src="{{ url('theme://images/loader/rolling.svg') }}" data-src="{{ p.media.images|first.url }}" alt="{{ p.title }}" class="lazy loader">
  19. {% endif %}
  20. </a>
  21. <a href="{{ p.url }}">
  22. <figcaption>
  23. {% switch p.parent.title %}
  24. {% case 'Publique' %}
  25. <span class="publique-title">
  26. {% case 'Sociale' %}
  27. <span class="sociale-title">
  28. {% case 'Culturelle' %}
  29. <span class="culturelle-title">
  30. {% endswitch %}
  31. {{ p.title }}</span>,
  32. {% for tag in p.taxonomy.tag %}{{ tag }}, {% endfor %}
  33. {{ p.date|date("Y") }}
  34. </figcaption>
  35. </a>
  36. </figure>
  37. </div>