var/cache/dev/twig/a3/a3419527495b71bf78c7ecc492f1148a.php line 60

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. /* ECommerce/App/Synonym/find_synonym_product.ajax.twig */
  16. class __TwigTemplate_b1572d886b84e73ea8fe32d63c1ca832 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->parent = false;
  28. $this->blocks = [
  29. ];
  30. }
  31. protected function doDisplay(array $context, array $blocks = []): iterable
  32. {
  33. $macros = $this->macros;
  34. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  35. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "ECommerce/App/Synonym/find_synonym_product.ajax.twig"));
  36. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  37. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "ECommerce/App/Synonym/find_synonym_product.ajax.twig"));
  38. // line 59
  39. $macros["͜macros"] = $this->macros["͜macros"] = $this;
  40. // line 61
  41. if ((($tmp = (isset($context["wrapped"]) || array_key_exists("wrapped", $context) ? $context["wrapped"] : (function () { throw new RuntimeError('Variable "wrapped" does not exist.', 61, $this->source); })())) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  42. // line 62
  43. yield "<div class=\"container table-like\">
  44. <div class=\"row row-header sticky-top bg-white pt-3 pb-3\">
  45. <div class=\"col-sm-3\">Title</div>
  46. <div class=\"col-sm-2\">Manufacturer</div>
  47. <div class=\"col-sm-5\">Description</div>
  48. <div class=\"col-sm-2\">Match</div>
  49. </div>";
  50. // line 69
  51. yield $macros["͜macros"]->getTemplateForMacro("macro_content", $context, 69, $this->getSourceContext())->macro_content(...[(isset($context["synonymProducts"]) || array_key_exists("synonymProducts", $context) ? $context["synonymProducts"] : (function () { throw new RuntimeError('Variable "synonymProducts" does not exist.', 69, $this->source); })()), (isset($context["title"]) || array_key_exists("title", $context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.', 69, $this->source); })())]);
  52. // line 70
  53. yield "</div>";
  54. } else {
  55. // line 72
  56. yield $macros["͜macros"]->getTemplateForMacro("macro_content", $context, 72, $this->getSourceContext())->macro_content(...[(isset($context["synonymProducts"]) || array_key_exists("synonymProducts", $context) ? $context["synonymProducts"] : (function () { throw new RuntimeError('Variable "synonymProducts" does not exist.', 72, $this->source); })()), (isset($context["title"]) || array_key_exists("title", $context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.', 72, $this->source); })())]);
  57. }
  58. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  59. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  60. yield from [];
  61. }
  62. // line 3
  63. public function macro_synonymRow($synonym = null, ...$varargs): string|Markup
  64. {
  65. $macros = $this->macros;
  66. $context = [
  67. "synonym" => $synonym,
  68. "varargs" => $varargs,
  69. ] + $this->env->getGlobals();
  70. $blocks = [];
  71. return ('' === $tmp = \Twig\Extension\CoreExtension::captureOutput((function () use (&$context, $macros, $blocks) {
  72. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  73. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "synonymRow"));
  74. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  75. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "synonymRow"));
  76. // line 4
  77. yield "<div class=\"row synonym-row\">
  78. <div class=\"col-sm-3\">";
  79. // line 5
  80. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["synonym"]) || array_key_exists("synonym", $context) ? $context["synonym"] : (function () { throw new RuntimeError('Variable "synonym" does not exist.', 5, $this->source); })()), "title", [], "any", false, false, false, 5), "html", null, true);
  81. yield "</div>
  82. <div class=\"col-sm-2\">";
  83. // line 6
  84. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["synonym"]) || array_key_exists("synonym", $context) ? $context["synonym"] : (function () { throw new RuntimeError('Variable "synonym" does not exist.', 6, $this->source); })()), "manufacturer", [], "any", false, false, false, 6), "html", null, true);
  85. yield "</div>
  86. <div class=\"col-sm-5\">";
  87. // line 7
  88. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["synonym"]) || array_key_exists("synonym", $context) ? $context["synonym"] : (function () { throw new RuntimeError('Variable "synonym" does not exist.', 7, $this->source); })()), "description", [], "any", false, false, false, 7), "html", null, true);
  89. yield "</div>
  90. ";
  91. // line 8
  92. if ((($tmp = !CoreExtension::getAttribute($this->env, $this->source, (isset($context["synonym"]) || array_key_exists("synonym", $context) ? $context["synonym"] : (function () { throw new RuntimeError('Variable "synonym" does not exist.', 8, $this->source); })()), "isPartial", [], "any", false, false, false, 8)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  93. // line 9
  94. yield " <div class=\"col-sm-2 synonym-category synonym-category-";
  95. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["synonym"]) || array_key_exists("synonym", $context) ? $context["synonym"] : (function () { throw new RuntimeError('Variable "synonym" does not exist.', 9, $this->source); })()), "categoryName", [], "any", false, false, false, 9), "html", null, true);
  96. yield "\">
  97. ";
  98. // line 10
  99. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(("synonym.category." . CoreExtension::getAttribute($this->env, $this->source, (isset($context["synonym"]) || array_key_exists("synonym", $context) ? $context["synonym"] : (function () { throw new RuntimeError('Variable "synonym" does not exist.', 10, $this->source); })()), "categoryName", [], "any", false, false, false, 10)), [], "ECommerceBundle"), "html", null, true);
  100. yield "
  101. </div>
  102. ";
  103. }
  104. // line 13
  105. yield " </div>";
  106. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  107. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  108. yield from [];
  109. })())) ? '' : new Markup($tmp, $this->env->getCharset());
  110. }
  111. // line 16
  112. public function macro_content($synonymProducts = null, $title = null, ...$varargs): string|Markup
  113. {
  114. $macros = $this->macros;
  115. $context = [
  116. "synonymProducts" => $synonymProducts,
  117. "title" => $title,
  118. "varargs" => $varargs,
  119. ] + $this->env->getGlobals();
  120. $blocks = [];
  121. return ('' === $tmp = \Twig\Extension\CoreExtension::captureOutput((function () use (&$context, $macros, $blocks) {
  122. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  123. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "content"));
  124. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  125. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "content"));
  126. // line 17
  127. $macros["͜macros"] = $this;
  128. // line 18
  129. yield " ";
  130. $context["brakePoint"] = 2;
  131. // line 19
  132. yield " ";
  133. $context['_parent'] = $context;
  134. $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, (isset($context["synonymProducts"]) || array_key_exists("synonymProducts", $context) ? $context["synonymProducts"] : (function () { throw new RuntimeError('Variable "synonymProducts" does not exist.', 19, $this->source); })()), "currentPageResults", [], "any", false, false, false, 19));
  135. foreach ($context['_seq'] as $context["_key"] => $context["synonymProduct"]) {
  136. // line 20
  137. yield " <div class=\"row synonym-product-row\">
  138. <div class=\"col-sm-3\">";
  139. // line 21
  140. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["synonymProduct"], "title", [], "any", false, false, false, 21), "html", null, true);
  141. yield "</div>
  142. <div class=\"col-sm-2\">";
  143. // line 22
  144. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["synonymProduct"], "manufacturer", [], "any", false, false, false, 22), "html", null, true);
  145. yield "</div>
  146. <div class=\"col-sm-5\">";
  147. // line 23
  148. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["synonymProduct"], "description", [], "any", false, false, false, 23), "html", null, true);
  149. yield "</div>
  150. </div>
  151. ";
  152. // line 26
  153. $context["unSimilar"] = CoreExtension::getAttribute($this->env, $this->source, $context["synonymProduct"], "unSimilarSynonyms", [(isset($context["title"]) || array_key_exists("title", $context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.', 26, $this->source); })())], "method", false, false, false, 26);
  154. // line 27
  155. yield "
  156. ";
  157. // line 28
  158. if ((Twig\Extension\CoreExtension::length($this->env->getCharset(), (isset($context["unSimilar"]) || array_key_exists("unSimilar", $context) ? $context["unSimilar"] : (function () { throw new RuntimeError('Variable "unSimilar" does not exist.', 28, $this->source); })())) < 10)) {
  159. // line 29
  160. yield " ";
  161. $context['_parent'] = $context;
  162. $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, $context["synonymProduct"], "synonyms", [], "any", false, false, false, 29));
  163. foreach ($context['_seq'] as $context["_key"] => $context["synonym"]) {
  164. // line 30
  165. yield " ";
  166. yield $macros["͜macros"]->getTemplateForMacro("macro_synonymRow", $context, 30, $this->getSourceContext())->macro_synonymRow(...[$context["synonym"]]);
  167. yield "
  168. ";
  169. }
  170. $_parent = $context['_parent'];
  171. unset($context['_seq'], $context['_key'], $context['synonym'], $context['_parent']);
  172. $context = array_intersect_key($context, $_parent) + $_parent;
  173. // line 32
  174. yield " ";
  175. } else {
  176. // line 33
  177. yield " ";
  178. $context["similar"] = CoreExtension::getAttribute($this->env, $this->source, $context["synonymProduct"], "similarSynonyms", [(isset($context["title"]) || array_key_exists("title", $context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.', 33, $this->source); })())], "method", false, false, false, 33);
  179. // line 34
  180. yield " ";
  181. $context['_parent'] = $context;
  182. $context['_seq'] = CoreExtension::ensureTraversable((isset($context["similar"]) || array_key_exists("similar", $context) ? $context["similar"] : (function () { throw new RuntimeError('Variable "similar" does not exist.', 34, $this->source); })()));
  183. foreach ($context['_seq'] as $context["_key"] => $context["synonym"]) {
  184. // line 35
  185. yield " ";
  186. yield $macros["͜macros"]->getTemplateForMacro("macro_synonymRow", $context, 35, $this->getSourceContext())->macro_synonymRow(...[$context["synonym"]]);
  187. yield "
  188. ";
  189. }
  190. $_parent = $context['_parent'];
  191. unset($context['_seq'], $context['_key'], $context['synonym'], $context['_parent']);
  192. $context = array_intersect_key($context, $_parent) + $_parent;
  193. // line 37
  194. yield "
  195. ";
  196. // line 38
  197. if ((($tmp = !Twig\Extension\CoreExtension::testEmpty((isset($context["unSimilar"]) || array_key_exists("unSimilar", $context) ? $context["unSimilar"] : (function () { throw new RuntimeError('Variable "unSimilar" does not exist.', 38, $this->source); })()))) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  198. // line 39
  199. yield " <div class=\"synonym-groups row\">
  200. <button class=\"col btn btn-light\" type=\"button\"
  201. data-toggle=\"collapse\"
  202. data-target=\"#collapse-synonym-group-";
  203. // line 42
  204. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["synonymProduct"], "id", [], "any", false, false, false, 42), "html", null, true);
  205. yield "\"
  206. aria-expanded=\"false\"
  207. aria-controls=\"collapse-synonym-group-";
  208. // line 44
  209. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["synonymProduct"], "id", [], "any", false, false, false, 44), "html", null, true);
  210. yield "\">
  211. ";
  212. // line 45
  213. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("synonym.page.show_rest", [], "ECommerceBundle"), "html", null, true);
  214. yield "
  215. </button>
  216. <div class=\"w-100\"></div>
  217. <div id=\"collapse-synonym-group-";
  218. // line 48
  219. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["synonymProduct"], "id", [], "any", false, false, false, 48), "html", null, true);
  220. yield "\" class=\"col collapse\">
  221. ";
  222. // line 49
  223. $context['_parent'] = $context;
  224. $context['_seq'] = CoreExtension::ensureTraversable((isset($context["unSimilar"]) || array_key_exists("unSimilar", $context) ? $context["unSimilar"] : (function () { throw new RuntimeError('Variable "unSimilar" does not exist.', 49, $this->source); })()));
  225. foreach ($context['_seq'] as $context["_key"] => $context["synonym"]) {
  226. // line 50
  227. yield " ";
  228. yield $macros["͜macros"]->getTemplateForMacro("macro_synonymRow", $context, 50, $this->getSourceContext())->macro_synonymRow(...[$context["synonym"]]);
  229. yield "
  230. ";
  231. }
  232. $_parent = $context['_parent'];
  233. unset($context['_seq'], $context['_key'], $context['synonym'], $context['_parent']);
  234. $context = array_intersect_key($context, $_parent) + $_parent;
  235. // line 52
  236. yield " </div>
  237. </div>
  238. ";
  239. }
  240. // line 55
  241. yield " ";
  242. }
  243. // line 56
  244. yield " ";
  245. }
  246. $_parent = $context['_parent'];
  247. unset($context['_seq'], $context['_key'], $context['synonymProduct'], $context['_parent']);
  248. $context = array_intersect_key($context, $_parent) + $_parent;
  249. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  250. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  251. yield from [];
  252. })())) ? '' : new Markup($tmp, $this->env->getCharset());
  253. }
  254. /**
  255. * @codeCoverageIgnore
  256. */
  257. public function getTemplateName(): string
  258. {
  259. return "ECommerce/App/Synonym/find_synonym_product.ajax.twig";
  260. }
  261. /**
  262. * @codeCoverageIgnore
  263. */
  264. public function isTraitable(): bool
  265. {
  266. return false;
  267. }
  268. /**
  269. * @codeCoverageIgnore
  270. */
  271. public function getDebugInfo(): array
  272. {
  273. return array ( 272 => 56, 269 => 55, 264 => 52, 255 => 50, 251 => 49, 247 => 48, 241 => 45, 237 => 44, 232 => 42, 227 => 39, 225 => 38, 222 => 37, 213 => 35, 208 => 34, 205 => 33, 202 => 32, 193 => 30, 188 => 29, 186 => 28, 183 => 27, 181 => 26, 175 => 23, 171 => 22, 167 => 21, 164 => 20, 159 => 19, 156 => 18, 154 => 17, 135 => 16, 123 => 13, 117 => 10, 112 => 9, 110 => 8, 106 => 7, 102 => 6, 98 => 5, 95 => 4, 77 => 3, 65 => 72, 62 => 70, 60 => 69, 52 => 62, 50 => 61, 48 => 59,);
  274. }
  275. public function getSourceContext(): Source
  276. {
  277. return new Source("{%- trans_default_domain 'ECommerceBundle' -%}
  278. {%- macro synonymRow(synonym) -%}
  279. <div class=\"row synonym-row\">
  280. <div class=\"col-sm-3\">{{ synonym.title }}</div>
  281. <div class=\"col-sm-2\">{{ synonym.manufacturer }}</div>
  282. <div class=\"col-sm-5\">{{ synonym.description }}</div>
  283. {% if not synonym.isPartial %}
  284. <div class=\"col-sm-2 synonym-category synonym-category-{{ synonym.categoryName }}\">
  285. {{ ('synonym.category.' ~ synonym.categoryName)|trans }}
  286. </div>
  287. {% endif %}
  288. </div>
  289. {%- endmacro -%}
  290. {%- macro content(synonymProducts, title) -%}
  291. {% import _self as macros %}
  292. {% set brakePoint = 2 %}
  293. {% for synonymProduct in synonymProducts.currentPageResults %}
  294. <div class=\"row synonym-product-row\">
  295. <div class=\"col-sm-3\">{{ synonymProduct.title }}</div>
  296. <div class=\"col-sm-2\">{{ synonymProduct.manufacturer }}</div>
  297. <div class=\"col-sm-5\">{{ synonymProduct.description }}</div>
  298. </div>
  299. {% set unSimilar = synonymProduct.unSimilarSynonyms(title) %}
  300. {% if (unSimilar|length) < 10 %}
  301. {% for synonym in synonymProduct.synonyms %}
  302. {{ macros.synonymRow(synonym) }}
  303. {% endfor %}
  304. {% else %}
  305. {% set similar = synonymProduct.similarSynonyms(title) %}
  306. {% for synonym in similar %}
  307. {{ macros.synonymRow(synonym) }}
  308. {% endfor %}
  309. {% if unSimilar is not empty %}
  310. <div class=\"synonym-groups row\">
  311. <button class=\"col btn btn-light\" type=\"button\"
  312. data-toggle=\"collapse\"
  313. data-target=\"#collapse-synonym-group-{{ synonymProduct.id }}\"
  314. aria-expanded=\"false\"
  315. aria-controls=\"collapse-synonym-group-{{ synonymProduct.id }}\">
  316. {{ 'synonym.page.show_rest'|trans }}
  317. </button>
  318. <div class=\"w-100\"></div>
  319. <div id=\"collapse-synonym-group-{{ synonymProduct.id }}\" class=\"col collapse\">
  320. {% for synonym in unSimilar %}
  321. {{ macros.synonymRow(synonym) }}
  322. {% endfor %}
  323. </div>
  324. </div>
  325. {% endif %}
  326. {% endif %}
  327. {% endfor %}
  328. {%- endmacro -%}
  329. {%- import _self as macros -%}
  330. {%- if wrapped -%}
  331. <div class=\"container table-like\">
  332. <div class=\"row row-header sticky-top bg-white pt-3 pb-3\">
  333. <div class=\"col-sm-3\">Title</div>
  334. <div class=\"col-sm-2\">Manufacturer</div>
  335. <div class=\"col-sm-5\">Description</div>
  336. <div class=\"col-sm-2\">Match</div>
  337. </div>
  338. {{- macros.content(synonymProducts, title) -}}
  339. </div>
  340. {%- else -%}
  341. {{ macros.content(synonymProducts, title) }}
  342. {%- endif -%}", "ECommerce/App/Synonym/find_synonym_product.ajax.twig", "/var/www/rs.optima/templates/ECommerce/App/Synonym/find_synonym_product.ajax.twig");
  343. }
  344. }