var/cache/dev/twig/59/592dc23e5e9af1e46c9d61b1221a385c.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. /* @openform_front_templates/Index/components/_news.html.twig */
  14. class __TwigTemplate_6e4ec63646bef3d683dd8162ef1655be 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_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  30.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@openform_front_templates/Index/components/_news.html.twig"));
  31.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  32.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@openform_front_templates/Index/components/_news.html.twig"));
  33.         // line 1
  34.         echo "
  35. ";
  36.         // line 2
  37.         $macros["__internal_parse_63"] = $this->macros["__internal_parse_63"] = $this->loadTemplate("@openform_front_templates/_includes/_icons.html.twig""@openform_front_templates/Index/components/_news.html.twig"2)->unwrap();
  38.         // line 3
  39.         if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["openform_front_util"]) || array_key_exists("openform_front_util"$context) ? $context["openform_front_util"] : (function () { throw new RuntimeError('Variable "openform_front_util" does not exist.'3$this->source); })()), "Config", [], "any"falsefalsefalse3), "showHomeNews", [], "any"falsefalsefalse3)) {
  40.             // line 4
  41.             if ((twig_length_filter($this->env, (isset($context["featuredNews"]) || array_key_exists("featuredNews"$context) ? $context["featuredNews"] : (function () { throw new RuntimeError('Variable "featuredNews" does not exist.'4$this->source); })())) > 0)) {
  42.                 // line 5
  43.                 echo "    <div class=\"home-news\">
  44.         <div class=\"container block-container\">
  45.             <div class=\"block__h2 block-container__title\">";
  46.                 // line 7
  47.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("T_HOME_NEWS", [], "openform_front"twig_get_attribute($this->env$this->sourcetwig_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.'7$this->source); })()), "request", [], "any"falsefalsefalse7), "locale", [], "any"falsefalsefalse7)), "html"nulltrue);
  48.                 echo "</div>
  49.             <div class=\"block-container__blocks\">
  50.                 ";
  51.                 // line 9
  52.                 $context['_parent'] = $context;
  53.                 $context['_seq'] = twig_ensure_traversable((isset($context["featuredNews"]) || array_key_exists("featuredNews"$context) ? $context["featuredNews"] : (function () { throw new RuntimeError('Variable "featuredNews" does not exist.'9$this->source); })()));
  54.                 $context['loop'] = [
  55.                   'parent' => $context['_parent'],
  56.                   'index0' => 0,
  57.                   'index'  => 1,
  58.                   'first'  => true,
  59.                 ];
  60.                 if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  61.                     $length count($context['_seq']);
  62.                     $context['loop']['revindex0'] = $length 1;
  63.                     $context['loop']['revindex'] = $length;
  64.                     $context['loop']['length'] = $length;
  65.                     $context['loop']['last'] = === $length;
  66.                 }
  67.                 foreach ($context['_seq'] as $context["_key"] => $context["news"]) {
  68.                     // line 10
  69.                     echo "                    ";
  70.                     $context["img"] = twig_get_attribute($this->env$this->source, (isset($context["openform_front_util"]) || array_key_exists("openform_front_util"$context) ? $context["openform_front_util"] : (function () { throw new RuntimeError('Variable "openform_front_util" does not exist.'10$this->source); })()), "getImagePathByType", [(((twig_get_attribute($this->env$this->source$context["news"], "Thumb", [], "any"truetruefalse10) &&  !(null === twig_get_attribute($this->env$this->source$context["news"], "Thumb", [], "any"falsefalsefalse10)))) ? (twig_get_attribute($this->env$this->source$context["news"], "Thumb", [], "any"falsefalsefalse10)) : ("")), "detail"], "method"falsefalsefalse10);
  71.                     // line 11
  72.                     echo "
  73.                     ";
  74.                     // line 12
  75.                     $context["href"] = twig_get_attribute($this->env$this->source, (isset($context["toolkit_route_localizer"]) || array_key_exists("toolkit_route_localizer"$context) ? $context["toolkit_route_localizer"] : (function () { throw new RuntimeError('Variable "toolkit_route_localizer" does not exist.'12$this->source); })()), "generate", ["news_item", ["slug" => twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["news"], "Translation", [], "any"falsefalsefalse12), twig_get_attribute($this->env$this->sourcetwig_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.'12$this->source); })()), "request", [], "any"falsefalsefalse12), "locale", [], "any"falsefalsefalse12), [], "array"falsefalsefalse12), "slug", [], "any"falsefalsefalse12)], twig_get_attribute($this->env$this->sourcetwig_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.'12$this->source); })()), "request", [], "any"falsefalsefalse12), "locale", [], "any"falsefalsefalse12)], "method"falsefalsefalse12);
  76.                     // line 13
  77.                     echo "                    <a href=\"";
  78.                     echo twig_escape_filter($this->env, (isset($context["href"]) || array_key_exists("href"$context) ? $context["href"] : (function () { throw new RuntimeError('Variable "href" does not exist.'13$this->source); })()), "html"nulltrue);
  79.                     echo "\" class=\"block-item block-image block-image--position-";
  80.                     echo (((== twig_get_attribute($this->env$this->source$context["loop"], "index", [], "any"falsefalsefalse13) % 2)) ? ("right") : ("left"));
  81.                     echo "\">
  82.                         <div class=\"block-image__container\">
  83.                             <div class=\"block-image__text\">
  84.                                 ";
  85.                     // line 17
  86.                     if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["news"], "Translation", [], "any"falsefalsefalse17), twig_get_attribute($this->env$this->sourcetwig_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.'17$this->source); })()), "request", [], "any"falsefalsefalse17), "locale", [], "any"falsefalsefalse17), [], "array"falsefalsefalse17), "titleHtml", [], "any"falsefalsefalse17)) {
  87.                         // line 18
  88.                         echo "                                    <div class=\"block__h3\">
  89.                                         ";
  90.                         // line 19
  91.                         echo twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["news"], "Translation", [], "any"falsefalsefalse19), twig_get_attribute($this->env$this->sourcetwig_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.'19$this->source); })()), "request", [], "any"falsefalsefalse19), "locale", [], "any"falsefalsefalse19), [], "array"falsefalsefalse19), "titleHtml", [], "any"falsefalsefalse19);
  92.                         echo "
  93.                                     </div>
  94.                                 ";
  95.                     }
  96.                     // line 22
  97.                     echo "                                <div class=\"home-news__date\">
  98.                                     <time class=\"block__text\">
  99.                                         ";
  100.                     // line 24
  101.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$this->extensions['App\Package\Openform\Twig\CustomExtensions']->explodedDateFilter(twig_get_attribute($this->env$this->source$context["news"], "publishDate", [], "any"falsefalsefalse24), twig_get_attribute($this->env$this->sourcetwig_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.'24$this->source); })()), "request", [], "any"falsefalsefalse24), "locale", [], "any"falsefalsefalse24)), "D", [], "any"falsefalsefalse24), "html"nulltrue);
  102.                     echo "
  103.                                         ";
  104.                     // line 25
  105.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$this->extensions['App\Package\Openform\Twig\CustomExtensions']->explodedDateFilter(twig_get_attribute($this->env$this->source$context["news"], "publishDate", [], "any"falsefalsefalse25), twig_get_attribute($this->env$this->sourcetwig_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.'25$this->source); })()), "request", [], "any"falsefalsefalse25), "locale", [], "any"falsefalsefalse25)), "month", [], "any"falsefalsefalse25), "html"nulltrue);
  106.                     echo "
  107.                                         ";
  108.                     // line 26
  109.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$this->extensions['App\Package\Openform\Twig\CustomExtensions']->explodedDateFilter(twig_get_attribute($this->env$this->source$context["news"], "publishDate", [], "any"falsefalsefalse26), twig_get_attribute($this->env$this->sourcetwig_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"falsefalsefalse26), "locale", [], "any"falsefalsefalse26)), "y", [], "any"falsefalsefalse26), "html"nulltrue);
  110.                     echo "
  111.                                     </time>
  112.                                 </div>
  113.                                 ";
  114.                     // line 29
  115.                     if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["news"], "Translation", [], "any"falsefalsefalse29), twig_get_attribute($this->env$this->sourcetwig_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.'29$this->source); })()), "request", [], "any"falsefalsefalse29), "locale", [], "any"falsefalsefalse29), [], "array"falsefalsefalse29), "shortLead", [], "any"falsefalsefalse29)) {
  116.                         // line 30
  117.                         echo "                                    <div class=\"block__text\">
  118.                                         ";
  119.                         // line 31
  120.                         echo twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["news"], "Translation", [], "any"falsefalsefalse31), twig_get_attribute($this->env$this->sourcetwig_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.'31$this->source); })()), "request", [], "any"falsefalsefalse31), "locale", [], "any"falsefalsefalse31), [], "array"falsefalsefalse31), "shortLead", [], "any"falsefalsefalse31);
  121.                         echo "
  122.                                     </div>
  123.                                 ";
  124.                     }
  125.                     // line 34
  126.                     echo "
  127.                                 ";
  128.                     // line 35
  129.                     if ((isset($context["href"]) || array_key_exists("href"$context) ? $context["href"] : (function () { throw new RuntimeError('Variable "href" does not exist.'35$this->source); })())) {
  130.                         // line 36
  131.                         echo "                                    <div class=\"block-text__btns\">
  132.                                         <div class=\"block-text__btns__btn\">
  133.                                             <span>";
  134.                         // line 38
  135.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("T_SEE_MORE", [], "openform_front"twig_get_attribute($this->env$this->sourcetwig_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.'38$this->source); })()), "request", [], "any"falsefalsefalse38), "locale", [], "any"falsefalsefalse38)), "html"nulltrue);
  136.                         echo "</span>
  137.                                             ";
  138.                         // line 39
  139.                         echo twig_call_macro($macros["__internal_parse_63"], "macro_arrowright", [], 39$context$this->getSourceContext());
  140.                         echo "
  141.                                         </div>
  142.                                     </div>
  143.                                 ";
  144.                     }
  145.                     // line 43
  146.                     echo "                            </div>
  147.                             <div class=\"block-image__image\">
  148.                                 ";
  149.                     // line 45
  150.                     if ((isset($context["img"]) || array_key_exists("img"$context) ? $context["img"] : (function () { throw new RuntimeError('Variable "img" does not exist.'45$this->source); })())) {
  151.                         // line 46
  152.                         echo "                                    <img class=\"block-image__image__img\" loading=\"lazy\" src=\"";
  153.                         echo twig_escape_filter($this->env, (isset($context["img"]) || array_key_exists("img"$context) ? $context["img"] : (function () { throw new RuntimeError('Variable "img" does not exist.'46$this->source); })()), "html"nulltrue);
  154.                         echo "\" alt=\"";
  155.                         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["news"], "Translation", [], "any"falsefalsefalse46), twig_get_attribute($this->env$this->sourcetwig_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.'46$this->source); })()), "request", [], "any"falsefalsefalse46), "locale", [], "any"falsefalsefalse46), [], "array"falsefalsefalse46), "alt", [], "any"falsefalsefalse46), "html"nulltrue);
  156.                         echo "\">
  157.                                 ";
  158.                     }
  159.                     // line 48
  160.                     echo "                            </div>
  161.                         </div>
  162.                     </a>
  163.                 ";
  164.                     ++$context['loop']['index0'];
  165.                     ++$context['loop']['index'];
  166.                     $context['loop']['first'] = false;
  167.                     if (isset($context['loop']['length'])) {
  168.                         --$context['loop']['revindex0'];
  169.                         --$context['loop']['revindex'];
  170.                         $context['loop']['last'] = === $context['loop']['revindex0'];
  171.                     }
  172.                 }
  173.                 $_parent $context['_parent'];
  174.                 unset($context['_seq'], $context['_iterated'], $context['_key'], $context['news'], $context['_parent'], $context['loop']);
  175.                 $context array_intersect_key($context$_parent) + $_parent;
  176.                 // line 52
  177.                 echo "                ";
  178.                 $context["hrefNews"] = twig_get_attribute($this->env$this->source, (isset($context["toolkit_route_localizer"]) || array_key_exists("toolkit_route_localizer"$context) ? $context["toolkit_route_localizer"] : (function () { throw new RuntimeError('Variable "toolkit_route_localizer" does not exist.'52$this->source); })()), "generate", ["news_list", [], twig_get_attribute($this->env$this->sourcetwig_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.'52$this->source); })()), "request", [], "any"falsefalsefalse52), "locale", [], "any"falsefalsefalse52)], "method"falsefalsefalse52);
  179.                 // line 53
  180.                 echo "                ";
  181.                 if ((isset($context["hrefNews"]) || array_key_exists("hrefNews"$context) ? $context["hrefNews"] : (function () { throw new RuntimeError('Variable "hrefNews" does not exist.'53$this->source); })())) {
  182.                     // line 54
  183.                     echo "                    <a href=\"";
  184.                     echo twig_escape_filter($this->env, (isset($context["hrefNews"]) || array_key_exists("hrefNews"$context) ? $context["hrefNews"] : (function () { throw new RuntimeError('Variable "hrefNews" does not exist.'54$this->source); })()), "html"nulltrue);
  185.                     echo "\" class=\"btn btn--color-white btn--position-right\">
  186.                         <span>";
  187.                     // line 55
  188.                     echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("T_SEE_ALL_NEWS", [], "openform_front"twig_get_attribute($this->env$this->sourcetwig_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.'55$this->source); })()), "request", [], "any"falsefalsefalse55), "locale", [], "any"falsefalsefalse55)), "html"nulltrue);
  189.                     echo "</span> ";
  190.                     echo twig_call_macro($macros["__internal_parse_63"], "macro_arrowright", [], 55$context$this->getSourceContext());
  191.                     echo "
  192.                     </a>
  193.                 ";
  194.                 }
  195.                 // line 58
  196.                 echo "
  197.             </div>
  198.         </div>
  199.     </div>
  200. ";
  201.             }
  202.         }
  203.         
  204.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  205.         
  206.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  207.     }
  208.     public function getTemplateName()
  209.     {
  210.         return "@openform_front_templates/Index/components/_news.html.twig";
  211.     }
  212.     public function isTraitable()
  213.     {
  214.         return false;
  215.     }
  216.     public function getDebugInfo()
  217.     {
  218.         return array (  206 => 58,  198 => 55,  193 => 54,  190 => 53,  187 => 52,  170 => 48,  162 => 46,  160 => 45,  156 => 43,  149 => 39,  145 => 38,  141 => 36,  139 => 35,  136 => 34,  130 => 31,  127 => 30,  125 => 29,  119 => 26,  115 => 25,  111 => 24,  107 => 22,  101 => 19,  98 => 18,  96 => 17,  86 => 13,  84 => 12,  81 => 11,  78 => 10,  61 => 9,  56 => 7,  52 => 5,  50 => 4,  48 => 3,  46 => 2,  43 => 1,);
  219.     }
  220.     public function getSourceContext()
  221.     {
  222.         return new Source("
  223. {% from '@openform_front_templates/_includes/_icons.html.twig' import arrowright %}
  224. {% if openform_front_util.Config.showHomeNews %}
  225. {% if featuredNews|length > 0 %}
  226.     <div class=\"home-news\">
  227.         <div class=\"container block-container\">
  228.             <div class=\"block__h2 block-container__title\">{{('T_HOME_NEWS')|trans({}, 'openform_front', app.request.locale)}}</div>
  229.             <div class=\"block-container__blocks\">
  230.                 {% for news in featuredNews %}
  231.                     {% set img = openform_front_util.getImagePathByType(news.Thumb ?? '','detail') %}
  232.                     {% set href = toolkit_route_localizer.generate('news_item',{ slug : news.Translation[app.request.locale].slug }, app.request.locale) %}
  233.                     <a href=\"{{href}}\" class=\"block-item block-image block-image--position-{{ loop.index is divisible by(2) ? 'right' : 'left' }}\">
  234.                         <div class=\"block-image__container\">
  235.                             <div class=\"block-image__text\">
  236.                                 {% if news.Translation[app.request.locale].titleHtml %}
  237.                                     <div class=\"block__h3\">
  238.                                         {{ news.Translation[app.request.locale].titleHtml|raw }}
  239.                                     </div>
  240.                                 {% endif %}
  241.                                 <div class=\"home-news__date\">
  242.                                     <time class=\"block__text\">
  243.                                         {{ news.publishDate|explodedDate(app.request.locale).D }}
  244.                                         {{ news.publishDate|explodedDate(app.request.locale).month }}
  245.                                         {{ news.publishDate|explodedDate(app.request.locale).y }}
  246.                                     </time>
  247.                                 </div>
  248.                                 {% if news.Translation[app.request.locale].shortLead %}
  249.                                     <div class=\"block__text\">
  250.                                         {{ news.Translation[app.request.locale].shortLead|raw }}
  251.                                     </div>
  252.                                 {% endif %}
  253.                                 {% if href %}
  254.                                     <div class=\"block-text__btns\">
  255.                                         <div class=\"block-text__btns__btn\">
  256.                                             <span>{{('T_SEE_MORE')|trans({}, 'openform_front', app.request.locale)}}</span>
  257.                                             {{arrowright()}}
  258.                                         </div>
  259.                                     </div>
  260.                                 {% endif %}
  261.                             </div>
  262.                             <div class=\"block-image__image\">
  263.                                 {% if img %}
  264.                                     <img class=\"block-image__image__img\" loading=\"lazy\" src=\"{{img}}\" alt=\"{{ news.Translation[app.request.locale].alt }}\">
  265.                                 {% endif %}
  266.                             </div>
  267.                         </div>
  268.                     </a>
  269.                 {% endfor %}
  270.                 {% set hrefNews = toolkit_route_localizer.generate('news_list',{}, app.request.locale) %}
  271.                 {% if hrefNews %}
  272.                     <a href=\"{{hrefNews}}\" class=\"btn btn--color-white btn--position-right\">
  273.                         <span>{{('T_SEE_ALL_NEWS')|trans({}, 'openform_front', app.request.locale)}}</span> {{arrowright()}}
  274.                     </a>
  275.                 {% endif %}
  276.             </div>
  277.         </div>
  278.     </div>
  279. {% endif %}
  280. {% endif %}
  281. ""@openform_front_templates/Index/components/_news.html.twig""/var/www/php81/fpd.in.openform.pl/src/Package/Openform/Front/Templates/Index/components/_news.html.twig");
  282.     }
  283. }