templates/front/petiteAnnonce.html.twig line 1

Open in your IDE?
  1. <div class="space-small bg-white">
  2.     <div class="container" style="margin: -7em auto -6em;">
  3.         <div class="row">
  4.             <div class="offset-xl-2 col-xl-8 offset-lg-2 col-lg-8 col-md-12 col-sm-12 col-12">
  5.                 <div
  6.                     class="section-title text-center">
  7.                     <!-- section title start-->
  8.                     <h1 class="text-center">
  9.                         <strong>Les Bons plans de dernières minutes </strong>
  10.                     </h1>
  11.                     <p class="sous_titre"> Retrouvez les annonces et les offres de dernières minutes. </p>
  12.                 </div>
  13.                 <!-- /.section title start-->
  14.             </div>
  15.         </div>
  16.         <div
  17.             class="row">
  18.             <!-- venue-categoris-block-->
  19.             {% set today = date() %}
  20.             {% set yesterday = date('-1days') %}
  21.             
  22.             {% for annonce in annonces %}
  23.                 {% if app.user %}
  24.                     {% if app.user is instanceof('App\\Entity\\Company') %}
  25.                         {% if app.user.abonnements|length > 0 %}
  26.                             {% set lastSubscription = app.user.abonnements|last %}
  27.                             {% if lastSubscription.isActive %}
  28.                             <div class="col-xl-4 col-lg-4 col-md-6 col-sm-12 col-12">
  29.                                 <div class="card" style="border-bottom: 5px solid #A066F2; box-shadow: 10px 10px 10px gainsboro;height: 15rem;">
  30.                                     <div class="d-flex">
  31.                                         {% if annonce.users.image is not empty %}
  32.                                             <img src={{ asset(constant('App\\Services\\File::IMAGE_CLIENT_DIR') ~ annonce.users.image) }} alt="profil" class="profil_img">
  33.                                         {% else %}
  34.                                             <img src={{ asset('images/avatar.jpg') }} alt="profil" class="profil_img">
  35.                                         {% endif %}
  36.                                         
  37.                                         <div class="ml-3">
  38.                                             <p class="mt-3">{{annonce.users.firstName}}{{annonce.users.lastName}}</p>
  39.                                             <p style="margin-top: -1.5em;">
  40.                                                 {% if annonce.createdAt|date('d/m/Y') == today|date("d/m/Y") %}
  41.                                                 <span>Aujourd'hui à {{annonce.createdAt | date('H:i')}}</span>
  42.                                                 {% elseif annonce.createdAt|date('d/m/Y') == yesterday|date("d/m/Y") %}
  43.                                                 <span>Hier à {{annonce.createdAt | date('H:i')}}</span>
  44.                                                 {% else %}
  45.                                                 <span>{{annonce.createdAt | date('d M Y')}}
  46.                                                     à
  47.                                                     {{annonce.createdAt | date('H:i')}}</span>
  48.                                                 {% endif %}
  49.                                             </p>
  50.                                         </div>
  51.                                     </div>
  52.                                     <div class="card-body">
  53.                                         <p class="card-title font-weight-bold"><a href="{{path('client_detail_annonce', {'id': annonce.id})}}">{{filter_service.limite_motsafficher(annonce.titre, 60)}}</a></p>
  54.                                         <p class="card-text">{{ filter_service.limite_motsafficher(annonce.description,60) | raw}}</p>
  55.                                     </div>
  56.                                 </div>
  57.                             </div>
  58.                             {% endif %}
  59.                         {% endif %}
  60.                     {% elseif annonce.users.id == app.user.id %}
  61.                         <div class="col-xl-4 col-lg-4 col-md-6 col-sm-12 col-12">
  62.                             <div class="card" style="border-bottom: 5px solid #A066F2; box-shadow: 10px 10px 10px gainsboro;height: 15rem;">
  63.                                 <div class="d-flex">
  64.                                     {% if annonce.users.image is not empty %}
  65.                                         <img src={{ asset(constant('App\\Services\\File::IMAGE_CLIENT_DIR') ~ annonce.users.image) }} alt="profil" class="profil_img">
  66.                                     {% else %}
  67.                                         <img src={{ asset('images/avatar.jpg') }} alt="profil" class="profil_img">
  68.                                     {% endif %}
  69.                                     
  70.                                     <div class="ml-3">
  71.                                         <p class="mt-3">{{annonce.users.firstName}}{{annonce.users.lastName}}</p>
  72.                                         <p style="margin-top: -1.5em;">
  73.                                             {% if annonce.createdAt|date('d/m/Y') == today|date("d/m/Y") %}
  74.                                             <span>Aujourd'hui à {{annonce.createdAt | date('H:i')}}</span>
  75.                                             {% elseif annonce.createdAt|date('d/m/Y') == yesterday|date("d/m/Y") %}
  76.                                             <span>Hier à {{annonce.createdAt | date('H:i')}}</span>
  77.                                             {% else %}
  78.                                             <span>{{annonce.createdAt | date('d M Y')}}
  79.                                                 à
  80.                                                 {{annonce.createdAt | date('H:i')}}</span>
  81.                                             {% endif %}
  82.                                         </p>
  83.                                     </div>
  84.                                 </div>
  85.                                 <div class="card-body">
  86.                                     <p class="card-title font-weight-bold"><a href="{{path('client_detail_annonce', {'id': annonce.id})}}">{{filter_service.limite_motsafficher(annonce.titre, 60)}}</a></p>
  87.                                     <p class="card-text">{{ filter_service.limite_motsafficher(annonce.description,60) | raw}}</p>
  88.                                 </div>
  89.                             </div>
  90.                         </div>
  91.                     {% endif %}
  92.                 {% endif %}
  93.             {% endfor %}
  94.         </div>
  95.         {% if clients is not empty %}
  96.             <div class="row">
  97.                 <div class="offset-xl-2 col-xl-8 offset-lg-2 col-lg-8 col-md-12 col-sm-12 col-12">
  98.                     <div class="text-center mt-5">
  99.                         <a class="btn btn-default" style="bg-color: #A066F2; border-radius: 22px; font-size: 20px; text-transform: none;" href="{{ path('client_space_annonce_tous') }}">
  100.                             {% if (clients is not empty) and (clients | length == 1) %}
  101.                                 <p class="text-white">Voir l' annonce du client</p>
  102.                             {% else %}
  103.                                 <p class="text-white">Voir les ({{clients | length}}) annonce(s) des client(s)</p>
  104.                             {% endif %}
  105.                         </a>
  106.                     </div>
  107.                 </div>
  108.             </div>
  109.         {% endif %}
  110.     </div>
  111. </div>