templates/site/blog/liste_actualites.html.twig line 1

Open in your IDE?
  1. {% extends "site/base.html.twig" %}
  2. {% block title %}Liste des actualités{% endblock %}
  3. {% block content %}
  4.     <section id="banner" class="z-0 h-80 relative w-full">
  5.         <img class="w-full h-full object-cover object-bottom" src="/img/tmp/element5-digital-OyCl7Y4y0Bk-unsplash.jpg" alt="">
  6.         </div>
  7.         <div class="z-10 absolute y-center lg:transform-none sm:left-28 lg:left-24 xl:left-64 text-white
  8.         px-8 sm:px-0">
  9.             {% set isOffres = (catSelected.id == '2') %}
  10.             {% set titre = isOffres?'LG_LISTE_OFFRES':'LG_LISTE_ACTUS' %}
  11.             <h1 class="uppercase text-white text-3xl sm:text-4xl leading-8 tracking-wider mb-2">{{ titre|trans() }}</h1>
  12.             <p class="uppercase leading-6 text-xl tracking-wider">{{ 'LG_ACTUALITES_SOUS_TITRE'|trans({'fr':'Dans les écoles A.B.C.M Zweisprachigkeit'}) }}</p>
  13.         </div>
  14.     </section>
  15.     <section id="liste" class="pt-28 lg:pt-12 pb-12 px-8 sm:px-28 lg:px-24 xl:px-64">
  16.         {% if isOffres %}
  17.             <div class="w-full justify-start flex flex-col sm:flex-row sm:items-center sm:gap-8 gap-y-2 mb-12">
  18.                 <p class="mb-0 font-semibold leading-7 tracking-wide">{{ 'LG_TYPE_OFFRES'|trans({'fr':'Type d\'offres :'}) }}</p>
  19.                 <div class="flex gap-4">
  20.                     <a data-id="0" class="toggle-offre bg-secondary text-white font-normal px-10 py-1 rounded-2xl duration-75 cursor-pointer hover:bg-transparent hover:text-secondary border-transparent border-2 hover:border-secondary">{{ 'LG_TYPE_OFFRES_0'|trans({'fr':'Emploi'}) }}</a>
  21.                     <a data-id="1" class="toggle-offre bg-secondary text-white font-normal px-10 py-1 rounded-2xl duration-75 cursor-pointer hover:bg-transparent hover:text-secondary border-transparent border-2 hover:border-secondary">{{ 'LG_TYPE_OFFRES_1'|trans({'fr':'Stage'}) }}</a>
  22.                 </div>
  23.             </div>
  24.         {% endif %}
  25.         <div id="liste-offres" class="flex justify-center flex-wrap gap-8 w-full">
  26.          {% for actualite in actualites %}
  27.              {% set route = isOffres?'offres_emploi_detail':'actualites_detail' %}
  28.              {% set hasPhoto = (actualite.photo is not empty) %}
  29.              <a href="{{ path(route, {slug:actualite.titreUrl, actualite:actualite.id}) }}" class="tag-{{ actualite.une?'1':'0' }} cursor-pointer w-full sm:w-45p lg:w-30p hover:opacity-80 transitioning xl:w-30p h-56 relative">
  30.                  {% if isOffres %}
  31.                     <p class="absolute -left-2 top-2 w-min bg-secondary text-white shadow-md rounded-2xl text-center px-4">{{ ('LG_TYPE_OFFRES_'~(actualite.une?'1':'0')) |trans() }}</p>
  32.                  {% endif %}
  33.                  <img class="w-full h-full object-cover" src="{{ hasPhoto ? ('actualites/'~actualite.photo)|imagine_filter('tm'): asset('/img/tmp/actu-haguenau.jpg') }}">
  34.                 <p class="absolute -right-2 top-2 w-min bg-tertiary text-white shadow-md rounded-2xl text-center px-4">{{ actualite.date|date('d/m') }}</p>
  35.                 <div class="absolute x-center bottom-2 text-white bg-primary rounded-full text-center text-xs w-9/12 py-3 px-4">
  36.                     <p class="mb-0">{{  actualite.titre }}</p>
  37.                 </div>
  38.             </a>
  39.         {% endfor %}
  40.     </div>
  41.     </section>
  42. {% endblock %}