var/cache/review/twig/95/9571c402de20b0bed1d90eb99007e29e.php line 33

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* ProfileList/filter/_selector.partial.twig */
  14. class __TwigTemplate_e30806ec855bb1f7e3cb9481dd098c89 extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source = $this->getSourceContext();
  22.         $this->parent = false;
  23.         $this->blocks = [
  24.         ];
  25.     }
  26.     protected function doDisplay(array $context, array $blocks = [])
  27.     {
  28.         $macros = $this->macros;
  29.         $__internal_b91a4435ea3baf1e2b6bfda56133dace = $this->extensions["Sentry\\SentryBundle\\Tracing\\Twig\\TwigTracingExtension"];
  30.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->enter($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "ProfileList/filter/_selector.partial.twig"));
  31.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  32.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "ProfileList/filter/_selector.partial.twig"));
  33.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  34.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "ProfileList/filter/_selector.partial.twig"));
  35.         // line 1
  36.         $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);
  37.         // line 2
  38.         echo "
  39. ";
  40.         // line 3
  41.         $context["cointDisabled"] = 0;
  42.         // line 4
  43.         $context["countSelected"] = 0;
  44.         // line 5
  45.         $context['_parent'] = $context;
  46.         $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));
  47.         foreach ($context['_seq'] as $context["_key"] => $context["choice"]) {
  48.             // line 6
  49.             echo "    ";
  50.             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")) {
  51.                 $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);
  52.             }
  53.             // line 7
  54.             echo "    ";
  55.             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")) {
  56.                 $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);
  57.             }
  58.         }
  59.         $_parent = $context['_parent'];
  60.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['choice'], $context['_parent'], $context['loop']);
  61.         $context = array_intersect_key($context, $_parent) + $_parent;
  62.         // line 9
  63.         $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); })()))));
  64.         // line 10
  65.         $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); })()));
  66.         // line 11
  67.         $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);
  68.         // line 12
  69.         echo "
  70. <div class=\"profile_filter__item rounding";
  71.         // line 13
  72.         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") : (""));
  73.         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") : (""));
  74.         echo "\">
  75.     <button class=\"profile_filter__item__button\" type=\"button\" data-filter-list-button data-filter-type=\"list\" data-filter-id=\"";
  76.         // line 14
  77.         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);
  78.         echo "\">
  79.         <span class=\"profile_filter__item__text\" data-filter-text>";
  80.         // line 15
  81.         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);
  82.         echo "</span>
  83.         <span class=\"profile_filter__item__count_selected";
  84.         // line 16
  85.         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") : (""));
  86.         echo "\">";
  87.         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);
  88.         echo "</span>
  89.         <svg class=\"profile_filter__item__icons\" width=\"25\" height=\"24\">
  90.             <use class=\"profile_filter__item__icons--close\" xlink:href=\"#close\"></use>
  91.             <use class=\"profile_filter__item__icons--expand\" xlink:href=\"#expand\"></use>
  92.         </svg>
  93.     </button>
  94.     <div class=\"dropdown_content dropdown_content--long\" id=\"";
  95.         // line 23
  96.         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);
  97.         echo "\">
  98.         ";
  99.         // line 24
  100.         $context['_parent'] = $context;
  101.         $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));
  102.         foreach ($context['_seq'] as $context["_key"] => $context["choice"]) {
  103.             // line 25
  104.             echo "            ";
  105.             $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);
  106.             // line 26
  107.             echo "            ";
  108.             $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)));
  109.             // line 27
  110.             echo "            ";
  111.             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); })()))) {
  112.                 // line 28
  113.                 echo "                <button class=\"dropdown_content__item";
  114.                 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") : (""));
  115.                 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") : (""));
  116.                 echo "\"
  117.                     type=\"button\"
  118.                     data-name=\"";
  119.                 // line 30
  120.                 echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["choice"], "value", [], "any", false, false, false, 30), "html", null, true);
  121.                 echo "\"
  122.                     data-r=\"";
  123.                 // line 31
  124.                 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);
  125.                 echo "\"
  126.                     >
  127.                     <span class=\"dropdown_content__item__text\">";
  128.                 // line 33
  129.                 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);
  130.                 echo "</span>
  131.                 </button>
  132.             ";
  133.             }
  134.             // line 36
  135.             echo "        ";
  136.         }
  137.         $_parent = $context['_parent'];
  138.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['choice'], $context['_parent'], $context['loop']);
  139.         $context = array_intersect_key($context, $_parent) + $_parent;
  140.         // line 37
  141.         echo "    </div>
  142.     ";
  143.         // line 38
  144.         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" => ""]]);
  145.         // line 41
  146.         echo "
  147. </div>
  148. ";
  149.         
  150.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->leave($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof);
  151.         
  152.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  153.         
  154.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  155.     }
  156.     /**
  157.      * @codeCoverageIgnore
  158.      */
  159.     public function getTemplateName()
  160.     {
  161.         return "ProfileList/filter/_selector.partial.twig";
  162.     }
  163.     /**
  164.      * @codeCoverageIgnore
  165.      */
  166.     public function isTraitable()
  167.     {
  168.         return false;
  169.     }
  170.     /**
  171.      * @codeCoverageIgnore
  172.      */
  173.     public function getDebugInfo()
  174.     {
  175.         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,);
  176.     }
  177.     public function getSourceContext()
  178.     {
  179.         return new Source("{% set filterID = formElement.vars.name %}
  180. {% set cointDisabled = 0 %}
  181. {% set countSelected = 0 %}
  182. {% for choice in formElement.vars['choices'] %}
  183.     {% if choice.attr.class == 'empty-filter' %}{% set cointDisabled = cointDisabled + 1 %}{% endif %}
  184.     {% if choice.attr.checked == 'true' %}{% set countSelected = countSelected + 1 %}{% endif %}
  185. {% endfor %}
  186. {% set countElement = formElement|length == 0 ? formElement.vars.choices|length : formElement|length %}
  187. {% set isDisabled = countElement == cointDisabled or choisen %}
  188. {% set isActive = countSelected > 0 %}
  189. <div class=\"profile_filter__item rounding{{ isActive ? ' profile_filter__item--active' : ''}}{{ isDisabled ? ' profile_filter__item--disable' : '' }}\">
  190.     <button class=\"profile_filter__item__button\" type=\"button\" data-filter-list-button data-filter-type=\"list\" data-filter-id=\"{{ filterID }}\">
  191.         <span class=\"profile_filter__item__text\" data-filter-text>{{ label }}</span>
  192.         <span class=\"profile_filter__item__count_selected{{ isActive ? ' profile_filter__item__count_selected--active' : ''}}\">{{ countSelected }}</span>
  193.         <svg class=\"profile_filter__item__icons\" width=\"25\" height=\"24\">
  194.             <use class=\"profile_filter__item__icons--close\" xlink:href=\"#close\"></use>
  195.             <use class=\"profile_filter__item__icons--expand\" xlink:href=\"#expand\"></use>
  196.         </svg>
  197.     </button>
  198.     <div class=\"dropdown_content dropdown_content--long\" id=\"{{ filterID }}\">
  199.         {% for choice in formElement.vars['choices'] %}
  200.             {% set isCityCheck = choice.attr['data-city'] is defined %}
  201.             {% set isMyCity = isCityCheck and app.request.attributes.get('city').id == choice.attr['data-city'] %}
  202.             {% if not isCityCheck or isMyCity %}
  203.                 <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' : '' }}\"
  204.                     type=\"button\"
  205.                     data-name=\"{{ choice.value }}\"
  206.                     data-r=\"{{ choice.attr|json_encode }}\"
  207.                     >
  208.                     <span class=\"dropdown_content__item__text\">{{ choice.label|trans({}, trans) }}</span>
  209.                 </button>
  210.             {% endif %}
  211.         {% endfor %}
  212.     </div>
  213.     {{ form_widget(formElement, {'attr': {
  214.         'class': 'visually_hidden',
  215.         'data-selector': ''
  216.     }}) }}
  217. </div>
  218. ", "ProfileList/filter/_selector.partial.twig", "/app/templates/ProfileList/filter/_selector.partial.twig");
  219.     }
  220. }