<?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;
/* ECommerce/App/Synonym/find_synonym_product.ajax.twig */
class __TwigTemplate_b1572d886b84e73ea8fe32d63c1ca832 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->parent = false;
$this->blocks = [
];
}
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", "ECommerce/App/Synonym/find_synonym_product.ajax.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "ECommerce/App/Synonym/find_synonym_product.ajax.twig"));
// line 59
$macros["͜macros"] = $this->macros["͜macros"] = $this;
// line 61
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)) {
// line 62
yield "<div class=\"container table-like\">
<div class=\"row row-header sticky-top bg-white pt-3 pb-3\">
<div class=\"col-sm-3\">Title</div>
<div class=\"col-sm-2\">Manufacturer</div>
<div class=\"col-sm-5\">Description</div>
<div class=\"col-sm-2\">Match</div>
</div>";
// line 69
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); })())]);
// line 70
yield "</div>";
} else {
// line 72
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); })())]);
}
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
yield from [];
}
// line 3
public function macro_synonymRow($synonym = null, ...$varargs): string|Markup
{
$macros = $this->macros;
$context = [
"synonym" => $synonym,
"varargs" => $varargs,
] + $this->env->getGlobals();
$blocks = [];
return ('' === $tmp = \Twig\Extension\CoreExtension::captureOutput((function () use (&$context, $macros, $blocks) {
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "synonymRow"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "synonymRow"));
// line 4
yield "<div class=\"row synonym-row\">
<div class=\"col-sm-3\">";
// line 5
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);
yield "</div>
<div class=\"col-sm-2\">";
// line 6
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);
yield "</div>
<div class=\"col-sm-5\">";
// line 7
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);
yield "</div>
";
// line 8
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)) {
// line 9
yield " <div class=\"col-sm-2 synonym-category synonym-category-";
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);
yield "\">
";
// line 10
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);
yield "
</div>
";
}
// line 13
yield " </div>";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
})())) ? '' : new Markup($tmp, $this->env->getCharset());
}
// line 16
public function macro_content($synonymProducts = null, $title = null, ...$varargs): string|Markup
{
$macros = $this->macros;
$context = [
"synonymProducts" => $synonymProducts,
"title" => $title,
"varargs" => $varargs,
] + $this->env->getGlobals();
$blocks = [];
return ('' === $tmp = \Twig\Extension\CoreExtension::captureOutput((function () use (&$context, $macros, $blocks) {
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "content"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "content"));
// line 17
$macros["͜macros"] = $this;
// line 18
yield " ";
$context["brakePoint"] = 2;
// line 19
yield " ";
$context['_parent'] = $context;
$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));
foreach ($context['_seq'] as $context["_key"] => $context["synonymProduct"]) {
// line 20
yield " <div class=\"row synonym-product-row\">
<div class=\"col-sm-3\">";
// line 21
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);
yield "</div>
<div class=\"col-sm-2\">";
// line 22
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);
yield "</div>
<div class=\"col-sm-5\">";
// line 23
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);
yield "</div>
</div>
";
// line 26
$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);
// line 27
yield "
";
// line 28
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)) {
// line 29
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, $context["synonymProduct"], "synonyms", [], "any", false, false, false, 29));
foreach ($context['_seq'] as $context["_key"] => $context["synonym"]) {
// line 30
yield " ";
yield $macros["͜macros"]->getTemplateForMacro("macro_synonymRow", $context, 30, $this->getSourceContext())->macro_synonymRow(...[$context["synonym"]]);
yield "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['synonym'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 32
yield " ";
} else {
// line 33
yield " ";
$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);
// line 34
yield " ";
$context['_parent'] = $context;
$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); })()));
foreach ($context['_seq'] as $context["_key"] => $context["synonym"]) {
// line 35
yield " ";
yield $macros["͜macros"]->getTemplateForMacro("macro_synonymRow", $context, 35, $this->getSourceContext())->macro_synonymRow(...[$context["synonym"]]);
yield "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['synonym'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 37
yield "
";
// line 38
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)) {
// line 39
yield " <div class=\"synonym-groups row\">
<button class=\"col btn btn-light\" type=\"button\"
data-toggle=\"collapse\"
data-target=\"#collapse-synonym-group-";
// line 42
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);
yield "\"
aria-expanded=\"false\"
aria-controls=\"collapse-synonym-group-";
// line 44
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);
yield "\">
";
// line 45
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("synonym.page.show_rest", [], "ECommerceBundle"), "html", null, true);
yield "
</button>
<div class=\"w-100\"></div>
<div id=\"collapse-synonym-group-";
// line 48
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);
yield "\" class=\"col collapse\">
";
// line 49
$context['_parent'] = $context;
$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); })()));
foreach ($context['_seq'] as $context["_key"] => $context["synonym"]) {
// line 50
yield " ";
yield $macros["͜macros"]->getTemplateForMacro("macro_synonymRow", $context, 50, $this->getSourceContext())->macro_synonymRow(...[$context["synonym"]]);
yield "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['synonym'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 52
yield " </div>
</div>
";
}
// line 55
yield " ";
}
// line 56
yield " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['synonymProduct'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
})())) ? '' : new Markup($tmp, $this->env->getCharset());
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "ECommerce/App/Synonym/find_synonym_product.ajax.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
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,);
}
public function getSourceContext(): Source
{
return new Source("{%- trans_default_domain 'ECommerceBundle' -%}
{%- macro synonymRow(synonym) -%}
<div class=\"row synonym-row\">
<div class=\"col-sm-3\">{{ synonym.title }}</div>
<div class=\"col-sm-2\">{{ synonym.manufacturer }}</div>
<div class=\"col-sm-5\">{{ synonym.description }}</div>
{% if not synonym.isPartial %}
<div class=\"col-sm-2 synonym-category synonym-category-{{ synonym.categoryName }}\">
{{ ('synonym.category.' ~ synonym.categoryName)|trans }}
</div>
{% endif %}
</div>
{%- endmacro -%}
{%- macro content(synonymProducts, title) -%}
{% import _self as macros %}
{% set brakePoint = 2 %}
{% for synonymProduct in synonymProducts.currentPageResults %}
<div class=\"row synonym-product-row\">
<div class=\"col-sm-3\">{{ synonymProduct.title }}</div>
<div class=\"col-sm-2\">{{ synonymProduct.manufacturer }}</div>
<div class=\"col-sm-5\">{{ synonymProduct.description }}</div>
</div>
{% set unSimilar = synonymProduct.unSimilarSynonyms(title) %}
{% if (unSimilar|length) < 10 %}
{% for synonym in synonymProduct.synonyms %}
{{ macros.synonymRow(synonym) }}
{% endfor %}
{% else %}
{% set similar = synonymProduct.similarSynonyms(title) %}
{% for synonym in similar %}
{{ macros.synonymRow(synonym) }}
{% endfor %}
{% if unSimilar is not empty %}
<div class=\"synonym-groups row\">
<button class=\"col btn btn-light\" type=\"button\"
data-toggle=\"collapse\"
data-target=\"#collapse-synonym-group-{{ synonymProduct.id }}\"
aria-expanded=\"false\"
aria-controls=\"collapse-synonym-group-{{ synonymProduct.id }}\">
{{ 'synonym.page.show_rest'|trans }}
</button>
<div class=\"w-100\"></div>
<div id=\"collapse-synonym-group-{{ synonymProduct.id }}\" class=\"col collapse\">
{% for synonym in unSimilar %}
{{ macros.synonymRow(synonym) }}
{% endfor %}
</div>
</div>
{% endif %}
{% endif %}
{% endfor %}
{%- endmacro -%}
{%- import _self as macros -%}
{%- if wrapped -%}
<div class=\"container table-like\">
<div class=\"row row-header sticky-top bg-white pt-3 pb-3\">
<div class=\"col-sm-3\">Title</div>
<div class=\"col-sm-2\">Manufacturer</div>
<div class=\"col-sm-5\">Description</div>
<div class=\"col-sm-2\">Match</div>
</div>
{{- macros.content(synonymProducts, title) -}}
</div>
{%- else -%}
{{ macros.content(synonymProducts, title) }}
{%- endif -%}", "ECommerce/App/Synonym/find_synonym_product.ajax.twig", "/var/www/rs.optima/templates/ECommerce/App/Synonym/find_synonym_product.ajax.twig");
}
}