<?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;
/* @openform_front_templates/Index/components/_news.html.twig */
class __TwigTemplate_6e4ec63646bef3d683dd8162ef1655be 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_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@openform_front_templates/Index/components/_news.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@openform_front_templates/Index/components/_news.html.twig"));
// line 1
echo "
";
// line 2
$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();
// line 3
if (twig_get_attribute($this->env, $this->source, 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.', 3, $this->source); })()), "Config", [], "any", false, false, false, 3), "showHomeNews", [], "any", false, false, false, 3)) {
// line 4
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)) {
// line 5
echo " <div class=\"home-news\">
<div class=\"container block-container\">
<div class=\"block__h2 block-container__title\">";
// line 7
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->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.', 7, $this->source); })()), "request", [], "any", false, false, false, 7), "locale", [], "any", false, false, false, 7)), "html", null, true);
echo "</div>
<div class=\"block-container__blocks\">
";
// line 9
$context['_parent'] = $context;
$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); })()));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["news"]) {
// line 10
echo " ";
$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", true, true, false, 10) && !(null === twig_get_attribute($this->env, $this->source, $context["news"], "Thumb", [], "any", false, false, false, 10)))) ? (twig_get_attribute($this->env, $this->source, $context["news"], "Thumb", [], "any", false, false, false, 10)) : ("")), "detail"], "method", false, false, false, 10);
// line 11
echo "
";
// line 12
$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->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["news"], "Translation", [], "any", false, false, false, 12), 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.', 12, $this->source); })()), "request", [], "any", false, false, false, 12), "locale", [], "any", false, false, false, 12), [], "array", false, false, false, 12), "slug", [], "any", false, false, false, 12)], 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.', 12, $this->source); })()), "request", [], "any", false, false, false, 12), "locale", [], "any", false, false, false, 12)], "method", false, false, false, 12);
// line 13
echo " <a href=\"";
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", null, true);
echo "\" class=\"block-item block-image block-image--position-";
echo (((0 == twig_get_attribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 13) % 2)) ? ("right") : ("left"));
echo "\">
<div class=\"block-image__container\">
<div class=\"block-image__text\">
";
// line 17
if (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["news"], "Translation", [], "any", false, false, false, 17), 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.', 17, $this->source); })()), "request", [], "any", false, false, false, 17), "locale", [], "any", false, false, false, 17), [], "array", false, false, false, 17), "titleHtml", [], "any", false, false, false, 17)) {
// line 18
echo " <div class=\"block__h3\">
";
// line 19
echo twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["news"], "Translation", [], "any", false, false, false, 19), 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.', 19, $this->source); })()), "request", [], "any", false, false, false, 19), "locale", [], "any", false, false, false, 19), [], "array", false, false, false, 19), "titleHtml", [], "any", false, false, false, 19);
echo "
</div>
";
}
// line 22
echo " <div class=\"home-news__date\">
<time class=\"block__text\">
";
// line 24
echo twig_escape_filter($this->env, twig_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", false, false, false, 24), 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.', 24, $this->source); })()), "request", [], "any", false, false, false, 24), "locale", [], "any", false, false, false, 24)), "D", [], "any", false, false, false, 24), "html", null, true);
echo "
";
// line 25
echo twig_escape_filter($this->env, twig_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", false, false, false, 25), 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.', 25, $this->source); })()), "request", [], "any", false, false, false, 25), "locale", [], "any", false, false, false, 25)), "month", [], "any", false, false, false, 25), "html", null, true);
echo "
";
// line 26
echo twig_escape_filter($this->env, twig_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", false, false, false, 26), 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), "locale", [], "any", false, false, false, 26)), "y", [], "any", false, false, false, 26), "html", null, true);
echo "
</time>
</div>
";
// line 29
if (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["news"], "Translation", [], "any", false, false, false, 29), 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.', 29, $this->source); })()), "request", [], "any", false, false, false, 29), "locale", [], "any", false, false, false, 29), [], "array", false, false, false, 29), "shortLead", [], "any", false, false, false, 29)) {
// line 30
echo " <div class=\"block__text\">
";
// line 31
echo twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["news"], "Translation", [], "any", false, false, false, 31), 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.', 31, $this->source); })()), "request", [], "any", false, false, false, 31), "locale", [], "any", false, false, false, 31), [], "array", false, false, false, 31), "shortLead", [], "any", false, false, false, 31);
echo "
</div>
";
}
// line 34
echo "
";
// line 35
if ((isset($context["href"]) || array_key_exists("href", $context) ? $context["href"] : (function () { throw new RuntimeError('Variable "href" does not exist.', 35, $this->source); })())) {
// line 36
echo " <div class=\"block-text__btns\">
<div class=\"block-text__btns__btn\">
<span>";
// line 38
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->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.', 38, $this->source); })()), "request", [], "any", false, false, false, 38), "locale", [], "any", false, false, false, 38)), "html", null, true);
echo "</span>
";
// line 39
echo twig_call_macro($macros["__internal_parse_63"], "macro_arrowright", [], 39, $context, $this->getSourceContext());
echo "
</div>
</div>
";
}
// line 43
echo " </div>
<div class=\"block-image__image\">
";
// line 45
if ((isset($context["img"]) || array_key_exists("img", $context) ? $context["img"] : (function () { throw new RuntimeError('Variable "img" does not exist.', 45, $this->source); })())) {
// line 46
echo " <img class=\"block-image__image__img\" loading=\"lazy\" src=\"";
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", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["news"], "Translation", [], "any", false, false, false, 46), 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.', 46, $this->source); })()), "request", [], "any", false, false, false, 46), "locale", [], "any", false, false, false, 46), [], "array", false, false, false, 46), "alt", [], "any", false, false, false, 46), "html", null, true);
echo "\">
";
}
// line 48
echo " </div>
</div>
</a>
";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['news'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 52
echo " ";
$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->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.', 52, $this->source); })()), "request", [], "any", false, false, false, 52), "locale", [], "any", false, false, false, 52)], "method", false, false, false, 52);
// line 53
echo " ";
if ((isset($context["hrefNews"]) || array_key_exists("hrefNews", $context) ? $context["hrefNews"] : (function () { throw new RuntimeError('Variable "hrefNews" does not exist.', 53, $this->source); })())) {
// line 54
echo " <a href=\"";
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", null, true);
echo "\" class=\"btn btn--color-white btn--position-right\">
<span>";
// line 55
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->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.', 55, $this->source); })()), "request", [], "any", false, false, false, 55), "locale", [], "any", false, false, false, 55)), "html", null, true);
echo "</span> ";
echo twig_call_macro($macros["__internal_parse_63"], "macro_arrowright", [], 55, $context, $this->getSourceContext());
echo "
</a>
";
}
// line 58
echo "
</div>
</div>
</div>
";
}
}
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
public function getTemplateName()
{
return "@openform_front_templates/Index/components/_news.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
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,);
}
public function getSourceContext()
{
return new Source("
{% from '@openform_front_templates/_includes/_icons.html.twig' import arrowright %}
{% if openform_front_util.Config.showHomeNews %}
{% if featuredNews|length > 0 %}
<div class=\"home-news\">
<div class=\"container block-container\">
<div class=\"block__h2 block-container__title\">{{('T_HOME_NEWS')|trans({}, 'openform_front', app.request.locale)}}</div>
<div class=\"block-container__blocks\">
{% for news in featuredNews %}
{% set img = openform_front_util.getImagePathByType(news.Thumb ?? '','detail') %}
{% set href = toolkit_route_localizer.generate('news_item',{ slug : news.Translation[app.request.locale].slug }, app.request.locale) %}
<a href=\"{{href}}\" class=\"block-item block-image block-image--position-{{ loop.index is divisible by(2) ? 'right' : 'left' }}\">
<div class=\"block-image__container\">
<div class=\"block-image__text\">
{% if news.Translation[app.request.locale].titleHtml %}
<div class=\"block__h3\">
{{ news.Translation[app.request.locale].titleHtml|raw }}
</div>
{% endif %}
<div class=\"home-news__date\">
<time class=\"block__text\">
{{ news.publishDate|explodedDate(app.request.locale).D }}
{{ news.publishDate|explodedDate(app.request.locale).month }}
{{ news.publishDate|explodedDate(app.request.locale).y }}
</time>
</div>
{% if news.Translation[app.request.locale].shortLead %}
<div class=\"block__text\">
{{ news.Translation[app.request.locale].shortLead|raw }}
</div>
{% endif %}
{% if href %}
<div class=\"block-text__btns\">
<div class=\"block-text__btns__btn\">
<span>{{('T_SEE_MORE')|trans({}, 'openform_front', app.request.locale)}}</span>
{{arrowright()}}
</div>
</div>
{% endif %}
</div>
<div class=\"block-image__image\">
{% if img %}
<img class=\"block-image__image__img\" loading=\"lazy\" src=\"{{img}}\" alt=\"{{ news.Translation[app.request.locale].alt }}\">
{% endif %}
</div>
</div>
</a>
{% endfor %}
{% set hrefNews = toolkit_route_localizer.generate('news_list',{}, app.request.locale) %}
{% if hrefNews %}
<a href=\"{{hrefNews}}\" class=\"btn btn--color-white btn--position-right\">
<span>{{('T_SEE_ALL_NEWS')|trans({}, 'openform_front', app.request.locale)}}</span> {{arrowright()}}
</a>
{% endif %}
</div>
</div>
</div>
{% endif %}
{% endif %}
", "@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");
}
}