<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
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;
/* ProfileList/filter/_selector.partial.twig */
class __TwigTemplate_e30806ec855bb1f7e3cb9481dd098c89 extends Template
{
private $source;
private $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 = [])
{
$macros = $this->macros;
$__internal_b91a4435ea3baf1e2b6bfda56133dace = $this->extensions["Sentry\\SentryBundle\\Tracing\\Twig\\TwigTracingExtension"];
$__internal_b91a4435ea3baf1e2b6bfda56133dace->enter($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "ProfileList/filter/_selector.partial.twig"));
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "ProfileList/filter/_selector.partial.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "ProfileList/filter/_selector.partial.twig"));
// line 1
$context["filterID"] = twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["formElement"]) || array_key_exists("formElement", $context) ? $context["formElement"] : (function () { throw new RuntimeError('Variable "formElement" does not exist.', 1, $this->source); })()), "vars", [], "any", false, false, false, 1), "name", [], "any", false, false, false, 1);
// line 2
echo "
";
// line 3
$context["cointDisabled"] = 0;
// line 4
$context["countSelected"] = 0;
// line 5
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["formElement"]) || array_key_exists("formElement", $context) ? $context["formElement"] : (function () { throw new RuntimeError('Variable "formElement" does not exist.', 5, $this->source); })()), "vars", [], "any", false, false, false, 5), "choices", [], "array", false, false, false, 5));
foreach ($context['_seq'] as $context["_key"] => $context["choice"]) {
// line 6
echo " ";
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["choice"], "attr", [], "any", false, false, false, 6), "class", [], "any", false, false, false, 6) == "empty-filter")) {
$context["cointDisabled"] = ((isset($context["cointDisabled"]) || array_key_exists("cointDisabled", $context) ? $context["cointDisabled"] : (function () { throw new RuntimeError('Variable "cointDisabled" does not exist.', 6, $this->source); })()) + 1);
}
// line 7
echo " ";
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["choice"], "attr", [], "any", false, false, false, 7), "checked", [], "any", false, false, false, 7) == "true")) {
$context["countSelected"] = ((isset($context["countSelected"]) || array_key_exists("countSelected", $context) ? $context["countSelected"] : (function () { throw new RuntimeError('Variable "countSelected" does not exist.', 7, $this->source); })()) + 1);
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['choice'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 9
$context["countElement"] = (((twig_length_filter($this->env, (isset($context["formElement"]) || array_key_exists("formElement", $context) ? $context["formElement"] : (function () { throw new RuntimeError('Variable "formElement" does not exist.', 9, $this->source); })())) == 0)) ? (twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["formElement"]) || array_key_exists("formElement", $context) ? $context["formElement"] : (function () { throw new RuntimeError('Variable "formElement" does not exist.', 9, $this->source); })()), "vars", [], "any", false, false, false, 9), "choices", [], "any", false, false, false, 9))) : (twig_length_filter($this->env, (isset($context["formElement"]) || array_key_exists("formElement", $context) ? $context["formElement"] : (function () { throw new RuntimeError('Variable "formElement" does not exist.', 9, $this->source); })()))));
// line 10
$context["isDisabled"] = (((isset($context["countElement"]) || array_key_exists("countElement", $context) ? $context["countElement"] : (function () { throw new RuntimeError('Variable "countElement" does not exist.', 10, $this->source); })()) == (isset($context["cointDisabled"]) || array_key_exists("cointDisabled", $context) ? $context["cointDisabled"] : (function () { throw new RuntimeError('Variable "cointDisabled" does not exist.', 10, $this->source); })())) || (isset($context["choisen"]) || array_key_exists("choisen", $context) ? $context["choisen"] : (function () { throw new RuntimeError('Variable "choisen" does not exist.', 10, $this->source); })()));
// line 11
$context["isActive"] = ((isset($context["countSelected"]) || array_key_exists("countSelected", $context) ? $context["countSelected"] : (function () { throw new RuntimeError('Variable "countSelected" does not exist.', 11, $this->source); })()) > 0);
// line 12
echo "
<div class=\"profile_filter__item rounding";
// line 13
echo (((isset($context["isActive"]) || array_key_exists("isActive", $context) ? $context["isActive"] : (function () { throw new RuntimeError('Variable "isActive" does not exist.', 13, $this->source); })())) ? (" profile_filter__item--active") : (""));
echo (((isset($context["isDisabled"]) || array_key_exists("isDisabled", $context) ? $context["isDisabled"] : (function () { throw new RuntimeError('Variable "isDisabled" does not exist.', 13, $this->source); })())) ? (" profile_filter__item--disable") : (""));
echo "\">
<button class=\"profile_filter__item__button\" type=\"button\" data-filter-list-button data-filter-type=\"list\" data-filter-id=\"";
// line 14
echo twig_escape_filter($this->env, (isset($context["filterID"]) || array_key_exists("filterID", $context) ? $context["filterID"] : (function () { throw new RuntimeError('Variable "filterID" does not exist.', 14, $this->source); })()), "html", null, true);
echo "\">
<span class=\"profile_filter__item__text\" data-filter-text>";
// line 15
echo twig_escape_filter($this->env, (isset($context["label"]) || array_key_exists("label", $context) ? $context["label"] : (function () { throw new RuntimeError('Variable "label" does not exist.', 15, $this->source); })()), "html", null, true);
echo "</span>
<span class=\"profile_filter__item__count_selected";
// line 16
echo (((isset($context["isActive"]) || array_key_exists("isActive", $context) ? $context["isActive"] : (function () { throw new RuntimeError('Variable "isActive" does not exist.', 16, $this->source); })())) ? (" profile_filter__item__count_selected--active") : (""));
echo "\">";
echo twig_escape_filter($this->env, (isset($context["countSelected"]) || array_key_exists("countSelected", $context) ? $context["countSelected"] : (function () { throw new RuntimeError('Variable "countSelected" does not exist.', 16, $this->source); })()), "html", null, true);
echo "</span>
<svg class=\"profile_filter__item__icons\" width=\"25\" height=\"24\">
<use class=\"profile_filter__item__icons--close\" xlink:href=\"#close\"></use>
<use class=\"profile_filter__item__icons--expand\" xlink:href=\"#expand\"></use>
</svg>
</button>
<div class=\"dropdown_content dropdown_content--long\" id=\"";
// line 23
echo twig_escape_filter($this->env, (isset($context["filterID"]) || array_key_exists("filterID", $context) ? $context["filterID"] : (function () { throw new RuntimeError('Variable "filterID" does not exist.', 23, $this->source); })()), "html", null, true);
echo "\">
";
// line 24
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["formElement"]) || array_key_exists("formElement", $context) ? $context["formElement"] : (function () { throw new RuntimeError('Variable "formElement" does not exist.', 24, $this->source); })()), "vars", [], "any", false, false, false, 24), "choices", [], "array", false, false, false, 24));
foreach ($context['_seq'] as $context["_key"] => $context["choice"]) {
// line 25
echo " ";
$context["isCityCheck"] = twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["choice"], "attr", [], "any", false, true, false, 25), "data-city", [], "array", true, true, false, 25);
// line 26
echo " ";
$context["isMyCity"] = ((isset($context["isCityCheck"]) || array_key_exists("isCityCheck", $context) ? $context["isCityCheck"] : (function () { throw new RuntimeError('Variable "isCityCheck" does not exist.', 26, $this->source); })()) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 26, $this->source); })()), "request", [], "any", false, false, false, 26), "attributes", [], "any", false, false, false, 26), "get", ["city"], "method", false, false, false, 26), "id", [], "any", false, false, false, 26) == twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["choice"], "attr", [], "any", false, false, false, 26), "data-city", [], "array", false, false, false, 26)));
// line 27
echo " ";
if (( !(isset($context["isCityCheck"]) || array_key_exists("isCityCheck", $context) ? $context["isCityCheck"] : (function () { throw new RuntimeError('Variable "isCityCheck" does not exist.', 27, $this->source); })()) || (isset($context["isMyCity"]) || array_key_exists("isMyCity", $context) ? $context["isMyCity"] : (function () { throw new RuntimeError('Variable "isMyCity" does not exist.', 27, $this->source); })()))) {
// line 28
echo " <button class=\"dropdown_content__item";
echo ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["choice"], "attr", [], "any", false, false, false, 28), "checked", [], "any", false, false, false, 28)) ? (" dropdown_content__item--selected dropdown_content__item--lock") : (""));
echo (((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["choice"], "attr", [], "any", false, false, false, 28), "class", [], "any", false, false, false, 28) == "empty-filter")) ? (" dropdown_content__item--disable") : (""));
echo "\"
type=\"button\"
data-name=\"";
// line 30
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["choice"], "value", [], "any", false, false, false, 30), "html", null, true);
echo "\"
data-r=\"";
// line 31
echo twig_escape_filter($this->env, json_encode(twig_get_attribute($this->env, $this->source, $context["choice"], "attr", [], "any", false, false, false, 31)), "html", null, true);
echo "\"
>
<span class=\"dropdown_content__item__text\">";
// line 33
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(twig_get_attribute($this->env, $this->source, $context["choice"], "label", [], "any", false, false, false, 33), [], (isset($context["trans"]) || array_key_exists("trans", $context) ? $context["trans"] : (function () { throw new RuntimeError('Variable "trans" does not exist.', 33, $this->source); })())), "html", null, true);
echo "</span>
</button>
";
}
// line 36
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['choice'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 37
echo " </div>
";
// line 38
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock((isset($context["formElement"]) || array_key_exists("formElement", $context) ? $context["formElement"] : (function () { throw new RuntimeError('Variable "formElement" does not exist.', 38, $this->source); })()), 'widget', ["attr" => ["class" => "visually_hidden", "data-selector" => ""]]);
// line 41
echo "
</div>
";
$__internal_b91a4435ea3baf1e2b6bfda56133dace->leave($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "ProfileList/filter/_selector.partial.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 157 => 41, 155 => 38, 152 => 37, 146 => 36, 140 => 33, 135 => 31, 131 => 30, 124 => 28, 121 => 27, 118 => 26, 115 => 25, 111 => 24, 107 => 23, 95 => 16, 91 => 15, 87 => 14, 82 => 13, 79 => 12, 77 => 11, 75 => 10, 73 => 9, 64 => 7, 59 => 6, 55 => 5, 53 => 4, 51 => 3, 48 => 2, 46 => 1,);
}
public function getSourceContext()
{
return new Source("{% set filterID = formElement.vars.name %}
{% set cointDisabled = 0 %}
{% set countSelected = 0 %}
{% for choice in formElement.vars['choices'] %}
{% if choice.attr.class == 'empty-filter' %}{% set cointDisabled = cointDisabled + 1 %}{% endif %}
{% if choice.attr.checked == 'true' %}{% set countSelected = countSelected + 1 %}{% endif %}
{% endfor %}
{% set countElement = formElement|length == 0 ? formElement.vars.choices|length : formElement|length %}
{% set isDisabled = countElement == cointDisabled or choisen %}
{% set isActive = countSelected > 0 %}
<div class=\"profile_filter__item rounding{{ isActive ? ' profile_filter__item--active' : ''}}{{ isDisabled ? ' profile_filter__item--disable' : '' }}\">
<button class=\"profile_filter__item__button\" type=\"button\" data-filter-list-button data-filter-type=\"list\" data-filter-id=\"{{ filterID }}\">
<span class=\"profile_filter__item__text\" data-filter-text>{{ label }}</span>
<span class=\"profile_filter__item__count_selected{{ isActive ? ' profile_filter__item__count_selected--active' : ''}}\">{{ countSelected }}</span>
<svg class=\"profile_filter__item__icons\" width=\"25\" height=\"24\">
<use class=\"profile_filter__item__icons--close\" xlink:href=\"#close\"></use>
<use class=\"profile_filter__item__icons--expand\" xlink:href=\"#expand\"></use>
</svg>
</button>
<div class=\"dropdown_content dropdown_content--long\" id=\"{{ filterID }}\">
{% for choice in formElement.vars['choices'] %}
{% set isCityCheck = choice.attr['data-city'] is defined %}
{% set isMyCity = isCityCheck and app.request.attributes.get('city').id == choice.attr['data-city'] %}
{% if not isCityCheck or isMyCity %}
<button class=\"dropdown_content__item{{ choice.attr.checked ? ' dropdown_content__item--selected dropdown_content__item--lock' : '' }}{{ choice.attr.class == 'empty-filter' ? ' dropdown_content__item--disable' : '' }}\"
type=\"button\"
data-name=\"{{ choice.value }}\"
data-r=\"{{ choice.attr|json_encode }}\"
>
<span class=\"dropdown_content__item__text\">{{ choice.label|trans({}, trans) }}</span>
</button>
{% endif %}
{% endfor %}
</div>
{{ form_widget(formElement, {'attr': {
'class': 'visually_hidden',
'data-selector': ''
}}) }}
</div>
", "ProfileList/filter/_selector.partial.twig", "/app/templates/ProfileList/filter/_selector.partial.twig");
}
}