<?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;
/* _includes/last-search.html.twig */
class __TwigTemplate_05028b1437bfa97830b9e3107a6f043006f522afb0ab35c3b42fb913465eaa9d 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_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "_includes/last-search.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "_includes/last-search.html.twig"));
// line 1
$context["lastSearch"] = twig_get_attribute($this->env, $this->source, (isset($context["historique"]) || array_key_exists("historique", $context) ? $context["historique"] : (function () { throw new RuntimeError('Variable "historique" does not exist.', 1, $this->source); })()), "getRecherches", [], "method", false, false, false, 1);
// line 2
if ( !twig_test_empty((isset($context["lastSearch"]) || array_key_exists("lastSearch", $context) ? $context["lastSearch"] : (function () { throw new RuntimeError('Variable "lastSearch" does not exist.', 2, $this->source); })()))) {
// line 3
echo "\t<div class=\"nav-block last-search\">
\t\t<p class=\"title\">Mes dernières recherches</p>
\t\t<ul ";
// line 5
if ((1 === twig_compare(twig_length_filter($this->env, (isset($context["lastSearch"]) || array_key_exists("lastSearch", $context) ? $context["lastSearch"] : (function () { throw new RuntimeError('Variable "lastSearch" does not exist.', 5, $this->source); })())), 4))) {
echo " class=\"slide\" ";
}
echo ">
\t\t\t";
// line 6
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["lastSearch"]) || array_key_exists("lastSearch", $context) ? $context["lastSearch"] : (function () { throw new RuntimeError('Variable "lastSearch" does not exist.', 6, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
// line 7
echo "\t\t\t\t";
$context["quoiLibelle"] = $this->extensions['App\Twig\TypeEtablissementLibelleExtension']->typeEtablissementLibelle(twig_replace_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["item"], "quoi", [], "any", false, false, false, 7), "libelle", [], "any", false, false, false, 7), ["---" => ""]));
// line 8
echo "\t\t\t\t";
if (twig_in_filter("annuaire-enseignement-prive", twig_get_attribute($this->env, $this->source, $context["item"], "requestUri", [], "any", false, false, false, 8))) {
// line 9
echo "\t\t\t\t\t";
$context["quoiLibelle"] = "Enseignement privé";
// line 10
echo "\t\t\t\t";
} elseif (twig_in_filter("annuaire-enseignement-catholique", twig_get_attribute($this->env, $this->source, $context["item"], "requestUri", [], "any", false, false, false, 10))) {
// line 11
echo "\t\t\t\t\t";
$context["quoiLibelle"] = "Enseignement catholique";
// line 12
echo "\t\t\t\t";
} elseif (twig_in_filter("annuaire", twig_get_attribute($this->env, $this->source, $context["item"], "requestUri", [], "any", false, false, false, 12))) {
// line 13
echo "\t\t\t\t\t";
$context["quoiLibelle"] = twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["item"], "quoi", [], "any", false, false, false, 13), "libelle", [], "any", false, false, false, 13);
// line 14
echo "\t\t\t\t";
}
// line 15
echo "\t\t\t\t";
if ((0 !== twig_compare(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["item"], "lieu", [], "any", false, false, false, 15), "libelle", [], "any", false, false, false, 15), "DEFAULT"))) {
// line 16
echo "\t\t\t\t\t";
$context["itemTitle"] = twig_join_filter([0 => (isset($context["quoiLibelle"]) || array_key_exists("quoiLibelle", $context) ? $context["quoiLibelle"] : (function () { throw new RuntimeError('Variable "quoiLibelle" does not exist.', 16, $this->source); })()), 1 => ",", 2 => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["item"], "lieu", [], "any", false, false, false, 16), "libelle", [], "any", false, false, false, 16)], " ");
// line 17
echo "\t\t\t\t\t<li>
\t\t\t\t\t\t<a href=\"#\" class=\"empty-link\"><span data-href=\"";
// line 18
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "requestUri", [], "any", false, false, false, 18), "html", null, true);
echo "\">
\t\t\t\t\t\t\t<strong>";
// line 19
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $this->extensions['Twig\Extra\String\StringExtension']->createUnicodeString((isset($context["itemTitle"]) || array_key_exists("itemTitle", $context) ? $context["itemTitle"] : (function () { throw new RuntimeError('Variable "itemTitle" does not exist.', 19, $this->source); })())), "truncate", [0 => 50, 1 => "…", 2 => true], "method", false, false, false, 19), "html", null, true);
echo "</strong><br>
\t\t\t\t\t\t\t";
// line 20
echo $this->extensions['Knp\Bundle\TimeBundle\Twig\Extension\TimeExtension']->diff(twig_get_attribute($this->env, $this->source, $context["item"], "date", [], "any", false, false, false, 20));
echo "</span></a>
\t\t\t\t\t</li>
\t\t\t\t";
} else {
// line 23
echo "\t\t\t\t\t";
$context["itemTitle"] = (isset($context["quoiLibelle"]) || array_key_exists("quoiLibelle", $context) ? $context["quoiLibelle"] : (function () { throw new RuntimeError('Variable "quoiLibelle" does not exist.', 23, $this->source); })());
// line 24
echo "\t\t\t\t\t<li>
\t\t\t\t\t\t<a href=\"#\"><span data-href=\"";
// line 25
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "requestUri", [], "any", false, false, false, 25), "html", null, true);
echo "\">
\t\t\t\t\t\t\t<strong>";
// line 26
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $this->extensions['Twig\Extra\String\StringExtension']->createUnicodeString((isset($context["itemTitle"]) || array_key_exists("itemTitle", $context) ? $context["itemTitle"] : (function () { throw new RuntimeError('Variable "itemTitle" does not exist.', 26, $this->source); })())), "truncate", [0 => 50, 1 => "…", 2 => true], "method", false, false, false, 26), "html", null, true);
echo "</strong><br>
\t\t\t\t\t\t\t";
// line 27
echo $this->extensions['Knp\Bundle\TimeBundle\Twig\Extension\TimeExtension']->diff(twig_get_attribute($this->env, $this->source, $context["item"], "date", [], "any", false, false, false, 27));
echo "</span></a>
\t\t\t\t\t</li>
\t\t\t\t";
}
// line 30
echo "\t\t\t";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 31
echo "\t\t</ul>
\t\t";
// line 32
if ((1 === twig_compare(twig_length_filter($this->env, (isset($context["lastSearch"]) || array_key_exists("lastSearch", $context) ? $context["lastSearch"] : (function () { throw new RuntimeError('Variable "lastSearch" does not exist.', 32, $this->source); })())), 4))) {
// line 33
echo "\t\t\t<span id=\"last-search-prev\"></span>
\t\t\t<span id=\"last-search-next\"></span>
\t\t";
}
// line 36
echo "\t</div>
";
}
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
public function getTemplateName()
{
return "_includes/last-search.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 144 => 36, 139 => 33, 137 => 32, 134 => 31, 128 => 30, 122 => 27, 118 => 26, 114 => 25, 111 => 24, 108 => 23, 102 => 20, 98 => 19, 94 => 18, 91 => 17, 88 => 16, 85 => 15, 82 => 14, 79 => 13, 76 => 12, 73 => 11, 70 => 10, 67 => 9, 64 => 8, 61 => 7, 57 => 6, 51 => 5, 47 => 3, 45 => 2, 43 => 1,);
}
public function getSourceContext()
{
return new Source("{% set lastSearch = historique.getRecherches() %}
{% if lastSearch is not empty %}
\t<div class=\"nav-block last-search\">
\t\t<p class=\"title\">Mes dernières recherches</p>
\t\t<ul {% if lastSearch | length > 4 %} class=\"slide\" {% endif %}>
\t\t\t{% for item in lastSearch %}
\t\t\t\t{% set quoiLibelle = item.quoi.libelle | replace({'---': ''}) | typeEtablissementLibelle %}
\t\t\t\t{% if 'annuaire-enseignement-prive' in item.requestUri %}
\t\t\t\t\t{% set quoiLibelle = 'Enseignement privé' %}
\t\t\t\t{% elseif 'annuaire-enseignement-catholique' in item.requestUri %}
\t\t\t\t\t{% set quoiLibelle = 'Enseignement catholique' %}
\t\t\t\t{% elseif 'annuaire' in item.requestUri %}
\t\t\t\t\t{% set quoiLibelle = item.quoi.libelle %}
\t\t\t\t{% endif %}
\t\t\t\t{% if item.lieu.libelle != 'DEFAULT' %}
\t\t\t\t\t{% set itemTitle = [quoiLibelle, ',', item.lieu.libelle] | join(' ') %}
\t\t\t\t\t<li>
\t\t\t\t\t\t<a href=\"#\" class=\"empty-link\"><span data-href=\"{{ item.requestUri }}\">
\t\t\t\t\t\t\t<strong>{{ itemTitle | u.truncate(50, '…', true) }}</strong><br>
\t\t\t\t\t\t\t{{ item.date | ago }}</span></a>
\t\t\t\t\t</li>
\t\t\t\t{% else %}
\t\t\t\t\t{% set itemTitle = quoiLibelle %}
\t\t\t\t\t<li>
\t\t\t\t\t\t<a href=\"#\"><span data-href=\"{{ item.requestUri }}\">
\t\t\t\t\t\t\t<strong>{{ itemTitle | u.truncate(50, '…', true) }}</strong><br>
\t\t\t\t\t\t\t{{ item.date | ago }}</span></a>
\t\t\t\t\t</li>
\t\t\t\t{% endif %}
\t\t\t{% endfor %}
\t\t</ul>
\t\t{% if lastSearch | length > 4 %}
\t\t\t<span id=\"last-search-prev\"></span>
\t\t\t<span id=\"last-search-next\"></span>
\t\t{% endif %}
\t</div>
{% endif %}
", "_includes/last-search.html.twig", "/app/templates/_includes/last-search.html.twig");
}
}