var/cache/dev/twig/68/68456856e7818e59637e9fd3f253f37c.php line 37

Open in your IDE?
  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. /* base.html.twig */
  14. class __TwigTemplate_f5c447a409ee4d81162b2829ed3d6f95 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->parent = false;
  23.         $this->blocks = [
  24.             'title' => [$this, 'block_title'],
  25.             'stylesheets' => [$this, 'block_stylesheets'],
  26.             'javascripts' => [$this, 'block_javascripts'],
  27.             'body' => [$this, 'block_body'],
  28.         ];
  29.     }
  30.     protected function doDisplay(array $context, array $blocks = [])
  31.     {
  32.         $macros = $this->macros;
  33.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  34.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "base.html.twig"));
  35.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  36.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "base.html.twig"));
  37.         // line 1
  38.         echo "<!DOCTYPE html>
  39. <html lang=\"fr\">
  40.     <head>
  41.         <meta charset=\"UTF-8\">
  42. \t\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">
  43. \t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">
  44. \t\t<meta name=\"description\" content=\"\">
  45. \t\t<meta name=\"author\" content=\"ventes en ligne, rapeto service, madagascar\">
  46.         <title>";
  47.         // line 9
  48.         $this->displayBlock('title', $context, $blocks);
  49.         echo "</title>
  50.         <link rel=\"icon\" href=\"data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text></svg>\">
  51.         <link rel=\"stylesheet\" href=\"https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css\">
  52.         ";
  53.         // line 13
  54.         echo "        ";
  55.         $this->displayBlock('stylesheets', $context, $blocks);
  56.         // line 127
  57.         echo "
  58.         ";
  59.         // line 128
  60.         $this->displayBlock('javascripts', $context, $blocks);
  61.         // line 131
  62.         echo "    </head>
  63.     <body id=\"page-top\">
  64.         ";
  65.         // line 134
  66.         $this->displayBlock('body', $context, $blocks);
  67.         // line 135
  68.         echo "
  69.         <script src=\"https://code.jquery.com/jquery-3.7.1.min.js\"></script>
  70.         <!-- Select2 JS -->
  71.         <script src=\"https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js\"></script>
  72.         <script src=\"https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js\"></script>
  73.         <script src=\"https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js\"></script>
  74.         <script>
  75.             \$(document).ready(function() {
  76.                 \$('.select2').select2({
  77.                     placeholder: \"Choisir un ou plusieurs services\",
  78.                     allowClear: true,
  79.                 });
  80.             });
  81.         </script>
  82.         ";
  83.         // line 167
  84.         echo "
  85.         <script>
  86.             \$(document).ready(function () {
  87.                 \$('.datatable').DataTable({
  88.                     pageLength: 25,
  89.                     ordering: true,
  90.                     searching: true,
  91.                     info: true,
  92.                     language: {
  93.                         decimal: ',',
  94.                         thousands: ' ',
  95.                         emptyTable: 'Aucune donnée disponible',
  96.                         info: 'Affichage de _START_ à _END_ sur _TOTAL_ entrées',
  97.                         infoEmpty: 'Affichage de 0 à 0 sur 0 entrée',
  98.                         infoFiltered: '(filtré depuis _MAX_ entrées au total)',
  99.                         lengthMenu: 'Afficher _MENU_ entrées',
  100.                         loadingRecords: 'Chargement...',
  101.                         processing: 'Traitement...',
  102.                         search: 'Rechercher :',
  103.                         zeroRecords: 'Aucun enregistrement correspondant trouvé',
  104.                         paginate: {
  105.                             first: 'Premier',
  106.                             last: 'Dernier',
  107.                             next: 'Suivant',
  108.                             previous: 'Précédent'
  109.                         }
  110.                     }
  111.                 });
  112.             });
  113.         </script>
  114.         <script>
  115.             document.querySelectorAll('.product-link').forEach(link => {
  116.                 link.addEventListener('click', function () {
  117.                     const url = this.dataset.clickUrl;
  118.                     if (navigator.sendBeacon) {
  119.                         navigator.sendBeacon(url);
  120.                     } else {
  121.                         fetch(url, { method: 'POST', keepalive: true });
  122.                     }
  123.                 });
  124.             });
  125.            const logoSrc = '/img/logo-rapeto-img.png';
  126.             function addLogoToProductImages() {
  127.                 document.querySelectorAll(\".image-wrapper\").forEach(wrapper => {
  128.                     // Maka ny sary produit
  129.                     const productImg = wrapper.querySelector(\"img\");
  130.                     // Raha tsy misy sary, dia tsy mamorona logo
  131.                     if (!productImg) return;
  132.                     // Raha efa misy logo, tsy mamorona indray
  133.                     if (wrapper.querySelector(\".logo-overlay\")) return;
  134.                     // Mamorona logo
  135.                     const logo = document.createElement(\"img\");
  136.                     logo.src = logoSrc;
  137.                     logo.alt = \"Logo\";
  138.                     logo.className = \"logo-overlay\";
  139.                     wrapper.appendChild(logo);
  140.                 });
  141.             }
  142.             // Alefa rehefa loaded ny DOM
  143.             document.addEventListener(\"DOMContentLoaded\", addLogoToProductImages);
  144.         </script>
  145.         <script>
  146.             const productClickBaseUrl = \"";
  147.         // line 243
  148.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_product_click_search", ["id" => "PRODUCT_ID"]);
  149.         echo "\";
  150.             const productShowBaseUrl  = \"";
  151.         // line 244
  152.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_product_show", ["id" => "PRODUCT_ID"]);
  153.         echo "\";
  154.         </script>
  155.         <script>
  156.             document.addEventListener(\"DOMContentLoaded\", function () {
  157.                 const input = document.getElementById(\"search-input\");
  158.                 const suggestionsBox = document.getElementById(\"search-suggestions\");
  159.                 const suggestionsBoxResults = document.getElementById(\"search-suggestions-results\");
  160.                 input.addEventListener(\"focus\", function () {
  161.                     if (this.value.length >= 2) return;
  162.                     fetch(\"";
  163.         // line 260
  164.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ajax_random_products");
  165.         echo "\")
  166.                         .then(response => response.json())
  167.                         .then(data => {
  168.                             const categoryContainer = document.getElementById(\"categoryResults\");
  169.                             categoryContainer.innerHTML = \"\";
  170.                             if (!data || data.length === 0) {
  171.                                 categoryContainer.innerHTML = `
  172.                                     <div class=\"text-center text-muted py-4\">
  173.                                         Aucun produit disponible.
  174.                                     </div>
  175.                                 `;
  176.                             }
  177.                             (data || []).forEach(group => {
  178.                                 let block = document.createElement(\"div\");
  179.                                 block.classList.add(\"mb-4\");
  180.                                 // block.innerHTML = `
  181.                                 //     <div class=\"d-flex justify-content-between align-items-center mb-2\">
  182.                                 //         <div class=\"fw-bold\">\${group.categoryName.charAt(0).toUpperCase() + group.categoryName.slice(1)}</div>
  183.                                 //         <a href=\"#\" class=\"small text-primary\"></a>
  184.                                 //     </div>
  185.                                 //     <div class=\"row g-3\" id=\"cat-\${group.categoryId}\"></div>
  186.                                 // `;
  187.                                 block.innerHTML = `
  188.                                     <div class=\"category-header d-flex justify-content-between align-items-center mb-3\">
  189.                                         <h6 class=\"category-title mb-0\">
  190.                                             \${group.categoryName 
  191.                                                 ? group.categoryName.charAt(0).toUpperCase() + group.categoryName.slice(1) 
  192.                                                 : ''}
  193.                                         </h6>
  194.                                         <a href=\"#\" class=\"small text-decoration-none fw-semibold view-all\"></a>
  195.                                     </div>
  196.                                     <div class=\"divider mb-3\"></div>
  197.                                     <div class=\"row g-3\" id=\"cat-\${group.categoryId}\"></div>
  198.                                 `;
  199.                                 categoryContainer.appendChild(block);
  200.                                 let row = block.querySelector(`#cat-\${group.categoryId}`);
  201.                                 group.products.slice(0, 4).forEach(product => {
  202.                                     let col = document.createElement(\"div\");
  203.                                     // col.classList.add(\"col-3\");
  204.                                     col.classList.add(\"col-6\", \"col-md-4\", \"col-lg-3\");
  205.                                     col.innerHTML = `
  206.                                         <div class=\"product-item\">
  207.                                             <img src=\"/uploads/products/\${product.image}\">
  208.                                             <div class=\"small mt-2\">\${product.title}</div>
  209.                                         </div>
  210.                                     `;
  211.                                     col.querySelector(\".product-item\").addEventListener(\"click\", function (e) {
  212.                                         e.preventDefault();
  213.                                         let clickUrl = productClickBaseUrl.replace('PRODUCT_ID', product.id);
  214.                                         let showUrl  = productShowBaseUrl.replace('PRODUCT_ID', product.id);
  215.                                         fetch(clickUrl + \"?fromSearch=1\", {
  216.                                             method: \"POST\",
  217.                                             headers: {
  218.                                                 \"X-Requested-With\": \"XMLHttpRequest\"
  219.                                             }
  220.                                         })
  221.                                         .then(() => {
  222.                                             window.location.href = showUrl;
  223.                                         });
  224.                                     });
  225.                                     row.appendChild(col);
  226.                                 });
  227.                             });
  228.                             // suggestionsBox.style.display = \"block\";
  229.                             suggestionsBox.style.display = \"block\";
  230.                             suggestionsBox.classList.add(\"show\");
  231.                         });
  232.                 });
  233.                 input.addEventListener(\"keyup\", function () {
  234.                     let query = this.value;
  235.                     if (query.length < 2) {
  236.                         suggestionsBox.style.display = \"none\";
  237.                         return;
  238.                     }
  239.                     fetch(\"";
  240.         // line 359
  241.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ajax_search");
  242.         echo "?q=\" + query)
  243.                         .then(response => response.json())
  244.                         .then(data => {
  245.                             suggestionsBoxResults.innerHTML = \"\";
  246.                             if (data.length === 0) {
  247.                                 suggestionsBoxResults.innerHTML = `
  248.                                     <div class=\"list-group-item text-muted\">
  249.                                         Aucun produit trouvé.
  250.                                     </div>
  251.                                 `;
  252.                                 suggestionsBoxResults.style.display = \"block\";
  253.                                 return;
  254.                             }
  255.                            data.forEach(product => {
  256.                                 let item = document.createElement(\"a\");
  257.                                 item.href = \"#\"; // prevent default link behavior
  258.                                 item.classList.add(\"list-group-item\", \"list-group-item-action\");
  259.                                 item.innerHTML = `
  260.                                     <div class=\"d-flex align-items-center\">
  261.                                         <img src=\"";
  262.         // line 383
  263.         echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("uploads/products/"), "html", null, true);
  264.         echo "\${product.image}\"
  265.                                             width=\"40\"
  266.                                             height=\"40\"
  267.                                             class=\"me-2 rounded\">
  268.                                         <div>
  269.                                             <div>\${product.title}</div>
  270.                                         </div>
  271.                                     </div>
  272.                                 `;
  273.                                 item.addEventListener(\"click\", function (e) {
  274.                                     e.preventDefault();
  275.                                     let clickUrl = productClickBaseUrl.replace('PRODUCT_ID', product.id);
  276.                                     let showUrl  = productShowBaseUrl.replace('PRODUCT_ID', product.id);
  277.                                     fetch(clickUrl + \"?fromSearch=1\", {
  278.                                         method: \"POST\",
  279.                                         headers: {
  280.                                             \"X-Requested-With\": \"XMLHttpRequest\"
  281.                                         }
  282.                                     })
  283.                                     .then(() => {
  284.                                         window.location.href = showUrl;
  285.                                     });
  286.                                 });
  287.                                 suggestionsBoxResults.appendChild(item);
  288.                             });
  289.                             suggestionsBoxResults.style.display = \"block\";
  290.                         });
  291.                 });
  292.                 // Hide when clicking outside
  293.                 // document.addEventListener(\"click\", function (e) {
  294.                 //     if (!input.contains(e.target)) {
  295.                 //         suggestionsBox.style.display = \"none\";
  296.                 //     }
  297.                 // });
  298.                 document.addEventListener(\"click\", function (e) {
  299.                     if (!input.contains(e.target) && !suggestionsBox.contains(e.target)) {
  300.                         suggestionsBox.style.display = \"none\";
  301.                     }
  302.                 });
  303.                 // document.addEventListener(\"click\", function (e) {
  304.                 //     if (!input.contains(e.target) && !suggestionsBoxResults.contains(e.target)) {
  305.                 //         suggestionsBoxResults.style.display = \"none\";
  306.                 //     }
  307.                 // });
  308.             });
  309.         </script>
  310.     </body>
  311. </html>
  312. ";
  313.         
  314.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  315.         
  316.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  317.     }
  318.     // line 9
  319.     public function block_title($context, array $blocks = [])
  320.     {
  321.         $macros = $this->macros;
  322.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  323.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
  324.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  325.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
  326.         echo " Dashboard Templates !";
  327.         
  328.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  329.         
  330.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  331.     }
  332.     // line 13
  333.     public function block_stylesheets($context, array $blocks = [])
  334.     {
  335.         $macros = $this->macros;
  336.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  337.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));
  338.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  339.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));
  340.         // line 14
  341.         echo "            ";
  342.         echo $this->extensions['Symfony\WebpackEncoreBundle\Twig\EntryFilesTwigExtension']->renderWebpackLinkTags("app");
  343.         echo "
  344.             <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.0/css/all.min.css\">
  345.             <link href=\"https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css\" rel=\"stylesheet\" />
  346.                 <style>
  347.                 
  348.                     /* Dans votre fichier CSS */
  349.                     .logo-overlay {
  350.                         position: absolute;
  351.                         top: 0;
  352.                         right: 0;
  353.                         width: 50%; /* Ajustez la largeur du logo selon vos besoins */
  354.                         height: auto;
  355.                         pointer-events: none;
  356.                         z-index: 10;
  357.                     }
  358.                     /* S'assurer que le wrapper a position: relative */
  359.                     .image-wrapper {
  360.                         position: relative !important;
  361.                         display: inline-block; /* ou selon votre layout */
  362.                     }
  363.                     /**/
  364.                     .mega-dropdown {
  365.                         position: fixed;          /* 👈 important */
  366.                         left: 50%;
  367.                         transform: translateX(-26%);
  368.                         /*width: 1200px;*/
  369.                         max-width: 95vw;
  370.                         max-height: 60vh; /* 60% of viewport height */
  371.                         overflow-y: auto; /* scroll if content exceeds max-height */
  372.                         background: #fff;
  373.                         border-radius: 15px;
  374.                         box-shadow: 0 15px 40px rgba(0,0,0,0.08);
  375.                         z-index: 9999;
  376.                         padding-top: 40px;     
  377.                     }
  378.                     /**/
  379.                     .category-header {
  380.                         padding: 10px 14px;
  381.                         background: #f8f9fa;
  382.                         border-radius: 10px;
  383.                     }
  384.                     .category-title {
  385.                         font-size: 0.95rem;
  386.                         font-weight: 600;
  387.                         letter-spacing: 0.3px;
  388.                         text-transform: capitalize; /* backup capitalization */
  389.                     }
  390.                     .view-all {
  391.                         color: #0d6efd;
  392.                         transition: 0.2s ease;
  393.                     }
  394.                     .view-all:hover {
  395.                         opacity: 0.7;
  396.                     }
  397.                     .divider {
  398.                         height: 1px;
  399.                         background: linear-gradient(to right, #e9ecef, transparent);
  400.                     }
  401.                     /* Add smooth appearance */
  402.                     .mega-dropdown.show {
  403.                         animation: fadeDown 0.25s ease;
  404.                     }
  405.                     @keyframes fadeDown {
  406.                         from {
  407.                             opacity: 0;
  408.                             transform: translateY(-10px);
  409.                         }
  410.                         to {
  411.                             opacity: 1;
  412.                             transform: translateY(0);
  413.                         }
  414.                     }
  415.                     .product-item {
  416.                         cursor: pointer;
  417.                         transition: transform 0.2s ease;
  418.                     }
  419.                     .product-item:hover {
  420.                         transform: translateY(-3px);
  421.                     }
  422.                     .product-img-wrapper {
  423.                         background: #f8f9fa;
  424.                         padding: 8px;
  425.                         border-radius: 8px;
  426.                     }
  427.                     .product-item img {
  428.                         width: 100%;
  429.                         height: 100px;
  430.                         object-fit: contain;
  431.                     }     
  432.                 </style>
  433.         ";
  434.         
  435.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  436.         
  437.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  438.     }
  439.     // line 128
  440.     public function block_javascripts($context, array $blocks = [])
  441.     {
  442.         $macros = $this->macros;
  443.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  444.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
  445.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  446.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
  447.         // line 129
  448.         echo "            ";
  449.         echo $this->extensions['Symfony\WebpackEncoreBundle\Twig\EntryFilesTwigExtension']->renderWebpackScriptTags("app");
  450.         echo "
  451.         ";
  452.         
  453.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  454.         
  455.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  456.     }
  457.     // line 134
  458.     public function block_body($context, array $blocks = [])
  459.     {
  460.         $macros = $this->macros;
  461.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  462.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
  463.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  464.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
  465.         
  466.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  467.         
  468.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  469.     }
  470.     public function getTemplateName()
  471.     {
  472.         return "base.html.twig";
  473.     }
  474.     public function isTraitable()
  475.     {
  476.         return false;
  477.     }
  478.     public function getDebugInfo()
  479.     {
  480.         return array (  572 => 134,  559 => 129,  549 => 128,  425 => 14,  415 => 13,  396 => 9,  326 => 383,  299 => 359,  197 => 260,  178 => 244,  174 => 243,  96 => 167,  78 => 135,  76 => 134,  71 => 131,  69 => 128,  66 => 127,  63 => 13,  57 => 9,  47 => 1,);
  481.     }
  482.     public function getSourceContext()
  483.     {
  484.         return new Source("<!DOCTYPE html>
  485. <html lang=\"fr\">
  486.     <head>
  487.         <meta charset=\"UTF-8\">
  488. \t\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">
  489. \t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">
  490. \t\t<meta name=\"description\" content=\"\">
  491. \t\t<meta name=\"author\" content=\"ventes en ligne, rapeto service, madagascar\">
  492.         <title>{% block title %} Dashboard Templates !{% endblock %}</title>
  493.         <link rel=\"icon\" href=\"data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text></svg>\">
  494.         <link rel=\"stylesheet\" href=\"https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap5.min.css\">
  495.         {# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #}
  496.         {% block stylesheets %}
  497.             {{ encore_entry_link_tags('app') }}
  498.             <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.0/css/all.min.css\">
  499.             <link href=\"https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css\" rel=\"stylesheet\" />
  500.                 <style>
  501.                 
  502.                     /* Dans votre fichier CSS */
  503.                     .logo-overlay {
  504.                         position: absolute;
  505.                         top: 0;
  506.                         right: 0;
  507.                         width: 50%; /* Ajustez la largeur du logo selon vos besoins */
  508.                         height: auto;
  509.                         pointer-events: none;
  510.                         z-index: 10;
  511.                     }
  512.                     /* S'assurer que le wrapper a position: relative */
  513.                     .image-wrapper {
  514.                         position: relative !important;
  515.                         display: inline-block; /* ou selon votre layout */
  516.                     }
  517.                     /**/
  518.                     .mega-dropdown {
  519.                         position: fixed;          /* 👈 important */
  520.                         left: 50%;
  521.                         transform: translateX(-26%);
  522.                         /*width: 1200px;*/
  523.                         max-width: 95vw;
  524.                         max-height: 60vh; /* 60% of viewport height */
  525.                         overflow-y: auto; /* scroll if content exceeds max-height */
  526.                         background: #fff;
  527.                         border-radius: 15px;
  528.                         box-shadow: 0 15px 40px rgba(0,0,0,0.08);
  529.                         z-index: 9999;
  530.                         padding-top: 40px;     
  531.                     }
  532.                     /**/
  533.                     .category-header {
  534.                         padding: 10px 14px;
  535.                         background: #f8f9fa;
  536.                         border-radius: 10px;
  537.                     }
  538.                     .category-title {
  539.                         font-size: 0.95rem;
  540.                         font-weight: 600;
  541.                         letter-spacing: 0.3px;
  542.                         text-transform: capitalize; /* backup capitalization */
  543.                     }
  544.                     .view-all {
  545.                         color: #0d6efd;
  546.                         transition: 0.2s ease;
  547.                     }
  548.                     .view-all:hover {
  549.                         opacity: 0.7;
  550.                     }
  551.                     .divider {
  552.                         height: 1px;
  553.                         background: linear-gradient(to right, #e9ecef, transparent);
  554.                     }
  555.                     /* Add smooth appearance */
  556.                     .mega-dropdown.show {
  557.                         animation: fadeDown 0.25s ease;
  558.                     }
  559.                     @keyframes fadeDown {
  560.                         from {
  561.                             opacity: 0;
  562.                             transform: translateY(-10px);
  563.                         }
  564.                         to {
  565.                             opacity: 1;
  566.                             transform: translateY(0);
  567.                         }
  568.                     }
  569.                     .product-item {
  570.                         cursor: pointer;
  571.                         transition: transform 0.2s ease;
  572.                     }
  573.                     .product-item:hover {
  574.                         transform: translateY(-3px);
  575.                     }
  576.                     .product-img-wrapper {
  577.                         background: #f8f9fa;
  578.                         padding: 8px;
  579.                         border-radius: 8px;
  580.                     }
  581.                     .product-item img {
  582.                         width: 100%;
  583.                         height: 100px;
  584.                         object-fit: contain;
  585.                     }     
  586.                 </style>
  587.         {% endblock %}
  588.         {% block javascripts %}
  589.             {{ encore_entry_script_tags('app') }}
  590.         {% endblock %}
  591.     </head>
  592.     <body id=\"page-top\">
  593.         {% block body %}{% endblock %}
  594.         <script src=\"https://code.jquery.com/jquery-3.7.1.min.js\"></script>
  595.         <!-- Select2 JS -->
  596.         <script src=\"https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js\"></script>
  597.         <script src=\"https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js\"></script>
  598.         <script src=\"https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js\"></script>
  599.         <script>
  600.             \$(document).ready(function() {
  601.                 \$('.select2').select2({
  602.                     placeholder: \"Choisir un ou plusieurs services\",
  603.                     allowClear: true,
  604.                 });
  605.             });
  606.         </script>
  607.         {# <script>
  608.             \$(document).ready(function () {
  609.                 \$('.datatable').DataTable({
  610.                     pageLength: 25,
  611.                     ordering: true,
  612.                     searching: true,
  613.                     info: true,
  614.                     language: {
  615.                         url: \"//cdn.datatables.net/plug-ins/1.13.8/i18n/fr-FR.json\"
  616.                     },
  617.                 });
  618.             });
  619.         </script> #}
  620.         <script>
  621.             \$(document).ready(function () {
  622.                 \$('.datatable').DataTable({
  623.                     pageLength: 25,
  624.                     ordering: true,
  625.                     searching: true,
  626.                     info: true,
  627.                     language: {
  628.                         decimal: ',',
  629.                         thousands: ' ',
  630.                         emptyTable: 'Aucune donnée disponible',
  631.                         info: 'Affichage de _START_ à _END_ sur _TOTAL_ entrées',
  632.                         infoEmpty: 'Affichage de 0 à 0 sur 0 entrée',
  633.                         infoFiltered: '(filtré depuis _MAX_ entrées au total)',
  634.                         lengthMenu: 'Afficher _MENU_ entrées',
  635.                         loadingRecords: 'Chargement...',
  636.                         processing: 'Traitement...',
  637.                         search: 'Rechercher :',
  638.                         zeroRecords: 'Aucun enregistrement correspondant trouvé',
  639.                         paginate: {
  640.                             first: 'Premier',
  641.                             last: 'Dernier',
  642.                             next: 'Suivant',
  643.                             previous: 'Précédent'
  644.                         }
  645.                     }
  646.                 });
  647.             });
  648.         </script>
  649.         <script>
  650.             document.querySelectorAll('.product-link').forEach(link => {
  651.                 link.addEventListener('click', function () {
  652.                     const url = this.dataset.clickUrl;
  653.                     if (navigator.sendBeacon) {
  654.                         navigator.sendBeacon(url);
  655.                     } else {
  656.                         fetch(url, { method: 'POST', keepalive: true });
  657.                     }
  658.                 });
  659.             });
  660.            const logoSrc = '/img/logo-rapeto-img.png';
  661.             function addLogoToProductImages() {
  662.                 document.querySelectorAll(\".image-wrapper\").forEach(wrapper => {
  663.                     // Maka ny sary produit
  664.                     const productImg = wrapper.querySelector(\"img\");
  665.                     // Raha tsy misy sary, dia tsy mamorona logo
  666.                     if (!productImg) return;
  667.                     // Raha efa misy logo, tsy mamorona indray
  668.                     if (wrapper.querySelector(\".logo-overlay\")) return;
  669.                     // Mamorona logo
  670.                     const logo = document.createElement(\"img\");
  671.                     logo.src = logoSrc;
  672.                     logo.alt = \"Logo\";
  673.                     logo.className = \"logo-overlay\";
  674.                     wrapper.appendChild(logo);
  675.                 });
  676.             }
  677.             // Alefa rehefa loaded ny DOM
  678.             document.addEventListener(\"DOMContentLoaded\", addLogoToProductImages);
  679.         </script>
  680.         <script>
  681.             const productClickBaseUrl = \"{{ path('app_product_click_search', {'id': 'PRODUCT_ID'}) }}\";
  682.             const productShowBaseUrl  = \"{{ path('app_product_show', {'id': 'PRODUCT_ID'}) }}\";
  683.         </script>
  684.         <script>
  685.             document.addEventListener(\"DOMContentLoaded\", function () {
  686.                 const input = document.getElementById(\"search-input\");
  687.                 const suggestionsBox = document.getElementById(\"search-suggestions\");
  688.                 const suggestionsBoxResults = document.getElementById(\"search-suggestions-results\");
  689.                 input.addEventListener(\"focus\", function () {
  690.                     if (this.value.length >= 2) return;
  691.                     fetch(\"{{ path('ajax_random_products') }}\")
  692.                         .then(response => response.json())
  693.                         .then(data => {
  694.                             const categoryContainer = document.getElementById(\"categoryResults\");
  695.                             categoryContainer.innerHTML = \"\";
  696.                             if (!data || data.length === 0) {
  697.                                 categoryContainer.innerHTML = `
  698.                                     <div class=\"text-center text-muted py-4\">
  699.                                         Aucun produit disponible.
  700.                                     </div>
  701.                                 `;
  702.                             }
  703.                             (data || []).forEach(group => {
  704.                                 let block = document.createElement(\"div\");
  705.                                 block.classList.add(\"mb-4\");
  706.                                 // block.innerHTML = `
  707.                                 //     <div class=\"d-flex justify-content-between align-items-center mb-2\">
  708.                                 //         <div class=\"fw-bold\">\${group.categoryName.charAt(0).toUpperCase() + group.categoryName.slice(1)}</div>
  709.                                 //         <a href=\"#\" class=\"small text-primary\"></a>
  710.                                 //     </div>
  711.                                 //     <div class=\"row g-3\" id=\"cat-\${group.categoryId}\"></div>
  712.                                 // `;
  713.                                 block.innerHTML = `
  714.                                     <div class=\"category-header d-flex justify-content-between align-items-center mb-3\">
  715.                                         <h6 class=\"category-title mb-0\">
  716.                                             \${group.categoryName 
  717.                                                 ? group.categoryName.charAt(0).toUpperCase() + group.categoryName.slice(1) 
  718.                                                 : ''}
  719.                                         </h6>
  720.                                         <a href=\"#\" class=\"small text-decoration-none fw-semibold view-all\"></a>
  721.                                     </div>
  722.                                     <div class=\"divider mb-3\"></div>
  723.                                     <div class=\"row g-3\" id=\"cat-\${group.categoryId}\"></div>
  724.                                 `;
  725.                                 categoryContainer.appendChild(block);
  726.                                 let row = block.querySelector(`#cat-\${group.categoryId}`);
  727.                                 group.products.slice(0, 4).forEach(product => {
  728.                                     let col = document.createElement(\"div\");
  729.                                     // col.classList.add(\"col-3\");
  730.                                     col.classList.add(\"col-6\", \"col-md-4\", \"col-lg-3\");
  731.                                     col.innerHTML = `
  732.                                         <div class=\"product-item\">
  733.                                             <img src=\"/uploads/products/\${product.image}\">
  734.                                             <div class=\"small mt-2\">\${product.title}</div>
  735.                                         </div>
  736.                                     `;
  737.                                     col.querySelector(\".product-item\").addEventListener(\"click\", function (e) {
  738.                                         e.preventDefault();
  739.                                         let clickUrl = productClickBaseUrl.replace('PRODUCT_ID', product.id);
  740.                                         let showUrl  = productShowBaseUrl.replace('PRODUCT_ID', product.id);
  741.                                         fetch(clickUrl + \"?fromSearch=1\", {
  742.                                             method: \"POST\",
  743.                                             headers: {
  744.                                                 \"X-Requested-With\": \"XMLHttpRequest\"
  745.                                             }
  746.                                         })
  747.                                         .then(() => {
  748.                                             window.location.href = showUrl;
  749.                                         });
  750.                                     });
  751.                                     row.appendChild(col);
  752.                                 });
  753.                             });
  754.                             // suggestionsBox.style.display = \"block\";
  755.                             suggestionsBox.style.display = \"block\";
  756.                             suggestionsBox.classList.add(\"show\");
  757.                         });
  758.                 });
  759.                 input.addEventListener(\"keyup\", function () {
  760.                     let query = this.value;
  761.                     if (query.length < 2) {
  762.                         suggestionsBox.style.display = \"none\";
  763.                         return;
  764.                     }
  765.                     fetch(\"{{ path('ajax_search') }}?q=\" + query)
  766.                         .then(response => response.json())
  767.                         .then(data => {
  768.                             suggestionsBoxResults.innerHTML = \"\";
  769.                             if (data.length === 0) {
  770.                                 suggestionsBoxResults.innerHTML = `
  771.                                     <div class=\"list-group-item text-muted\">
  772.                                         Aucun produit trouvé.
  773.                                     </div>
  774.                                 `;
  775.                                 suggestionsBoxResults.style.display = \"block\";
  776.                                 return;
  777.                             }
  778.                            data.forEach(product => {
  779.                                 let item = document.createElement(\"a\");
  780.                                 item.href = \"#\"; // prevent default link behavior
  781.                                 item.classList.add(\"list-group-item\", \"list-group-item-action\");
  782.                                 item.innerHTML = `
  783.                                     <div class=\"d-flex align-items-center\">
  784.                                         <img src=\"{{ asset('uploads/products/') }}\${product.image}\"
  785.                                             width=\"40\"
  786.                                             height=\"40\"
  787.                                             class=\"me-2 rounded\">
  788.                                         <div>
  789.                                             <div>\${product.title}</div>
  790.                                         </div>
  791.                                     </div>
  792.                                 `;
  793.                                 item.addEventListener(\"click\", function (e) {
  794.                                     e.preventDefault();
  795.                                     let clickUrl = productClickBaseUrl.replace('PRODUCT_ID', product.id);
  796.                                     let showUrl  = productShowBaseUrl.replace('PRODUCT_ID', product.id);
  797.                                     fetch(clickUrl + \"?fromSearch=1\", {
  798.                                         method: \"POST\",
  799.                                         headers: {
  800.                                             \"X-Requested-With\": \"XMLHttpRequest\"
  801.                                         }
  802.                                     })
  803.                                     .then(() => {
  804.                                         window.location.href = showUrl;
  805.                                     });
  806.                                 });
  807.                                 suggestionsBoxResults.appendChild(item);
  808.                             });
  809.                             suggestionsBoxResults.style.display = \"block\";
  810.                         });
  811.                 });
  812.                 // Hide when clicking outside
  813.                 // document.addEventListener(\"click\", function (e) {
  814.                 //     if (!input.contains(e.target)) {
  815.                 //         suggestionsBox.style.display = \"none\";
  816.                 //     }
  817.                 // });
  818.                 document.addEventListener(\"click\", function (e) {
  819.                     if (!input.contains(e.target) && !suggestionsBox.contains(e.target)) {
  820.                         suggestionsBox.style.display = \"none\";
  821.                     }
  822.                 });
  823.                 // document.addEventListener(\"click\", function (e) {
  824.                 //     if (!input.contains(e.target) && !suggestionsBoxResults.contains(e.target)) {
  825.                 //         suggestionsBoxResults.style.display = \"none\";
  826.                 //     }
  827.                 // });
  828.             });
  829.         </script>
  830.     </body>
  831. </html>
  832. ", "base.html.twig", "/htdocs/templates/base.html.twig");
  833.     }
  834. }