var/cache/dev/twig/48/488aec1a9b011767a1a75a4213c9e485.php line 54

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* order/index.html.twig */
  16. class __TwigTemplate_250eee5ef27d2aa555fdd63e7ca6fc7e extends Template
  17. {
  18.     private Source $source;
  19.     /**
  20.      * @var array<string, Template>
  21.      */
  22.     private array $macros = [];
  23.     public function __construct(Environment $env)
  24.     {
  25.         parent::__construct($env);
  26.         $this->source $this->getSourceContext();
  27.         $this->blocks = [
  28.             'title' => [$this'block_title'],
  29.             'body' => [$this'block_body'],
  30.         ];
  31.     }
  32.     protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
  33.     {
  34.         // line 1
  35.         return "base.html.twig";
  36.     }
  37.     protected function doDisplay(array $context, array $blocks = []): iterable
  38.     {
  39.         $macros $this->macros;
  40.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  41.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""order/index.html.twig"));
  42.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  43.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""order/index.html.twig"));
  44.         $this->parent $this->load("base.html.twig"1);
  45.         yield from $this->parent->unwrap()->yield($contextarray_merge($this->blocks$blocks));
  46.         
  47.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  48.         
  49.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  50.     }
  51.     // line 3
  52.     /**
  53.      * @return iterable<null|scalar|\Stringable>
  54.      */
  55.     public function block_title(array $context, array $blocks = []): iterable
  56.     {
  57.         $macros $this->macros;
  58.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  59.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  60.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  61.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  62.         yield "Pedir - Restaurante";
  63.         
  64.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  65.         
  66.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  67.         yield from [];
  68.     }
  69.     // line 5
  70.     /**
  71.      * @return iterable<null|scalar|\Stringable>
  72.      */
  73.     public function block_body(array $context, array $blocks = []): iterable
  74.     {
  75.         $macros $this->macros;
  76.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  77.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  78.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  79.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  80.         // line 6
  81.         yield "
  82. <style>
  83.     #confirmation-message{
  84.         transition: opacity 0.5s ease;
  85.     }
  86.     /* Estilo general del contenedor */
  87.     .filter-container {
  88.       position: sticky;
  89.       z-index: 1000;
  90.       background: rgba(255, 255, 255, 0.1); /* Fondo transparente */
  91.       padding: 15px;
  92.       border-radius: 10px;
  93.     }
  94.     /* Título del dropdown con separador negro y flecha */
  95.     .filter-title {
  96.       background: none;
  97.       border: none;
  98.       font-size: 16px;
  99.       font-weight: bold;
  100.       cursor: pointer;
  101.       width: 100%;
  102.       text-align: left;
  103.       padding: 10px;
  104.       display: flex;
  105.       justify-content: space-between;
  106.       align-items: center;
  107.       border-bottom: 2px solid black; /* Línea separadora negra */
  108.     }
  109.     .filter-title:hover {
  110.       background: rgba(255, 255, 255, 0.1);
  111.     }
  112.     /* Icono de la flecha */
  113.     .filter-title .arrow {
  114.       transition: transform 0.3s ease;
  115.     }
  116.     /* Rango de precio */
  117.     .slider-container {
  118.       padding: 10px;
  119.     }
  120.     input[type=\"range\"] {
  121.       width: 100%;
  122.       accent-color: red;
  123.     }
  124.     input[type=\"range\"]::-webkit-slider-thumb {
  125.       background: black;
  126.     }
  127.     /* Checkboxes */
  128.     .checkbox-container {
  129.       padding: 10px;
  130.     }
  131.     .form-check-label {
  132.         margin-bottom: 10px;
  133.     }
  134.     .filter-container .btn-search{
  135.         border-start-end-radius: 30px;
  136.         border-end-end-radius: 30px;
  137.         background: white;
  138.         border: 0px;
  139.     }
  140.     
  141.     /* Personalización del checkbox */
  142.     .category-checkbox {
  143.         appearance: none; /* Elimina el diseño predeterminado */
  144.         width: 18px;
  145.         height: 18px;
  146.         border: 2px solid #E63946; /* Borde rojo */
  147.         border-radius: 4px;
  148.         display: inline-block;
  149.         position: relative;
  150.         cursor: pointer;
  151.     }
  152.     /* Cuando está marcado, cambiar fondo y mostrar un check */
  153.     .category-checkbox:checked {
  154.         background-color: #E63946; /* Fondo rojo */
  155.         border: 2px solid #E63946;
  156.     }
  157.     /* Agregar un icono de check al marcar */
  158.     .category-checkbox:checked::after {
  159.         color: white;
  160.         font-size: 14px;
  161.         font-weight: bold;
  162.         position: absolute;
  163.         top: 50%;
  164.         left: 50%;
  165.         transform: translate(-50%, -50%);
  166.     }
  167.   </style>
  168. <body>
  169. <!-- Header -->
  170. ";
  171.         // line 110
  172.         yield $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment(Symfony\Bridge\Twig\Extension\HttpKernelExtension::controller("App\\Controller\\HeaderController::index"));
  173.         yield "
  174. <div class=\"container container-custom order-container mt-4\">
  175.     <div id=\"confirmation-message\" class=\"container alert alert-success d-none fixed-top\" role=\"alert\" style=\"margin-top: 90px\">
  176.         ¡Producto añadido al carrito correctamente!
  177.     </div>
  178.     <div class=\"row\">
  179.         <div class=\"col-12 mb-3 title-block\">
  180.             <nav aria-label=\"breadcrumb\">
  181.                 <ol class=\"breadcrumb\">
  182.                     <li class=\"breadcrumb-item\"><a class=\"text-decoration-none section-title\" href=\"/\">Home</a></li>
  183.                     
  184.                     ";
  185.         // line 123
  186.         if ((($tmp CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'123$this->source); })()), "request", [], "any"falsefalsefalse123), "get", ["category"], "method"falsefalsefalse123)) && $tmp instanceof Markup ? (string) $tmp $tmp)) {
  187.             // line 124
  188.             yield "                        ";
  189.             $context["selectedCategoryId"] = CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'124$this->source); })()), "request", [], "any"falsefalsefalse124), "get", ["category"], "method"falsefalsefalse124);
  190.             // line 125
  191.             yield "                        ";
  192.             $context["selectedCategory"] = Twig\Extension\CoreExtension::first($this->env->getCharset(), Twig\Extension\CoreExtension::filter($this->env, (isset($context["categories"]) || array_key_exists("categories"$context) ? $context["categories"] : (function () { throw new RuntimeError('Variable "categories" does not exist.'125$this->source); })()), function ($__c__) use ($context$macros) { $context["c"] = $__c__; return (CoreExtension::getAttribute($this->env$this->source, (isset($context["c"]) || array_key_exists("c"$context) ? $context["c"] : (function () { throw new RuntimeError('Variable "c" does not exist.'125$this->source); })()), "id", [], "any"falsefalsefalse125) == (isset($context["selectedCategoryId"]) || array_key_exists("selectedCategoryId"$context) ? $context["selectedCategoryId"] : (function () { throw new RuntimeError('Variable "selectedCategoryId" does not exist.'125$this->source); })())); }));
  193.             // line 126
  194.             yield "                        
  195.                         <li class=\"breadcrumb-item\"><a class=\"text-decoration-none section-title\" href=\"";
  196.             // line 127
  197.             yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_order");
  198.             yield "\">Productos</a></li>
  199.                         ";
  200.             // line 128
  201.             if ((($tmp = (isset($context["selectedCategory"]) || array_key_exists("selectedCategory"$context) ? $context["selectedCategory"] : (function () { throw new RuntimeError('Variable "selectedCategory" does not exist.'128$this->source); })())) && $tmp instanceof Markup ? (string) $tmp $tmp)) {
  202.                 // line 129
  203.                 yield "                            <li class=\"breadcrumb-item active\" aria-current=\"page\">";
  204.                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source, (isset($context["selectedCategory"]) || array_key_exists("selectedCategory"$context) ? $context["selectedCategory"] : (function () { throw new RuntimeError('Variable "selectedCategory" does not exist.'129$this->source); })()), "name", [], "any"falsefalsefalse129), "html"nulltrue);
  205.                 yield "</li>
  206.                         ";
  207.             }
  208.             // line 131
  209.             yield "                    ";
  210.         } else {
  211.             // line 132
  212.             yield "                        <li class=\"breadcrumb-item active\" aria-current=\"page\">Productos</li>
  213.                     ";
  214.         }
  215.         // line 134
  216.         yield "                </ol>
  217.             </nav>
  218.             <h1 class=\"section-title category-section my-4 \">Nuestros Productos</h1>
  219.         </div>
  220.         <!-- Productos -->
  221.         <div class=\"col-12 col-lg-12\" style=\"min-height: 50vh\">
  222.             <div class=\"row align-items-start\" >
  223.                     ";
  224.         // line 141
  225.         yield from $this->load("components/products.html.twig"141)->unwrap()->yield(CoreExtension::merge($context, ["products" => (isset($context["products"]) || array_key_exists("products"$context) ? $context["products"] : (function () { throw new RuntimeError('Variable "products" does not exist.'141$this->source); })())]));
  226.         // line 142
  227.         yield "            </div>
  228.         </div>
  229.     </div>
  230. </div>
  231.     
  232.     
  233. ";
  234.         // line 150
  235.         yield "<button class=\"btn btn-primary rounded-circle position-fixed \" 
  236.         style=\"bottom: 20px; left: 20px; z-index: 1050; width: 50px; height: 50px;\" 
  237.         type=\"button\" 
  238.         data-bs-toggle=\"offcanvas\" 
  239.         data-bs-target=\"#filterOffcanvas\" 
  240.         aria-controls=\"filterOffcanvas\">
  241.     <i class=\"bi bi-filter\" style=\"font-size: 1.5rem;\"></i>
  242. </button>
  243. ";
  244.         // line 160
  245.         yield "<div class=\"offcanvas offcanvas-start\" tabindex=\"-1\" id=\"filterOffcanvas\" aria-labelledby=\"filterOffcanvasLabel\">
  246.   <div class=\"offcanvas-header\">
  247.     <h5 class=\"offcanvas-title\" id=\"filterOffcanvasLabel\">Filtros</h5>
  248.     <button type=\"button\" class=\"btn-close text-reset\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\"></button>
  249.   </div>
  250.   <div class=\"offcanvas-body\">
  251.       <div class=\"filter-container pt-0\">
  252.           <form method=\"GET\" action=\"";
  253.         // line 167
  254.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_order");
  255.         yield "\">
  256.               <button type=\"submit\" class=\"btn btn-primary w-100 mb-3\">Filtrar</button>
  257.               <!-- Filtro de Buscador -->
  258.               <button class=\"filter-title\" data-bs-toggle=\"collapse\" data-bs-target=\"#filter-search\" aria-expanded=\"true\" type=\"button\">
  259.                   Filtrar por Nombre <span class=\"arrow\">▼</span>
  260.               </button>
  261.               <div id=\"filter-search\" class=\"collapse show\">
  262.                   <div class=\"my-3 d-flex\">
  263.                       <div class=\"input-group input-group-lg\">
  264.                           <input type=\"search\" name=\"search\" class=\"form-control fs-6 bar-search\" placeholder=\"Nombre...\" 
  265.                               aria-label=\"Nombre\" value=\"";
  266.         // line 178
  267.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'178$this->source); })()), "request", [], "any"falsefalsefalse178), "get", ["search"], "method"falsefalsefalse178), "html"nulltrue);
  268.         yield "\">
  269.                       </div>
  270.                   </div>
  271.               </div>
  272.               <!-- Filtro de Precio -->
  273.               <button class=\"filter-title\" data-bs-toggle=\"collapse\" data-bs-target=\"#filter-price\" aria-expanded=\"true\" type=\"button\">
  274.                   Filtrar por Precio <span class=\"arrow\">▼</span>
  275.               </button>
  276.               <div id=\"filter-price\" class=\"collapse show\">
  277.                   <div class=\"slider-container\">
  278.                       <input type=\"range\" name=\"price\" min=\"0\" max=\"";
  279.         // line 189
  280.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["max_price"]) || array_key_exists("max_price"$context) ? $context["max_price"] : (function () { throw new RuntimeError('Variable "max_price" does not exist.'189$this->source); })()), "html"nulltrue);
  281.         yield "\" step=\"1\" id=\"priceRange\"
  282.                           value=\"";
  283.         // line 190
  284.         yield ((CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'190$this->source); })()), "request", [], "any"falsefalsefalse190), "get", ["price"], "method"falsefalsefalse190)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'190$this->source); })()), "request", [], "any"falsefalsefalse190), "get", ["price"], "method"falsefalsefalse190), "html"nulltrue)) : ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["max_price"]) || array_key_exists("max_price"$context) ? $context["max_price"] : (function () { throw new RuntimeError('Variable "max_price" does not exist.'190$this->source); })()), "html"nulltrue)));
  285.         yield "\">
  286.                       <p class=\"fs-6\">Precio: <span id=\"priceValue\">";
  287.         // line 191
  288.         yield ((CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'191$this->source); })()), "request", [], "any"falsefalsefalse191), "get", ["price"], "method"falsefalsefalse191)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'191$this->source); })()), "request", [], "any"falsefalsefalse191), "get", ["price"], "method"falsefalsefalse191), "html"nulltrue)) : ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["max_price"]) || array_key_exists("max_price"$context) ? $context["max_price"] : (function () { throw new RuntimeError('Variable "max_price" does not exist.'191$this->source); })()), "html"nulltrue)));
  289.         yield "</span>€</p>
  290.                   </div>
  291.               </div>
  292.               <!-- Filtro de Categorías -->
  293.               <button class=\"filter-title\" data-bs-toggle=\"collapse\" data-bs-target=\"#filter-category\" aria-expanded=\"true\" type=\"button\">
  294.                   Filtrar por Categorías <span class=\"arrow\">▼</span>
  295.               </button>
  296.               <div id=\"filter-category\" class=\"collapse show\">
  297.                   <div class=\"checkbox-container\">
  298.                       ";
  299.         // line 201
  300.         $context['_parent'] = $context;
  301.         $context['_seq'] = CoreExtension::ensureTraversable((isset($context["categories"]) || array_key_exists("categories"$context) ? $context["categories"] : (function () { throw new RuntimeError('Variable "categories" does not exist.'201$this->source); })()));
  302.         foreach ($context['_seq'] as $context["_key"] => $context["category"]) {
  303.             // line 202
  304.             yield "                          <div class=\"form-check\">
  305.                               <input class=\"form-check-input category-checkbox\" type=\"checkbox\" name=\"category\" id=\"cat";
  306.             // line 203
  307.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["category"], "id", [], "any"falsefalsefalse203), "html"nulltrue);
  308.             yield "\" value=\"";
  309.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["category"], "id", [], "any"falsefalsefalse203), "html"nulltrue);
  310.             yield "\"
  311.                                   ";
  312.             // line 204
  313.             if ((CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'204$this->source); })()), "request", [], "any"falsefalsefalse204), "get", ["category"], "method"falsefalsefalse204) == $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(CoreExtension::getAttribute($this->env$this->source$context["category"], "id", [], "any"falsefalsefalse204)))) {
  314.                 yield "checked";
  315.             }
  316.             yield ">
  317.                               <label class=\"form-check-label\" for=\"cat";
  318.             // line 205
  319.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["category"], "id", [], "any"falsefalsefalse205), "html"nulltrue);
  320.             yield "\">";
  321.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["category"], "name", [], "any"falsefalsefalse205), "html"nulltrue);
  322.             yield "</label>
  323.                           </div>
  324.                       ";
  325.         }
  326.         $_parent $context['_parent'];
  327.         unset($context['_seq'], $context['_key'], $context['category'], $context['_parent']);
  328.         $context array_intersect_key($context$_parent) + $_parent;
  329.         // line 208
  330.         yield "                  </div>
  331.               </div>
  332.           </form>
  333.       </div>
  334.   </div>
  335. </div>
  336.     
  337.     
  338. </body>
  339. <script>
  340.     document.getElementById('priceRange').addEventListener('input', function() {
  341.         document.getElementById('priceValue').innerText = this.value;
  342.     });
  343. </script>
  344. <script>
  345.     document.addEventListener(\"DOMContentLoaded\", function () {
  346.         const checkboxes = document.querySelectorAll(\".category-checkbox\");
  347.         checkboxes.forEach(checkbox => {
  348.             checkbox.addEventListener(\"click\", function () {
  349.                 if (this.checked) {
  350.                     checkboxes.forEach(cb => {
  351.                         if (cb !== this) cb.checked = false; // Desmarca los otros
  352.                     });
  353.                 }
  354.             });
  355.         });
  356.     });
  357. </script>
  358. ";
  359.         
  360.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  361.         
  362.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  363.         yield from [];
  364.     }
  365.     /**
  366.      * @codeCoverageIgnore
  367.      */
  368.     public function getTemplateName(): string
  369.     {
  370.         return "order/index.html.twig";
  371.     }
  372.     /**
  373.      * @codeCoverageIgnore
  374.      */
  375.     public function isTraitable(): bool
  376.     {
  377.         return false;
  378.     }
  379.     /**
  380.      * @codeCoverageIgnore
  381.      */
  382.     public function getDebugInfo(): array
  383.     {
  384.         return array (  371 => 208,  360 => 205,  354 => 204,  348 => 203,  345 => 202,  341 => 201,  328 => 191,  324 => 190,  320 => 189,  306 => 178,  292 => 167,  283 => 160,  272 => 150,  263 => 142,  261 => 141,  252 => 134,  248 => 132,  245 => 131,  239 => 129,  237 => 128,  233 => 127,  230 => 126,  227 => 125,  224 => 124,  222 => 123,  206 => 110,  100 => 6,  87 => 5,  64 => 3,  41 => 1,);
  385.     }
  386.     public function getSourceContext(): Source
  387.     {
  388.         return new Source("{% extends 'base.html.twig' %}
  389. {% block title %}Pedir - Restaurante{% endblock %}
  390. {% block body %}
  391. <style>
  392.     #confirmation-message{
  393.         transition: opacity 0.5s ease;
  394.     }
  395.     /* Estilo general del contenedor */
  396.     .filter-container {
  397.       position: sticky;
  398.       z-index: 1000;
  399.       background: rgba(255, 255, 255, 0.1); /* Fondo transparente */
  400.       padding: 15px;
  401.       border-radius: 10px;
  402.     }
  403.     /* Título del dropdown con separador negro y flecha */
  404.     .filter-title {
  405.       background: none;
  406.       border: none;
  407.       font-size: 16px;
  408.       font-weight: bold;
  409.       cursor: pointer;
  410.       width: 100%;
  411.       text-align: left;
  412.       padding: 10px;
  413.       display: flex;
  414.       justify-content: space-between;
  415.       align-items: center;
  416.       border-bottom: 2px solid black; /* Línea separadora negra */
  417.     }
  418.     .filter-title:hover {
  419.       background: rgba(255, 255, 255, 0.1);
  420.     }
  421.     /* Icono de la flecha */
  422.     .filter-title .arrow {
  423.       transition: transform 0.3s ease;
  424.     }
  425.     /* Rango de precio */
  426.     .slider-container {
  427.       padding: 10px;
  428.     }
  429.     input[type=\"range\"] {
  430.       width: 100%;
  431.       accent-color: red;
  432.     }
  433.     input[type=\"range\"]::-webkit-slider-thumb {
  434.       background: black;
  435.     }
  436.     /* Checkboxes */
  437.     .checkbox-container {
  438.       padding: 10px;
  439.     }
  440.     .form-check-label {
  441.         margin-bottom: 10px;
  442.     }
  443.     .filter-container .btn-search{
  444.         border-start-end-radius: 30px;
  445.         border-end-end-radius: 30px;
  446.         background: white;
  447.         border: 0px;
  448.     }
  449.     
  450.     /* Personalización del checkbox */
  451.     .category-checkbox {
  452.         appearance: none; /* Elimina el diseño predeterminado */
  453.         width: 18px;
  454.         height: 18px;
  455.         border: 2px solid #E63946; /* Borde rojo */
  456.         border-radius: 4px;
  457.         display: inline-block;
  458.         position: relative;
  459.         cursor: pointer;
  460.     }
  461.     /* Cuando está marcado, cambiar fondo y mostrar un check */
  462.     .category-checkbox:checked {
  463.         background-color: #E63946; /* Fondo rojo */
  464.         border: 2px solid #E63946;
  465.     }
  466.     /* Agregar un icono de check al marcar */
  467.     .category-checkbox:checked::after {
  468.         color: white;
  469.         font-size: 14px;
  470.         font-weight: bold;
  471.         position: absolute;
  472.         top: 50%;
  473.         left: 50%;
  474.         transform: translate(-50%, -50%);
  475.     }
  476.   </style>
  477. <body>
  478. <!-- Header -->
  479. {{ render(controller('App\\\\Controller\\\\HeaderController::index')) }}
  480. <div class=\"container container-custom order-container mt-4\">
  481.     <div id=\"confirmation-message\" class=\"container alert alert-success d-none fixed-top\" role=\"alert\" style=\"margin-top: 90px\">
  482.         ¡Producto añadido al carrito correctamente!
  483.     </div>
  484.     <div class=\"row\">
  485.         <div class=\"col-12 mb-3 title-block\">
  486.             <nav aria-label=\"breadcrumb\">
  487.                 <ol class=\"breadcrumb\">
  488.                     <li class=\"breadcrumb-item\"><a class=\"text-decoration-none section-title\" href=\"/\">Home</a></li>
  489.                     
  490.                     {% if app.request.get('category') %}
  491.                         {% set selectedCategoryId = app.request.get('category') %}
  492.                         {% set selectedCategory = categories|filter(c => c.id == selectedCategoryId)|first %}
  493.                         
  494.                         <li class=\"breadcrumb-item\"><a class=\"text-decoration-none section-title\" href=\"{{ path('app_order') }}\">Productos</a></li>
  495.                         {% if selectedCategory %}
  496.                             <li class=\"breadcrumb-item active\" aria-current=\"page\">{{ selectedCategory.name }}</li>
  497.                         {% endif %}
  498.                     {% else %}
  499.                         <li class=\"breadcrumb-item active\" aria-current=\"page\">Productos</li>
  500.                     {% endif %}
  501.                 </ol>
  502.             </nav>
  503.             <h1 class=\"section-title category-section my-4 \">Nuestros Productos</h1>
  504.         </div>
  505.         <!-- Productos -->
  506.         <div class=\"col-12 col-lg-12\" style=\"min-height: 50vh\">
  507.             <div class=\"row align-items-start\" >
  508.                     {% include \"components/products.html.twig\" with {'products': products} %}
  509.             </div>
  510.         </div>
  511.     </div>
  512. </div>
  513.     
  514.     
  515. {# Botón flotante para abrir el offcanvas de filtros #}
  516. <button class=\"btn btn-primary rounded-circle position-fixed \" 
  517.         style=\"bottom: 20px; left: 20px; z-index: 1050; width: 50px; height: 50px;\" 
  518.         type=\"button\" 
  519.         data-bs-toggle=\"offcanvas\" 
  520.         data-bs-target=\"#filterOffcanvas\" 
  521.         aria-controls=\"filterOffcanvas\">
  522.     <i class=\"bi bi-filter\" style=\"font-size: 1.5rem;\"></i>
  523. </button>
  524. {# Offcanvas que contendrá los filtros #}
  525. <div class=\"offcanvas offcanvas-start\" tabindex=\"-1\" id=\"filterOffcanvas\" aria-labelledby=\"filterOffcanvasLabel\">
  526.   <div class=\"offcanvas-header\">
  527.     <h5 class=\"offcanvas-title\" id=\"filterOffcanvasLabel\">Filtros</h5>
  528.     <button type=\"button\" class=\"btn-close text-reset\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\"></button>
  529.   </div>
  530.   <div class=\"offcanvas-body\">
  531.       <div class=\"filter-container pt-0\">
  532.           <form method=\"GET\" action=\"{{ path('app_order') }}\">
  533.               <button type=\"submit\" class=\"btn btn-primary w-100 mb-3\">Filtrar</button>
  534.               <!-- Filtro de Buscador -->
  535.               <button class=\"filter-title\" data-bs-toggle=\"collapse\" data-bs-target=\"#filter-search\" aria-expanded=\"true\" type=\"button\">
  536.                   Filtrar por Nombre <span class=\"arrow\">▼</span>
  537.               </button>
  538.               <div id=\"filter-search\" class=\"collapse show\">
  539.                   <div class=\"my-3 d-flex\">
  540.                       <div class=\"input-group input-group-lg\">
  541.                           <input type=\"search\" name=\"search\" class=\"form-control fs-6 bar-search\" placeholder=\"Nombre...\" 
  542.                               aria-label=\"Nombre\" value=\"{{ app.request.get('search') }}\">
  543.                       </div>
  544.                   </div>
  545.               </div>
  546.               <!-- Filtro de Precio -->
  547.               <button class=\"filter-title\" data-bs-toggle=\"collapse\" data-bs-target=\"#filter-price\" aria-expanded=\"true\" type=\"button\">
  548.                   Filtrar por Precio <span class=\"arrow\">▼</span>
  549.               </button>
  550.               <div id=\"filter-price\" class=\"collapse show\">
  551.                   <div class=\"slider-container\">
  552.                       <input type=\"range\" name=\"price\" min=\"0\" max=\"{{ max_price }}\" step=\"1\" id=\"priceRange\"
  553.                           value=\"{{ app.request.get('price') ?: max_price }}\">
  554.                       <p class=\"fs-6\">Precio: <span id=\"priceValue\">{{ app.request.get('price') ?: max_price }}</span>€</p>
  555.                   </div>
  556.               </div>
  557.               <!-- Filtro de Categorías -->
  558.               <button class=\"filter-title\" data-bs-toggle=\"collapse\" data-bs-target=\"#filter-category\" aria-expanded=\"true\" type=\"button\">
  559.                   Filtrar por Categorías <span class=\"arrow\">▼</span>
  560.               </button>
  561.               <div id=\"filter-category\" class=\"collapse show\">
  562.                   <div class=\"checkbox-container\">
  563.                       {% for category in categories %}
  564.                           <div class=\"form-check\">
  565.                               <input class=\"form-check-input category-checkbox\" type=\"checkbox\" name=\"category\" id=\"cat{{ category.id }}\" value=\"{{ category.id }}\"
  566.                                   {% if app.request.get('category') == category.id|trans %}checked{% endif %}>
  567.                               <label class=\"form-check-label\" for=\"cat{{ category.id }}\">{{ category.name }}</label>
  568.                           </div>
  569.                       {% endfor %}
  570.                   </div>
  571.               </div>
  572.           </form>
  573.       </div>
  574.   </div>
  575. </div>
  576.     
  577.     
  578. </body>
  579. <script>
  580.     document.getElementById('priceRange').addEventListener('input', function() {
  581.         document.getElementById('priceValue').innerText = this.value;
  582.     });
  583. </script>
  584. <script>
  585.     document.addEventListener(\"DOMContentLoaded\", function () {
  586.         const checkboxes = document.querySelectorAll(\".category-checkbox\");
  587.         checkboxes.forEach(checkbox => {
  588.             checkbox.addEventListener(\"click\", function () {
  589.                 if (this.checked) {
  590.                     checkboxes.forEach(cb => {
  591.                         if (cb !== this) cb.checked = false; // Desmarca los otros
  592.                     });
  593.                 }
  594.             });
  595.         });
  596.     });
  597. </script>
  598. {% endblock %}
  599. ""order/index.html.twig""/home/u619587673/domains/tcgbunker.shop/templates/order/index.html.twig");
  600.     }
  601. }