<?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;
/* home/home.html.twig */
class __TwigTemplate_4714168958827dfa9fd33a536ad93c3aab99e1de6aa94b6cf9fb6f6dd1a3f4ce extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'body' => [$this, 'block_body'],
'javascripts' => [$this, 'block_javascripts'],
];
}
protected function doGetParent(array $context)
{
// line 1
return "base.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "home/home.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "home/home.html.twig"));
$this->parent = $this->loadTemplate("base.html.twig", "home/home.html.twig", 1);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
// line 3
public function block_body($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
// line 4
echo " <h1>Page d'accueil</h1>
";
// line 5
if (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.', 5, $this->source); })()), "user", [], "any", false, false, false, 5)) {
// line 6
echo " <fieldset>
";
// line 7
if ((isset($context["articles"]) || array_key_exists("articles", $context) ? $context["articles"] : (function () { throw new RuntimeError('Variable "articles" does not exist.', 7, $this->source); })())) {
// line 8
echo " <legend>NEWS : </legend>
";
// line 11
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["articles"]) || array_key_exists("articles", $context) ? $context["articles"] : (function () { throw new RuntimeError('Variable "articles" does not exist.', 11, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["article"]) {
// line 12
echo " <div style=\"border: thin solid black\">
<h4>";
// line 13
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["article"], "nomArticle", [], "any", false, false, false, 13), "html", null, true);
echo "</h4>
";
// line 14
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["article"], "textArticle", [], "any", false, false, false, 14), "html", null, true);
echo "
<br><br>
Documents :
<br>
";
// line 19
$context["exist"] = 0;
// line 20
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["docs"]) || array_key_exists("docs", $context) ? $context["docs"] : (function () { throw new RuntimeError('Variable "docs" does not exist.', 20, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["file"]) {
// line 21
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["file"], "article", [], "any", false, false, false, 21) == $context["article"])) {
// line 22
echo " ";
$context["exist"] = 1;
// line 23
echo " <br>
<a href=\"";
// line 24
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("openFileArticle", ["file" => twig_get_attribute($this->env, $this->source, $context["file"], "farId", [], "any", false, false, false, 24)]), "html", null, true);
echo "\">
";
// line 25
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["file"], "farnomuser", [], "any", false, false, false, 25), "html", null, true);
echo "
</a>
";
}
// line 28
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['file'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 29
echo " ";
if (((isset($context["exist"]) || array_key_exists("exist", $context) ? $context["exist"] : (function () { throw new RuntimeError('Variable "exist" does not exist.', 29, $this->source); })()) == 0)) {
// line 30
echo " Aucun document.
";
}
// line 32
echo " <br><br>
Date de création : ";
// line 33
echo twig_escape_filter($this->env, twig_date_format_filter($this->env, twig_get_attribute($this->env, $this->source, $context["article"], "dateArticle", [], "any", false, false, false, 33), "d/m/Y"), "html", null, true);
echo "
<br>
";
// line 37
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(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.', 37, $this->source); })()), "user", [], "any", false, false, false, 37), "roles", [], "method", false, false, false, 37));
foreach ($context['_seq'] as $context["_key"] => $context["role"]) {
// line 38
echo " ";
if (($context["role"] == "ROLE_SUPER_ADMIN")) {
// line 39
echo "
<br>
<a href=\"";
// line 41
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("validationDeleteArticle", ["idArticle" => twig_get_attribute($this->env, $this->source, $context["article"], "idArticle", [], "any", false, false, false, 41)]), "html", null, true);
echo "\">Supprimer l'article </a>
";
}
// line 44
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['role'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 45
echo " </div><br><br>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['article'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 47
echo " ";
}
// line 48
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(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.', 48, $this->source); })()), "user", [], "any", false, false, false, 48), "roles", [], "method", false, false, false, 48));
foreach ($context['_seq'] as $context["_key"] => $context["role"]) {
// line 49
echo "
";
// line 50
if (($context["role"] == "ROLE_SUPER_ADMIN")) {
// line 51
echo "
<form method=\"POST\" action=\"";
// line 52
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("Ajout_Article");
echo "\" enctype=\"multipart/form-data\">
<button class=\"btn btn-sm btn-primary\">Ajouter une nouvelle news </button>
</form><br><br>
";
}
// line 56
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['role'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 57
echo "
</fieldset>
";
}
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 62
public function block_javascripts($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
// line 63
echo "
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
public function getTemplateName()
{
return "home/home.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 234 => 63, 224 => 62, 211 => 57, 205 => 56, 198 => 52, 195 => 51, 193 => 50, 190 => 49, 185 => 48, 182 => 47, 175 => 45, 169 => 44, 163 => 41, 159 => 39, 156 => 38, 152 => 37, 145 => 33, 142 => 32, 138 => 30, 135 => 29, 129 => 28, 123 => 25, 119 => 24, 116 => 23, 113 => 22, 110 => 21, 105 => 20, 103 => 19, 95 => 14, 91 => 13, 88 => 12, 84 => 11, 79 => 8, 77 => 7, 74 => 6, 72 => 5, 69 => 4, 59 => 3, 36 => 1,);
}
public function getSourceContext()
{
return new Source("{% extends 'base.html.twig' %}
{% block body %}
<h1>Page d'accueil</h1>
{% if app.user %}
<fieldset>
{% if articles %}
<legend>NEWS : </legend>
{% for article in articles %}
<div style=\"border: thin solid black\">
<h4>{{ article.nomArticle }}</h4>
{{ article.textArticle }}
<br><br>
Documents :
<br>
{% set exist = 0 %}
{% for file in docs %}
{% if file.article == article %}
{% set exist = 1 %}
<br>
<a href=\"{{path('openFileArticle',{ 'file': file.farId}) }}\">
{{ file.farnomuser }}
</a>
{% endif %}
{% endfor %}
{% if exist == 0 %}
Aucun document.
{% endif %}
<br><br>
Date de création : {{ article.dateArticle|date(\"d/m/Y\") }}
<br>
{% for role in app.user.roles() %}
{% if role == 'ROLE_SUPER_ADMIN' %}
<br>
<a href=\"{{path('validationDeleteArticle',{ 'idArticle': article.idArticle}) }}\">Supprimer l'article </a>
{% endif %}
{% endfor %}
</div><br><br>
{% endfor %}
{% endif %}
{% for role in app.user.roles() %}
{% if role == 'ROLE_SUPER_ADMIN' %}
<form method=\"POST\" action=\"{{path('Ajout_Article') }}\" enctype=\"multipart/form-data\">
<button class=\"btn btn-sm btn-primary\">Ajouter une nouvelle news </button>
</form><br><br>
{% endif %}
{% endfor %}
</fieldset>
{% endif %}
{% endblock %}
{% block javascripts %}
{% endblock %}", "home/home.html.twig", "/home/rlvchht/www/dev/templates/home/home.html.twig");
}
}