<?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;
/* front/search/results.html.twig */
class __TwigTemplate_d1d19f68ed5b9fb543d9fbd9df5921ea extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'bodyClass' => [$this, 'block_bodyClass'],
'metas' => [$this, 'block_metas'],
'breadcrumbs' => [$this, 'block_breadcrumbs'],
'content' => [$this, 'block_content'],
'javascripts' => [$this, 'block_javascripts'],
];
}
protected function doGetParent(array $context)
{
// line 1
return "front/front.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$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", "front/search/results.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/search/results.html.twig"));
$this->parent = $this->loadTemplate("front/front.html.twig", "front/search/results.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
public function block_bodyClass($context, array $blocks = [])
{
$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", "bodyClass"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "bodyClass"));
yield "search";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return; yield '';
}
// line 5
public function block_metas($context, array $blocks = [])
{
$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", "metas"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "metas"));
// line 6
yield " <title>";
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Resultats de la recherche pour", [], "messages");
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["query"]) || array_key_exists("query", $context) ? $context["query"] : (function () { throw new RuntimeError('Variable "query" does not exist.', 6, $this->source); })()), "html");
yield "</title>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return; yield '';
}
// line 9
public function block_breadcrumbs($context, array $blocks = [])
{
$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", "breadcrumbs"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "breadcrumbs"));
// line 10
yield " ";
yield from $this->loadTemplate("front/layout/breadcrumbs.html.twig", "front/search/results.html.twig", 10)->unwrap()->yield(CoreExtension::merge($context, ["query" => (isset($context["query"]) || array_key_exists("query", $context) ? $context["query"] : (function () { throw new RuntimeError('Variable "query" does not exist.', 10, $this->source); })())]));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return; yield '';
}
// line 13
public function block_content($context, array $blocks = [])
{
$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", "content"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
// line 14
yield "
<div class=\"ctn\">
";
// line 21
yield " <div class=\"search-page-results\">
<h1 class=\"header\">";
// line 22
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Tous les résultats pour votre recherche", [], "messages");
yield " \"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["query"]) || array_key_exists("query", $context) ? $context["query"] : (function () { throw new RuntimeError('Variable "query" does not exist.', 22, $this->source); })()), "html");
yield "\"</h1>
<div class=\"results\">
";
// line 24
yield from $this->loadTemplate("front/catalog/product/list.html.twig", "front/search/results.html.twig", 24)->unwrap()->yield(CoreExtension::merge($context, ["products" => (isset($context["results"]) || array_key_exists("results", $context) ? $context["results"] : (function () { throw new RuntimeError('Variable "results" does not exist.', 24, $this->source); })()), "listClass" => "wide-list", "nbPages" => 0]));
// line 25
yield " </div>
";
// line 26
if (array_key_exists("nbPages", $context)) {
// line 27
yield " ";
if ((((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 27, $this->source); })()) == "exact") && ((isset($context["nbPages"]) || array_key_exists("nbPages", $context) ? $context["nbPages"] : (function () { throw new RuntimeError('Variable "nbPages" does not exist.', 27, $this->source); })()) == (isset($context["page"]) || array_key_exists("page", $context) ? $context["page"] : (function () { throw new RuntimeError('Variable "page" does not exist.', 27, $this->source); })())))) {
// line 28
yield " <div class=\"center pagination\">
<button class=\"button more-results\" data-page=\"";
// line 29
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["page"]) || array_key_exists("page", $context) ? $context["page"] : (function () { throw new RuntimeError('Variable "page" does not exist.', 29, $this->source); })()), "html", null, true);
yield "\" data-nbpages=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["nbPages"]) || array_key_exists("nbPages", $context) ? $context["nbPages"] : (function () { throw new RuntimeError('Variable "nbPages" does not exist.', 29, $this->source); })()), "html", null, true);
yield "\" data-mode=\"keywords\">";
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Plus de résultats", [], "messages");
yield "</button>
</div>
";
} elseif (( // line 31
(isset($context["nbPages"]) || array_key_exists("nbPages", $context) ? $context["nbPages"] : (function () { throw new RuntimeError('Variable "nbPages" does not exist.', 31, $this->source); })()) > 1)) {
// line 32
yield " <div class=\"center pagination\">
<button class=\"button more-results\" data-page=\"";
// line 33
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["page"]) || array_key_exists("page", $context) ? $context["page"] : (function () { throw new RuntimeError('Variable "page" does not exist.', 33, $this->source); })()), "html", null, true);
yield "\" data-nbpages=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["nbPages"]) || array_key_exists("nbPages", $context) ? $context["nbPages"] : (function () { throw new RuntimeError('Variable "nbPages" does not exist.', 33, $this->source); })()), "html", null, true);
yield "\" data-mode=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 33, $this->source); })()), "html", null, true);
yield "\">";
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Plus de résultats", [], "messages");
yield "</button>
</div>
";
}
// line 36
yield " ";
}
// line 37
yield " </div>
</div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return; yield '';
}
// line 41
public function block_javascripts($context, array $blocks = [])
{
$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", "javascripts"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
// line 42
yield "<script>
\$(document).ready(function(){
var searchMode = '";
// line 44
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 44, $this->source); })()), "html", null, true);
yield "';
\$('.more-results').click(function(){
var page = parseInt(\$(this).data('page'),10)+1;
var nbPages = parseInt(\$(this).data('nbpages'),10);
var mode = \$(this).data('mode');
var pagin = \$(this).closest('.pagination');
if((page<=nbPages) || (mode != searchMode)){
pagin.addClass('loading');
\$.get(document.location,{p:page, mode:mode},function(response){
pagin.removeClass('loading');
pagin.find('.more-results').data('page',page);
if(page>=nbPages){
pagin.remove();
}
\$('.search-page-results .results ul').append(response);
}, 'text');
}else{
pagin.hide();;
}
});
});
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return; yield '';
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "front/search/results.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 223 => 44, 219 => 42, 209 => 41, 196 => 37, 193 => 36, 181 => 33, 178 => 32, 176 => 31, 167 => 29, 164 => 28, 161 => 27, 159 => 26, 156 => 25, 154 => 24, 147 => 22, 144 => 21, 140 => 14, 130 => 13, 118 => 10, 108 => 9, 93 => 6, 83 => 5, 63 => 3, 40 => 1,);
}
public function getSourceContext()
{
return new Source("{% extends 'front/front.html.twig' %}
{% block bodyClass %}search{% endblock %}
{% block metas %}
<title>{% trans %}Resultats de la recherche pour {% endtrans %}{{ query|e('html') }}</title>
{% endblock %}
{% block breadcrumbs %}
{% include 'front/layout/breadcrumbs.html.twig' with {query:query} %}
{% endblock %}
{% block content %}
<div class=\"ctn\">
{# <form class=\"search-form\" action=\"{{ path('search') }}\" method=\"GET\">
<label for=\"top-search-input\">{% trans %}Rechercher{% endtrans %}</label>
<input type=\"text\" name=\"q\" value=\"{{ query }}\" id=\"top-search-input\">
</form>
#}
<div class=\"search-page-results\">
<h1 class=\"header\">{#{{ nbResults }} #}{% trans %}Tous les résultats pour votre recherche{% endtrans %} \"{{ query|e('html') }}\"</h1>
<div class=\"results\">
{% include 'front/catalog/product/list.html.twig' with {products:results, listClass:'wide-list', nbPages:0} %}
</div>
{% if nbPages is defined %}
{% if (mode == 'exact') and (nbPages == page) %}
<div class=\"center pagination\">
<button class=\"button more-results\" data-page=\"{{ page }}\" data-nbpages=\"{{ nbPages }}\" data-mode=\"keywords\">{% trans %}Plus de résultats{% endtrans %}</button>
</div>
{% elseif (nbPages > 1) %}
<div class=\"center pagination\">
<button class=\"button more-results\" data-page=\"{{ page }}\" data-nbpages=\"{{ nbPages }}\" data-mode=\"{{ mode }}\">{% trans %}Plus de résultats{% endtrans %}</button>
</div>
{% endif %}
{% endif %}
</div>
</div>
{% endblock %}
{% block javascripts %}
<script>
\$(document).ready(function(){
var searchMode = '{{ mode }}';
\$('.more-results').click(function(){
var page = parseInt(\$(this).data('page'),10)+1;
var nbPages = parseInt(\$(this).data('nbpages'),10);
var mode = \$(this).data('mode');
var pagin = \$(this).closest('.pagination');
if((page<=nbPages) || (mode != searchMode)){
pagin.addClass('loading');
\$.get(document.location,{p:page, mode:mode},function(response){
pagin.removeClass('loading');
pagin.find('.more-results').data('page',page);
if(page>=nbPages){
pagin.remove();
}
\$('.search-page-results .results ul').append(response);
}, 'text');
}else{
pagin.hide();;
}
});
});
</script>
{% endblock %}", "front/search/results.html.twig", "/var/www/dogcat.com/v2-test/templates/front/search/results.html.twig");
}
}