var/cache/dev/twig/63/634e2efb9b8b869558c00224844f6044.php line 170

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. /* front/search/results.html.twig */
  16. class __TwigTemplate_8e91aae00706271e94351d5e561f00fd 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. 'bodyClass' => [$this, 'block_bodyClass'],
  29. 'metas' => [$this, 'block_metas'],
  30. 'breadcrumbs' => [$this, 'block_breadcrumbs'],
  31. 'content' => [$this, 'block_content'],
  32. 'javascripts' => [$this, 'block_javascripts'],
  33. ];
  34. }
  35. protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
  36. {
  37. // line 1
  38. return "front/front.html.twig";
  39. }
  40. protected function doDisplay(array $context, array $blocks = []): iterable
  41. {
  42. $macros = $this->macros;
  43. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  44. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/search/results.html.twig"));
  45. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  46. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/search/results.html.twig"));
  47. $this->parent = $this->load("front/front.html.twig", 1);
  48. yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
  49. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  50. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  51. }
  52. // line 3
  53. /**
  54. * @return iterable<null|scalar|\Stringable>
  55. */
  56. public function block_bodyClass(array $context, array $blocks = []): iterable
  57. {
  58. $macros = $this->macros;
  59. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  60. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "bodyClass"));
  61. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  62. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "bodyClass"));
  63. yield "search";
  64. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  65. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  66. yield from [];
  67. }
  68. // line 5
  69. /**
  70. * @return iterable<null|scalar|\Stringable>
  71. */
  72. public function block_metas(array $context, array $blocks = []): iterable
  73. {
  74. $macros = $this->macros;
  75. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  76. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "metas"));
  77. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  78. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "metas"));
  79. // line 6
  80. yield " <title>";
  81. yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Resultats de la recherche pour", [], "messages");
  82. 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");
  83. yield "</title>
  84. ";
  85. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  86. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  87. yield from [];
  88. }
  89. // line 9
  90. /**
  91. * @return iterable<null|scalar|\Stringable>
  92. */
  93. public function block_breadcrumbs(array $context, array $blocks = []): iterable
  94. {
  95. $macros = $this->macros;
  96. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  97. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "breadcrumbs"));
  98. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  99. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "breadcrumbs"));
  100. // line 10
  101. yield " ";
  102. yield from $this->load("front/layout/breadcrumbs.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); })())]));
  103. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  104. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  105. yield from [];
  106. }
  107. // line 13
  108. /**
  109. * @return iterable<null|scalar|\Stringable>
  110. */
  111. public function block_content(array $context, array $blocks = []): iterable
  112. {
  113. $macros = $this->macros;
  114. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  115. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
  116. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  117. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
  118. // line 14
  119. yield "
  120. <div class=\"ctn\">
  121. ";
  122. // line 21
  123. yield " <div class=\"search-page-results\">
  124. <h1 class=\"header\">";
  125. // line 22
  126. yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Tous les résultats pour votre recherche", [], "messages");
  127. yield " \"";
  128. 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");
  129. yield "\"</h1>
  130. <div class=\"results\">
  131. ";
  132. // line 24
  133. yield from $this->load("front/catalog/product/list.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]));
  134. // line 25
  135. yield " </div>
  136. ";
  137. // line 26
  138. if (array_key_exists("nbPages", $context)) {
  139. // line 27
  140. yield " ";
  141. 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); })())))) {
  142. // line 28
  143. yield " <div class=\"center pagination\">
  144. <button class=\"button more-results\" data-page=\"";
  145. // line 29
  146. 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);
  147. yield "\" data-nbpages=\"";
  148. 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);
  149. yield "\" data-mode=\"keywords\">";
  150. yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Plus de résultats", [], "messages");
  151. yield "</button>
  152. </div>
  153. ";
  154. } elseif (( // line 31
  155. (isset($context["nbPages"]) || array_key_exists("nbPages", $context) ? $context["nbPages"] : (function () { throw new RuntimeError('Variable "nbPages" does not exist.', 31, $this->source); })()) > 1)) {
  156. // line 32
  157. yield " <div class=\"center pagination\">
  158. <button class=\"button more-results\" data-page=\"";
  159. // line 33
  160. 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);
  161. yield "\" data-nbpages=\"";
  162. 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);
  163. yield "\" data-mode=\"";
  164. 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);
  165. yield "\">";
  166. yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Plus de résultats", [], "messages");
  167. yield "</button>
  168. </div>
  169. ";
  170. }
  171. // line 36
  172. yield " ";
  173. }
  174. // line 37
  175. yield " </div>
  176. </div>
  177. ";
  178. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  179. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  180. yield from [];
  181. }
  182. // line 41
  183. /**
  184. * @return iterable<null|scalar|\Stringable>
  185. */
  186. public function block_javascripts(array $context, array $blocks = []): iterable
  187. {
  188. $macros = $this->macros;
  189. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  190. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
  191. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  192. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
  193. // line 42
  194. yield "<script>
  195. \$(document).ready(function(){
  196. var searchMode = \x27";
  197. // line 44
  198. 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);
  199. yield "\x27;
  200. \$(\x27.more-results\x27).click(function(){
  201. var page = parseInt(\$(this).data(\x27page\x27),10)+1;
  202. var nbPages = parseInt(\$(this).data(\x27nbpages\x27),10);
  203. var mode = \$(this).data(\x27mode\x27);
  204. var pagin = \$(this).closest(\x27.pagination\x27);
  205. if((page<=nbPages) || (mode != searchMode)){
  206. pagin.addClass(\x27loading\x27);
  207. \$.get(document.location,{p:page, mode:mode},function(response){
  208. pagin.removeClass(\x27loading\x27);
  209. pagin.find(\x27.more-results\x27).data(\x27page\x27,page);
  210. if(page>=nbPages){
  211. pagin.remove();
  212. }
  213. \$(\x27.search-page-results .results ul\x27).append(response);
  214. }, \x27text\x27);
  215. }else{
  216. pagin.hide();;
  217. }
  218. });
  219. });
  220. </script>
  221. ";
  222. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  223. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  224. yield from [];
  225. }
  226. /**
  227. * @codeCoverageIgnore
  228. */
  229. public function getTemplateName(): string
  230. {
  231. return "front/search/results.html.twig";
  232. }
  233. /**
  234. * @codeCoverageIgnore
  235. */
  236. public function isTraitable(): bool
  237. {
  238. return false;
  239. }
  240. /**
  241. * @codeCoverageIgnore
  242. */
  243. public function getDebugInfo(): array
  244. {
  245. return array ( 242 => 44, 238 => 42, 225 => 41, 212 => 37, 209 => 36, 197 => 33, 194 => 32, 192 => 31, 183 => 29, 180 => 28, 177 => 27, 175 => 26, 172 => 25, 170 => 24, 163 => 22, 160 => 21, 156 => 14, 143 => 13, 131 => 10, 118 => 9, 103 => 6, 90 => 5, 67 => 3, 44 => 1,);
  246. }
  247. public function getSourceContext(): Source
  248. {
  249. return new Source("{% extends \x27front/front.html.twig\x27 %}
  250. {% block bodyClass %}search{% endblock %}
  251. {% block metas %}
  252. <title>{% trans %}Resultats de la recherche pour {% endtrans %}{{ query|e(\x27html\x27) }}</title>
  253. {% endblock %}
  254. {% block breadcrumbs %}
  255. {% include \x27front/layout/breadcrumbs.html.twig\x27 with {query:query} %}
  256. {% endblock %}
  257. {% block content %}
  258. <div class=\"ctn\">
  259. {# <form class=\"search-form\" action=\"{{ path(\x27search\x27) }}\" method=\"GET\">
  260. <label for=\"top-search-input\">{% trans %}Rechercher{% endtrans %}</label>
  261. <input type=\"text\" name=\"q\" value=\"{{ query }}\" id=\"top-search-input\">
  262. </form>
  263. #}
  264. <div class=\"search-page-results\">
  265. <h1 class=\"header\">{#{{ nbResults }} #}{% trans %}Tous les résultats pour votre recherche{% endtrans %} \"{{ query|e(\x27html\x27) }}\"</h1>
  266. <div class=\"results\">
  267. {% include \x27front/catalog/product/list.html.twig\x27 with {products:results, listClass:\x27wide-list\x27, nbPages:0} %}
  268. </div>
  269. {% if nbPages is defined %}
  270. {% if (mode == \x27exact\x27) and (nbPages == page) %}
  271. <div class=\"center pagination\">
  272. <button class=\"button more-results\" data-page=\"{{ page }}\" data-nbpages=\"{{ nbPages }}\" data-mode=\"keywords\">{% trans %}Plus de résultats{% endtrans %}</button>
  273. </div>
  274. {% elseif (nbPages > 1) %}
  275. <div class=\"center pagination\">
  276. <button class=\"button more-results\" data-page=\"{{ page }}\" data-nbpages=\"{{ nbPages }}\" data-mode=\"{{ mode }}\">{% trans %}Plus de résultats{% endtrans %}</button>
  277. </div>
  278. {% endif %}
  279. {% endif %}
  280. </div>
  281. </div>
  282. {% endblock %}
  283. {% block javascripts %}
  284. <script>
  285. \$(document).ready(function(){
  286. var searchMode = \x27{{ mode }}\x27;
  287. \$(\x27.more-results\x27).click(function(){
  288. var page = parseInt(\$(this).data(\x27page\x27),10)+1;
  289. var nbPages = parseInt(\$(this).data(\x27nbpages\x27),10);
  290. var mode = \$(this).data(\x27mode\x27);
  291. var pagin = \$(this).closest(\x27.pagination\x27);
  292. if((page<=nbPages) || (mode != searchMode)){
  293. pagin.addClass(\x27loading\x27);
  294. \$.get(document.location,{p:page, mode:mode},function(response){
  295. pagin.removeClass(\x27loading\x27);
  296. pagin.find(\x27.more-results\x27).data(\x27page\x27,page);
  297. if(page>=nbPages){
  298. pagin.remove();
  299. }
  300. \$(\x27.search-page-results .results ul\x27).append(response);
  301. }, \x27text\x27);
  302. }else{
  303. pagin.hide();;
  304. }
  305. });
  306. });
  307. </script>
  308. {% endblock %}", "front/search/results.html.twig", "/var/www/dogcat.com/v2-test/templates/front/search/results.html.twig");
  309. }
  310. }