<?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;
/* pages/sim/news.html.twig */
class __TwigTemplate_4a67e058659adddfdafe58c6d9111cd1 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->blocks = [
'content' => [$this, 'block_content'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "layouts/common/default.html.twig";
}
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", "pages/sim/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", "pages/sim/news.html.twig"));
// line 3
$context["pageAttributes"] = ((array_key_exists("pageAttributes", $context)) ? ((isset($context["pageAttributes"]) || array_key_exists("pageAttributes", $context) ? $context["pageAttributes"] : (function () { throw new RuntimeError('Variable "pageAttributes" does not exist.', 3, $this->source); })())) : (["group" => "sim", "section" => "sim"]));
// line 4
$context["page_title"] = $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("news.title");
// line 1
$this->parent = $this->load("layouts/common/default.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 6
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_content(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(), "block", "content"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
// line 7
yield "<h1 class=\"is-Page-H1\">";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("nav.news"), "html", null, true);
yield "</h1>
";
// line 8
if ((array_key_exists("firstPost", $context) && !Twig\Extension\CoreExtension::testEmpty((isset($context["firstPost"]) || array_key_exists("firstPost", $context) ? $context["firstPost"] : (function () { throw new RuntimeError('Variable "firstPost" does not exist.', 8, $this->source); })())))) {
// line 9
yield "<div class=\"is-Banner\">
<div class=\"is-Banner-Wrapper";
// line 10
if (( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["firstPost"]) || array_key_exists("firstPost", $context) ? $context["firstPost"] : (function () { throw new RuntimeError('Variable "firstPost" does not exist.', 10, $this->source); })()), "image", [], "any", false, false, false, 10)) && (CoreExtension::getAttribute($this->env, $this->source, (isset($context["firstPost"]) || array_key_exists("firstPost", $context) ? $context["firstPost"] : (function () { throw new RuntimeError('Variable "firstPost" does not exist.', 10, $this->source); })()), "image", [], "any", false, false, false, 10) != " "))) {
yield " is-Banner-Wrapper_WithImage";
}
yield "\">
<a href=\"";
// line 11
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("news.get", ["id" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["firstPost"]) || array_key_exists("firstPost", $context) ? $context["firstPost"] : (function () { throw new RuntimeError('Variable "firstPost" does not exist.', 11, $this->source); })()), "id", [], "any", false, false, false, 11)]), "html", null, true);
yield "\" class=\"is-Banner-Wrapper-Link\">
";
// line 12
if (( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["firstPost"]) || array_key_exists("firstPost", $context) ? $context["firstPost"] : (function () { throw new RuntimeError('Variable "firstPost" does not exist.', 12, $this->source); })()), "image", [], "any", false, false, false, 12)) && (CoreExtension::getAttribute($this->env, $this->source, (isset($context["firstPost"]) || array_key_exists("firstPost", $context) ? $context["firstPost"] : (function () { throw new RuntimeError('Variable "firstPost" does not exist.', 12, $this->source); })()), "image", [], "any", false, false, false, 12) != " "))) {
// line 13
yield " <img class=\"is-Banner-Image\" src=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["firstPost"]) || array_key_exists("firstPost", $context) ? $context["firstPost"] : (function () { throw new RuntimeError('Variable "firstPost" does not exist.', 13, $this->source); })()), "image", [], "any", false, false, false, 13), "html", null, true);
yield "\" alt=\"\">
";
}
// line 15
yield " <div class=\"is-Banner-Content\">
<h2 class=\"is-Banner-H2\">";
// line 16
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["firstPost"]) || array_key_exists("firstPost", $context) ? $context["firstPost"] : (function () { throw new RuntimeError('Variable "firstPost" does not exist.', 16, $this->source); })()), "title", [], "any", false, false, false, 16), "html", null, true);
yield "</h2>
<p class=\"is-Banner-Text\">";
// line 17
yield CoreExtension::getAttribute($this->env, $this->source, $this->extensions['Twig\Extra\String\StringExtension']->createUnicodeString(CoreExtension::getAttribute($this->env, $this->source, (isset($context["firstPost"]) || array_key_exists("firstPost", $context) ? $context["firstPost"] : (function () { throw new RuntimeError('Variable "firstPost" does not exist.', 17, $this->source); })()), "content", [], "any", false, false, false, 17)), "truncate", [250], "method", false, false, false, 17);
yield "</p>
</div>
</a>
</div>
</div>
";
}
// line 23
yield "
<div class=\"is-row is-PostList is-Equalizer\" is-data-equalizer-id=\"news-items\">
";
// line 25
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["posts"]) || array_key_exists("posts", $context) ? $context["posts"] : (function () { throw new RuntimeError('Variable "posts" does not exist.', 25, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["post"]) {
// line 26
yield " <article class=\"is-Post is-col-xs-12 is-col-sm-12 is-col-md-4 is-col-lg-3\">
<a href=\"";
// line 27
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("news.get", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["post"], "id", [], "any", false, false, false, 27)]), "html", null, true);
yield "\" class=\"is-Post-Link\">
<div class=\"is-Post-Image-Wrapper\">
<img class=\"is-Post-Image\" src=\"";
// line 29
yield (((Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "image", [], "any", false, false, false, 29)) || (Twig\Extension\CoreExtension::trim(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "image", [], "any", false, false, false, 29)) == ""))) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("img/sim/img_default.png"), "html", null, true)) : ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "image", [], "any", false, false, false, 29), "html", null, true)));
yield "\" alt=\"\">
</div>
<div class=\"is-Post-Content\" is-data-equalizer-watch=\"news-items\">
<header>
<h3 class=\"is-Post-Title is-Post-Title_Blue\">";
// line 33
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "title", [], "any", false, false, false, 33), "html", null, true);
yield "</h3>
</header>
<p class=\"is-Post-Summary\">";
// line 35
yield CoreExtension::getAttribute($this->env, $this->source, $this->extensions['Twig\Extra\String\StringExtension']->createUnicodeString(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "content", [], "any", false, false, false, 35)), "truncate", [90], "method", false, false, false, 35);
yield "</p>
<footer class=\"is-Post-Footer\">
<span class=\"is-Post-Date is-Post-Date_Blue\">";
// line 37
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "time_diff", [], "any", false, false, false, 37), "html", null, true);
yield "</span>
</footer>
</div>
</a>
</article>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['post'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 43
yield "</div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "pages/sim/news.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 170 => 43, 158 => 37, 153 => 35, 148 => 33, 141 => 29, 136 => 27, 133 => 26, 129 => 25, 125 => 23, 116 => 17, 112 => 16, 109 => 15, 103 => 13, 101 => 12, 97 => 11, 91 => 10, 88 => 9, 86 => 8, 81 => 7, 68 => 6, 57 => 1, 55 => 4, 53 => 3, 40 => 1,);
}
public function getSourceContext(): Source
{
return new Source("{% extends 'layouts/common/default.html.twig' %}
{% set pageAttributes = pageAttributes is defined ? pageAttributes : { group: 'sim', section: 'sim' } %}
{% set page_title = 'news.title'|trans %}
{% block content %}
<h1 class=\"is-Page-H1\">{{ 'nav.news'|trans }}</h1>
{% if firstPost is defined and firstPost is not empty%}
<div class=\"is-Banner\">
<div class=\"is-Banner-Wrapper{% if firstPost.image is not empty and firstPost.image != ' ' %} is-Banner-Wrapper_WithImage{% endif %}\">
<a href=\"{{ path('news.get', {'id': firstPost.id}) }}\" class=\"is-Banner-Wrapper-Link\">
{% if firstPost.image is not empty and firstPost.image != ' ' %}
<img class=\"is-Banner-Image\" src=\"{{ firstPost.image }}\" alt=\"\">
{% endif %}
<div class=\"is-Banner-Content\">
<h2 class=\"is-Banner-H2\">{{ firstPost.title }}</h2>
<p class=\"is-Banner-Text\">{{ firstPost.content | u.truncate(250) | raw }}</p>
</div>
</a>
</div>
</div>
{% endif %}
<div class=\"is-row is-PostList is-Equalizer\" is-data-equalizer-id=\"news-items\">
{% for post in posts %}
<article class=\"is-Post is-col-xs-12 is-col-sm-12 is-col-md-4 is-col-lg-3\">
<a href=\"{{ path('news.get', {'id': post.id}) }}\" class=\"is-Post-Link\">
<div class=\"is-Post-Image-Wrapper\">
<img class=\"is-Post-Image\" src=\"{{ (post.image is empty or post.image|trim == '') ? asset('img/sim/img_default.png') : post.image }}\" alt=\"\">
</div>
<div class=\"is-Post-Content\" is-data-equalizer-watch=\"news-items\">
<header>
<h3 class=\"is-Post-Title is-Post-Title_Blue\">{{ post.title }}</h3>
</header>
<p class=\"is-Post-Summary\">{{ post.content|u.truncate(90)|raw }}</p>
<footer class=\"is-Post-Footer\">
<span class=\"is-Post-Date is-Post-Date_Blue\">{{ post.time_diff }}</span>
</footer>
</div>
</a>
</article>
{% endfor %}
</div>
{% endblock %}
", "pages/sim/news.html.twig", "/var/www/html/templates/pages/sim/news.html.twig");
}
}