<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* order/index.html.twig */
class __TwigTemplate_250eee5ef27d2aa555fdd63e7ca6fc7e extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'title' => [$this, 'block_title'],
'body' => [$this, 'block_body'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "base.html.twig";
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "order/index.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "order/index.html.twig"));
$this->parent = $this->load("base.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_title(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
yield "Pedir - Restaurante";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 5
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_body(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
// line 6
yield "
<style>
#confirmation-message{
transition: opacity 0.5s ease;
}
/* Estilo general del contenedor */
.filter-container {
position: sticky;
z-index: 1000;
background: rgba(255, 255, 255, 0.1); /* Fondo transparente */
padding: 15px;
border-radius: 10px;
}
/* Título del dropdown con separador negro y flecha */
.filter-title {
background: none;
border: none;
font-size: 16px;
font-weight: bold;
cursor: pointer;
width: 100%;
text-align: left;
padding: 10px;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 2px solid black; /* Línea separadora negra */
}
.filter-title:hover {
background: rgba(255, 255, 255, 0.1);
}
/* Icono de la flecha */
.filter-title .arrow {
transition: transform 0.3s ease;
}
/* Rango de precio */
.slider-container {
padding: 10px;
}
input[type=\"range\"] {
width: 100%;
accent-color: red;
}
input[type=\"range\"]::-webkit-slider-thumb {
background: black;
}
/* Checkboxes */
.checkbox-container {
padding: 10px;
}
.form-check-label {
margin-bottom: 10px;
}
.filter-container .btn-search{
border-start-end-radius: 30px;
border-end-end-radius: 30px;
background: white;
border: 0px;
}
/* Personalización del checkbox */
.category-checkbox {
appearance: none; /* Elimina el diseño predeterminado */
width: 18px;
height: 18px;
border: 2px solid #E63946; /* Borde rojo */
border-radius: 4px;
display: inline-block;
position: relative;
cursor: pointer;
}
/* Cuando está marcado, cambiar fondo y mostrar un check */
.category-checkbox:checked {
background-color: #E63946; /* Fondo rojo */
border: 2px solid #E63946;
}
/* Agregar un icono de check al marcar */
.category-checkbox:checked::after {
color: white;
font-size: 14px;
font-weight: bold;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
<body>
<!-- Header -->
";
// line 110
yield $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment(Symfony\Bridge\Twig\Extension\HttpKernelExtension::controller("App\\Controller\\HeaderController::index"));
yield "
<div class=\"container container-custom order-container mt-4\">
<div id=\"confirmation-message\" class=\"container alert alert-success d-none fixed-top\" role=\"alert\" style=\"margin-top: 90px\">
¡Producto añadido al carrito correctamente!
</div>
<div class=\"row\">
<div class=\"col-12 mb-3 title-block\">
<nav aria-label=\"breadcrumb\">
<ol class=\"breadcrumb\">
<li class=\"breadcrumb-item\"><a class=\"text-decoration-none section-title\" href=\"/\">Home</a></li>
";
// line 123
if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::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", false, false, false, 123), "get", ["category"], "method", false, false, false, 123)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 124
yield " ";
$context["selectedCategoryId"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::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", false, false, false, 124), "get", ["category"], "method", false, false, false, 124);
// line 125
yield " ";
$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", false, false, false, 125) == (isset($context["selectedCategoryId"]) || array_key_exists("selectedCategoryId", $context) ? $context["selectedCategoryId"] : (function () { throw new RuntimeError('Variable "selectedCategoryId" does not exist.', 125, $this->source); })())); }));
// line 126
yield "
<li class=\"breadcrumb-item\"><a class=\"text-decoration-none section-title\" href=\"";
// line 127
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_order");
yield "\">Productos</a></li>
";
// line 128
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)) {
// line 129
yield " <li class=\"breadcrumb-item active\" aria-current=\"page\">";
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", false, false, false, 129), "html", null, true);
yield "</li>
";
}
// line 131
yield " ";
} else {
// line 132
yield " <li class=\"breadcrumb-item active\" aria-current=\"page\">Productos</li>
";
}
// line 134
yield " </ol>
</nav>
<h1 class=\"section-title category-section my-4 \">Nuestros Productos</h1>
</div>
<!-- Productos -->
<div class=\"col-12 col-lg-12\" style=\"min-height: 50vh\">
<div class=\"row align-items-start\" >
";
// line 141
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); })())]));
// line 142
yield " </div>
</div>
</div>
</div>
";
// line 150
yield "<button class=\"btn btn-primary rounded-circle position-fixed \"
style=\"bottom: 20px; left: 20px; z-index: 1050; width: 50px; height: 50px;\"
type=\"button\"
data-bs-toggle=\"offcanvas\"
data-bs-target=\"#filterOffcanvas\"
aria-controls=\"filterOffcanvas\">
<i class=\"bi bi-filter\" style=\"font-size: 1.5rem;\"></i>
</button>
";
// line 160
yield "<div class=\"offcanvas offcanvas-start\" tabindex=\"-1\" id=\"filterOffcanvas\" aria-labelledby=\"filterOffcanvasLabel\">
<div class=\"offcanvas-header\">
<h5 class=\"offcanvas-title\" id=\"filterOffcanvasLabel\">Filtros</h5>
<button type=\"button\" class=\"btn-close text-reset\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\"></button>
</div>
<div class=\"offcanvas-body\">
<div class=\"filter-container pt-0\">
<form method=\"GET\" action=\"";
// line 167
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_order");
yield "\">
<button type=\"submit\" class=\"btn btn-primary w-100 mb-3\">Filtrar</button>
<!-- Filtro de Buscador -->
<button class=\"filter-title\" data-bs-toggle=\"collapse\" data-bs-target=\"#filter-search\" aria-expanded=\"true\" type=\"button\">
Filtrar por Nombre <span class=\"arrow\">▼</span>
</button>
<div id=\"filter-search\" class=\"collapse show\">
<div class=\"my-3 d-flex\">
<div class=\"input-group input-group-lg\">
<input type=\"search\" name=\"search\" class=\"form-control fs-6 bar-search\" placeholder=\"Nombre...\"
aria-label=\"Nombre\" value=\"";
// line 178
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::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", false, false, false, 178), "get", ["search"], "method", false, false, false, 178), "html", null, true);
yield "\">
</div>
</div>
</div>
<!-- Filtro de Precio -->
<button class=\"filter-title\" data-bs-toggle=\"collapse\" data-bs-target=\"#filter-price\" aria-expanded=\"true\" type=\"button\">
Filtrar por Precio <span class=\"arrow\">▼</span>
</button>
<div id=\"filter-price\" class=\"collapse show\">
<div class=\"slider-container\">
<input type=\"range\" name=\"price\" min=\"0\" max=\"";
// line 189
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", null, true);
yield "\" step=\"1\" id=\"priceRange\"
value=\"";
// line 190
yield ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::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", false, false, false, 190), "get", ["price"], "method", false, false, false, 190)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::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", false, false, false, 190), "get", ["price"], "method", false, false, false, 190), "html", null, true)) : ($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", null, true)));
yield "\">
<p class=\"fs-6\">Precio: <span id=\"priceValue\">";
// line 191
yield ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::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", false, false, false, 191), "get", ["price"], "method", false, false, false, 191)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::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", false, false, false, 191), "get", ["price"], "method", false, false, false, 191), "html", null, true)) : ($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", null, true)));
yield "</span>€</p>
</div>
</div>
<!-- Filtro de Categorías -->
<button class=\"filter-title\" data-bs-toggle=\"collapse\" data-bs-target=\"#filter-category\" aria-expanded=\"true\" type=\"button\">
Filtrar por Categorías <span class=\"arrow\">▼</span>
</button>
<div id=\"filter-category\" class=\"collapse show\">
<div class=\"checkbox-container\">
";
// line 201
$context['_parent'] = $context;
$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); })()));
foreach ($context['_seq'] as $context["_key"] => $context["category"]) {
// line 202
yield " <div class=\"form-check\">
<input class=\"form-check-input category-checkbox\" type=\"checkbox\" name=\"category\" id=\"cat";
// line 203
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["category"], "id", [], "any", false, false, false, 203), "html", null, true);
yield "\" value=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["category"], "id", [], "any", false, false, false, 203), "html", null, true);
yield "\"
";
// line 204
if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::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", false, false, false, 204), "get", ["category"], "method", false, false, false, 204) == $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(CoreExtension::getAttribute($this->env, $this->source, $context["category"], "id", [], "any", false, false, false, 204)))) {
yield "checked";
}
yield ">
<label class=\"form-check-label\" for=\"cat";
// line 205
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["category"], "id", [], "any", false, false, false, 205), "html", null, true);
yield "\">";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["category"], "name", [], "any", false, false, false, 205), "html", null, true);
yield "</label>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['category'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 208
yield " </div>
</div>
</form>
</div>
</div>
</div>
</body>
<script>
document.getElementById('priceRange').addEventListener('input', function() {
document.getElementById('priceValue').innerText = this.value;
});
</script>
<script>
document.addEventListener(\"DOMContentLoaded\", function () {
const checkboxes = document.querySelectorAll(\".category-checkbox\");
checkboxes.forEach(checkbox => {
checkbox.addEventListener(\"click\", function () {
if (this.checked) {
checkboxes.forEach(cb => {
if (cb !== this) cb.checked = false; // Desmarca los otros
});
}
});
});
});
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "order/index.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
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,);
}
public function getSourceContext(): Source
{
return new Source("{% extends 'base.html.twig' %}
{% block title %}Pedir - Restaurante{% endblock %}
{% block body %}
<style>
#confirmation-message{
transition: opacity 0.5s ease;
}
/* Estilo general del contenedor */
.filter-container {
position: sticky;
z-index: 1000;
background: rgba(255, 255, 255, 0.1); /* Fondo transparente */
padding: 15px;
border-radius: 10px;
}
/* Título del dropdown con separador negro y flecha */
.filter-title {
background: none;
border: none;
font-size: 16px;
font-weight: bold;
cursor: pointer;
width: 100%;
text-align: left;
padding: 10px;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 2px solid black; /* Línea separadora negra */
}
.filter-title:hover {
background: rgba(255, 255, 255, 0.1);
}
/* Icono de la flecha */
.filter-title .arrow {
transition: transform 0.3s ease;
}
/* Rango de precio */
.slider-container {
padding: 10px;
}
input[type=\"range\"] {
width: 100%;
accent-color: red;
}
input[type=\"range\"]::-webkit-slider-thumb {
background: black;
}
/* Checkboxes */
.checkbox-container {
padding: 10px;
}
.form-check-label {
margin-bottom: 10px;
}
.filter-container .btn-search{
border-start-end-radius: 30px;
border-end-end-radius: 30px;
background: white;
border: 0px;
}
/* Personalización del checkbox */
.category-checkbox {
appearance: none; /* Elimina el diseño predeterminado */
width: 18px;
height: 18px;
border: 2px solid #E63946; /* Borde rojo */
border-radius: 4px;
display: inline-block;
position: relative;
cursor: pointer;
}
/* Cuando está marcado, cambiar fondo y mostrar un check */
.category-checkbox:checked {
background-color: #E63946; /* Fondo rojo */
border: 2px solid #E63946;
}
/* Agregar un icono de check al marcar */
.category-checkbox:checked::after {
color: white;
font-size: 14px;
font-weight: bold;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
<body>
<!-- Header -->
{{ render(controller('App\\\\Controller\\\\HeaderController::index')) }}
<div class=\"container container-custom order-container mt-4\">
<div id=\"confirmation-message\" class=\"container alert alert-success d-none fixed-top\" role=\"alert\" style=\"margin-top: 90px\">
¡Producto añadido al carrito correctamente!
</div>
<div class=\"row\">
<div class=\"col-12 mb-3 title-block\">
<nav aria-label=\"breadcrumb\">
<ol class=\"breadcrumb\">
<li class=\"breadcrumb-item\"><a class=\"text-decoration-none section-title\" href=\"/\">Home</a></li>
{% if app.request.get('category') %}
{% set selectedCategoryId = app.request.get('category') %}
{% set selectedCategory = categories|filter(c => c.id == selectedCategoryId)|first %}
<li class=\"breadcrumb-item\"><a class=\"text-decoration-none section-title\" href=\"{{ path('app_order') }}\">Productos</a></li>
{% if selectedCategory %}
<li class=\"breadcrumb-item active\" aria-current=\"page\">{{ selectedCategory.name }}</li>
{% endif %}
{% else %}
<li class=\"breadcrumb-item active\" aria-current=\"page\">Productos</li>
{% endif %}
</ol>
</nav>
<h1 class=\"section-title category-section my-4 \">Nuestros Productos</h1>
</div>
<!-- Productos -->
<div class=\"col-12 col-lg-12\" style=\"min-height: 50vh\">
<div class=\"row align-items-start\" >
{% include \"components/products.html.twig\" with {'products': products} %}
</div>
</div>
</div>
</div>
{# Botón flotante para abrir el offcanvas de filtros #}
<button class=\"btn btn-primary rounded-circle position-fixed \"
style=\"bottom: 20px; left: 20px; z-index: 1050; width: 50px; height: 50px;\"
type=\"button\"
data-bs-toggle=\"offcanvas\"
data-bs-target=\"#filterOffcanvas\"
aria-controls=\"filterOffcanvas\">
<i class=\"bi bi-filter\" style=\"font-size: 1.5rem;\"></i>
</button>
{# Offcanvas que contendrá los filtros #}
<div class=\"offcanvas offcanvas-start\" tabindex=\"-1\" id=\"filterOffcanvas\" aria-labelledby=\"filterOffcanvasLabel\">
<div class=\"offcanvas-header\">
<h5 class=\"offcanvas-title\" id=\"filterOffcanvasLabel\">Filtros</h5>
<button type=\"button\" class=\"btn-close text-reset\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\"></button>
</div>
<div class=\"offcanvas-body\">
<div class=\"filter-container pt-0\">
<form method=\"GET\" action=\"{{ path('app_order') }}\">
<button type=\"submit\" class=\"btn btn-primary w-100 mb-3\">Filtrar</button>
<!-- Filtro de Buscador -->
<button class=\"filter-title\" data-bs-toggle=\"collapse\" data-bs-target=\"#filter-search\" aria-expanded=\"true\" type=\"button\">
Filtrar por Nombre <span class=\"arrow\">▼</span>
</button>
<div id=\"filter-search\" class=\"collapse show\">
<div class=\"my-3 d-flex\">
<div class=\"input-group input-group-lg\">
<input type=\"search\" name=\"search\" class=\"form-control fs-6 bar-search\" placeholder=\"Nombre...\"
aria-label=\"Nombre\" value=\"{{ app.request.get('search') }}\">
</div>
</div>
</div>
<!-- Filtro de Precio -->
<button class=\"filter-title\" data-bs-toggle=\"collapse\" data-bs-target=\"#filter-price\" aria-expanded=\"true\" type=\"button\">
Filtrar por Precio <span class=\"arrow\">▼</span>
</button>
<div id=\"filter-price\" class=\"collapse show\">
<div class=\"slider-container\">
<input type=\"range\" name=\"price\" min=\"0\" max=\"{{ max_price }}\" step=\"1\" id=\"priceRange\"
value=\"{{ app.request.get('price') ?: max_price }}\">
<p class=\"fs-6\">Precio: <span id=\"priceValue\">{{ app.request.get('price') ?: max_price }}</span>€</p>
</div>
</div>
<!-- Filtro de Categorías -->
<button class=\"filter-title\" data-bs-toggle=\"collapse\" data-bs-target=\"#filter-category\" aria-expanded=\"true\" type=\"button\">
Filtrar por Categorías <span class=\"arrow\">▼</span>
</button>
<div id=\"filter-category\" class=\"collapse show\">
<div class=\"checkbox-container\">
{% for category in categories %}
<div class=\"form-check\">
<input class=\"form-check-input category-checkbox\" type=\"checkbox\" name=\"category\" id=\"cat{{ category.id }}\" value=\"{{ category.id }}\"
{% if app.request.get('category') == category.id|trans %}checked{% endif %}>
<label class=\"form-check-label\" for=\"cat{{ category.id }}\">{{ category.name }}</label>
</div>
{% endfor %}
</div>
</div>
</form>
</div>
</div>
</div>
</body>
<script>
document.getElementById('priceRange').addEventListener('input', function() {
document.getElementById('priceValue').innerText = this.value;
});
</script>
<script>
document.addEventListener(\"DOMContentLoaded\", function () {
const checkboxes = document.querySelectorAll(\".category-checkbox\");
checkboxes.forEach(checkbox => {
checkbox.addEventListener(\"click\", function () {
if (this.checked) {
checkboxes.forEach(cb => {
if (cb !== this) cb.checked = false; // Desmarca los otros
});
}
});
});
});
</script>
{% endblock %}
", "order/index.html.twig", "/home/u619587673/domains/tcgbunker.shop/templates/order/index.html.twig");
}
}