var/cache/dev/twig/bc/bc62e98bc1e48365b5be4032af48b588.php line 50

  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* @Flexy/FrontBundle/Themes/CoWorking/templates/pages/actualites.html.twig */
  14. class __TwigTemplate_113ccfcbbf66fdc2ff715f54ec4acc46 extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->blocks = [
  23.             'stylesheets' => [$this'block_stylesheets'],
  24.             'body' => [$this'block_body'],
  25.             'javascripts' => [$this'block_javascripts'],
  26.         ];
  27.     }
  28.     protected function doGetParent(array $context)
  29.     {
  30.         // line 1
  31.         return "@Flexy/FrontBundle/Themes/CoWorking/templates/layout.html.twig";
  32.     }
  33.     protected function doDisplay(array $context, array $blocks = [])
  34.     {
  35.         $macros $this->macros;
  36.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  37.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@Flexy/FrontBundle/Themes/CoWorking/templates/pages/actualites.html.twig"));
  38.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  39.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@Flexy/FrontBundle/Themes/CoWorking/templates/pages/actualites.html.twig"));
  40.         $this->parent $this->loadTemplate("@Flexy/FrontBundle/Themes/CoWorking/templates/layout.html.twig""@Flexy/FrontBundle/Themes/CoWorking/templates/pages/actualites.html.twig"1);
  41.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  42.         
  43.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  44.         
  45.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  46.     }
  47.     // line 2
  48.     public function block_stylesheets($context, array $blocks = [])
  49.     {
  50.         $macros $this->macros;
  51.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  52.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""stylesheets"));
  53.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  54.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""stylesheets"));
  55.         // line 3
  56.         echo "
  57. ";
  58.         // line 4
  59.         $this->displayParentBlock("stylesheets"$context$blocks);
  60.         echo "
  61.      
  62.    
  63. <style>
  64.  .pagination {
  65.     display: flex;
  66.     justify-content: center;
  67.     margin-top: 20px;
  68. }
  69. .pagination li {
  70.     margin: 0 5px;
  71.     list-style: none;
  72. }
  73. .pagination li a {
  74.     text-decoration: none;
  75.     padding: 8px 12px;
  76.     border: 1px solid #FFCB00; /* Ajout de la couleur principale */
  77.     border-radius: 5px;
  78.     color: #FFCB00; /* Texte en couleur principale */
  79.     font-weight: 600;
  80.     transition: background-color 0.3s, color 0.3s;
  81. }
  82. .pagination li a:hover {
  83.     background-color: #FFCB00; /* Couleur au survol */
  84.     color: white; /* Texte en blanc au survol */
  85. }
  86. .pagination li.active a {
  87.     background-color: #FFCB00; /* Couleur principale pour l'élément actif */
  88.     color: white; /* Texte en blanc */
  89.     border: none; /* Supprimer la bordure */
  90. }
  91. .pagination li.disabled {
  92.     display: none; /* Cacher les boutons désactivés */
  93. }
  94.     
  95.     .img-article {
  96.     width: 100%; /* La largeur de l'image s'ajuste à la colonne */
  97.     height: 260px; /* Hauteur fixe pour uniformiser toutes les images */
  98.     object-fit: cover; /* Coupe les parties excédentaires pour conserver le rapport d'aspect */
  99.     border-radius: 5px; /* Optionnel : coins arrondis */
  100. }
  101.     
  102.     #hideHeaderInPageHome{
  103.         display:none !important;
  104.     }
  105.     
  106.     .title-article{
  107.         color: #292825;
  108.         font-size: 21px;
  109.         line-height: 35px;
  110.         font-weight: 800;
  111. }
  112. .lire-suite{
  113.    
  114.     /*padding: 10px;*/
  115.     font-weight:600;
  116.     font-size:13px;
  117.     border-radius: 4px;
  118. .img-article{
  119.     width:95%;
  120. }
  121. .shadow-custom:hover{
  122.      box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
  123. }
  124.  
  125. .shadow-custom{
  126.     box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;
  127. }
  128.   .custom-hr {
  129.      width: 10%;
  130.     border: 3px solid #555;
  131.     margin: 4px;
  132. }
  133. .custom-hr-1{
  134.      width: 3%;
  135.     border: 3px solid #555;
  136.     margin: 4px;
  137. }
  138.   .carousel-image {
  139.     width: 100%; /* Adapte la largeur à celle du conteneur */
  140.     height: 400px; /* Hauteur fixe pour un rendu uniforme */
  141.     object-fit: cover; /* Coupe et zoome l'image pour remplir le conteneur */
  142.     
  143. }
  144. </style>
  145.   
  146. ";
  147.         
  148.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  149.         
  150.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  151.     }
  152.     // line 105
  153.     public function block_body($context, array $blocks = [])
  154.     {
  155.         $macros $this->macros;
  156.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  157.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  158.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  159.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  160.         // line 106
  161.         echo 
  162. <!--Carousel-->
  163. <div id=\"carouselExampleInterval\" class=\"carousel slide\" data-bs-ride=\"carousel\">
  164.   <div class=\"carousel-inner\">
  165.    <div id=\"carouselExampleInterval\" class=\"carousel slide\" data-bs-ride=\"carousel\">
  166.   <div class=\"carousel-inner\">
  167.     ";
  168.         // line 115
  169.         $context['_parent'] = $context;
  170.         $context['_seq'] = twig_ensure_traversable((isset($context["newshome"]) || array_key_exists("newshome"$context) ? $context["newshome"] : (function () { throw new RuntimeError('Variable "newshome" does not exist.'115$this->source); })()));
  171.         $context['loop'] = [
  172.           'parent' => $context['_parent'],
  173.           'index0' => 0,
  174.           'index'  => 1,
  175.           'first'  => true,
  176.         ];
  177.         if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  178.             $length count($context['_seq']);
  179.             $context['loop']['revindex0'] = $length 1;
  180.             $context['loop']['revindex'] = $length;
  181.             $context['loop']['length'] = $length;
  182.             $context['loop']['last'] = === $length;
  183.         }
  184.         foreach ($context['_seq'] as $context["_key"] => $context["news"]) {
  185.             // line 116
  186.             echo "    <div class=\"carousel-item ";
  187.             if (twig_get_attribute($this->env$this->source$context["loop"], "first", [], "any"falsefalsefalse116)) {
  188.                 echo "active";
  189.             }
  190.             echo "\" data-bs-interval=\"6000\">
  191.       <img src=\"/uploads/coworking/";
  192.             // line 117
  193.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["news"], "image", [], "any"falsefalsefalse117), "html"nulltrue);
  194.             echo "\" class=\"d-block w-100 carousel-image\" alt=\"...\">
  195.     </div>
  196.     ";
  197.             ++$context['loop']['index0'];
  198.             ++$context['loop']['index'];
  199.             $context['loop']['first'] = false;
  200.             if (isset($context['loop']['length'])) {
  201.                 --$context['loop']['revindex0'];
  202.                 --$context['loop']['revindex'];
  203.                 $context['loop']['last'] = === $context['loop']['revindex0'];
  204.             }
  205.         }
  206.         $_parent $context['_parent'];
  207.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['news'], $context['_parent'], $context['loop']);
  208.         $context array_intersect_key($context$_parent) + $_parent;
  209.         // line 120
  210.         echo "  </div>
  211. </div>
  212.   <button class=\"carousel-control-prev\" type=\"button\" data-bs-target=\"#carouselExampleInterval\" data-bs-slide=\"prev\">
  213.     <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\"></span>
  214.     <span class=\"visually-hidden\">Previous</span>
  215.   </button>
  216.   <button class=\"carousel-control-next\" type=\"button\" data-bs-target=\"#carouselExampleInterval\" data-bs-slide=\"next\">
  217.     <span class=\"carousel-control-next-icon\" aria-hidden=\"true\"></span>
  218.     <span class=\"visually-hidden\">Next</span>
  219.   </button>
  220. </div>
  221. <div class=\"container\" style=\"max-width: 1230px;\">
  222.  
  223.     <div class=\"row\">
  224.         <div class=\"col-lg-12\">
  225.             
  226.             <h1 style=\"font-size: 34px; color: black;\" class=\"title-actualites mt-5 mb-2\">Actualités</h1>
  227.              <hr class=\"custom-hr-1\">
  228.             
  229.             <div class=\"row\">
  230.                 <!-- Articles -->
  231.                 
  232.                 <div class=\"col-lg-9\">
  233.                 
  234.          <div id=\"result-container\">
  235.     ";
  236.         // line 150
  237.         $this->loadTemplate("@Flexy/FrontBundle/Themes/CoWorking/templates/pages/_sorted_results.html.twig""@Flexy/FrontBundle/Themes/CoWorking/templates/pages/actualites.html.twig"150)->display(twig_array_merge($context, ["news" => (isset($context["newshome"]) || array_key_exists("newshome"$context) ? $context["newshome"] : (function () { throw new RuntimeError('Variable "newshome" does not exist.'150$this->source); })())]));
  238.         // line 151
  239.         echo "</div>
  240.                    ";
  241.         // line 173
  242.         echo "                </div>
  243.                 <!-- Sidebar -->
  244.                 <div class=\"col-lg-3\">
  245.                 
  246.              <select id=\"sortSelect\" class=\"form-select\" aria-label=\"Default select example\">
  247.                         <option selected value=\"1\">Les plus récentes</option>
  248.                         <option value=\"2\">Les plus anciens</option>
  249.                 </select>
  250.                 <br>
  251.                     <!-- Remplacez 'ffff' par du contenu réel -->
  252.                     <h5 class=\"\">Actualités récentes</h5>
  253.                     <hr class=\"custom-hr\">
  254.                     
  255.                          ";
  256.         // line 187
  257.         $context['_parent'] = $context;
  258.         $context['_seq'] = twig_ensure_traversable((isset($context["newshome"]) || array_key_exists("newshome"$context) ? $context["newshome"] : (function () { throw new RuntimeError('Variable "newshome" does not exist.'187$this->source); })()));
  259.         $context['loop'] = [
  260.           'parent' => $context['_parent'],
  261.           'index0' => 0,
  262.           'index'  => 1,
  263.           'first'  => true,
  264.         ];
  265.         if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  266.             $length count($context['_seq']);
  267.             $context['loop']['revindex0'] = $length 1;
  268.             $context['loop']['revindex'] = $length;
  269.             $context['loop']['length'] = $length;
  270.             $context['loop']['last'] = === $length;
  271.         }
  272.         foreach ($context['_seq'] as $context["_key"] => $context["news"]) {
  273.             // line 188
  274.             echo "                    ";
  275.             if ((twig_get_attribute($this->env$this->source$context["loop"], "index", [], "any"falsefalsefalse188) <= 8)) {
  276.                 // line 189
  277.                 echo "                       <p class=\"mt-3\" style=\"font-size: 14px;\">";
  278.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["news"], "Title", [], "any"falsefalsefalse189), "html"nulltrue);
  279.                 echo "</p>
  280.                        ";
  281.             }
  282.             // line 191
  283.             echo "                     ";
  284.             ++$context['loop']['index0'];
  285.             ++$context['loop']['index'];
  286.             $context['loop']['first'] = false;
  287.             if (isset($context['loop']['length'])) {
  288.                 --$context['loop']['revindex0'];
  289.                 --$context['loop']['revindex'];
  290.                 $context['loop']['last'] = === $context['loop']['revindex0'];
  291.             }
  292.         }
  293.         $_parent $context['_parent'];
  294.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['news'], $context['_parent'], $context['loop']);
  295.         $context array_intersect_key($context$_parent) + $_parent;
  296.         // line 192
  297.         echo "                </div>
  298.             </div>
  299.         </div>
  300.       ";
  301.         // line 195
  302.         if ( !(null === (isset($context["newshome"]) || array_key_exists("newshome"$context) ? $context["newshome"] : (function () { throw new RuntimeError('Variable "newshome" does not exist.'195$this->source); })()))) {
  303.             // line 196
  304.             echo "        <div class=\"pagination\">
  305.     ";
  306.             // line 197
  307.             echo $this->extensions['Knp\Bundle\PaginatorBundle\Twig\Extension\PaginationExtension']->render($this->env, (isset($context["newshome"]) || array_key_exists("newshome"$context) ? $context["newshome"] : (function () { throw new RuntimeError('Variable "newshome" does not exist.'197$this->source); })()));
  308.             echo "
  309. </div>
  310.     ";
  311.         }
  312.         // line 200
  313.         echo 
  314.     </div>
  315.     
  316. </div>
  317.  
  318. \t
  319. ";
  320.         
  321.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  322.         
  323.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  324.     }
  325.     // line 211
  326.     public function block_javascripts($context, array $blocks = [])
  327.     {
  328.         $macros $this->macros;
  329.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  330.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  331.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  332.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  333.         // line 212
  334.         echo "
  335. ";
  336.         // line 213
  337.         $this->displayParentBlock("javascripts"$context$blocks);
  338.         echo "
  339.  
  340.  
  341. <script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js\" integrity=\"sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe\" crossorigin=\"anonymous\"></script>
  342. <script>
  343. \$(document).ready(function () {
  344.     // Fonction pour charger les actualités triées
  345.     function loadSortedNews(sortOrder, page = 1) {
  346.         console.log(\"Tri sélectionné :\", sortOrder, \"Page :\", page);
  347.         \$.ajax({
  348.             url: '";
  349.         // line 227
  350.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_sort_data");
  351.         echo "',
  352.             type: 'GET',
  353.             data: { sortOrder: sortOrder, page: page },
  354.             beforeSend: function () {
  355.                 \$('#result-container').html('<div class=\"text-center\"><i class=\"fa fa-spinner fa-spin fa-3x\"></i>  Chargement en cours ....</div>');
  356.     
  357.             },
  358.             success: function (response) {
  359.                 \$('#result-container').html(response);
  360.                 // Gérer les liens de pagination après le tri
  361.                 \$('#result-container').on('click', '.pagination a', function (e) {
  362.                     e.preventDefault();
  363.                     let pageUrl = \$(this).attr('href');
  364.                     let pageNumber = pageUrl.split('page=')[1];
  365.                     loadSortedNews(sortOrder, pageNumber);
  366.                 });
  367.             },
  368.             error: function () {
  369.                 alert('Une erreur est survenue lors du tri.');
  370.             }
  371.         });
  372.     }
  373.     // Événement de changement sur le select
  374.     \$('#sortSelect').on('change', function () {
  375.         let selectedValue = \$(this).val();
  376.         loadSortedNews(selectedValue);
  377.     });
  378.     // Capture les clics de pagination dès le chargement initial
  379.     \$('#result-container').on('click', '.pagination a', function (e) {
  380.         e.preventDefault();
  381.         let selectedValue = \$('#sortSelect').val();
  382.         let pageUrl = \$(this).attr('href');
  383.         let pageNumber = pageUrl.split('page=')[1];
  384.         loadSortedNews(selectedValue, pageNumber);
  385.     });
  386. });
  387.  
  388. </script>
  389. ";
  390.         
  391.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  392.         
  393.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  394.     }
  395.     public function getTemplateName()
  396.     {
  397.         return "@Flexy/FrontBundle/Themes/CoWorking/templates/pages/actualites.html.twig";
  398.     }
  399.     public function isTraitable()
  400.     {
  401.         return false;
  402.     }
  403.     public function getDebugInfo()
  404.     {
  405.         return array (  404 => 227,  387 => 213,  384 => 212,  374 => 211,  355 => 200,  349 => 197,  346 => 196,  344 => 195,  339 => 192,  325 => 191,  319 => 189,  316 => 188,  299 => 187,  283 => 173,  280 => 151,  278 => 150,  246 => 120,  229 => 117,  222 => 116,  205 => 115,  194 => 106,  184 => 105,  73 => 4,  70 => 3,  60 => 2,  37 => 1,);
  406.     }
  407.     public function getSourceContext()
  408.     {
  409.         return new Source("{% extends '@Flexy/FrontBundle/Themes/CoWorking/templates/layout.html.twig' %}
  410. {% block stylesheets %}
  411. {{ parent() }}
  412.      
  413.    
  414. <style>
  415.  .pagination {
  416.     display: flex;
  417.     justify-content: center;
  418.     margin-top: 20px;
  419. }
  420. .pagination li {
  421.     margin: 0 5px;
  422.     list-style: none;
  423. }
  424. .pagination li a {
  425.     text-decoration: none;
  426.     padding: 8px 12px;
  427.     border: 1px solid #FFCB00; /* Ajout de la couleur principale */
  428.     border-radius: 5px;
  429.     color: #FFCB00; /* Texte en couleur principale */
  430.     font-weight: 600;
  431.     transition: background-color 0.3s, color 0.3s;
  432. }
  433. .pagination li a:hover {
  434.     background-color: #FFCB00; /* Couleur au survol */
  435.     color: white; /* Texte en blanc au survol */
  436. }
  437. .pagination li.active a {
  438.     background-color: #FFCB00; /* Couleur principale pour l'élément actif */
  439.     color: white; /* Texte en blanc */
  440.     border: none; /* Supprimer la bordure */
  441. }
  442. .pagination li.disabled {
  443.     display: none; /* Cacher les boutons désactivés */
  444. }
  445.     
  446.     .img-article {
  447.     width: 100%; /* La largeur de l'image s'ajuste à la colonne */
  448.     height: 260px; /* Hauteur fixe pour uniformiser toutes les images */
  449.     object-fit: cover; /* Coupe les parties excédentaires pour conserver le rapport d'aspect */
  450.     border-radius: 5px; /* Optionnel : coins arrondis */
  451. }
  452.     
  453.     #hideHeaderInPageHome{
  454.         display:none !important;
  455.     }
  456.     
  457.     .title-article{
  458.         color: #292825;
  459.         font-size: 21px;
  460.         line-height: 35px;
  461.         font-weight: 800;
  462. }
  463. .lire-suite{
  464.    
  465.     /*padding: 10px;*/
  466.     font-weight:600;
  467.     font-size:13px;
  468.     border-radius: 4px;
  469. .img-article{
  470.     width:95%;
  471. }
  472. .shadow-custom:hover{
  473.      box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
  474. }
  475.  
  476. .shadow-custom{
  477.     box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;
  478. }
  479.   .custom-hr {
  480.      width: 10%;
  481.     border: 3px solid #555;
  482.     margin: 4px;
  483. }
  484. .custom-hr-1{
  485.      width: 3%;
  486.     border: 3px solid #555;
  487.     margin: 4px;
  488. }
  489.   .carousel-image {
  490.     width: 100%; /* Adapte la largeur à celle du conteneur */
  491.     height: 400px; /* Hauteur fixe pour un rendu uniforme */
  492.     object-fit: cover; /* Coupe et zoome l'image pour remplir le conteneur */
  493.     
  494. }
  495. </style>
  496.   
  497. {% endblock  %}
  498. {% block body %}
  499.  
  500. <!--Carousel-->
  501. <div id=\"carouselExampleInterval\" class=\"carousel slide\" data-bs-ride=\"carousel\">
  502.   <div class=\"carousel-inner\">
  503.    <div id=\"carouselExampleInterval\" class=\"carousel slide\" data-bs-ride=\"carousel\">
  504.   <div class=\"carousel-inner\">
  505.     {% for news in newshome %}
  506.     <div class=\"carousel-item {% if loop.first %}active{% endif %}\" data-bs-interval=\"6000\">
  507.       <img src=\"/uploads/coworking/{{ news.image }}\" class=\"d-block w-100 carousel-image\" alt=\"...\">
  508.     </div>
  509.     {% endfor %}
  510.   </div>
  511. </div>
  512.   <button class=\"carousel-control-prev\" type=\"button\" data-bs-target=\"#carouselExampleInterval\" data-bs-slide=\"prev\">
  513.     <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\"></span>
  514.     <span class=\"visually-hidden\">Previous</span>
  515.   </button>
  516.   <button class=\"carousel-control-next\" type=\"button\" data-bs-target=\"#carouselExampleInterval\" data-bs-slide=\"next\">
  517.     <span class=\"carousel-control-next-icon\" aria-hidden=\"true\"></span>
  518.     <span class=\"visually-hidden\">Next</span>
  519.   </button>
  520. </div>
  521. <div class=\"container\" style=\"max-width: 1230px;\">
  522.  
  523.     <div class=\"row\">
  524.         <div class=\"col-lg-12\">
  525.             
  526.             <h1 style=\"font-size: 34px; color: black;\" class=\"title-actualites mt-5 mb-2\">Actualités</h1>
  527.              <hr class=\"custom-hr-1\">
  528.             
  529.             <div class=\"row\">
  530.                 <!-- Articles -->
  531.                 
  532.                 <div class=\"col-lg-9\">
  533.                 
  534.          <div id=\"result-container\">
  535.     {% include '@Flexy/FrontBundle/Themes/CoWorking/templates/pages/_sorted_results.html.twig' with { 'news': newshome } %}
  536. </div>
  537.                    {# {% for news in newshome %}
  538.     
  539.                     <article class=\"card shadow-custom mt-4\">
  540.                         <div class=\"row g-0\">
  541.                             <div class=\"col-lg-5\">
  542.                                 <img class=\"img-article img-fluid\" 
  543.                                      src=\"/uploads/coworking/{{ news.image }}\"
  544.                                      alt=\"image\">
  545.                             </div>
  546.                             <div class=\"col-lg-7 col-md-12 \" >
  547.                                 <p class=\"mt-2\" style=\"font-size:12px\">{{ news.dateDebut|date('d M Y')|default('Aucune date') }}</p>
  548.                                 <h3>  {{ news.title }}  </h3>
  549.                                 <h2 class=\"title-article\"> {{ news.underTitle }}</h2>
  550.                                 <p style=\"font-size: 15px;width:95%;\">{{ news.description|slice(0, 110) ~ '...' }}</p>
  551.                                 <a href=\"{{path('actualite',{id:news.id})}}\" class=\"lire-suite\">Lire Plus <i style=\"font-size:18px\" class=\"fa fa-play-circle\" aria-hidden=\"true\"></i></a>
  552.                                 
  553.                             </div>
  554.                         </div>
  555.                     </article>
  556.                     {% endfor %}
  557.      #}
  558.                 </div>
  559.                 <!-- Sidebar -->
  560.                 <div class=\"col-lg-3\">
  561.                 
  562.              <select id=\"sortSelect\" class=\"form-select\" aria-label=\"Default select example\">
  563.                         <option selected value=\"1\">Les plus récentes</option>
  564.                         <option value=\"2\">Les plus anciens</option>
  565.                 </select>
  566.                 <br>
  567.                     <!-- Remplacez 'ffff' par du contenu réel -->
  568.                     <h5 class=\"\">Actualités récentes</h5>
  569.                     <hr class=\"custom-hr\">
  570.                     
  571.                          {% for news in newshome %}
  572.                     {% if loop.index <= 8 %}
  573.                        <p class=\"mt-3\" style=\"font-size: 14px;\">{{ news.Title }}</p>
  574.                        {% endif %}
  575.                      {% endfor %}
  576.                 </div>
  577.             </div>
  578.         </div>
  579.       {% if newshome is not null %}
  580.         <div class=\"pagination\">
  581.     {{ knp_pagination_render(newshome) }}
  582. </div>
  583.     {% endif %}
  584.  
  585.     </div>
  586.     
  587. </div>
  588.  
  589. \t
  590. {% endblock %}
  591. {% block javascripts %}
  592. {{ parent() }}
  593.  
  594.  
  595. <script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js\" integrity=\"sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe\" crossorigin=\"anonymous\"></script>
  596. <script>
  597. \$(document).ready(function () {
  598.     // Fonction pour charger les actualités triées
  599.     function loadSortedNews(sortOrder, page = 1) {
  600.         console.log(\"Tri sélectionné :\", sortOrder, \"Page :\", page);
  601.         \$.ajax({
  602.             url: '{{ path('app_sort_data') }}',
  603.             type: 'GET',
  604.             data: { sortOrder: sortOrder, page: page },
  605.             beforeSend: function () {
  606.                 \$('#result-container').html('<div class=\"text-center\"><i class=\"fa fa-spinner fa-spin fa-3x\"></i>  Chargement en cours ....</div>');
  607.     
  608.             },
  609.             success: function (response) {
  610.                 \$('#result-container').html(response);
  611.                 // Gérer les liens de pagination après le tri
  612.                 \$('#result-container').on('click', '.pagination a', function (e) {
  613.                     e.preventDefault();
  614.                     let pageUrl = \$(this).attr('href');
  615.                     let pageNumber = pageUrl.split('page=')[1];
  616.                     loadSortedNews(sortOrder, pageNumber);
  617.                 });
  618.             },
  619.             error: function () {
  620.                 alert('Une erreur est survenue lors du tri.');
  621.             }
  622.         });
  623.     }
  624.     // Événement de changement sur le select
  625.     \$('#sortSelect').on('change', function () {
  626.         let selectedValue = \$(this).val();
  627.         loadSortedNews(selectedValue);
  628.     });
  629.     // Capture les clics de pagination dès le chargement initial
  630.     \$('#result-container').on('click', '.pagination a', function (e) {
  631.         e.preventDefault();
  632.         let selectedValue = \$('#sortSelect').val();
  633.         let pageUrl = \$(this).attr('href');
  634.         let pageNumber = pageUrl.split('page=')[1];
  635.         loadSortedNews(selectedValue, pageNumber);
  636.     });
  637. });
  638.  
  639. </script>
  640. {% endblock %}
  641. ""@Flexy/FrontBundle/Themes/CoWorking/templates/pages/actualites.html.twig""/home/gebcloud/public_html/cowork.gebanalysis.cloud/src/Flexy/FrontBundle/Themes/CoWorking/templates/pages/actualites.html.twig");
  642.     }
  643. }