<?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/acheter/index.html.twig */
class __TwigTemplate_7b363b3502ec142f6859e8fb7eb139fcbe4756a74fa182256d23b18e52edfc64 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'title' => [$this, 'block_title'],
'meta_description' => [$this, 'block_meta_description'],
'metas' => [$this, 'block_metas'],
'header_bottom' => [$this, 'block_header_bottom'],
'content' => [$this, 'block_content'],
'footer' => [$this, 'block_footer'],
'stylesheets' => [$this, 'block_stylesheets'],
'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", "front/acheter/index.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/acheter/index.html.twig"));
$this->parent = $this->loadTemplate("base.html.twig", "front/acheter/index.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_title($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", "title"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
echo " - Annonces immobilières";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 4
public function block_meta_description($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", "meta_description"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "meta_description"));
echo "Trouvez votre futur nid douillet en Bretagne. Maison, appartement, bien de prestige et terrain sont mis en valeur pour vous aider dans votre choix";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 5
public function block_metas($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", "metas"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "metas"));
// line 6
echo " ";
if (twig_in_filter(twig_get_attribute($this->env, $this->source, 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.', 6, $this->source); })()), "request", [], "any", false, false, false, 6), "attributes", [], "any", false, false, false, 6), "get", [0 => "_route"], "method", false, false, false, 6), [0 => "acheter_estate", 1 => "commerces_estate"])) {
// line 7
echo " <meta property=\"og:locale\" content=\"fr_FR\" />
<meta property=\"og:type\" content=\"article\" />
<meta property=\"og:title\" content=\"Annonce Sublimons - ";
// line 9
echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["estate"]) || array_key_exists("estate", $context) ? $context["estate"] : (function () { throw new RuntimeError('Variable "estate" does not exist.', 9, $this->source); })()), "libelle", [], "any", false, false, false, 9)), "html", null, true);
echo "\" />
<meta property=\"og:description\" content=\"";
// line 10
echo twig_escape_filter($this->env, twig_striptags(twig_get_attribute($this->env, $this->source, (isset($context["estate"]) || array_key_exists("estate", $context) ? $context["estate"] : (function () { throw new RuntimeError('Variable "estate" does not exist.', 10, $this->source); })()), "descriptifCourt", [], "any", false, false, false, 10)), "html", null, true);
echo "\" />
<meta property=\"og:url\" content=\"";
// line 11
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\HttpFoundationExtension']->generateAbsoluteUrl($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("acheter_estate", ["refannonce" => twig_get_attribute($this->env, $this->source, (isset($context["estate"]) || array_key_exists("estate", $context) ? $context["estate"] : (function () { throw new RuntimeError('Variable "estate" does not exist.', 11, $this->source); })()), "refannonce", [], "any", false, false, false, 11)])), "html", null, true);
echo "/\" />
<meta property=\"og:site_name\" content=\"Sublimons\" />
<meta property=\"article:publisher\" content=\"https://www.facebook.com/sublimons\" />
<meta property=\"og:image\" content=\"";
// line 14
echo twig_escape_filter($this->env, $this->extensions['Liip\ImagineBundle\Templating\FilterExtension']->filter(twig_get_attribute($this->env, $this->source, (isset($context["estate"]) || array_key_exists("estate", $context) ? $context["estate"] : (function () { throw new RuntimeError('Variable "estate" does not exist.', 14, $this->source); })()), "cover", [], "any", false, false, false, 14), "stream_estate_share"), "html", null, true);
echo "\" />
<meta property=\"og:image:secure_url\" content=\"";
// line 15
echo twig_escape_filter($this->env, $this->extensions['Liip\ImagineBundle\Templating\FilterExtension']->filter(twig_get_attribute($this->env, $this->source, (isset($context["estate"]) || array_key_exists("estate", $context) ? $context["estate"] : (function () { throw new RuntimeError('Variable "estate" does not exist.', 15, $this->source); })()), "cover", [], "any", false, false, false, 15), "stream_estate_large"), "html", null, true);
echo "\" />
<meta property=\"og:image:width\" content=\"1200\" />
<meta property=\"og:image:height\" content=\"630\" />
<meta name=\"twitter:card\" content=\"summary\" />
<meta name=\"twitter:description\" content=\"";
// line 19
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["estate"]) || array_key_exists("estate", $context) ? $context["estate"] : (function () { throw new RuntimeError('Variable "estate" does not exist.', 19, $this->source); })()), "descriptifCourt", [], "any", false, false, false, 19), "html", null, true);
echo "\" />
<meta name=\"twitter:title\" content=\"Annonce Sublimons - ";
// line 20
echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["estate"]) || array_key_exists("estate", $context) ? $context["estate"] : (function () { throw new RuntimeError('Variable "estate" does not exist.', 20, $this->source); })()), "libelle", [], "any", false, false, false, 20)), "html", null, true);
echo "\" />
<meta name=\"twitter:site\" content=\"@Sublimonsimmo\" />
<meta name=\"twitter:image\" content=\"";
// line 22
echo twig_escape_filter($this->env, $this->extensions['Liip\ImagineBundle\Templating\FilterExtension']->filter(twig_get_attribute($this->env, $this->source, (isset($context["estate"]) || array_key_exists("estate", $context) ? $context["estate"] : (function () { throw new RuntimeError('Variable "estate" does not exist.', 22, $this->source); })()), "cover", [], "any", false, false, false, 22), "stream_estate_share"), "html", null, true);
echo "\" />
<meta name=\"twitter:creator\" content=\"@Sublimonsimmo\" />
";
}
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 27
public function block_header_bottom($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", "header_bottom"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "header_bottom"));
// line 28
echo " <div id=\"header_bottom\" class=\"container-fluid d-none d-lg-block\">
";
// line 29
echo twig_include($this->env, $context, "front/acheter/_filter.html.twig");
echo "
</div>
<div id=\"header_bottom_mobile\" class=\"bg-dark border-top border-white container-fluid d-lg-none text-center p-2\">
<button id=\"btn_open_search\" class=\"btn btn-primary btn-sm flex-grow-1\"><i class=\"icon-search\"></i> Rechercher</button>
<button class=\"btn_save_search btn btn-primary btn-sm mx-0 flex-grow-1\"><i class=\"icon-floppy\"></i> Sauvegarder</button>
";
// line 34
$this->loadTemplate("front/acheter/_sort.html.twig", "front/acheter/index.html.twig", 34)->display(twig_array_merge($context, ["context" => "select", "class" => "btn btn-primary btn-sm flex-grow-1", "sort_by" => twig_get_attribute($this->env, $this->source, (isset($context["datas"]) || array_key_exists("datas", $context) ? $context["datas"] : (function () { throw new RuntimeError('Variable "datas" does not exist.', 34, $this->source); })()), "sort_by", [], "any", false, false, false, 34)]));
// line 35
echo " </div>
<!-- Témoin de chargement-->
<div id=\"loader\">
<div class=\"overlay\">
<div class=\"loader\"></div>
</div>
</div>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 46
public function block_content($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", "content"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
// line 47
echo "
<section id=\"estates\" class=\"container-fluid\">
<div class=\"row\">
";
// line 50
if ((isset($context["with_map"]) || array_key_exists("with_map", $context) ? $context["with_map"] : (function () { throw new RuntimeError('Variable "with_map" does not exist.', 50, $this->source); })())) {
// line 51
echo " <div class=\"col-lg-6 p-0 d-none d-lg-block \">
<div class=\"map_full bg-light\">
<div id=\"estates_map\" class=\"map_container\"></div>
</div>
</div>
<div id=\"list_sidebar\" class=\"with_map col-lg-6 px-0\">
";
} else {
// line 58
echo " <div id=\"list_sidebar\" class=\"col-lg-12 px-0\">
";
}
// line 60
echo " <div class=\"p-3 p-lg-4 px-xxl-5 \">
<div class=\"d-none d-lg-block\">
<div class=\"d-flex justify-content-between pl-3 pr-0 mb-2\">
<div style=\"visibility: hidden;\"><span id=\"visible_estates\"></span>/<span id=\"total_estates\"></span> résultats</div>
<div id=\"estastes_sort\">Trier : ";
// line 64
$this->loadTemplate("front/acheter/_sort.html.twig", "front/acheter/index.html.twig", 64)->display(twig_array_merge($context, ["context" => "select", "class" => "select-unstyle", "sort_by" => twig_get_attribute($this->env, $this->source, (isset($context["datas"]) || array_key_exists("datas", $context) ? $context["datas"] : (function () { throw new RuntimeError('Variable "datas" does not exist.', 64, $this->source); })()), "sort_by", [], "any", false, false, false, 64)]));
echo "</div>
</div>
</div>
<div id=\"estates_container\" class=\"row align-items-stretch\"></div>
<div id=\"no_estate\" class=\"banner_no_content banner_container text-white col-md-6 col-lg-12 col-xl-9 mx-auto\" style=\"display:none;\">
<div class=\"bloc_txt_image\">
<div class=\"bg_image\" style=\"background-image: url(/assets/media/acheter/no_content_L.jpg);\"></div>
<div class=\"overlay\"></div>
<div class=\"content py-5 \">
<div class=\"mt-5 px-4 py-5 mt-xl-0 d-flex align-items-center text-center\">
<div class=\"pt-5\">
<h4 class=\"mb-2\">Aucun bien ne correspond à votre recherche</h4>
<p>Contactez le conseiller proche de chez vous</p>
</div>
</div>
</div>
<div class=\"btn_container\">
<a class=\"btn-horn\" href=\"";
// line 81
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("agents");
echo "\" target=\"_blank\"><span>Je contacte !</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<div id=\"contactForm_source\" style=\"display: none;\">";
// line 90
echo $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment(Symfony\Bridge\Twig\Extension\HttpKernelExtension::controller("App\\Controller\\Front\\MessageController::contactForm", ["context" => "agent", "display" => "agent_modal"]));
echo "</div>
";
// line 92
echo twig_source($this->env, "front/acheter/estates-template.html");
echo "
";
// line 93
echo twig_source($this->env, "front/acheter/estate-infobox-template.html");
echo "
";
// line 94
echo twig_source($this->env, "front/acheter/modal-template.html");
echo "
";
// line 95
echo twig_include($this->env, $context, "front/acheter/modal-save_search.html.twig");
echo "
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 98
public function block_footer($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", "footer"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "footer"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 101
public function block_stylesheets($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", "stylesheets"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));
// line 102
echo " ";
$this->displayParentBlock("stylesheets", $context, $blocks);
echo "
<link rel=\"stylesheet\" href=\"";
// line 103
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/vendor/OwlCarousel2-2.3.4/dist/assets/owl.carousel.min.css"), "html", null, true);
echo "\"/>
<link rel=\"stylesheet\" href=\"";
// line 104
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/vendor/OwlCarousel2-2.3.4/dist/assets/owl.theme.default.min.css"), "html", null, true);
echo "\"/>
<link rel=\"stylesheet\" href=\"";
// line 106
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/vendor/bootstrap-4-master/build/css/tempusdominus-bootstrap-4.min.css"), "html", null, true);
echo "\"/>
<link rel=\"stylesheet\" href=\"https://unpkg.com/leaflet@1.7.1/dist/leaflet.css\" />
";
// line 109
echo " <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/gh/tomik23/autocomplete@1.6.8/dist/css/autocomplete.min.css\"/>
<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css\" />
<link rel=\"stylesheet\" href=\"";
// line 111
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/css/dpe_ges.css"), "html", null, true);
echo "\"/>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 114
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 115
echo " ";
$this->displayParentBlock("javascripts", $context, $blocks);
echo "
";
// line 117
echo "
<script src=\"";
// line 118
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("bundles/fosjsrouting/js/router.min.js"), "html", null, true);
echo "\"></script>
<script src=\"";
// line 119
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("fos_js_routing_js", ["callback" => "fos.Router.setData"]);
echo "\"></script>
<script src=\"";
// line 120
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/vendor/OwlCarousel2-2.3.4/dist/owl.carousel.min.js"), "html", null, true);
echo "\"></script>
<script src=\"https://cdn.jsdelivr.net/npm/lazyload@2.0.0-rc.2/lazyload.js\"></script>
<script src=\"";
// line 123
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/vendor/swag.min.js"), "html", null, true);
echo "\"></script>
<script src=\"https://cdn.jsdelivr.net/npm/handlebars@latest/dist/handlebars.js\"></script>
<script src=\"https://unpkg.com/leaflet@1.7.1/dist/leaflet.js\"></script>
<script src=\"https://leaflet.github.io/Leaflet.markercluster/dist/leaflet.markercluster-src.js\"></script>
<script src=\"";
// line 129
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/vendor/Leaflet.SmoothMarkerBouncing.js"), "html", null, true);
echo "\"></script>
<script src=\"https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js\" integrity=\"sha512-qTXRIMyZIFb8iQcfjXWCO8+M5Tbc38Qi5WzdPOYZHIlZpzBHG3L3by84BBBOiRGiEb7KKtAOAs5qYdUiZiQNNQ==\" crossorigin=\"anonymous\"></script>
<script src=\"https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/locale/fr.min.js\" integrity=\"sha512-RAt2+PIRwJiyjWpzvvhKAG2LEdPpQhTgWfbEkFDCo8wC4rFYh5GQzJBVIFDswwaEDEYX16GEE/4fpeDNr7OIZw==\" crossorigin=\"anonymous\"></script>
<script src=\"";
// line 132
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/vendor/bootstrap-4-master/build/js/tempusdominus-bootstrap-4.js"), "html", null, true);
echo "\"></script>
<script src=\"https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js\"></script>
<script src=\"";
// line 134
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/vendor/jquery.serialize-object.min.js"), "html", null, true);
echo "\"></script>
<script src=\"";
// line 135
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/js/autocomplete.js"), "html", null, true);
echo "\"></script>
<script src=\"";
// line 137
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/js/base_map.js?v1.0"), "html", null, true);
echo "\"></script>
<script src=\"";
// line 138
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/js/estates_map.js?v1.3"), "html", null, true);
echo "\"></script>
<script src=\"";
// line 139
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/js/rrose.js"), "html", null, true);
echo "\"></script>
<script src=\"";
// line 141
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/js/auto_complete_geosearch.js"), "html", null, true);
echo "\"></script>
<script>
var current_page = '";
// line 144
echo twig_escape_filter($this->env, (isset($context["current_route"]) || array_key_exists("current_route", $context) ? $context["current_route"] : (function () { throw new RuntimeError('Variable "current_route" does not exist.', 144, $this->source); })()), "html", null, true);
echo "';
var current_route = Routing.generate('";
// line 145
echo twig_escape_filter($this->env, (isset($context["current_route"]) || array_key_exists("current_route", $context) ? $context["current_route"] : (function () { throw new RuntimeError('Variable "current_route" does not exist.', 145, $this->source); })()), "html", null, true);
echo "');
var datas = ";
// line 146
echo json_encode((isset($context["datas"]) || array_key_exists("datas", $context) ? $context["datas"] : (function () { throw new RuntimeError('Variable "datas" does not exist.', 146, $this->source); })()));
echo ";
var banners = ";
// line 147
echo json_encode((isset($context["banners"]) || array_key_exists("banners", $context) ? $context["banners"] : (function () { throw new RuntimeError('Variable "banners" does not exist.', 147, $this->source); })()));
echo ";
var col_class = datas.col_class;
var with_map = ";
// line 149
echo twig_escape_filter($this->env, (isset($context["with_map"]) || array_key_exists("with_map", $context) ? $context["with_map"] : (function () { throw new RuntimeError('Variable "with_map" does not exist.', 149, $this->source); })()), "html", null, true);
echo ";
var with_carrousel = ";
// line 150
echo twig_escape_filter($this->env, (isset($context["with_carrousel"]) || array_key_exists("with_carrousel", $context) ? $context["with_carrousel"] : (function () { throw new RuntimeError('Variable "with_carrousel" does not exist.', 150, $this->source); })()), "html", null, true);
echo ";
var current_banner = 0;
var next_estates = ";
// line 152
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["datas"]) || array_key_exists("datas", $context) ? $context["datas"] : (function () { throw new RuntimeError('Variable "datas" does not exist.', 152, $this->source); })()), "next", [], "any", false, false, false, 152), "html", null, true);
echo ";
// console.log(datas.estates);
var source_estate;
var template_estate;
var source_btn_next;
var template_btn_next;
var source_infobox;
var template_infobox;
var source_modal;
var template_modal;
var source_banner;
var template_banner;
jQuery(document).ready(function(){
initHandlebars();
source_estates = \$(\"#estates-template\").html();
template_estates = Handlebars.compile(source_estates);
source_btn_next = \$(\"#btn_next-template\").html();
template_btn_next = Handlebars.compile(source_btn_next);
source_infobox = \$(\"#infobox-template\").html();
template_infobox = Handlebars.compile(source_infobox);
source_modal = \$(\"#modal-template\").html();
template_modal = Handlebars.compile(source_modal);
source_banner = \$(\"#banner-template\").html();
template_banner = Handlebars.compile(source_banner);
//Initialisation de la sauvegarde des recherche
if(\$('#search_form').length > 0){
initSaveSearchForm();
}
//Ouverture par url
var parts = window.location.pathname.split('/');
if( parts.length == 3 ) {
var refannonce = parts[2];
var estate = datas.estates.find(estate => String(estate.refannonce) === String(refannonce));
if( estate === undefined){ //ajax
getEstate(refannonce);
}
else{
displayEstate(estate);
}
}
if(with_map){
setMap( 'estates_map', 9, 7, 16 );
geoSearch('geosearch', map);
}
else{
geoSearch('geosearch', false);
}
//gestion du filtre
\$('#filter form').submit(function(e){
e.preventDefault();
});
//Filtre à zero
\$('#filter form').trigger(\"reset\");
//Tri
\$(\".sort_estate\").change(\"change\", function(){
\$('#filter form #sort_by').val(\$(this).val());
searchEstates( 0 , 'filter');
});
\$('.dropdown-item').click(function(e) {
e.preventDefault(); // empêcher le lien de naviguer
var value = \$(this).data('value'); // nouvelle valeur
var label = \$(this).text(); // texte à afficher
// Mettre à jour le champ caché
\$('#sort_by').val(value);
\$('#filter form #sort_by').val(value);
// Mettre à jour le texte du bouton
\$('#dropdownSort').text(label);
// Mettre à jour l'option active
\$('.dropdown-item').removeClass('active text-white bg-primary');
\$(this).addClass('active text-white bg-primary');
});
//Ajout des parametres d'url dans le filtre ---------------------------------------------------------
//Ajout des parametres d'url dans le filtre
// const queryString = window.location.search;
// const urlParams = new URLSearchParams(window.location);
const url = new URL(window.location);
const urlParams = url.searchParams;
\$('#estate_filter_nue_propriete').val(0);
\$('#estate_filter_neuf').val(0);
if(urlParams.size > 0){
if(urlParams.has('type')){
var typebien = urlParams.get('type');
var checkbox = \$('#estate_filter_typebien').find(':checkbox[value=\"'+typebien+'\"]');
checkbox.prop(\"checked\",\"true\");
}
else if(urlParams.has('nue_propriete')){
\$('#estate_filter_nue_propriete').val(urlParams.get('nue_propriete'));
}
else if(urlParams.has('neuf')){
\$('#estate_filter_neuf').val(urlParams.get('neuf'));
}
else if(urlParams.has('autres')){
var not_types = ['maison/villa', 'appartement', 'terrain'];
\$('#estate_filter_typebien input:checkbox').each(function(){
if(\$.inArray(\$(this).val(), not_types) == -1){
\$(this).prop(\"checked\",\"true\");
}
});
}
}
\$(\"#filter [data-toggle=popover]\").popover({
// trigger: 'focus',
customClass: \$(\"#filter [data-toggle=popover]\").data('popover_class'),
html: true,
sanitize: false,
content: function() {
return \$(this).next().html();
}
});
//fermeture de tous les popover avant l'ouverture
\$('#filter [data-toggle=popover]').on('show.bs.popover', function (event) {
\$('#filter [data-toggle=popover]').popover('hide');
});
//synchro avec les input du filtre
\$('#filter [data-toggle=popover]').on('inserted.bs.popover', function (event) {
var button = \$(event.target)
var popover_source = button.next();
// Affichage des valeurs de la source cachée
//input text
popover_source.find('input[type=text]').each(function(){
\$('.popover').find('#'+\$(this).attr(\"id\")).val( \$(this).val() );
});
//check radio
popover_source.find('input[type=radio]').each(function(){
\$('.popover').find('#'+\$(this).attr(\"id\")).prop('checked', \$(this).is(':checked'));
});
//check checkbox
popover_source.find('input[type=checkbox]').each(function(){
\$('.popover').find('#'+\$(this).attr(\"id\")).prop('checked', \$(this).is(':checked'));
});
//survol des checkbox_icone
\$('.popover').find('[data-toggle=\"tooltip\"]').tooltip();
// A la saisie on synchronise les champs -----------------------------------------
// input text
\$('.popover input[type=text]').change(function() {
popover_source.find('#'+\$(this).attr(\"id\")).val( \$(this).val() ).trigger('change');
});
//input radio in popover
\$('.popover input[type=radio]').change(function() {
popover_source.find('#'+\$(this).attr(\"id\")).prop('checked', \$(this).is(':checked'));
popover_source.find('#'+\$(this).attr(\"id\")).trigger('change');
});
//input radio in popover
\$('.popover input[type=checkbox]').change(function() {
popover_source.find('#'+\$(this).attr(\"id\")).prop('checked', \$(this).is(':checked'));
popover_source.find('#'+\$(this).attr(\"id\")).trigger('change');
});
//input radio in source : marche à l'envers à cause de l'id
popover_source.find('input[type=radio]').change(function() {
\$('.popover').find('#'+\$(this).attr(\"id\")).prop('checked', \$(this).is(':checked'));
//pour le statut on change le texte du bouton
// if(\$(this).attr('name') == \"estate_filter[statut]\"){
// changeButtonStatut(\$(this).next().text());
// }
});
//input checkbox : : marche à l'envers à cause de l'id
popover_source.find('input[type=checkbox]').change(function() {
\$('.popover').find('#'+\$(this).attr(\"id\")).prop('checked', \$(this).is(':checked'));
});
//range_prices click
\$('.popover #range_prices a.price_min').click( function(e) {
e.preventDefault();
\$('.popover #estate_filter_prix_left_number').val(\$(this).data('price')).trigger('change');
});
\$('.popover #range_prices a.price_max').click( function(e) {
e.preventDefault();
\$('.popover #estate_filter_prix_right_number').val(\$(this).data('price')).trigger('change');
});
//
\$('.popover .btn_apply').click( function(e) {
e.preventDefault();
changeButton(true);
button.popover('hide');
searchEstates( 0 , 'filter');
});
\$('.popover .btn_cancel').click( function(e) {
e.preventDefault();
\$('.popover').find('input[type=text]').each(function(){
\$(this).val('').trigger('change');
});
\$('.popover').find('input[type=checkbox]').each(function(){
\$(this).prop('checked', false).trigger('change');
});
changeButton(true);
searchEstates( 0 , 'filter');
});
});
\$('.btn_reset').click( function(e) {
e.preventDefault();
\$('#filter form').trigger(\"reset\");
\$('#estate_filter_geo_name').val('');
\$('#estate_filter_geo_bbox').val('');
\$('#estate_filter_geo_position').val('');
changeButton(true);
searchEstates( 0 , 'filter');
// map.flyTo([47.803644, -2.416665], 16,{animate: true,duration: 1.5 });//Saint Marcel
map.setView([47.803644, -2.416665], 9);/*/Saint Marcel*/
});
//Modale save search
\$('.btn_save_search').click( function(e) {
e.preventDefault();
//Initialisation de la saugarde des recherche
displaySaveSearchModal();
});
\$('#btn_open_search').click( function(e) {
\$('#header_bottom').removeClass('d-none');
\$('#header_bottom').addClass('full_height');
// var H = \$(document).height() - \$('#header_top').height();
// \$('#header_bottom').height(H);
\$('#content').addClass('d-none');
\$('#header_bottom_mobile').hide();
// window.scroll(0, 0);
});
\$('#btn_close_search').click( function(e) {
closeMobileSearch();
});
\$('#btn_load_search').click( function(e) {
searchEstates( 0 , 'filter');
});
//Encien code
// \$('#filter input').change(function() {
// var has_btn_apply = \$(this).parents('.popover_content').find('.btn_apply').length;
// if(has_btn_apply == 0 && \$(this).attr('id') != 'geosearch'){
// changeButton(false);
// if(!isMobile() ){
// searchEstates( 0 , 'filter');
// }
// }
// });
// nouveau code ------------------------------------------------------------------------------------------
// Fix Safari : empêche les faux \"blur\" et déclenchements change
\$('#filter input[type=\"text\"]').on('focus', function (e) {
e.stopPropagation();
\$(this).data('old-value', \$(this).val());
});
// Pour les champs texte : Safari iOS bug avec change. Émulation de \"change\" → blur + changement de valeur
\$('#filter input[type=\"text\"]').on('blur', function () {
var oldValue = \$(this).data('old-value');
var newValue = \$(this).val();
if (oldValue !== newValue) {
handleFilterInput(\$(this)); // Comme un vrai \"change\"
}
});
// Pour tous les autres inputs
\$('#filter input:not([type=\"text\"])').on('change', function () {
handleFilterInput(\$(this));
});
// fin du nouveau code ------------------------------------------------------------------------------------------
\$('#contact_form').trigger(\"reset\");
//création du cookie
var params = \$('#filter form').serialize();
createCookie('sublimons_search_save' , params, 1, current_route );
//assignation du filtre si il existe ---------------------------------------------------------
var sublimons_search_save = readCookie('sublimons_search_save');
if(sublimons_search_save != null && false){
// console.log('FILTRE');
\$('#filter form').deserialize(sublimons_search_save);
// console.log(\$('#filter form').serializeArray());
//lance la recherche
changeButton(true);
searchEstates( 0 , 'filter');
//si il existe une localisation
var geo_name = \$('#estate_filter_geo_name').val();
var geo_bbox = \$('#estate_filter_geo_bbox').val();
if( geo_name.length > 0 && geo_bbox.length > 0){
\$('#geosearch').val(geo_name);
geo_bbox = JSON.parse(geo_bbox);
bbox = [[geo_bbox[3], geo_bbox[2]],[geo_bbox[1], geo_bbox[0]]];
if(with_map){
map.fitBounds( bbox, {padding: [20, 20], maxzoom: 16});
}
}
}
else{
// console.log('DIRECT');
displayEstates( datas , 'init');
}
//deplacement de la map
if(with_map){
map.on('moveend', function(e) {
setTimeout( getVisibleClusters, 500);
});
}
});
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function handleFilterInput(\$input) {
var has_btn_apply = \$input.parents('.popover_content').find('.btn_apply').length;
if (has_btn_apply == 0 && \$input.attr('id') !== 'geosearch') {
changeButton(false);
if (!isMobile()) {
searchEstates(0, 'filter');
}
}
}
function closeMobileSearch() {
if(isMobile() && \$('#header_bottom').is(\":visible\")){
\$('#header_bottom').removeClass('full_height');
\$('#header_bottom').addClass('d-none');
\$('#content').removeClass('d-none');
\$('#header_bottom_mobile').show();
}
}
function changeButton(with_apply) {
console.log(\"CHANGE \" + with_apply);
//Statut
var statut_is_checked = \$('#estate_filter_statut').find('input:checked');
var label = statut_is_checked.next(\"label\").text();
\$('#btn_estate_filter_statut').text(label);
if(label == \"Vendu\"){
\$('#btn_estate_filter_statut').removeClass('btn-";
// line 567
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 567, $this->source); })()), "html", null, true);
echo "').addClass('btn-danger');
//on vide les champs prix
\$('#estate_filter_prix input').val('');
//on desactive le bouton prox
\$('#btn_estate_filter_prix').prop('disabled', true);
}
else{
\$('#btn_estate_filter_statut').removeClass('btn-danger').addClass('btn-";
// line 574
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 574, $this->source); })()), "html", null, true);
echo "');
//on active le bouton prix
\$('#btn_estate_filter_prix').prop('disabled', false );
}
//Type de bien
var typebien_is_checked = \$('#estate_filter_typebien').find('input:checked').length;
var sous_type_is_checked = \$('#estate_filter_sous_type').find('input:checked').length;
if(typebien_is_checked > 0 || sous_type_is_checked){
\$(\"#btn_estate_filter_typebien\") .removeClass('btn-outline-";
// line 583
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 583, $this->source); })()), "html", null, true);
echo "').addClass('btn-";
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 583, $this->source); })()), "html", null, true);
echo "');
}
else{
\$(\"#btn_estate_filter_typebien\") .removeClass('btn-";
// line 586
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 586, $this->source); })()), "html", null, true);
echo "').addClass('btn-outline-";
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 586, $this->source); })()), "html", null, true);
echo "');
}
//Nombre de chambre
var nbchambres_is_checked = \$('#estate_filter_nbchambres').find('input:checked:not(#estate_filter_nbchambres_0)').length ;
if(nbchambres_is_checked> 0 ){
\$(\"#btn_estate_filter_nbchambres\") .removeClass('btn-outline-";
// line 592
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 592, $this->source); })()), "html", null, true);
echo "').addClass('btn-";
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 592, $this->source); })()), "html", null, true);
echo "');
}
else{
\$(\"#btn_estate_filter_nbchambres\") .removeClass('btn-";
// line 595
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 595, $this->source); })()), "html", null, true);
echo "').addClass('btn-outline-";
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 595, $this->source); })()), "html", null, true);
echo "');
}
if(with_apply == true){
//Prix
var prix_is_not_empty = 0;
\$(\"#filter #estate_filter_prix input\").each(function(){
if(\$(this).val() != ''){
prix_is_not_empty++;
}
});
if( prix_is_not_empty > 0 ){
\$(\"#btn_estate_filter_prix\") .removeClass('btn-outline-";
// line 607
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 607, $this->source); })()), "html", null, true);
echo "').addClass('btn-";
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 607, $this->source); })()), "html", null, true);
echo "');
}
else{
\$(\"#btn_estate_filter_prix\") .removeClass('btn-";
// line 610
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 610, $this->source); })()), "html", null, true);
echo "').addClass('btn-outline-";
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 610, $this->source); })()), "html", null, true);
echo "');
}
// + de critères
var more_text_is_not_empty = 0;
\$(\"#filter #more_text input\").each(function(){
if(\$(this).val() != ''){
more_text_is_not_empty++;
}
});
var more_picto_is_checked = \$('#more_picto').find('input:checked').length;
if( more_text_is_not_empty > 0 || more_picto_is_checked > 0){
\$(\"#btn_more\") .removeClass('btn-outline-";
// line 622
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 622, $this->source); })()), "html", null, true);
echo "').addClass('btn-";
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 622, $this->source); })()), "html", null, true);
echo "');
}
else{
\$(\"#btn_more\") .removeClass('btn-";
// line 625
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 625, $this->source); })()), "html", null, true);
echo "').addClass('btn-outline-";
echo twig_escape_filter($this->env, (isset($context["theme_class"]) || array_key_exists("theme_class", $context) ? $context["theme_class"] : (function () { throw new RuntimeError('Variable "theme_class" does not exist.', 625, $this->source); })()), "html", null, true);
echo "');
}
}
}
function centerMe_(e) {
e.target.openOn(map);
return;
//https://github.com/erictheise/rrose
//http://jsfiddle.net/asleepwalker/6m81vtad/
//http://erictheise.com/rrose/
var marker = e.target;
var pixelPosition = map.latLngToLayerPoint(marker.getLatLng());
var marker_rose = new L.Rrose({ offset: new L.Point(0, 0), closeButton: true, autoPan: false})
.setContent(template_infobox(marker.location))
.setLatLng(e.target.getLatLng())
.openOn(map);
return;
var element = document.getElementById(marker.slug);
element.scrollIntoView({behavior: \"smooth\", block: \"center\"});
map.setView(e.target.getLatLng());
marker.setBouncingOptions(bouncing_options);
marker.bounce();
}
function centerMe(e) {
var marker = e.target;
//Positionne la liste des biens sur le marker cliqué
var element = document.getElementById(marker.slug);
element.scrollIntoView({behavior: \"smooth\", block: \"center\"});
//centre le marker au milieu de la carte
// map.setView(e.target.getLatLng());
//marker.setBouncingOptions(bouncing_options);
marker.bounce();
marker.getPopup().on('remove', function() {
marker.stopBouncing();
});
}
function geoSearchOnSearch(map) {
map.closePopup();
}
function geoSearchOnSubmit(map, object ) {
// closeMobileSearch();
if(map != false){
map.closePopup();
}
var geo_name = \$('#geosearch').val();
var geo_bbox = JSON.stringify(object.bbox);
var geo_position = JSON.stringify(object.geometry.coordinates);
\$('#estate_filter_geo_name').val(geo_name);
\$('#estate_filter_geo_bbox').val(geo_bbox);
\$('#estate_filter_geo_position').val(geo_position);
console.log(geo_position);
searchEstates( 0 , 'filter');
}
function geoSearchOnReset(map, element) {
\$('#estate_filter_geo_name').val('');
\$('#estate_filter_geo_bbox').val('');
\$('#estate_filter_geo_position').val('');
searchEstates( 0 , 'filter');
if(map != false){
map.setView([47.803644, -2.416665], 8); //Saint Marcel
}
}
</script>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
public function getTemplateName()
{
return "front/acheter/index.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 992 => 625, 984 => 622, 967 => 610, 959 => 607, 942 => 595, 934 => 592, 923 => 586, 915 => 583, 903 => 574, 893 => 567, 475 => 152, 470 => 150, 466 => 149, 461 => 147, 457 => 146, 453 => 145, 449 => 144, 443 => 141, 438 => 139, 434 => 138, 430 => 137, 425 => 135, 421 => 134, 416 => 132, 410 => 129, 401 => 123, 395 => 120, 391 => 119, 387 => 118, 384 => 117, 379 => 115, 369 => 114, 357 => 111, 353 => 109, 348 => 106, 343 => 104, 339 => 103, 334 => 102, 324 => 101, 306 => 98, 294 => 95, 290 => 94, 286 => 93, 282 => 92, 277 => 90, 265 => 81, 245 => 64, 239 => 60, 235 => 58, 226 => 51, 224 => 50, 219 => 47, 209 => 46, 191 => 35, 189 => 34, 181 => 29, 178 => 28, 168 => 27, 154 => 22, 149 => 20, 145 => 19, 138 => 15, 134 => 14, 128 => 11, 124 => 10, 120 => 9, 116 => 7, 113 => 6, 103 => 5, 84 => 4, 65 => 3, 42 => 1,);
}
public function getSourceContext()
{
return new Source("{% extends 'base.html.twig' %}
{% block title %} - Annonces immobilières{% endblock %}
{% block meta_description %}Trouvez votre futur nid douillet en Bretagne. Maison, appartement, bien de prestige et terrain sont mis en valeur pour vous aider dans votre choix{% endblock %}
{% block metas %}
{% if app.request.attributes.get('_route') in ['acheter_estate', 'commerces_estate'] %}
<meta property=\"og:locale\" content=\"fr_FR\" />
<meta property=\"og:type\" content=\"article\" />
<meta property=\"og:title\" content=\"Annonce Sublimons - {{ estate.libelle|capitalize }}\" />
<meta property=\"og:description\" content=\"{{ estate.descriptifCourt|striptags }}\" />
<meta property=\"og:url\" content=\"{{ absolute_url(path( 'acheter_estate' , {refannonce:estate.refannonce})) }}/\" />
<meta property=\"og:site_name\" content=\"Sublimons\" />
<meta property=\"article:publisher\" content=\"https://www.facebook.com/sublimons\" />
<meta property=\"og:image\" content=\"{{ estate.cover|imagine_filter('stream_estate_share') }}\" />
<meta property=\"og:image:secure_url\" content=\"{{ estate.cover|imagine_filter('stream_estate_large') }}\" />
<meta property=\"og:image:width\" content=\"1200\" />
<meta property=\"og:image:height\" content=\"630\" />
<meta name=\"twitter:card\" content=\"summary\" />
<meta name=\"twitter:description\" content=\"{{ estate.descriptifCourt }}\" />
<meta name=\"twitter:title\" content=\"Annonce Sublimons - {{ estate.libelle|capitalize }}\" />
<meta name=\"twitter:site\" content=\"@Sublimonsimmo\" />
<meta name=\"twitter:image\" content=\"{{ estate.cover|imagine_filter('stream_estate_share') }}\" />
<meta name=\"twitter:creator\" content=\"@Sublimonsimmo\" />
{% endif %}
{% endblock %}
{% block header_bottom %}
<div id=\"header_bottom\" class=\"container-fluid d-none d-lg-block\">
{{ include('front/acheter/_filter.html.twig') }}
</div>
<div id=\"header_bottom_mobile\" class=\"bg-dark border-top border-white container-fluid d-lg-none text-center p-2\">
<button id=\"btn_open_search\" class=\"btn btn-primary btn-sm flex-grow-1\"><i class=\"icon-search\"></i> Rechercher</button>
<button class=\"btn_save_search btn btn-primary btn-sm mx-0 flex-grow-1\"><i class=\"icon-floppy\"></i> Sauvegarder</button>
{% include 'front/acheter/_sort.html.twig' with{'context': 'select', 'class': 'btn btn-primary btn-sm flex-grow-1', sort_by: datas.sort_by} %}
</div>
<!-- Témoin de chargement-->
<div id=\"loader\">
<div class=\"overlay\">
<div class=\"loader\"></div>
</div>
</div>
{% endblock %}
{% block content %}
<section id=\"estates\" class=\"container-fluid\">
<div class=\"row\">
{% if with_map %}
<div class=\"col-lg-6 p-0 d-none d-lg-block \">
<div class=\"map_full bg-light\">
<div id=\"estates_map\" class=\"map_container\"></div>
</div>
</div>
<div id=\"list_sidebar\" class=\"with_map col-lg-6 px-0\">
{% else %}
<div id=\"list_sidebar\" class=\"col-lg-12 px-0\">
{% endif %}
<div class=\"p-3 p-lg-4 px-xxl-5 \">
<div class=\"d-none d-lg-block\">
<div class=\"d-flex justify-content-between pl-3 pr-0 mb-2\">
<div style=\"visibility: hidden;\"><span id=\"visible_estates\"></span>/<span id=\"total_estates\"></span> résultats</div>
<div id=\"estastes_sort\">Trier : {% include 'front/acheter/_sort.html.twig' with {'context': 'select', 'class': 'select-unstyle', sort_by: datas.sort_by} %}</div>
</div>
</div>
<div id=\"estates_container\" class=\"row align-items-stretch\"></div>
<div id=\"no_estate\" class=\"banner_no_content banner_container text-white col-md-6 col-lg-12 col-xl-9 mx-auto\" style=\"display:none;\">
<div class=\"bloc_txt_image\">
<div class=\"bg_image\" style=\"background-image: url(/assets/media/acheter/no_content_L.jpg);\"></div>
<div class=\"overlay\"></div>
<div class=\"content py-5 \">
<div class=\"mt-5 px-4 py-5 mt-xl-0 d-flex align-items-center text-center\">
<div class=\"pt-5\">
<h4 class=\"mb-2\">Aucun bien ne correspond à votre recherche</h4>
<p>Contactez le conseiller proche de chez vous</p>
</div>
</div>
</div>
<div class=\"btn_container\">
<a class=\"btn-horn\" href=\"{{ path( 'agents' ) }}\" target=\"_blank\"><span>Je contacte !</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<div id=\"contactForm_source\" style=\"display: none;\">{{ render(controller('App\\\\Controller\\\\Front\\\\MessageController::contactForm', { 'context': 'agent' , 'display' : 'agent_modal'})) }}</div>
{{ source('front/acheter/estates-template.html') }}
{{ source('front/acheter/estate-infobox-template.html') }}
{{ source('front/acheter/modal-template.html') }}
{{ include('front/acheter/modal-save_search.html.twig') }}
{% endblock %}
{% block footer %}
{% endblock %}
{% block stylesheets %}
{{ parent() }}
<link rel=\"stylesheet\" href=\"{{ asset('assets/vendor/OwlCarousel2-2.3.4/dist/assets/owl.carousel.min.css') }}\"/>
<link rel=\"stylesheet\" href=\"{{ asset('assets/vendor/OwlCarousel2-2.3.4/dist/assets/owl.theme.default.min.css') }}\"/>
<link rel=\"stylesheet\" href=\"{{ asset('assets/vendor/bootstrap-4-master/build/css/tempusdominus-bootstrap-4.min.css') }}\"/>
<link rel=\"stylesheet\" href=\"https://unpkg.com/leaflet@1.7.1/dist/leaflet.css\" />
{# <link rel=\"stylesheet\" href=\"{{ asset('assets/vendor/leaflet-control-geocoder/Control.Geocoder.css') }}\"/> #}
<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/gh/tomik23/autocomplete@1.6.8/dist/css/autocomplete.min.css\"/>
<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css\" />
<link rel=\"stylesheet\" href=\"{{ asset('assets/css/dpe_ges.css') }}\"/>
{% endblock %}
{% block javascripts %}
{{ parent() }}
{# <script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js\"></script> #}
<script src=\"{{ asset('bundles/fosjsrouting/js/router.min.js') }}\"></script>
<script src=\"{{ path('fos_js_routing_js', { callback: 'fos.Router.setData' }) }}\"></script>
<script src=\"{{ asset('assets/vendor/OwlCarousel2-2.3.4/dist/owl.carousel.min.js') }}\"></script>
<script src=\"https://cdn.jsdelivr.net/npm/lazyload@2.0.0-rc.2/lazyload.js\"></script>
<script src=\"{{ asset('assets/vendor/swag.min.js') }}\"></script>
<script src=\"https://cdn.jsdelivr.net/npm/handlebars@latest/dist/handlebars.js\"></script>
<script src=\"https://unpkg.com/leaflet@1.7.1/dist/leaflet.js\"></script>
<script src=\"https://leaflet.github.io/Leaflet.markercluster/dist/leaflet.markercluster-src.js\"></script>
<script src=\"{{ asset('assets/vendor/Leaflet.SmoothMarkerBouncing.js') }}\"></script>
<script src=\"https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js\" integrity=\"sha512-qTXRIMyZIFb8iQcfjXWCO8+M5Tbc38Qi5WzdPOYZHIlZpzBHG3L3by84BBBOiRGiEb7KKtAOAs5qYdUiZiQNNQ==\" crossorigin=\"anonymous\"></script>
<script src=\"https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/locale/fr.min.js\" integrity=\"sha512-RAt2+PIRwJiyjWpzvvhKAG2LEdPpQhTgWfbEkFDCo8wC4rFYh5GQzJBVIFDswwaEDEYX16GEE/4fpeDNr7OIZw==\" crossorigin=\"anonymous\"></script>
<script src=\"{{ asset('assets/vendor/bootstrap-4-master/build/js/tempusdominus-bootstrap-4.js') }}\"></script>
<script src=\"https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js\"></script>
<script src=\"{{ asset('assets/vendor/jquery.serialize-object.min.js') }}\"></script>
<script src=\"{{ asset('assets/js/autocomplete.js') }}\"></script>
<script src=\"{{ asset('assets/js/base_map.js?v1.0') }}\"></script>
<script src=\"{{ asset('assets/js/estates_map.js?v1.3') }}\"></script>
<script src=\"{{ asset('assets/js/rrose.js') }}\"></script>
<script src=\"{{ asset('assets/js/auto_complete_geosearch.js') }}\"></script>
<script>
var current_page = '{{ current_route }}';
var current_route = Routing.generate('{{ current_route }}');
var datas = {{ datas|json_encode()|raw }};
var banners = {{ banners|json_encode()|raw }};
var col_class = datas.col_class;
var with_map = {{ with_map }};
var with_carrousel = {{ with_carrousel }};
var current_banner = 0;
var next_estates = {{ datas.next }};
// console.log(datas.estates);
var source_estate;
var template_estate;
var source_btn_next;
var template_btn_next;
var source_infobox;
var template_infobox;
var source_modal;
var template_modal;
var source_banner;
var template_banner;
jQuery(document).ready(function(){
initHandlebars();
source_estates = \$(\"#estates-template\").html();
template_estates = Handlebars.compile(source_estates);
source_btn_next = \$(\"#btn_next-template\").html();
template_btn_next = Handlebars.compile(source_btn_next);
source_infobox = \$(\"#infobox-template\").html();
template_infobox = Handlebars.compile(source_infobox);
source_modal = \$(\"#modal-template\").html();
template_modal = Handlebars.compile(source_modal);
source_banner = \$(\"#banner-template\").html();
template_banner = Handlebars.compile(source_banner);
//Initialisation de la sauvegarde des recherche
if(\$('#search_form').length > 0){
initSaveSearchForm();
}
//Ouverture par url
var parts = window.location.pathname.split('/');
if( parts.length == 3 ) {
var refannonce = parts[2];
var estate = datas.estates.find(estate => String(estate.refannonce) === String(refannonce));
if( estate === undefined){ //ajax
getEstate(refannonce);
}
else{
displayEstate(estate);
}
}
if(with_map){
setMap( 'estates_map', 9, 7, 16 );
geoSearch('geosearch', map);
}
else{
geoSearch('geosearch', false);
}
//gestion du filtre
\$('#filter form').submit(function(e){
e.preventDefault();
});
//Filtre à zero
\$('#filter form').trigger(\"reset\");
//Tri
\$(\".sort_estate\").change(\"change\", function(){
\$('#filter form #sort_by').val(\$(this).val());
searchEstates( 0 , 'filter');
});
\$('.dropdown-item').click(function(e) {
e.preventDefault(); // empêcher le lien de naviguer
var value = \$(this).data('value'); // nouvelle valeur
var label = \$(this).text(); // texte à afficher
// Mettre à jour le champ caché
\$('#sort_by').val(value);
\$('#filter form #sort_by').val(value);
// Mettre à jour le texte du bouton
\$('#dropdownSort').text(label);
// Mettre à jour l'option active
\$('.dropdown-item').removeClass('active text-white bg-primary');
\$(this).addClass('active text-white bg-primary');
});
//Ajout des parametres d'url dans le filtre ---------------------------------------------------------
//Ajout des parametres d'url dans le filtre
// const queryString = window.location.search;
// const urlParams = new URLSearchParams(window.location);
const url = new URL(window.location);
const urlParams = url.searchParams;
\$('#estate_filter_nue_propriete').val(0);
\$('#estate_filter_neuf').val(0);
if(urlParams.size > 0){
if(urlParams.has('type')){
var typebien = urlParams.get('type');
var checkbox = \$('#estate_filter_typebien').find(':checkbox[value=\"'+typebien+'\"]');
checkbox.prop(\"checked\",\"true\");
}
else if(urlParams.has('nue_propriete')){
\$('#estate_filter_nue_propriete').val(urlParams.get('nue_propriete'));
}
else if(urlParams.has('neuf')){
\$('#estate_filter_neuf').val(urlParams.get('neuf'));
}
else if(urlParams.has('autres')){
var not_types = ['maison/villa', 'appartement', 'terrain'];
\$('#estate_filter_typebien input:checkbox').each(function(){
if(\$.inArray(\$(this).val(), not_types) == -1){
\$(this).prop(\"checked\",\"true\");
}
});
}
}
\$(\"#filter [data-toggle=popover]\").popover({
// trigger: 'focus',
customClass: \$(\"#filter [data-toggle=popover]\").data('popover_class'),
html: true,
sanitize: false,
content: function() {
return \$(this).next().html();
}
});
//fermeture de tous les popover avant l'ouverture
\$('#filter [data-toggle=popover]').on('show.bs.popover', function (event) {
\$('#filter [data-toggle=popover]').popover('hide');
});
//synchro avec les input du filtre
\$('#filter [data-toggle=popover]').on('inserted.bs.popover', function (event) {
var button = \$(event.target)
var popover_source = button.next();
// Affichage des valeurs de la source cachée
//input text
popover_source.find('input[type=text]').each(function(){
\$('.popover').find('#'+\$(this).attr(\"id\")).val( \$(this).val() );
});
//check radio
popover_source.find('input[type=radio]').each(function(){
\$('.popover').find('#'+\$(this).attr(\"id\")).prop('checked', \$(this).is(':checked'));
});
//check checkbox
popover_source.find('input[type=checkbox]').each(function(){
\$('.popover').find('#'+\$(this).attr(\"id\")).prop('checked', \$(this).is(':checked'));
});
//survol des checkbox_icone
\$('.popover').find('[data-toggle=\"tooltip\"]').tooltip();
// A la saisie on synchronise les champs -----------------------------------------
// input text
\$('.popover input[type=text]').change(function() {
popover_source.find('#'+\$(this).attr(\"id\")).val( \$(this).val() ).trigger('change');
});
//input radio in popover
\$('.popover input[type=radio]').change(function() {
popover_source.find('#'+\$(this).attr(\"id\")).prop('checked', \$(this).is(':checked'));
popover_source.find('#'+\$(this).attr(\"id\")).trigger('change');
});
//input radio in popover
\$('.popover input[type=checkbox]').change(function() {
popover_source.find('#'+\$(this).attr(\"id\")).prop('checked', \$(this).is(':checked'));
popover_source.find('#'+\$(this).attr(\"id\")).trigger('change');
});
//input radio in source : marche à l'envers à cause de l'id
popover_source.find('input[type=radio]').change(function() {
\$('.popover').find('#'+\$(this).attr(\"id\")).prop('checked', \$(this).is(':checked'));
//pour le statut on change le texte du bouton
// if(\$(this).attr('name') == \"estate_filter[statut]\"){
// changeButtonStatut(\$(this).next().text());
// }
});
//input checkbox : : marche à l'envers à cause de l'id
popover_source.find('input[type=checkbox]').change(function() {
\$('.popover').find('#'+\$(this).attr(\"id\")).prop('checked', \$(this).is(':checked'));
});
//range_prices click
\$('.popover #range_prices a.price_min').click( function(e) {
e.preventDefault();
\$('.popover #estate_filter_prix_left_number').val(\$(this).data('price')).trigger('change');
});
\$('.popover #range_prices a.price_max').click( function(e) {
e.preventDefault();
\$('.popover #estate_filter_prix_right_number').val(\$(this).data('price')).trigger('change');
});
//
\$('.popover .btn_apply').click( function(e) {
e.preventDefault();
changeButton(true);
button.popover('hide');
searchEstates( 0 , 'filter');
});
\$('.popover .btn_cancel').click( function(e) {
e.preventDefault();
\$('.popover').find('input[type=text]').each(function(){
\$(this).val('').trigger('change');
});
\$('.popover').find('input[type=checkbox]').each(function(){
\$(this).prop('checked', false).trigger('change');
});
changeButton(true);
searchEstates( 0 , 'filter');
});
});
\$('.btn_reset').click( function(e) {
e.preventDefault();
\$('#filter form').trigger(\"reset\");
\$('#estate_filter_geo_name').val('');
\$('#estate_filter_geo_bbox').val('');
\$('#estate_filter_geo_position').val('');
changeButton(true);
searchEstates( 0 , 'filter');
// map.flyTo([47.803644, -2.416665], 16,{animate: true,duration: 1.5 });//Saint Marcel
map.setView([47.803644, -2.416665], 9);/*/Saint Marcel*/
});
//Modale save search
\$('.btn_save_search').click( function(e) {
e.preventDefault();
//Initialisation de la saugarde des recherche
displaySaveSearchModal();
});
\$('#btn_open_search').click( function(e) {
\$('#header_bottom').removeClass('d-none');
\$('#header_bottom').addClass('full_height');
// var H = \$(document).height() - \$('#header_top').height();
// \$('#header_bottom').height(H);
\$('#content').addClass('d-none');
\$('#header_bottom_mobile').hide();
// window.scroll(0, 0);
});
\$('#btn_close_search').click( function(e) {
closeMobileSearch();
});
\$('#btn_load_search').click( function(e) {
searchEstates( 0 , 'filter');
});
//Encien code
// \$('#filter input').change(function() {
// var has_btn_apply = \$(this).parents('.popover_content').find('.btn_apply').length;
// if(has_btn_apply == 0 && \$(this).attr('id') != 'geosearch'){
// changeButton(false);
// if(!isMobile() ){
// searchEstates( 0 , 'filter');
// }
// }
// });
// nouveau code ------------------------------------------------------------------------------------------
// Fix Safari : empêche les faux \"blur\" et déclenchements change
\$('#filter input[type=\"text\"]').on('focus', function (e) {
e.stopPropagation();
\$(this).data('old-value', \$(this).val());
});
// Pour les champs texte : Safari iOS bug avec change. Émulation de \"change\" → blur + changement de valeur
\$('#filter input[type=\"text\"]').on('blur', function () {
var oldValue = \$(this).data('old-value');
var newValue = \$(this).val();
if (oldValue !== newValue) {
handleFilterInput(\$(this)); // Comme un vrai \"change\"
}
});
// Pour tous les autres inputs
\$('#filter input:not([type=\"text\"])').on('change', function () {
handleFilterInput(\$(this));
});
// fin du nouveau code ------------------------------------------------------------------------------------------
\$('#contact_form').trigger(\"reset\");
//création du cookie
var params = \$('#filter form').serialize();
createCookie('sublimons_search_save' , params, 1, current_route );
//assignation du filtre si il existe ---------------------------------------------------------
var sublimons_search_save = readCookie('sublimons_search_save');
if(sublimons_search_save != null && false){
// console.log('FILTRE');
\$('#filter form').deserialize(sublimons_search_save);
// console.log(\$('#filter form').serializeArray());
//lance la recherche
changeButton(true);
searchEstates( 0 , 'filter');
//si il existe une localisation
var geo_name = \$('#estate_filter_geo_name').val();
var geo_bbox = \$('#estate_filter_geo_bbox').val();
if( geo_name.length > 0 && geo_bbox.length > 0){
\$('#geosearch').val(geo_name);
geo_bbox = JSON.parse(geo_bbox);
bbox = [[geo_bbox[3], geo_bbox[2]],[geo_bbox[1], geo_bbox[0]]];
if(with_map){
map.fitBounds( bbox, {padding: [20, 20], maxzoom: 16});
}
}
}
else{
// console.log('DIRECT');
displayEstates( datas , 'init');
}
//deplacement de la map
if(with_map){
map.on('moveend', function(e) {
setTimeout( getVisibleClusters, 500);
});
}
});
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function handleFilterInput(\$input) {
var has_btn_apply = \$input.parents('.popover_content').find('.btn_apply').length;
if (has_btn_apply == 0 && \$input.attr('id') !== 'geosearch') {
changeButton(false);
if (!isMobile()) {
searchEstates(0, 'filter');
}
}
}
function closeMobileSearch() {
if(isMobile() && \$('#header_bottom').is(\":visible\")){
\$('#header_bottom').removeClass('full_height');
\$('#header_bottom').addClass('d-none');
\$('#content').removeClass('d-none');
\$('#header_bottom_mobile').show();
}
}
function changeButton(with_apply) {
console.log(\"CHANGE \" + with_apply);
//Statut
var statut_is_checked = \$('#estate_filter_statut').find('input:checked');
var label = statut_is_checked.next(\"label\").text();
\$('#btn_estate_filter_statut').text(label);
if(label == \"Vendu\"){
\$('#btn_estate_filter_statut').removeClass('btn-{{theme_class }}').addClass('btn-danger');
//on vide les champs prix
\$('#estate_filter_prix input').val('');
//on desactive le bouton prox
\$('#btn_estate_filter_prix').prop('disabled', true);
}
else{
\$('#btn_estate_filter_statut').removeClass('btn-danger').addClass('btn-{{theme_class }}');
//on active le bouton prix
\$('#btn_estate_filter_prix').prop('disabled', false );
}
//Type de bien
var typebien_is_checked = \$('#estate_filter_typebien').find('input:checked').length;
var sous_type_is_checked = \$('#estate_filter_sous_type').find('input:checked').length;
if(typebien_is_checked > 0 || sous_type_is_checked){
\$(\"#btn_estate_filter_typebien\") .removeClass('btn-outline-{{theme_class }}').addClass('btn-{{theme_class }}');
}
else{
\$(\"#btn_estate_filter_typebien\") .removeClass('btn-{{theme_class }}').addClass('btn-outline-{{theme_class }}');
}
//Nombre de chambre
var nbchambres_is_checked = \$('#estate_filter_nbchambres').find('input:checked:not(#estate_filter_nbchambres_0)').length ;
if(nbchambres_is_checked> 0 ){
\$(\"#btn_estate_filter_nbchambres\") .removeClass('btn-outline-{{theme_class }}').addClass('btn-{{theme_class }}');
}
else{
\$(\"#btn_estate_filter_nbchambres\") .removeClass('btn-{{theme_class }}').addClass('btn-outline-{{theme_class }}');
}
if(with_apply == true){
//Prix
var prix_is_not_empty = 0;
\$(\"#filter #estate_filter_prix input\").each(function(){
if(\$(this).val() != ''){
prix_is_not_empty++;
}
});
if( prix_is_not_empty > 0 ){
\$(\"#btn_estate_filter_prix\") .removeClass('btn-outline-{{theme_class }}').addClass('btn-{{theme_class }}');
}
else{
\$(\"#btn_estate_filter_prix\") .removeClass('btn-{{theme_class }}').addClass('btn-outline-{{theme_class }}');
}
// + de critères
var more_text_is_not_empty = 0;
\$(\"#filter #more_text input\").each(function(){
if(\$(this).val() != ''){
more_text_is_not_empty++;
}
});
var more_picto_is_checked = \$('#more_picto').find('input:checked').length;
if( more_text_is_not_empty > 0 || more_picto_is_checked > 0){
\$(\"#btn_more\") .removeClass('btn-outline-{{theme_class }}').addClass('btn-{{theme_class }}');
}
else{
\$(\"#btn_more\") .removeClass('btn-{{theme_class }}').addClass('btn-outline-{{theme_class }}');
}
}
}
function centerMe_(e) {
e.target.openOn(map);
return;
//https://github.com/erictheise/rrose
//http://jsfiddle.net/asleepwalker/6m81vtad/
//http://erictheise.com/rrose/
var marker = e.target;
var pixelPosition = map.latLngToLayerPoint(marker.getLatLng());
var marker_rose = new L.Rrose({ offset: new L.Point(0, 0), closeButton: true, autoPan: false})
.setContent(template_infobox(marker.location))
.setLatLng(e.target.getLatLng())
.openOn(map);
return;
var element = document.getElementById(marker.slug);
element.scrollIntoView({behavior: \"smooth\", block: \"center\"});
map.setView(e.target.getLatLng());
marker.setBouncingOptions(bouncing_options);
marker.bounce();
}
function centerMe(e) {
var marker = e.target;
//Positionne la liste des biens sur le marker cliqué
var element = document.getElementById(marker.slug);
element.scrollIntoView({behavior: \"smooth\", block: \"center\"});
//centre le marker au milieu de la carte
// map.setView(e.target.getLatLng());
//marker.setBouncingOptions(bouncing_options);
marker.bounce();
marker.getPopup().on('remove', function() {
marker.stopBouncing();
});
}
function geoSearchOnSearch(map) {
map.closePopup();
}
function geoSearchOnSubmit(map, object ) {
// closeMobileSearch();
if(map != false){
map.closePopup();
}
var geo_name = \$('#geosearch').val();
var geo_bbox = JSON.stringify(object.bbox);
var geo_position = JSON.stringify(object.geometry.coordinates);
\$('#estate_filter_geo_name').val(geo_name);
\$('#estate_filter_geo_bbox').val(geo_bbox);
\$('#estate_filter_geo_position').val(geo_position);
console.log(geo_position);
searchEstates( 0 , 'filter');
}
function geoSearchOnReset(map, element) {
\$('#estate_filter_geo_name').val('');
\$('#estate_filter_geo_bbox').val('');
\$('#estate_filter_geo_position').val('');
searchEstates( 0 , 'filter');
if(map != false){
map.setView([47.803644, -2.416665], 8); //Saint Marcel
}
}
</script>
{% endblock %} ", "front/acheter/index.html.twig", "/home/pofr4524/sites/dev.sublimons.com/templates/front/acheter/index.html.twig");
}
}