<?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;
/* article/show.html.twig */
class __TwigTemplate_cf165116bffa52d57eb19d34b1192bbd extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'title' => [$this, 'block_title'],
'body' => [$this, 'block_body'],
];
}
protected function doGetParent(array $context)
{
// line 1
return "base.html.twig";
}
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", "article/show.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "article/show.html.twig"));
$this->parent = $this->loadTemplate("base.html.twig", "article/show.html.twig", 1);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
public function block_title($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(), "block", "title"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
// line 4
echo "\t";
if (array_key_exists("title", $context)) {
// line 5
echo "\t\t";
echo twig_escape_filter($this->env, twig_replace_filter((isset($context["title"]) || array_key_exists("title", $context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.', 5, $this->source); })()), ["<br>" => ""]), "html", null, true);
echo "
\t";
} else {
// line 7
echo "\t\t";
echo twig_escape_filter($this->env, twig_replace_filter(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.', 7, $this->source); })()), "title", [], "any", false, false, false, 7), ["<br>" => ""]), "html", null, true);
echo "
\t";
}
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 11
public function block_body($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(), "block", "body"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
// line 12
echo "\t<div class=\"titre\">
\t\t<h1>";
// line 13
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.', 13, $this->source); })()), "title", [], "any", false, false, false, 13);
echo "</h1>
\t</div>
\t";
// line 15
if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_EDITOR")) {
// line 16
echo "\t\t";
$context["url"] = twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $this->extensions['EasyCorp\Bundle\EasyAdminBundle\Twig\EasyAdminTwigExtension']->getAdminUrlGenerator(), "setController", ["App\\Controller\\Admin\\ArticleCrudController"], "method", false, false, false, 16), "setAction", ["edit"], "method", false, false, false, 17), "setEntityId", [twig_get_attribute($this->env, $this->source, // line 19
(isset($context["article"]) || array_key_exists("article", $context) ? $context["article"] : (function () { throw new RuntimeError('Variable "article" does not exist.', 19, $this->source); })()), "id", [], "any", false, false, false, 19)], "method", false, false, false, 18);
// line 20
echo "\t\t<p>
<a class=\"adm-link\" href=\"";
// line 21
echo twig_escape_filter($this->env, (isset($context["url"]) || array_key_exists("url", $context) ? $context["url"] : (function () { throw new RuntimeError('Variable "url" does not exist.', 21, $this->source); })()), "html", null, true);
echo "\" target=\"_blank\">administrer l'article</a><br>
";
// line 22
if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_SUPER_ADMIN")) {
echo "<strong>tmpOldIds:";
echo twig_escape_filter($this->env, twig_join_filter(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.', 22, $this->source); })()), "tmpOldIds", [], "any", false, false, false, 22), ","), "html", null, true);
echo "</strong>";
}
// line 23
echo " </p>
\t";
}
// line 25
echo "
<div class=\"container\">
<div class=\"date\">
";
// line 28
echo twig_escape_filter($this->env, twig_date_format_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.', 28, $this->source); })()), "createdAt", [], "any", false, false, false, 28), "d/m/Y"), "html", null, true);
echo "
</div>
";
// line 31
$this->loadTemplate("media/postMedias.html.twig", "article/show.html.twig", 31)->display(twig_array_merge($context, ["medias" => 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); })()), "medias", [], "any", false, false, false, 31), "mediasType" => "slides"]));
// line 32
echo "
";
// line 33
if ((twig_length_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.', 33, $this->source); })()), "chapo", [], "any", false, false, false, 33)) > 5)) {
// line 34
echo " <div class=\"chapo\">
";
// line 35
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.', 35, $this->source); })()), "chapo", [], "any", false, false, false, 35);
echo "
</div>
";
}
// line 38
echo "
";
// line 40
$context["hideThumbnails"] = false;
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_array_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.', 40, $this->source); })()), "medias", [], "any", false, false, false, 40), function ($__media__) use ($context, $macros) { $context["media"] = $__media__; return (twig_get_attribute($this->env, $this->source, $context["media"], "role", [], "any", false, false, false, 40) == "slide"); }));
foreach ($context['_seq'] as $context["_key"] => $context["media"]) {
$context["hideThumbnails"] = true;
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['media'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 41
echo " ";
if ( !(isset($context["hideThumbnails"]) || array_key_exists("hideThumbnails", $context) ? $context["hideThumbnails"] : (function () { throw new RuntimeError('Variable "hideThumbnails" does not exist.', 41, $this->source); })())) {
$this->loadTemplate("media/postMedias.html.twig", "article/show.html.twig", 41)->display(twig_array_merge($context, ["medias" => 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.', 41, $this->source); })()), "medias", [], "any", false, false, false, 41), "mediasType" => "thumbnails"]));
}
// line 42
echo "
<div class=\"contenu\">
";
// line 46
if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_SUPER_ADMIN")) {
echo "<strong>tmpOldIds:";
echo twig_escape_filter($this->env, twig_join_filter(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.', 46, $this->source); })()), "tmpOldIds", [], "any", false, false, false, 46), ","), "html", null, true);
echo "</strong><br><br>";
}
// line 47
echo " ";
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.', 47, $this->source); })()), "content", [], "any", false, false, false, 47);
echo "
</div>
";
// line 50
$this->loadTemplate("media/postMedias.html.twig", "article/show.html.twig", 50)->display(twig_array_merge($context, ["medias" => 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.', 50, $this->source); })()), "medias", [], "any", false, false, false, 50), "mediasType" => "documents"]));
// line 51
echo "\t</div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
public function getTemplateName()
{
return "article/show.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 200 => 51, 198 => 50, 191 => 47, 185 => 46, 179 => 42, 174 => 41, 164 => 40, 160 => 38, 154 => 35, 151 => 34, 149 => 33, 146 => 32, 144 => 31, 138 => 28, 133 => 25, 129 => 23, 123 => 22, 119 => 21, 116 => 20, 114 => 19, 112 => 16, 110 => 15, 105 => 13, 102 => 12, 92 => 11, 78 => 7, 72 => 5, 69 => 4, 59 => 3, 36 => 1,);
}
public function getSourceContext()
{
return new Source("{% extends 'base.html.twig' %}
{% block title %}
\t{% if title is defined %}
\t\t{{ title|replace({ '<br>':'' }) }}
\t{% else %}
\t\t{{ article.title|replace({ '<br>':'' }) }}
\t{% endif %}
{% endblock %}
{% block body %}
\t<div class=\"titre\">
\t\t<h1>{{ article.title|raw }}</h1>
\t</div>
\t{% if is_granted('ROLE_EDITOR') %}
\t\t{% set url = ea_url()
\t\t\t.setController('App\\\\Controller\\\\Admin\\\\ArticleCrudController')
\t\t\t.setAction('edit')
\t\t\t.setEntityId(article.id) %}
\t\t<p>
<a class=\"adm-link\" href=\"{{ url }}\" target=\"_blank\">administrer l'article</a><br>
{% if is_granted('ROLE_SUPER_ADMIN') %}<strong>tmpOldIds:{{ article.tmpOldIds|join(\",\") }}</strong>{% endif %}
</p>
\t{% endif %}
<div class=\"container\">
<div class=\"date\">
{{article.createdAt|date(\"d/m/Y\")}}
</div>
{% include 'media/postMedias.html.twig' with {'medias': article.medias, 'mediasType': 'slides' } %}
{% if article.chapo|length > 5 %}
<div class=\"chapo\">
{{ article.chapo|raw }}
</div>
{% endif %}
{% set hideThumbnails = false %}{% for media in article.medias|filter(media => media.role == \"slide\") %}{% set hideThumbnails = true %}{% endfor %}{# car icig ne veut pas de thumbnail s'il y a des slides #}
{% if not hideThumbnails %}{% include 'media/postMedias.html.twig' with {'medias': article.medias, 'mediasType': 'thumbnails' } %}{% endif %}
<div class=\"contenu\">
{% if is_granted('ROLE_SUPER_ADMIN') %}<strong>tmpOldIds:{{ article.tmpOldIds|join(\",\") }}</strong><br><br>{% endif %}
{{ article.content|raw }}
</div>
{% include 'media/postMedias.html.twig' with {'medias': article.medias, 'mediasType': 'documents' } %}
\t</div>
{% endblock %}
", "article/show.html.twig", "/home/ovow2306/public_html/ici-grenoble/ici-gre-back-dev/templates/article/show.html.twig");
}
}