<?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;
/* model/collection.html.twig */
class __TwigTemplate_0ff2c966f17d14af9e34a20de2ffc07e 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 = [
'title' => [$this, 'block_title'],
'body' => [$this, 'block_body'],
'javascripts' => [$this, 'block_javascripts'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "base.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", "model/collection.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "model/collection.html.twig"));
$this->parent = $this->load("base.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 3
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_title(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", "title"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
yield "Collection complète";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 5
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_body(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", "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 6
yield " <div style=\"width: 100%;\">
<section class='topPageCollection'>
";
// line 11
yield " <div class=\"subtitleCollection\">
<span class=\"mt-5\">Le site est en cours de remplissage.<br>
À venir, plus de 8 000 écussons. Merci de prendre contact pour plus d'informations.
</span>
<p>Nombre total d'écussons en base : ";
// line 15
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["count"]) || array_key_exists("count", $context) ? $context["count"] : (function () { throw new RuntimeError('Variable "count" does not exist.', 15, $this->source); })()), "html", null, true);
yield "</p>
</div>
";
// line 18
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["form2"]) || array_key_exists("form2", $context) ? $context["form2"] : (function () { throw new RuntimeError('Variable "form2" does not exist.', 18, $this->source); })()), 'form_start', ["method" => "GET"]);
yield "
<span class=\"searchPart\">
<i class=\"fa-solid fa-magnifying-glass\" style=\"color: #ffffff;\"></i>
";
// line 21
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form2"]) || array_key_exists("form2", $context) ? $context["form2"] : (function () { throw new RuntimeError('Variable "form2" does not exist.', 21, $this->source); })()), "search", [], "any", false, false, false, 21), 'row');
yield "
<button type=\"submit\" class=\"btn btn-grad rounded-pill\">Rechercher</button>
</span>
";
// line 24
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["form2"]) || array_key_exists("form2", $context) ? $context["form2"] : (function () { throw new RuntimeError('Variable "form2" does not exist.', 24, $this->source); })()), 'form_end');
yield "
<div class=\"converter-list\">
<button id=\"list-button\">
<i class=\"fa-solid fa-list\"></i>
</button>
<button id=\"grid-button\">
<i class=\"fa-solid fa-table-cells-large\"></i>
</button>
</div>
";
// line 33
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 33, $this->source); })()), 'form_start', ["method" => "GET"]);
yield "
<div class=\"filterdiv\">
";
// line 35
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 35, $this->source); })()), "categorie", [], "any", false, false, false, 35), 'row');
yield "
";
// line 36
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 36, $this->source); })()), "sousCategorie", [], "any", false, false, false, 36), 'row');
yield "
";
// line 37
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 37, $this->source); })()), "p", [], "any", false, false, false, 37), 'row');
yield "
";
// line 38
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 38, $this->source); })()), "tags", [], "any", false, false, false, 38), 'row');
yield "
<button type=\"submit\" class=\"btn btn-grad rounded-pill\">Filtrer</button>
</div>
";
// line 41
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 41, $this->source); })()), 'form_end');
yield "
</section>
<section>
<div class=\"results-filter\">
<span>";
// line 46
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["pageCount"]) || array_key_exists("pageCount", $context) ? $context["pageCount"] : (function () { throw new RuntimeError('Variable "pageCount" does not exist.', 46, $this->source); })()), "html", null, true);
yield " écussons pour cette recherche</span>
</div>
<div class=\"row block grid-collection\" id=\"content-collection\">
";
// line 49
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["models"]) || array_key_exists("models", $context) ? $context["models"] : (function () { throw new RuntimeError('Variable "models" does not exist.', 49, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["model"]) {
// line 50
yield " <div class=\"card\">";
if (Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, $context["model"], "photos", [], "any", false, false, false, 50))) {
// line 51
yield " <img src=\"/images/logo_ecusson_bleu_grand_format.png\" class=\"img-fluid rounded- \" alt=\"logo_ecusson_bleu_grand_format\">
";
} else {
// line 53
yield " <img src=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["model"], "photos", [], "any", false, false, false, 53), 0, [], "array", false, false, false, 53), "chemin", [], "any", false, false, false, 53), "html", null, true);
yield "\" class=\"img-fluid rounded- \" alt=\"\">
";
}
// line 55
yield " <h5>";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["model"], "titre", [], "any", false, false, false, 55), "html", null, true);
yield "</h5>
";
// line 56
if (CoreExtension::inFilter("ROLE_ADMIN", CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 56, $this->source); })()), "user", [], "any", false, false, false, 56), "roles", [], "any", false, false, false, 56))) {
// line 57
yield " <span class=\"qty\">x";
yield (((CoreExtension::getAttribute($this->env, $this->source, $context["model"], "nb", [], "any", false, false, false, 57) > 10)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["model"], "nb", [], "any", false, false, false, 57), "html", null, true)) : ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(("0" . CoreExtension::getAttribute($this->env, $this->source, $context["model"], "nb", [], "any", false, false, false, 57)), "html", null, true)));
yield "</span>
";
} else {
// line 59
yield " <br>
";
}
// line 61
yield " <div class=\"card-body\">
<ul>
<li class=\"title-category\">Catégories :</li>
";
// line 64
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, $context["model"], "categories", [], "any", false, false, false, 64));
foreach ($context['_seq'] as $context["_key"] => $context["categorie"]) {
// line 65
yield " <li>
";
// line 66
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["categorie"], "nom", [], "any", false, false, false, 66), "html", null, true);
yield "
</li>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['categorie'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 69
yield " </ul>
</div>
<div class=\"bottom-card\">
<a href=\"";
// line 72
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_model_show", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["model"], "id", [], "any", false, false, false, 72)]), "html", null, true);
yield "\" class=\"link\" >En savoir plus</a>
</div>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['model'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 76
yield " </div>
";
// line 77
yield $this->extensions['Knp\Bundle\PaginatorBundle\Twig\Extension\PaginationExtension']->render($this->env, (isset($context["models"]) || array_key_exists("models", $context) ? $context["models"] : (function () { throw new RuntimeError('Variable "models" does not exist.', 77, $this->source); })()));
yield "
</div>
</section>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 83
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_javascripts(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", "javascripts"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
// line 84
yield " ";
yield $this->extensions['Symfony\WebpackEncoreBundle\Twig\EntryFilesTwigExtension']->renderWebpackScriptTags("app");
yield "
";
// line 86
yield "
";
// line 90
yield "
";
// line 92
yield "
";
// line 94
yield "
";
// line 100
yield "
";
// line 102
yield "
";
// line 108
yield "
";
// line 110
yield "
";
// line 112
yield " <script type=\"text/javascript\">
// Fonction pour ajouter ou mettre à jour un paramètre d'URL
function updateURLParameter(url, param, value) {
var re = new RegExp(\"([?&])\" + param + \"=.*?(&|\$)\", \"i\");
var separator = url.indexOf('?') !== -1 ? \"&\" : \"?\";
if (url.match(re)) {
return url.replace(re, '\$1' + param + \"=\" + value + '\$2');
} else {
return url + separator + param + \"=\" + value;
}
}
let listButton = document.getElementById('list-button')
let gridButton = document.getElementById('grid-button')
let contentCollection = document.getElementById('content-collection')
// Récupérer le mode actuel depuis l'URL
const currentMode = new URLSearchParams(window.location.search).get('view');
if (currentMode === 'list') {
// Si le mode actuel est \"list\", activer le bouton \"list\" et appliquer la classe CSS
contentCollection.classList.remove('grid-collection');
contentCollection.classList.add('list-collection');
listButton.classList.add('active');
gridButton.classList.remove('active');
} else {
// Par défaut, activer le bouton \"grid\"
gridButton.classList.add('active');
}
listButton.addEventListener('click', () => {
// Lorsque l'utilisateur clique sur le bouton \"list\", mettre à jour l'URL avec le mode \"list\"
window.location.href = updateURLParameter(window.location.href, 'view', 'list');
})
gridButton.addEventListener('click', () => {
// Lorsque l'utilisateur clique sur le bouton \"grid\", mettre à jour l'URL avec le mode \"grid\"
window.location.href = updateURLParameter(window.location.href, 'view', 'grid');
})
\$('.select2').select2();
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "model/collection.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 309 => 112, 306 => 110, 303 => 108, 300 => 102, 297 => 100, 294 => 94, 291 => 92, 288 => 90, 285 => 86, 280 => 84, 267 => 83, 251 => 77, 248 => 76, 238 => 72, 233 => 69, 224 => 66, 221 => 65, 217 => 64, 212 => 61, 208 => 59, 202 => 57, 200 => 56, 195 => 55, 189 => 53, 185 => 51, 182 => 50, 178 => 49, 172 => 46, 164 => 41, 158 => 38, 154 => 37, 150 => 36, 146 => 35, 141 => 33, 129 => 24, 123 => 21, 117 => 18, 111 => 15, 105 => 11, 101 => 6, 88 => 5, 65 => 3, 42 => 1,);
}
public function getSourceContext(): Source
{
return new Source("{% extends 'base.html.twig' %}
{% block title %}Collection complète{% endblock %}
{% block body %}
<div style=\"width: 100%;\">
<section class='topPageCollection'>
{# <div class=\"firstPart\">#}
{# <h3 class=\"lists-title\">Ecusson.</h3>#}
{# </div>#}
<div class=\"subtitleCollection\">
<span class=\"mt-5\">Le site est en cours de remplissage.<br>
À venir, plus de 8 000 écussons. Merci de prendre contact pour plus d'informations.
</span>
<p>Nombre total d'écussons en base : {{ count }}</p>
</div>
{{ form_start(form2, {'method': 'GET'}) }}
<span class=\"searchPart\">
<i class=\"fa-solid fa-magnifying-glass\" style=\"color: #ffffff;\"></i>
{{ form_row(form2.search) }}
<button type=\"submit\" class=\"btn btn-grad rounded-pill\">Rechercher</button>
</span>
{{ form_end(form2) }}
<div class=\"converter-list\">
<button id=\"list-button\">
<i class=\"fa-solid fa-list\"></i>
</button>
<button id=\"grid-button\">
<i class=\"fa-solid fa-table-cells-large\"></i>
</button>
</div>
{{ form_start(form, {'method': 'GET'}) }}
<div class=\"filterdiv\">
{{ form_row(form.categorie) }}
{{ form_row(form.sousCategorie) }}
{{ form_row(form.p) }}
{{ form_row(form.tags) }}
<button type=\"submit\" class=\"btn btn-grad rounded-pill\">Filtrer</button>
</div>
{{ form_end(form) }}
</section>
<section>
<div class=\"results-filter\">
<span>{{ pageCount }} écussons pour cette recherche</span>
</div>
<div class=\"row block grid-collection\" id=\"content-collection\">
{% for model in models %}
<div class=\"card\">{% if model.photos is empty %}
<img src=\"/images/logo_ecusson_bleu_grand_format.png\" class=\"img-fluid rounded- \" alt=\"logo_ecusson_bleu_grand_format\">
{% else %}
<img src=\"{{ model.photos[0].chemin }}\" class=\"img-fluid rounded- \" alt=\"\">
{% endif %}
<h5>{{ model.titre }}</h5>
{% if 'ROLE_ADMIN' in app.user.roles %}
<span class=\"qty\">x{{ model.nb > 10 ? model.nb : '0'~model.nb }}</span>
{% else %}
<br>
{% endif %}
<div class=\"card-body\">
<ul>
<li class=\"title-category\">Catégories :</li>
{% for categorie in model.categories %}
<li>
{{ categorie.nom }}
</li>
{% endfor %}
</ul>
</div>
<div class=\"bottom-card\">
<a href=\"{{ path('app_model_show', {'id':model.id}) }}\" class=\"link\" >En savoir plus</a>
</div>
</div>
{% endfor %}
</div>
{{ knp_pagination_render(models) }}
</div>
</section>
{% endblock %}
{% block javascripts %}
{{ encore_entry_script_tags('app') }}
{# <script type=\"text/javascript\">#}
{# let listButton = document.getElementById('list-button')#}
{# let gridButton = document.getElementById('grid-button')#}
{# let contentCollection = document.getElementById('content-collection')#}
{# gridButton.classList.add('active')#}
{# listButton.addEventListener('click', () => {#}
{# contentCollection.classList.remove('grid-collection')#}
{# contentCollection.classList.add('list-collection')#}
{# listButton.classList.add('active')#}
{# gridButton.classList.remove('active')#}
{# })#}
{# gridButton.addEventListener('click', () => {#}
{# contentCollection.classList.remove('list-collection');#}
{# contentCollection.classList.add('grid-collection');#}
{# gridButton.classList.add('active');#}
{# listButton.classList.remove('active')#}
{# })#}
{# \$('.select2').select2();#}
{# </script>#}
<script type=\"text/javascript\">
// Fonction pour ajouter ou mettre à jour un paramètre d'URL
function updateURLParameter(url, param, value) {
var re = new RegExp(\"([?&])\" + param + \"=.*?(&|\$)\", \"i\");
var separator = url.indexOf('?') !== -1 ? \"&\" : \"?\";
if (url.match(re)) {
return url.replace(re, '\$1' + param + \"=\" + value + '\$2');
} else {
return url + separator + param + \"=\" + value;
}
}
let listButton = document.getElementById('list-button')
let gridButton = document.getElementById('grid-button')
let contentCollection = document.getElementById('content-collection')
// Récupérer le mode actuel depuis l'URL
const currentMode = new URLSearchParams(window.location.search).get('view');
if (currentMode === 'list') {
// Si le mode actuel est \"list\", activer le bouton \"list\" et appliquer la classe CSS
contentCollection.classList.remove('grid-collection');
contentCollection.classList.add('list-collection');
listButton.classList.add('active');
gridButton.classList.remove('active');
} else {
// Par défaut, activer le bouton \"grid\"
gridButton.classList.add('active');
}
listButton.addEventListener('click', () => {
// Lorsque l'utilisateur clique sur le bouton \"list\", mettre à jour l'URL avec le mode \"list\"
window.location.href = updateURLParameter(window.location.href, 'view', 'list');
})
gridButton.addEventListener('click', () => {
// Lorsque l'utilisateur clique sur le bouton \"grid\", mettre à jour l'URL avec le mode \"grid\"
window.location.href = updateURLParameter(window.location.href, 'view', 'grid');
})
\$('.select2').select2();
</script>
{% endblock %}
", "model/collection.html.twig", "/var/www/php81/ecusson2026/templates/model/collection.html.twig");
}
}