var/cache/dev/twig/00/00cd1d0cbd9e8d91869617932e3287b4.php line 58

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* pages/sim/news.html.twig */
  16. class __TwigTemplate_4a67e058659adddfdafe58c6d9111cd1 extends Template
  17. {
  18. private Source $source;
  19. /**
  20. * @var array<string, Template>
  21. */
  22. private array $macros = [];
  23. public function __construct(Environment $env)
  24. {
  25. parent::__construct($env);
  26. $this->source = $this->getSourceContext();
  27. $this->blocks = [
  28. 'content' => [$this, 'block_content'],
  29. ];
  30. }
  31. protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
  32. {
  33. // line 1
  34. return "layouts/common/default.html.twig";
  35. }
  36. protected function doDisplay(array $context, array $blocks = []): iterable
  37. {
  38. $macros = $this->macros;
  39. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  40. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "pages/sim/news.html.twig"));
  41. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  42. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "pages/sim/news.html.twig"));
  43. // line 3
  44. $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"]));
  45. // line 4
  46. $context["page_title"] = $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("news.title");
  47. // line 1
  48. $this->parent = $this->load("layouts/common/default.html.twig", 1);
  49. yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
  50. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  51. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  52. }
  53. // line 6
  54. /**
  55. * @return iterable<null|scalar|\Stringable>
  56. */
  57. public function block_content(array $context, array $blocks = []): iterable
  58. {
  59. $macros = $this->macros;
  60. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  61. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
  62. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  63. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
  64. // line 7
  65. yield "<h1 class=\"is-Page-H1\">";
  66. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("nav.news"), "html", null, true);
  67. yield "</h1>
  68. ";
  69. // line 8
  70. 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); })())))) {
  71. // line 9
  72. yield "<div class=\"is-Banner\">
  73. <div class=\"is-Banner-Wrapper";
  74. // line 10
  75. 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) != " "))) {
  76. yield " is-Banner-Wrapper_WithImage";
  77. }
  78. yield "\">
  79. <a href=\"";
  80. // line 11
  81. 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);
  82. yield "\" class=\"is-Banner-Wrapper-Link\">
  83. ";
  84. // line 12
  85. 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) != " "))) {
  86. // line 13
  87. yield " <img class=\"is-Banner-Image\" src=\"";
  88. 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);
  89. yield "\" alt=\"\">
  90. ";
  91. }
  92. // line 15
  93. yield " <div class=\"is-Banner-Content\">
  94. <h2 class=\"is-Banner-H2\">";
  95. // line 16
  96. 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);
  97. yield "</h2>
  98. <p class=\"is-Banner-Text\">";
  99. // line 17
  100. 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);
  101. yield "</p>
  102. </div>
  103. </a>
  104. </div>
  105. </div>
  106. ";
  107. }
  108. // line 23
  109. yield "
  110. <div class=\"is-row is-PostList is-Equalizer\" is-data-equalizer-id=\"news-items\">
  111. ";
  112. // line 25
  113. $context['_parent'] = $context;
  114. $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); })()));
  115. foreach ($context['_seq'] as $context["_key"] => $context["post"]) {
  116. // line 26
  117. yield " <article class=\"is-Post is-col-xs-12 is-col-sm-12 is-col-md-4 is-col-lg-3\">
  118. <a href=\"";
  119. // line 27
  120. 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);
  121. yield "\" class=\"is-Post-Link\">
  122. <div class=\"is-Post-Image-Wrapper\">
  123. <img class=\"is-Post-Image\" src=\"";
  124. // line 29
  125. 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)));
  126. yield "\" alt=\"\">
  127. </div>
  128. <div class=\"is-Post-Content\" is-data-equalizer-watch=\"news-items\">
  129. <header>
  130. <h3 class=\"is-Post-Title is-Post-Title_Blue\">";
  131. // line 33
  132. 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);
  133. yield "</h3>
  134. </header>
  135. <p class=\"is-Post-Summary\">";
  136. // line 35
  137. 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);
  138. yield "</p>
  139. <footer class=\"is-Post-Footer\">
  140. <span class=\"is-Post-Date is-Post-Date_Blue\">";
  141. // line 37
  142. 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);
  143. yield "</span>
  144. </footer>
  145. </div>
  146. </a>
  147. </article>
  148. ";
  149. }
  150. $_parent = $context['_parent'];
  151. unset($context['_seq'], $context['_key'], $context['post'], $context['_parent']);
  152. $context = array_intersect_key($context, $_parent) + $_parent;
  153. // line 43
  154. yield "</div>
  155. ";
  156. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  157. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  158. yield from [];
  159. }
  160. /**
  161. * @codeCoverageIgnore
  162. */
  163. public function getTemplateName(): string
  164. {
  165. return "pages/sim/news.html.twig";
  166. }
  167. /**
  168. * @codeCoverageIgnore
  169. */
  170. public function isTraitable(): bool
  171. {
  172. return false;
  173. }
  174. /**
  175. * @codeCoverageIgnore
  176. */
  177. public function getDebugInfo(): array
  178. {
  179. 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,);
  180. }
  181. public function getSourceContext(): Source
  182. {
  183. return new Source("{% extends 'layouts/common/default.html.twig' %}
  184. {% set pageAttributes = pageAttributes is defined ? pageAttributes : { group: 'sim', section: 'sim' } %}
  185. {% set page_title = 'news.title'|trans %}
  186. {% block content %}
  187. <h1 class=\"is-Page-H1\">{{ 'nav.news'|trans }}</h1>
  188. {% if firstPost is defined and firstPost is not empty%}
  189. <div class=\"is-Banner\">
  190. <div class=\"is-Banner-Wrapper{% if firstPost.image is not empty and firstPost.image != ' ' %} is-Banner-Wrapper_WithImage{% endif %}\">
  191. <a href=\"{{ path('news.get', {'id': firstPost.id}) }}\" class=\"is-Banner-Wrapper-Link\">
  192. {% if firstPost.image is not empty and firstPost.image != ' ' %}
  193. <img class=\"is-Banner-Image\" src=\"{{ firstPost.image }}\" alt=\"\">
  194. {% endif %}
  195. <div class=\"is-Banner-Content\">
  196. <h2 class=\"is-Banner-H2\">{{ firstPost.title }}</h2>
  197. <p class=\"is-Banner-Text\">{{ firstPost.content | u.truncate(250) | raw }}</p>
  198. </div>
  199. </a>
  200. </div>
  201. </div>
  202. {% endif %}
  203. <div class=\"is-row is-PostList is-Equalizer\" is-data-equalizer-id=\"news-items\">
  204. {% for post in posts %}
  205. <article class=\"is-Post is-col-xs-12 is-col-sm-12 is-col-md-4 is-col-lg-3\">
  206. <a href=\"{{ path('news.get', {'id': post.id}) }}\" class=\"is-Post-Link\">
  207. <div class=\"is-Post-Image-Wrapper\">
  208. <img class=\"is-Post-Image\" src=\"{{ (post.image is empty or post.image|trim == '') ? asset('img/sim/img_default.png') : post.image }}\" alt=\"\">
  209. </div>
  210. <div class=\"is-Post-Content\" is-data-equalizer-watch=\"news-items\">
  211. <header>
  212. <h3 class=\"is-Post-Title is-Post-Title_Blue\">{{ post.title }}</h3>
  213. </header>
  214. <p class=\"is-Post-Summary\">{{ post.content|u.truncate(90)|raw }}</p>
  215. <footer class=\"is-Post-Footer\">
  216. <span class=\"is-Post-Date is-Post-Date_Blue\">{{ post.time_diff }}</span>
  217. </footer>
  218. </div>
  219. </a>
  220. </article>
  221. {% endfor %}
  222. </div>
  223. {% endblock %}
  224. ", "pages/sim/news.html.twig", "/var/www/html/templates/pages/sim/news.html.twig");
  225. }
  226. }