templates/user_projets/list_projects_by.html.twig line 1

  1. {% extends 'base.html.twig' %}
  2. {% block title %}Projets d'utilisateurs
  3. {% endblock %}
  4. {% block content %}
  5.     <div class="content">
  6.         <div class="content__base">
  7.             <div class="flex flex-wrap flex-col justify-center gap-4 text-start">
  8.                 <h1 class="title">{{title}}</h1>
  9.                 <div class="flex flex-wrap gap-6 rounded-lg">
  10.                     {% if projects|length > 0 %}
  11.                         {% for project in projects|reverse() %}
  12.                             <div class="flex flex-col max-w-md w-72 h-fit md:h-96 bg-white border border-gray-200 rounded-lg shadow dark:bg-gray-800 dark:border-gray-700 grow hover:bg-slate-50">
  13.                                 {% set firstImageSlider = project.projet.getImageSliders|first %}
  14.                                 {% if firstImageSlider %}
  15.                                     {% if firstImageSlider.getUrl starts with 'http' %}
  16.                                         <img class="rounded-t-lg h-60 w-full object-cover" src=" {{ firstImageSlider.getUrl }} " alt=" image de slider">
  17.                                     {% else %}
  18.                                         <img class="rounded-t-lg h-60 w-full object-cover" src=" {{ asset('uploads/SliderImages/' ~ firstImageSlider.getUrl) }} " alt=" image de slider">
  19.                                     {% endif %}
  20.                                 {% else %}
  21.                                     <img class="rounded-t-lg h-60 w-full object-cover" src=" {{ asset('uploads/SliderImages/default-image.png') }} " alt=" image par défaut">
  22.                                 {% endif %}
  23.                                 <div
  24.                                     class="p-4 flex flex-col h-full gap-2">
  25.                                     {# PROJECT NAME AND USER #}
  26.                                     <div class="flex flex-col">
  27.                                         <h5 class="text-xl font-bold tracking-tight text-gray-800 dark:text-white mb-1">
  28.                                             {{ project.projet.name }}</h5>
  29.                                         <p class="mb-2">{{project.User.UserInfos.name}}</p>
  30.                                     </div>
  31.                                     <p class="flex gap-2 font-normal text-gray-700 dark:text-gray-400 mb-1">
  32.                                         <svg class="w-6 h-6 text-green-400 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 20 20">
  33.                                             <path stroke="currentColor" stroke-linejoin="round" stroke-width="2" d="M10 6v4l3.276 3.276M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
  34.                                         </svg>
  35.                                         {{ project.createdAt|date('d/m H:i') }}</p>
  36.                                     {% if project.Completed %}
  37.                                         <p class="flex gap-2 font-normal text-gray-700 dark:text-gray-400 mb-2">
  38.                                             <svg class="w-6 h-6 text-red-400 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 20 20">
  39.                                                 <path stroke="currentColor" stroke-linejoin="round" stroke-width="2" d="M10 6v4l3.276 3.276M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
  40.                                             </svg>
  41.                                             {{ project.finishedAt|date('d/m H:i') }}</p>
  42.                                     {% endif %}
  43.                                     <a href="{{ path('app_user_projet_show', {'id': project.id})}}" class="inline-flex justify-between items-center px-3 py-2  text-sm font-medium text-center text-white bg-purple-400 rounded-lg hover:bg-purple-600 focus:ring-4 focus:outline-none focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800 mt-auto">
  44.                                         Voir plus...
  45.                                         <svg class="w-3.5 h-3.5 ml-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 14 10">
  46.                                             <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 5h12m0 0L9 1m4 4L9 9"/>
  47.                                         </svg>
  48.                                     </a>
  49.                                 </div>
  50.                             </div>
  51.                         {% endfor %}
  52.                     {% else %}
  53.                         <p>Aucun Projet</p>
  54.                     {% endif %}
  55.                 </div>
  56.             </div>
  57.         </div>
  58.     </div>
  59. {% endblock %}