<?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;
/* front/blog/_blog-card.html.twig */
class __TwigTemplate_643e8ee63a3b963e084d32d6f3910e84 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", "front/blog/_blog-card.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/blog/_blog-card.html.twig"));
// line 1
echo "<div class=\"blog-card\">
\t<a href=\"";
// line 2
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("show_article", ["slug" => twig_get_attribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 2, $this->source); })()), "slug", [], "any", false, false, false, 2)]), "html", null, true);
echo "\">
\t<div class=\"blog-card-img\">
\t\t<img loading=\"lazy\" src=\"";
// line 4
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(("/images/blog/" . twig_get_attribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 4, $this->source); })()), "cover", [], "any", false, false, false, 4))), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 4, $this->source); })()), "altCover", [], "any", false, false, false, 4), "html", null, true);
echo "\"/>
\t\t<div class=\"categories-wrap\">
\t\t\t";
// line 6
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 6, $this->source); })()), "categories", [], "any", false, false, false, 6));
$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["category"]) {
// line 7
echo "\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 7) <= 2)) {
// line 8
echo "
\t\t\t\t\t";
// line 9
$context["articleCategoryInfos"] = $this->extensions['App\Twig\AppExtension']->articleCategoryInfos($context["category"], 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.', 9, $this->source); })()), "request", [], "any", false, false, false, 9), "locale", [], "any", false, false, false, 9));
// line 10
echo "
\t\t\t\t\t<a href=\"";
// line 11
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["articleCategoryInfos"]) || array_key_exists("articleCategoryInfos", $context) ? $context["articleCategoryInfos"] : (function () { throw new RuntimeError('Variable "articleCategoryInfos" does not exist.', 11, $this->source); })()), "link", [], "any", false, false, false, 11), "html", null, true);
echo "\" class=\"category-item\">";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["articleCategoryInfos"]) || array_key_exists("articleCategoryInfos", $context) ? $context["articleCategoryInfos"] : (function () { throw new RuntimeError('Variable "articleCategoryInfos" does not exist.', 11, $this->source); })()), "title", [], "any", false, false, false, 11), "html", null, true);
echo "</a>
\t\t\t\t";
}
// line 13
echo "\t\t\t";
++$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['category'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 14
echo "\t\t</div>
\t\t<a href=\"";
// line 15
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("show_article", ["slug" => twig_get_attribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 15, $this->source); })()), "slug", [], "any", false, false, false, 15)]), "html", null, true);
echo "\">
\t\t\t<div class=\"blog-card-image-after\"></div>
\t\t</a>
\t</div>
\t<div class=\"blog-card-preview\">
\t\t<div class=\"blog-author\">
\t\t\t
\t\t\t<h2 class=\"blog-title\">
<a href=\"";
// line 23
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("show_article", ["slug" => twig_get_attribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 23, $this->source); })()), "slug", [], "any", false, false, false, 23)]), "html", null, true);
echo "\">
";
// line 24
echo twig_get_attribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 24, $this->source); })()), "title", [], "any", false, false, false, 24);
echo "
</a>
</h2>
\t\t\t<div class=\"preview-content\">
\t\t\t\t<div class=\"extract\">
\t\t\t\t\t";
// line 29
echo twig_slice($this->env, twig_striptags(twig_get_attribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 29, $this->source); })()), "description", [], "any", false, false, false, 29)), 0, 600);
echo "
\t\t\t\t</div>
\t\t\t\t<a href=\"";
// line 31
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("show_article", ["slug" => twig_get_attribute($this->env, $this->source, (isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 31, $this->source); })()), "slug", [], "any", false, false, false, 31)]), "html", null, true);
echo "\" class=\"read-more\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("blog.read_more"), "html", null, true);
echo "</a>
\t\t\t</div>
\t\t</div>
\t</div>
\t</a>
</div>
";
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "front/blog/_blog-card.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 138 => 31, 133 => 29, 125 => 24, 121 => 23, 110 => 15, 107 => 14, 93 => 13, 86 => 11, 83 => 10, 81 => 9, 78 => 8, 75 => 7, 58 => 6, 51 => 4, 46 => 2, 43 => 1,);
}
public function getSourceContext()
{
return new Source("<div class=\"blog-card\">
\t<a href=\"{{ path('show_article', {'slug': article.slug}) }}\">
\t<div class=\"blog-card-img\">
\t\t<img loading=\"lazy\" src=\"{{asset('/images/blog/' ~ article.cover) }}\" alt=\"{{ article.altCover }}\"/>
\t\t<div class=\"categories-wrap\">
\t\t\t{% for category in article.categories %}
\t\t\t\t{% if loop.index <= 2 %}
\t\t\t\t\t{% set articleCategoryInfos = articleCategoryInfos(category, app.request.locale) %}
\t\t\t\t\t<a href=\"{{ articleCategoryInfos.link }}\" class=\"category-item\">{{ articleCategoryInfos.title }}</a>
\t\t\t\t{% endif %}
\t\t\t{% endfor %}
\t\t</div>
\t\t<a href=\"{{ path('show_article', {'slug': article.slug}) }}\">
\t\t\t<div class=\"blog-card-image-after\"></div>
\t\t</a>
\t</div>
\t<div class=\"blog-card-preview\">
\t\t<div class=\"blog-author\">
\t\t\t
\t\t\t<h2 class=\"blog-title\">
<a href=\"{{ path('show_article', {'slug': article.slug}) }}\">
{{ article.title | raw }}
</a>
</h2>
\t\t\t<div class=\"preview-content\">
\t\t\t\t<div class=\"extract\">
\t\t\t\t\t{{ article.description | striptags | slice (0, 600) | raw}}
\t\t\t\t</div>
\t\t\t\t<a href=\"{{ path('show_article', {'slug': article.slug}) }}\" class=\"read-more\">{{ 'blog.read_more' | trans }}</a>
\t\t\t</div>
\t\t</div>
\t</div>
\t</a>
</div>
", "front/blog/_blog-card.html.twig", "/var/www/preprod/racket-trip/templates/front/blog/_blog-card.html.twig");
}
}