<?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;
/* @NotarisFrontend/addressbook/search.html.twig */
class __TwigTemplate_df1ddb5b6f2c9294dfd530440117b69e extends \Twig\Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'title' => [$this, 'block_title'],
'extralinks' => [$this, 'block_extralinks'],
'extrameta' => [$this, 'block_extrameta'],
'body' => [$this, 'block_body'],
'extrajs' => [$this, 'block_extrajs'],
'extracss' => [$this, 'block_extracss'],
];
}
protected function doGetParent(array $context)
{
// line 1
return "@NotarisFrontend/layout2017.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@NotarisFrontend/addressbook/search.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@NotarisFrontend/addressbook/search.html.twig"));
$this->parent = $this->loadTemplate("@NotarisFrontend/layout2017.html.twig", "@NotarisFrontend/addressbook/search.html.twig", 1);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
public function block_title($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
// line 4
echo " <title>";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_notary_search_title"), "html", null, true);
echo "</title>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 7
public function block_extralinks($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "extralinks"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "extralinks"));
// line 8
echo " ";
$context["hreflang_start_nl"] = (((isset($context["url_scheme"]) || array_key_exists("url_scheme", $context) ? $context["url_scheme"] : (function () { throw new RuntimeError('Variable "url_scheme" does not exist.', 8, $this->source); })()) . "://www.") . (isset($context["url_nl"]) || array_key_exists("url_nl", $context) ? $context["url_nl"] : (function () { throw new RuntimeError('Variable "url_nl" does not exist.', 8, $this->source); })()));
// line 9
echo " ";
$context["hreflang_start_fr"] = (((isset($context["url_scheme"]) || array_key_exists("url_scheme", $context) ? $context["url_scheme"] : (function () { throw new RuntimeError('Variable "url_scheme" does not exist.', 9, $this->source); })()) . "://www.") . (isset($context["url_fr"]) || array_key_exists("url_fr", $context) ? $context["url_fr"] : (function () { throw new RuntimeError('Variable "url_fr" does not exist.', 9, $this->source); })()));
// line 10
echo " ";
$context["hreflang_nl"] = ((isset($context["hreflang_start_nl"]) || array_key_exists("hreflang_start_nl", $context) ? $context["hreflang_start_nl"] : (function () { throw new RuntimeError('Variable "hreflang_start_nl" does not exist.', 10, $this->source); })()) . $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("notaris_frontend_addressbook"));
// line 11
echo " ";
$context["hreflang_fr"] = ((isset($context["hreflang_start_fr"]) || array_key_exists("hreflang_start_fr", $context) ? $context["hreflang_start_fr"] : (function () { throw new RuntimeError('Variable "hreflang_start_fr" does not exist.', 11, $this->source); })()) . $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("notaris_frontend_addressbook"));
// line 12
echo "
<link rel=\"alternate\" hreflang=\"nl-be\"
href=\"";
// line 14
echo twig_escape_filter($this->env, (isset($context["hreflang_nl"]) || array_key_exists("hreflang_nl", $context) ? $context["hreflang_nl"] : (function () { throw new RuntimeError('Variable "hreflang_nl" does not exist.', 14, $this->source); })()), "html", null, true);
echo "\"/>
<link rel=\"alternate\" hreflang=\"fr-be\"
href=\"";
// line 16
echo twig_escape_filter($this->env, (isset($context["hreflang_fr"]) || array_key_exists("hreflang_fr", $context) ? $context["hreflang_fr"] : (function () { throw new RuntimeError('Variable "hreflang_fr" does not exist.', 16, $this->source); })()), "html", null, true);
echo "\"/>
<link rel=\"alternate\" hreflang=\"x-default\"
href=\"";
// line 18
echo twig_escape_filter($this->env, (isset($context["hreflang_nl"]) || array_key_exists("hreflang_nl", $context) ? $context["hreflang_nl"] : (function () { throw new RuntimeError('Variable "hreflang_nl" does not exist.', 18, $this->source); })()), "html", null, true);
echo "\"/>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 21
public function block_extrameta($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "extrameta"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "extrameta"));
// line 22
echo " ";
$this->displayParentBlock("extrameta", $context, $blocks);
echo "
<meta name=\"keywords\" content=\"";
// line 23
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_notary_search_keywords"), "html", null, true);
echo "\"/>
<meta name=\"description\" lang=\"";
// line 24
echo twig_escape_filter($this->env, (isset($context["locale"]) || array_key_exists("locale", $context) ? $context["locale"] : (function () { throw new RuntimeError('Variable "locale" does not exist.', 24, $this->source); })()), "html", null, true);
echo "\" content=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_notary_search_description"), "html", null, true);
echo "\"/>
";
// line 25
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["subsite"]) || array_key_exists("subsite", $context) ? $context["subsite"] : (function () { throw new RuntimeError('Variable "subsite" does not exist.', 25, $this->source); })()), "meta", [], "any", false, false, false, 25), "ogTitle", [], "any", false, false, false, 25) != "")) {
// line 26
echo " <meta property=\"og:title\" content=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_notary_search_title"), "html", null, true);
echo "\"/>
<meta property=\"og:type\" content=\"article\"/>
<meta property=\"og:url\" content=\" ";
// line 28
echo twig_escape_filter($this->env, 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.', 28, $this->source); })()), "request", [], "any", false, false, false, 28), "uri", [], "any", false, false, false, 28), "html", null, true);
echo "\"/>
";
}
// line 30
echo " ";
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["subsite"]) || array_key_exists("subsite", $context) ? $context["subsite"] : (function () { throw new RuntimeError('Variable "subsite" does not exist.', 30, $this->source); })()), "meta", [], "any", false, false, false, 30), "ogDescription", [], "any", false, false, false, 30) != "")) {
// line 31
echo " <meta property=\"og:description\" content=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["subsite"]) || array_key_exists("subsite", $context) ? $context["subsite"] : (function () { throw new RuntimeError('Variable "subsite" does not exist.', 31, $this->source); })()), "meta", [], "any", false, false, false, 31), "ogDescription", [], "any", false, false, false, 31), "html", null, true);
echo "\"/>
";
}
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 35
public function block_body($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
// line 36
echo " <section class=\"content u-padding-top-large\">
<aside id=\"content-left\" class=\"content-left-small hidesmartphone\">
<nav class=\"standard-nav\">
<ul class=\"u-margin-left-none u-padding-left-none\">
<li class=\"active\">
<div class=\"activestate\"> </div>
<a href=\"#\" title=\"";
// line 42
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search");
echo "\" class=\"hi\">";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search");
echo "</a>
</li>
</ul>
</nav>
</aside>
<div id=\"content-center\" class=\"content-center-large ";
// line 48
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["subsite"]) || array_key_exists("subsite", $context) ? $context["subsite"] : (function () { throw new RuntimeError('Variable "subsite" does not exist.', 48, $this->source); })()), "stylesheet", [], "any", false, false, false, 48), "html", null, true);
echo "\">
<section id=\"info\" class=\"no-margin\">
<div class=\"tab-by-name active\">";
// line 50
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_by_name");
echo "</div><div class=\"tab-by-location inactive\">";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_by_location");
echo "</div>
<form action=\"";
// line 51
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("notaris_frontend_addressbook");
echo "\" method=\"get\" class=\"u-padding-top-large u-padding-small form-by-name o-layout__item--relative\">
<span class=\"addressbook-results-empty u-margin-bottom-small u-display--block\" ";
// line 52
if (((null === 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.', 52, $this->source); })()), "request", [], "any", false, false, false, 52), "query", [], "any", false, false, false, 52), "get", [0 => "query"], "method", false, false, false, 52)) || !twig_test_empty((isset($context["results"]) || array_key_exists("results", $context) ? $context["results"] : (function () { throw new RuntimeError('Variable "results" does not exist.', 52, $this->source); })())))) {
echo "style=\"display: none\"";
}
echo ">";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_no_results", ["%link%" => $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("notaris_frontend_addressbook_deed")]);
echo "<br></span>
<span class=\"addressbook-input-empty\" style=\"display: none;\">";
// line 53
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_no_input");
echo "<br></span>
<input type=\"text\" placeholder=\"";
// line 54
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_placeholder_name"), "html", null, true);
echo "\" name=\"query\" id=\"addressbookSearch\" ";
if ( !(null === 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.', 54, $this->source); })()), "request", [], "any", false, false, false, 54), "query", [], "any", false, false, false, 54), "get", [0 => "query"], "method", false, false, false, 54))) {
echo "value=\"";
echo twig_escape_filter($this->env, 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.', 54, $this->source); })()), "request", [], "any", false, false, false, 54), "query", [], "any", false, false, false, 54), "get", [0 => "query"], "method", false, false, false, 54), "html", null, true);
echo "\"";
}
echo "/>
<div id=\"addressbook-menu-container\"></div>
<button type=\"submit\" class=\"c-btn--primary u-color-white addressbook-search-button\" style=\"vertical-align: top\">
";
// line 57
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_button"), "html", null, true);
echo "
</button>
<div class=\"u-margin-top-small\">";
// line 59
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_notary_footer");
echo "</div>
</form>
<form action=\"";
// line 61
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("notaris_frontend_addressbook");
echo "\" method=\"get\" class=\"u-padding-top-large u-padding-small form-by-location\" style=\"display: none\">
<span class=\"addressbook-location-results-empty u-margin-bottom-small u-display--block\" ";
// line 62
if (((null === 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.', 62, $this->source); })()), "request", [], "any", false, false, false, 62), "query", [], "any", false, false, false, 62), "get", [0 => "query"], "method", false, false, false, 62)) || !twig_test_empty((isset($context["results"]) || array_key_exists("results", $context) ? $context["results"] : (function () { throw new RuntimeError('Variable "results" does not exist.', 62, $this->source); })())))) {
echo "style=\"display: none\"";
}
echo ">";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_location_no_results");
echo "</span>
<span class=\"addressbook-location-results-empty2 u-margin-bottom-small u-display--block\" ";
// line 63
if (((null === 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.', 63, $this->source); })()), "request", [], "any", false, false, false, 63), "query", [], "any", false, false, false, 63), "all", [0 => "queryLocation"], "method", false, false, false, 63)) || !twig_test_empty((isset($context["results"]) || array_key_exists("results", $context) ? $context["results"] : (function () { throw new RuntimeError('Variable "results" does not exist.', 63, $this->source); })())))) {
echo "style=\"display: none\"";
}
echo ">";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_location_no_results2");
echo "</span>
<span class=\"addressbook-location-selected-too-many u-margin-bottom-small u-display--block\" style=\"display: none\">";
// line 64
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_location_selected_too_many");
echo "</span>
<div class=\"form-by-location-container\">
<input type=\"text\" placeholder=\"";
// line 66
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_location_placeholder_name"), "html", null, true);
echo "\" name=\"query-location\" id=\"addressbookLocationSearch\" style=\"height: 46px;min-height: 46px;padding-right: 5px;\" ";
if ( !(null === 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.', 66, $this->source); })()), "request", [], "any", false, false, false, 66), "query", [], "any", false, false, false, 66), "get", [0 => "query-location"], "method", false, false, false, 66))) {
echo "value=\"";
echo twig_escape_filter($this->env, 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.', 66, $this->source); })()), "request", [], "any", false, false, false, 66), "query", [], "any", false, false, false, 66), "get", [0 => "query-location"], "method", false, false, false, 66), "html", null, true);
echo "\"";
}
echo "/>
<div class=\"municipalities\"></div>
<div id=\"addressbook-location-menu-container\" style=\"position: absolute\"></div>
<div class=\"u-margin-top-tiny\">
<input type=\"checkbox\" name=\"mediators\" id=\"mediators\" style=\"width: auto;\" ";
// line 70
if ( !(null === 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.', 70, $this->source); })()), "request", [], "any", false, false, false, 70), "query", [], "any", false, false, false, 70), "get", [0 => "mediators"], "method", false, false, false, 70))) {
echo "checked";
}
echo "/>
<label for=\"mediators\" class=\"u-margin-left-tiny\">";
// line 71
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("md_bemiddelaar");
echo "</label>
</div>
<div class=\"u-margin-top-tiny\">
<input type=\"checkbox\" name=\"show_on_map\" id=\"show_on_map\" style=\"width: auto;\" ";
// line 74
if ( !(null === 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.', 74, $this->source); })()), "request", [], "any", false, false, false, 74), "query", [], "any", false, false, false, 74), "get", [0 => "show_on_map"], "method", false, false, false, 74))) {
echo "checked";
}
echo "/>
<label for=\"show_on_map\" class=\"u-margin-left-tiny\">";
// line 75
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("md_kaart"), "html", null, true);
echo "</label>
</div>
<select name=\"language\" class=\"u-margin-top-tiny location-select\">
<option value=\"\">";
// line 78
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("md_kennis"), "html", null, true);
echo "</option>
";
// line 79
$context["languages"] = $this->extensions['Notaris\FrontendBundle\Twig\NotarySearchLanguageExtension']->getNotarySearchLanguage();
// line 80
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["languages"]) || array_key_exists("languages", $context) ? $context["languages"] : (function () { throw new RuntimeError('Variable "languages" does not exist.', 80, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["language"]) {
// line 81
echo " <option value=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["language"], "languageShort", [], "any", false, false, false, 81), "html", null, true);
echo "\" ";
if ((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.', 81, $this->source); })()), "request", [], "any", false, false, false, 81), "query", [], "any", false, false, false, 81), "get", [0 => "language"], "method", false, false, false, 81) == twig_get_attribute($this->env, $this->source, $context["language"], "languageShort", [], "any", false, false, false, 81))) {
echo "selected";
}
echo ">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(twig_get_attribute($this->env, $this->source, $context["language"], "language", [], "any", false, false, false, 81)), "html", null, true);
echo "</option>;
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['language'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 83
echo " </select>
<button type=\"submit\" class=\"c-btn--primary u-color-white u-margin-top-tiny addressbook-search-location-button\">
";
// line 85
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_button"), "html", null, true);
echo "
</button>
<div class=\"u-margin-top-small\">";
// line 87
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_notary_footer");
echo "</div>
</div>
</form>
";
// line 91
if ( !twig_test_empty((isset($context["results"]) || array_key_exists("results", $context) ? $context["results"] : (function () { throw new RuntimeError('Variable "results" does not exist.', 91, $this->source); })()))) {
// line 92
echo " <div class=\"results-header u-margin-top-large u-padding-tiny u-padding-bottom-small u-padding-top-small\">
";
// line 93
if ((twig_length_filter($this->env, (isset($context["results"]) || array_key_exists("results", $context) ? $context["results"] : (function () { throw new RuntimeError('Variable "results" does not exist.', 93, $this->source); })())) == 1)) {
// line 94
echo " ";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_top_one_result");
echo "
";
} elseif ((twig_length_filter($this->env, // line 95
(isset($context["results"]) || array_key_exists("results", $context) ? $context["results"] : (function () { throw new RuntimeError('Variable "results" does not exist.', 95, $this->source); })())) > 1)) {
// line 96
echo " ";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_top_multiple_results", ["%results%" => twig_length_filter($this->env, (isset($context["results"]) || array_key_exists("results", $context) ? $context["results"] : (function () { throw new RuntimeError('Variable "results" does not exist.', 96, $this->source); })()))]);
echo "
";
}
// line 98
echo " </div>
<div class=\"article-content results-filters u-padding-tiny u-padding-bottom-small u-padding-top-small\">
<p class=\"ordering\">";
// line 100
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("zk_not_order");
echo "
<a href=\"#\" id=\"order-name\" data-order=\"name\" data-orderpos=\"za\">";
// line 101
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("zk_not_ordernaam");
echo "</a> /
<a href=\"#\" id=\"order-postal\" data-order=\"postal\" data-orderpos=\"za\">";
// line 102
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("zk_not_orderpostcode");
echo "</a> /
<a href=\"#\" id=\"order-city\" data-order=\"city\" data-orderpos=\"za\">";
// line 103
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("zk_not_ordergemeente");
echo "</a>
</p>
</div>
<div id=\"info-content\" class=\"niveau1 info-news-content\">
";
// line 107
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["results"]) || array_key_exists("results", $context) ? $context["results"] : (function () { throw new RuntimeError('Variable "results" does not exist.', 107, $this->source); })()));
foreach ($context['_seq'] as $context["key"] => $context["result"]) {
// line 108
echo " <a class=\"info-content-blocklink tooltip office-active u-padding-top-small u-padding-bottom-small\" href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("notaris_frontend_search_notary_detail", ["slug" => ((twig_get_attribute($this->env, $this->source, $context["result"], "slug", [], "any", true, true, false, 108)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, $context["result"], "slug", [], "any", false, false, false, 108), "slug")) : ("slug"))]), "html", null, true);
echo "\" title=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_kantoor"), "html", null, true);
echo "\"
data-name=\"";
// line 109
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["result"], "kantoor", [], "any", false, false, false, 109), "html", null, true);
echo "\" data-postal=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["result"], "addresses", [], "any", false, false, false, 109), 0, [], "array", false, false, false, 109), "html", null, true);
echo "\" data-city=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["result"], "municipality", [], "any", false, false, false, 109), "html", null, true);
echo "\">
<div class=\"icon\"><img src=\"/images/icons/office.png\"></div>
<div class=\"text\"><h3>";
// line 111
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("zk_not_kantoor");
echo " ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["result"], "kantoor", [], "any", false, false, false, 111), "html", null, true);
echo "</h3>
<p class=\"u-margin-none\">
";
// line 113
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["result"], "addresses", [], "any", false, false, false, 113));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["address"]) {
// line 114
echo " ";
if ( !twig_get_attribute($this->env, $this->source, $context["loop"], "first", [], "any", false, false, false, 114)) {
echo " - ";
}
echo twig_escape_filter($this->env, $context["address"], "html", null, true);
echo "
";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['address'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 116
echo " ";
if (twig_get_attribute($this->env, $this->source, $context["result"], "hasCalendar", [], "any", false, false, false, 116)) {
// line 117
echo " <span class=\"c-link-lookalike\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("zk_has_calendar"), "html", null, true);
echo "</span>
";
}
// line 119
echo " </p>
</div>
<div class=\"cleaner\"> </div>
</a>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['key'], $context['result'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 124
echo " </div>
<div class=\"results-footer\">
<div class=\"prevnext-pages\"></div>
<div class=\"results-footer-text\">
";
// line 128
if ((twig_length_filter($this->env, (isset($context["results"]) || array_key_exists("results", $context) ? $context["results"] : (function () { throw new RuntimeError('Variable "results" does not exist.', 128, $this->source); })())) == 1)) {
// line 129
echo " ";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_one_result", ["%link%" => $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("notaris_frontend_addressbook")]);
echo "
";
} elseif ((twig_length_filter($this->env, // line 130
(isset($context["results"]) || array_key_exists("results", $context) ? $context["results"] : (function () { throw new RuntimeError('Variable "results" does not exist.', 130, $this->source); })())) > 1)) {
// line 131
echo " ";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_multiple_results", ["%link%" => $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("notaris_frontend_addressbook")]);
echo "
";
}
// line 133
echo " </div>
</div>
";
} else {
// line 136
echo " <span class=\"u-margin-bottom-small u-margin-top-large u-m u-display--block\" ";
if (((null === 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.', 136, $this->source); })()), "request", [], "any", false, false, false, 136), "query", [], "any", false, false, false, 136), "get", [0 => "query"], "method", false, false, false, 136)) && (null === 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.', 136, $this->source); })()), "request", [], "any", false, false, false, 136), "query", [], "any", false, false, false, 136), "all", [0 => "queryLocation"], "method", false, false, false, 136)))) {
echo "style=\"display: none\"";
}
echo ">";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_no_results_bottom");
echo "</span>
";
}
// line 138
echo " </section>
</div>
</section>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 143
public function block_extrajs($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "extrajs"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "extrajs"));
// line 144
echo " <script src=\"/adminassets/libs/jqueryui/jquery-ui-1.10.4.custom.min.js\"></script>
<script>
var addressbookLocationSearchGroup = [];
var currentpage = 0;
initFormTabs();
initAddressbookSearchAutocomplete();
initAddressbookLocationSearchAutocomplete();
initPaging(currentpage);
initOrdering();
setLocationQuery();
function initAddressbookSearchAutocomplete() {
\$('#addressbookSearch').autocomplete({
minLength: 2,
delay: 500,
source: '";
// line 160
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("notaris_frontend_addressbook_autocomplete");
echo "',
appendTo: '#addressbook-menu-container',
response: function (event, ui) {
if (ui.content.length === 0) {
\$('.addressbook-results-empty').show();
return;
}
\$('.addressbook-results-empty').hide();
},
}).bind('focus', function () {
if (\$('.ui-autocomplete').children().length > 0) {
\$('.ui-autocomplete').show();
}
}).data('uiAutocomplete')._renderItem = function (ul, item) {
var regexpString = \$('#addressbookSearch').val();
regexpString = regexpString.replaceAll('a', '[aàâ]');
regexpString = regexpString.replaceAll('e', '[eéèêë]');
regexpString = regexpString.replaceAll('i', '[iìîï]');
regexpString = regexpString.replaceAll('o', '[oòô]');
regexpString = regexpString.replaceAll('u', '[uùûü]');
regexpString = regexpString.replaceAll('c', '[cç]');
var regexp = new RegExp('(' + regexpString + ')', 'gi');
var autocompleteOption = '<div><div class=\"addressbook-result-title\">' + '";
// line 183
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("zk_not_kantoor");
echo "' + ' ';
autocompleteOption += item.kantoor.replace(regexp, '<span class=\"addressbook-result-keyword\">\$1</span>');
item.addresses.forEach((address, index) => {
autocompleteOption += ' - ';
autocompleteOption += address.replace(regexp, '<span class=\"addressbook-result-keyword\">\$1</span>');
});
if (item.hasCalendar) {
autocompleteOption += ' - <span class=\"c-link-lookalike\">";
// line 190
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("zk_has_calendar"), "html", null, true);
echo "</span>';
}
autocompleteOption += '</div><div>(';
item.notaris.forEach((notaris, index) => {
if (index > 0) {
autocompleteOption += ' - ';
}
autocompleteOption += '";
// line 197
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("zk_not_notaris_verwant");
echo "' + ' ' + notaris.replace(regexp, '<span class=\"addressbook-result-keyword\">\$1</span>');
});
autocompleteOption += ')</div></div>';
var listItem = \$('<li>').append(autocompleteOption);
listItem.on('click', () => {
var slug = '";
// line 203
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("notaris_frontend_search_notary_detail", ["slug" => "slug"]);
echo "';
slug = slug.replace('slug', item.slug);
window.location.href = slug;
});
return listItem.appendTo(ul);
};
\$('.addressbook-search-button').on('click', event => {
if (\$('#addressbookSearch').val().length === 0) {
\$('.addressbook-input-empty').show();
event.preventDefault();
}
});
}
function initPaging(page) {
currentpage = page;
var perpage = 25;
\$('a.not-active').hide();
\$('a.office-active').hide();
var query = 'a.office-active';
\$.each(\$(query), function (index, value) {
if (index >= page * perpage && index < page * perpage + perpage) {
\$(value).show();
}
});
var activecount = \$(query).length;
var pages = Math.ceil(activecount / perpage);
\$('form#choosetype strong').text(activecount);
\$('.prevnext-pages').html('');
if (pages == 1) {
return;
}
//show first pages
var html = '';
var vispages = 4;
var startpage = page - vispages / 2;
if (startpage < 0) {
startpage = 0;
} else {
vispages++;
}
var count = 0;
var index = 0;
if (page != 0) {
html += '<a href=\"\" data-page=' + (page - 1) + '>";
// line 259
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("vorige");
echo "</a>';
}
if (startpage != 0) {
html += '<span>...</span>';
}
for (var i = startpage; i < pages; i++) {
count++;
if (count <= vispages) {
index = i;
if (i == page) {
html += '<span class=\"current\">' + (i + 1) + '</span>';
} else {
html += '<a href=\"\" data-page=' + i + '>' + (i + 1) + '</a>';
}
}
}
if (index < pages - 1) {
html += '<span>...</span>';
}
if (page < pages - 1) {
html += '<a href=\"\" data-page=' + (page + 1) + '>";
// line 283
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("volgende");
echo "</a>';
}
\$('.prevnext-pages').html(html);
\$('.prevnext-pages a').click(function (e) {
initPaging(parseInt(\$(this).attr('data-page')));
e.preventDefault();
});
}
function initOrdering() {
\$('.ordering a').click(function (e) {
\$('.ordering a').removeClass('active');
\$(this).addClass('active');
currentpage = 0;
var elements = \$('a.not-active, a.office-active');
var elementsHtml = [];
\$('a.not-active, a.office-active').each(function () {
var obj = {object: \$(this), html: \$(this)[0].outerHTML};
elementsHtml.push(obj);
})
\$('#info-content').html('');
if (\$(this).attr('data-order') == 'name') {
var orderNameDirection;
if (\$(this).data('orderpos') == 'za') {
orderNameDirection = 'az';
} else {
orderNameDirection = 'za';
}
\$('#order-postal').data('orderpos', 'za');
\$('#order-city').data('orderpos', 'za');
\$(this).data('orderpos', orderNameDirection);
elementsHtml.sort(function (a, b) {
//sort on name
var x = \$(a.object).attr('data-name').toLowerCase();
var y = \$(b.object).attr('data-name').toLowerCase();
if (orderNameDirection == 'az') {
return x < y ? -1 : x > y ? 1 : 0;
} else {
return x > y ? -1 : x < y ? 1 : 0;
}
});
}
if (\$(this).attr('data-order') == 'postal') {
var orderZipDirection;
if (\$(this).data('orderpos') == 'za') {
orderZipDirection = 'az';
} else {
orderZipDirection = 'za';
}
\$('#order-name').data('orderpos', 'za');
\$('#order-city').data('orderpos', 'za');
\$(this).data('orderpos', orderZipDirection);
elementsHtml.sort(function (a, b) {
//sort on zip
var zipA = parseInt(\$(a.object).attr('data-postal'));
var zipB = parseInt(\$(b.object).attr('data-postal'));
if (zipA === zipB) {
//when zip is the same, sort on name
var x = \$(a.object).attr('data-name').toLowerCase();
var y = \$(b.object).attr('data-name').toLowerCase();
//return sort on name
if (orderZipDirection == 'az') {
return x < y ? -1 : x > y ? 1 : 0;
} else {
return x > y ? -1 : x < y ? 1 : 0;
}
}
//return sort on zip
if (orderZipDirection == 'az') {
return zipA - zipB;
} else {
return zipB - zipA;
}
});
}
if (\$(this).attr('data-order') == 'city') {
var orderCityDirection;
if (\$(this).data('orderpos') == 'za') {
orderCityDirection = 'az';
} else {
orderCityDirection = 'za';
}
\$('#order-name').data('orderpos', 'za');
\$('#order-postal').data('orderpos', 'za');
\$(this).data('orderpos', orderCityDirection);
elementsHtml.sort(function (a, b) {
//sort on city
var x = \$(a.object).attr('data-city').toLowerCase();
var y = \$(b.object).attr('data-city').toLowerCase();
if (x === y) {
//when city is the same, sort on zip
var zipA = parseInt(\$(a.object).attr('data-postal'));
var zipB = parseInt(\$(b.object).attr('data-postal'));
if (zipA === zipB) {
//when zip is the same, sort on name
var nameA = \$(a.object).attr('data-name').toLowerCase();
var nameB = \$(b.object).attr('data-name').toLowerCase();
//return sort on name
if (orderCityDirection == 'az') {
return nameA < nameB ? -1 : nameA > nameB ? 1 : 0;
} else {
return nameA > nameB ? -1 : nameA < nameB ? 1 : 0;
}
}
//return sort on zip
if (orderCityDirection == 'az') {
return zipA < zipB ? -1 : zipA > zipB ? 1 : 0;
} else {
return zipA > zipB ? -1 : zipA < zipB ? 1 : 0;
}
}
//return sort on city
if (orderCityDirection == 'az') {
return x < y ? -1 : x > y ? 1 : 0;
} else {
return x > y ? -1 : x < y ? 1 : 0;
}
});
}
for (var i = 0; i < elementsHtml.length; i++) {
\$('#info-content').append(elementsHtml[i].html);
}
initPaging(currentpage);
e.preventDefault();
});
}
function initFormTabs() {
\$('.tab-by-name').click(() => {
\$('.tab-by-name').addClass('active');
\$('.tab-by-name').removeClass('inactive');
\$('.tab-by-location').addClass('inactive');
\$('.tab-by-location').removeClass('active');
\$('.form-by-name').show();
\$('.form-by-location').hide();
});
\$('.tab-by-location').click(() => {
\$('.tab-by-name').addClass('inactive');
\$('.tab-by-name').removeClass('active');
\$('.tab-by-location').addClass('active');
\$('.tab-by-location').removeClass('inactive');
\$('.form-by-name').hide();
\$('.form-by-location').show();
});
}
function initAddressbookLocationSearchAutocomplete() {
\$('#addressbookLocationSearch').autocomplete({
minLength: 1,
delay: 500,
source: '";
// line 464
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("notaris_frontend_addressbook_autocomplete_location");
echo "',
appendTo: '#addressbook-location-menu-container',
response: function(event, ui) {
if (ui.content.length === 0) {
\$('.addressbook-location-results-empty2').show();
\$('.addressbook-location-selected-too-many').hide();
return;
}
\$('.addressbook-location-results-empty').hide();
\$('.addressbook-location-results-empty2').hide();
},
}).bind('focus', function () {
if (\$('.ui-autocomplete').children().length > 0) {
\$('.ui-autocomplete').show();
}
}).data('uiAutocomplete')._renderItem = function (ul, item) {
var regexpString = \$('#addressbookLocationSearch').val();
regexpString = regexpString.replaceAll('a', '[aàâ]');
regexpString = regexpString.replaceAll('e', '[eéèêë]');
regexpString = regexpString.replaceAll('i', '[iìîï]');
regexpString = regexpString.replaceAll('o', '[oòô]');
regexpString = regexpString.replaceAll('u', '[uùûü]');
regexpString = regexpString.replaceAll('c', '[cç]');
var regexp = new RegExp('(' + regexpString + ')', 'gi');
var autocompleteOption = '<div><div class=\"addressbook-result-title\">' + item.municipality.replace(regexp, '<span class=\"addressbook-result-keyword\">\$1</span>');
autocompleteOption += '</div><div>';
if (item.localities.length > 0) {
autocompleteOption += '(';
}
item.localities.forEach((locality, index) => {
if (index > 0) {
autocompleteOption += ', ';
}
autocompleteOption += locality.replace(regexp, '<span class=\"addressbook-result-keyword\">\$1</span>');
});
if (item.localities.length > 0) {
autocompleteOption += ')';
}
autocompleteOption += '</div></div>';
var listItem = \$('<li>').append(autocompleteOption);
listItem.on('click', () => {
if (addressbookLocationSearchGroup.length > 3) {
\$('.addressbook-location-results-empty').show();
return;
}
\$('.addressbook-location-results-empty').hide();
\$('.addressbook-location-results-empty2').hide();
\$('.addressbook-location-selected-too-many').hide();
addressbookLocationSearchGroup.push(item.municipality);
updateMunicipalitySelector();
\$('#addressbookLocationSearch').val('');
\$('#addressbookLocationSearch').attr('placeholder', '');
});
return listItem.appendTo(ul);
};
\$('.municipalities').click(() => {
\$('#addressbookLocationSearch').focus();
});
\$('.addressbook-search-location-button').on('click', event => {
if (addressbookLocationSearchGroup.length === 0) {
\$('.addressbook-location-results-empty2').show();
event.preventDefault();
}
});
}
function updateMunicipalitySelector() {
addressbookLocationSearchGroup = addressbookLocationSearchGroup.filter((v, i, a) => a.indexOf(v) === i);
\$('.addressbookLocationSearchGroup').remove();
\$('.municipalities').empty();
addressbookLocationSearchGroup.forEach((municipality, index) => {
\$('.form-by-location').append('<input type=\"hidden\" name=\"queryLocation[]\" class=\"addressbookLocationSearchGroup\" value=\"' + municipality + '\">');
\$('.municipalities').append('<span class=\"tag\">' + municipality + '<span class=\"tag-delete\" data-index=\"' + index + '\">×</span></span>');
});
\$('.tag-delete').off('click');
\$('.tag-delete').on('click', event => {
var index = \$(event.target).data('index');
addressbookLocationSearchGroup.splice(index, 1);
updateMunicipalitySelector();
if (addressbookLocationSearchGroup.length === 0) {
\$('#addressbookLocationSearch').attr('placeholder', '";
// line 554
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ab_search_location_placeholder_name"), "html", null, true);
echo "');
}
});
if (\$('.municipalities').height() < 45) {
\$('#addressbookLocationSearch').css('padding-top', 9);
\$('#addressbookLocationSearch').css('padding-left', \$('.municipalities').width() + 5);
\$('#addressbookLocationSearch').css('height', \$('.municipalities').height() + 8);
}
if (\$('.municipalities').height() >= 45 || \$('.municipalities').width() + 10 > \$('#addressbookLocationSearch').width()) {
\$('#addressbookLocationSearch').css('padding-left', 9);
\$('#addressbookLocationSearch').css('padding-top', \$('.municipalities').height() + 8);
\$('#addressbookLocationSearch').css('height', \$('.municipalities').height() + 48);
}
/*if (addressbookLocationSearchGroup.length > 0) {
\$('.addressbook-search-location-button').prop('disabled', false);
} else {
\$('.addressbook-search-location-button').prop('disabled', true);
}*/
}
function setLocationQuery() {
var urlParams = new URLSearchParams(window.location.search);
var queryLocation = urlParams.getAll('queryLocation[]');
var queryLocation2 = urlParams.get('query-location');
if (queryLocation.length > 0 || queryLocation2 !== null) {
\$('.tab-by-location').click();
queryLocation.forEach(location => {
addressbookLocationSearchGroup.push(location);
});
updateMunicipalitySelector();
}
}
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 591
public function block_extracss($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "extracss"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "extracss"));
// line 592
echo " <style>
.addressbook-search-button, .addressbook-search-location-button {
width: 100%;
padding-top: 3px;
font-size: 13px;
border: 1px solid #8d8d8d;
cursor: pointer;
height: 40px;
}
ul.ui-autocomplete {
list-style: none;
background: white;
border: 1px solid #8d8d8d;
max-height: 386px;
overflow-y: auto;
width: 100% !important;
}
ul.ui-autocomplete li {
padding: 5px 10px;
border-bottom: 1px solid #8d8d8d;
cursor: pointer;
}
.addressbook-result-title {
font-weight: bold;
}
.addressbook-result-keyword {
color: #1db3c3;
}
.ui-helper-hidden-accessible {
display: none;
}
#addressbookSearch.ui-autocomplete-loading, #addressbookLocationSearch.ui-autocomplete-loading {
background: url(\"/images/lightbox/loading.gif\") no-repeat 99%;
background-size: 25px;
}
.tab-by-name, .tab-by-location {
display: inline-block;
width: 50%;
text-align: center;
padding: 10px 0;
font-weight: bold;
cursor: pointer;
background-color: #E9EDED;
font-size: 15px;
}
.tab-by-name.inactive, .tab-by-location.inactive {
background-color: #FFFFFF;
}
.municipalities {
display: inline-block;
position: absolute;
top: 7px;
left: 8px;
}
.municipalities .tag {
background-color: #6bcad4;
color: white;
padding: 4px 5px;
border-radius: 4px;
margin-right: 8px;
margin-bottom: 5px;
display: inline-block;
}
.municipalities .tag-delete {
margin-left: 10px;
font-size: 18px;
cursor: pointer;
}
.form-by-location-container {
position: relative;
}
.c-nav--subnav .c-nav__parent-item:hover .c-nav--subsubnav {
visibility: hidden !important;
}
.location-select {
width: 200px;
height: auto;
}
.form-by-name, .form-by-location {
background-color: #E9EDED;
}
#addressbook-menu-container {
position: absolute;
width: calc(100% - 40px);
}
#addressbook-location-menu-container {
position: absolute;
width: 100%;
}
.addressbook-search-location-button {
display: block;
margin-left: auto;
}
.results-filters {
background-color: #E9EDED;
}
.results-filters .active {
background-color: #FFFFFF;
}
.ordering a {
padding: 3px 6px;
}
.info-news-content .icon {
vertical-align: middle;
float: none !important;
display: inline-block !important;
height: auto !important;
}
.info-news-content .text {
float: none !important;
display: inline-block !important;
vertical-align: middle;
margin-left: 0 !important;
}
.results-footer {
background-color: #E9EDED;
}
.results-footer .current {
background-color: #FFFFFF;
}
.results-footer-text {
display: inline-block;
/*width: 76%;*/
padding: 0 20px 20px 20px;
}
.prevnext-pages {
display: inline-block;
/*width: 23% !important;*/
vertical-align: top;
padding-top: 20px !important;
}
.prevnext-pages span, .prevnext-pages a {
margin-right: 10px;
}
.results-header {
background-color: #00b3c4;
color: white;
}
@media screen and (min-width: 768px){
#addressbookSearch, #addressbookLocationSearch {
width: 79%;
}
.municipalities {
max-width: 79%;
}
#addressbook-menu-container {
width: calc(79% - 31px);
}
#addressbook-location-menu-container {
width: 79%;
}
.addressbook-search-button, .addressbook-search-location-button {
width: 20%;
}
}
</style>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
public function getTemplateName()
{
return "@NotarisFrontend/addressbook/search.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 1048 => 592, 1038 => 591, 992 => 554, 899 => 464, 715 => 283, 688 => 259, 629 => 203, 620 => 197, 610 => 190, 600 => 183, 574 => 160, 556 => 144, 546 => 143, 533 => 138, 523 => 136, 518 => 133, 512 => 131, 510 => 130, 505 => 129, 503 => 128, 497 => 124, 487 => 119, 481 => 117, 478 => 116, 458 => 114, 441 => 113, 434 => 111, 425 => 109, 418 => 108, 414 => 107, 407 => 103, 403 => 102, 399 => 101, 395 => 100, 391 => 98, 385 => 96, 383 => 95, 378 => 94, 376 => 93, 373 => 92, 371 => 91, 364 => 87, 359 => 85, 355 => 83, 340 => 81, 335 => 80, 333 => 79, 329 => 78, 323 => 75, 317 => 74, 311 => 71, 305 => 70, 292 => 66, 287 => 64, 279 => 63, 271 => 62, 267 => 61, 262 => 59, 257 => 57, 245 => 54, 241 => 53, 233 => 52, 229 => 51, 223 => 50, 218 => 48, 207 => 42, 199 => 36, 189 => 35, 175 => 31, 172 => 30, 167 => 28, 161 => 26, 159 => 25, 153 => 24, 149 => 23, 144 => 22, 134 => 21, 122 => 18, 117 => 16, 112 => 14, 108 => 12, 105 => 11, 102 => 10, 99 => 9, 96 => 8, 86 => 7, 73 => 4, 63 => 3, 40 => 1,);
}
public function getSourceContext()
{
return new Source("{% extends '@NotarisFrontend/layout2017.html.twig' %}
{% block title %}
<title>{{ 'ab_search_notary_search_title' | trans }}</title>
{% endblock %}
{% block extralinks %}
{% set hreflang_start_nl = url_scheme ~ '://www.' ~ url_nl %}
{% set hreflang_start_fr = url_scheme ~ '://www.' ~ url_fr %}
{% set hreflang_nl = hreflang_start_nl ~ path('notaris_frontend_addressbook') %}
{% set hreflang_fr = hreflang_start_fr ~ path('notaris_frontend_addressbook') %}
<link rel=\"alternate\" hreflang=\"nl-be\"
href=\"{{ hreflang_nl }}\"/>
<link rel=\"alternate\" hreflang=\"fr-be\"
href=\"{{ hreflang_fr }}\"/>
<link rel=\"alternate\" hreflang=\"x-default\"
href=\"{{ hreflang_nl }}\"/>
{% endblock %}
{% block extrameta %}
{{ parent() }}
<meta name=\"keywords\" content=\"{{ 'ab_search_notary_search_keywords' | trans }}\"/>
<meta name=\"description\" lang=\"{{ locale }}\" content=\"{{ 'ab_search_notary_search_description' | trans }}\"/>
{% if subsite.meta.ogTitle != '' %}
<meta property=\"og:title\" content=\"{{ 'ab_search_notary_search_title' | trans }}\"/>
<meta property=\"og:type\" content=\"article\"/>
<meta property=\"og:url\" content=\" {{ app.request.uri }}\"/>
{% endif %}
{% if subsite.meta.ogDescription != '' %}
<meta property=\"og:description\" content=\"{{ subsite.meta.ogDescription }}\"/>
{% endif %}
{% endblock %}
{% block body %}
<section class=\"content u-padding-top-large\">
<aside id=\"content-left\" class=\"content-left-small hidesmartphone\">
<nav class=\"standard-nav\">
<ul class=\"u-margin-left-none u-padding-left-none\">
<li class=\"active\">
<div class=\"activestate\"> </div>
<a href=\"#\" title=\"{{ 'ab_search' | trans | raw }}\" class=\"hi\">{{ 'ab_search' | trans | raw }}</a>
</li>
</ul>
</nav>
</aside>
<div id=\"content-center\" class=\"content-center-large {{ subsite.stylesheet }}\">
<section id=\"info\" class=\"no-margin\">
<div class=\"tab-by-name active\">{{ 'ab_by_name' | trans | raw }}</div><div class=\"tab-by-location inactive\">{{ 'ab_by_location' | trans | raw }}</div>
<form action=\"{{ path('notaris_frontend_addressbook') }}\" method=\"get\" class=\"u-padding-top-large u-padding-small form-by-name o-layout__item--relative\">
<span class=\"addressbook-results-empty u-margin-bottom-small u-display--block\" {% if app.request.query.get('query') is null or results is not empty %}style=\"display: none\"{% endif %}>{{ 'ab_search_no_results' | trans({'%link%': path('notaris_frontend_addressbook_deed')}) | raw }}<br></span>
<span class=\"addressbook-input-empty\" style=\"display: none;\">{{ 'ab_search_no_input' | trans | raw }}<br></span>
<input type=\"text\" placeholder=\"{{ 'ab_search_placeholder_name' | trans }}\" name=\"query\" id=\"addressbookSearch\" {% if app.request.query.get('query') is not null %}value=\"{{ app.request.query.get('query') }}\"{% endif %}/>
<div id=\"addressbook-menu-container\"></div>
<button type=\"submit\" class=\"c-btn--primary u-color-white addressbook-search-button\" style=\"vertical-align: top\">
{{ 'ab_search_button' | trans }}
</button>
<div class=\"u-margin-top-small\">{{ 'ab_search_notary_footer' | trans | raw }}</div>
</form>
<form action=\"{{ path('notaris_frontend_addressbook') }}\" method=\"get\" class=\"u-padding-top-large u-padding-small form-by-location\" style=\"display: none\">
<span class=\"addressbook-location-results-empty u-margin-bottom-small u-display--block\" {% if app.request.query.get('query') is null or results is not empty %}style=\"display: none\"{% endif %}>{{ 'ab_search_location_no_results' | trans | raw }}</span>
<span class=\"addressbook-location-results-empty2 u-margin-bottom-small u-display--block\" {% if app.request.query.all('queryLocation') is null or results is not empty %}style=\"display: none\"{% endif %}>{{ 'ab_search_location_no_results2' | trans | raw }}</span>
<span class=\"addressbook-location-selected-too-many u-margin-bottom-small u-display--block\" style=\"display: none\">{{ 'ab_search_location_selected_too_many' | trans | raw }}</span>
<div class=\"form-by-location-container\">
<input type=\"text\" placeholder=\"{{ 'ab_search_location_placeholder_name' | trans }}\" name=\"query-location\" id=\"addressbookLocationSearch\" style=\"height: 46px;min-height: 46px;padding-right: 5px;\" {% if app.request.query.get('query-location') is not null %}value=\"{{ app.request.query.get('query-location') }}\"{% endif %}/>
<div class=\"municipalities\"></div>
<div id=\"addressbook-location-menu-container\" style=\"position: absolute\"></div>
<div class=\"u-margin-top-tiny\">
<input type=\"checkbox\" name=\"mediators\" id=\"mediators\" style=\"width: auto;\" {% if app.request.query.get('mediators') is not null %}checked{% endif %}/>
<label for=\"mediators\" class=\"u-margin-left-tiny\">{{ 'md_bemiddelaar' | trans | raw }}</label>
</div>
<div class=\"u-margin-top-tiny\">
<input type=\"checkbox\" name=\"show_on_map\" id=\"show_on_map\" style=\"width: auto;\" {% if app.request.query.get('show_on_map') is not null %}checked{% endif %}/>
<label for=\"show_on_map\" class=\"u-margin-left-tiny\">{{ 'md_kaart' | trans }}</label>
</div>
<select name=\"language\" class=\"u-margin-top-tiny location-select\">
<option value=\"\">{{ 'md_kennis' | trans }}</option>
{% set languages = getNotarySearchLanguage() %}
{% for language in languages %}
<option value=\"{{ language.languageShort }}\" {% if app.request.query.get('language') == language.languageShort %}selected{% endif %}>{{ language.language | trans }}</option>;
{% endfor %}
</select>
<button type=\"submit\" class=\"c-btn--primary u-color-white u-margin-top-tiny addressbook-search-location-button\">
{{ 'ab_search_button' | trans }}
</button>
<div class=\"u-margin-top-small\">{{ 'ab_search_notary_footer' | trans | raw }}</div>
</div>
</form>
{% if results is not empty %}
<div class=\"results-header u-margin-top-large u-padding-tiny u-padding-bottom-small u-padding-top-small\">
{% if results|length == 1 %}
{{ 'ab_search_top_one_result' | trans | raw }}
{% elseif results|length > 1 %}
{{ 'ab_search_top_multiple_results' | trans({'%results%': results|length}) | raw }}
{% endif %}
</div>
<div class=\"article-content results-filters u-padding-tiny u-padding-bottom-small u-padding-top-small\">
<p class=\"ordering\">{{ 'zk_not_order' | trans | raw }}
<a href=\"#\" id=\"order-name\" data-order=\"name\" data-orderpos=\"za\">{{ 'zk_not_ordernaam' | trans | raw }}</a> /
<a href=\"#\" id=\"order-postal\" data-order=\"postal\" data-orderpos=\"za\">{{ 'zk_not_orderpostcode' | trans | raw }}</a> /
<a href=\"#\" id=\"order-city\" data-order=\"city\" data-orderpos=\"za\">{{ 'zk_not_ordergemeente' | trans | raw }}</a>
</p>
</div>
<div id=\"info-content\" class=\"niveau1 info-news-content\">
{% for key, result in results %}
<a class=\"info-content-blocklink tooltip office-active u-padding-top-small u-padding-bottom-small\" href=\"{{ path('notaris_frontend_search_notary_detail', {'slug': result.slug|default('slug')}) }}\" title=\"{{ 'ab_search_kantoor' | trans }}\"
data-name=\"{{ result.kantoor }}\" data-postal=\"{{ result.addresses[0] }}\" data-city=\"{{ result.municipality }}\">
<div class=\"icon\"><img src=\"/images/icons/office.png\"></div>
<div class=\"text\"><h3>{{ 'zk_not_kantoor' | trans | raw }} {{ result.kantoor }}</h3>
<p class=\"u-margin-none\">
{% for address in result.addresses %}
{% if not loop.first %} - {% endif %}{{ address }}
{% endfor %}
{% if result.hasCalendar %}
<span class=\"c-link-lookalike\">{{ 'zk_has_calendar' | trans }}</span>
{% endif %}
</p>
</div>
<div class=\"cleaner\"> </div>
</a>
{% endfor %}
</div>
<div class=\"results-footer\">
<div class=\"prevnext-pages\"></div>
<div class=\"results-footer-text\">
{% if results|length == 1 %}
{{ 'ab_search_one_result' | trans({'%link%': path('notaris_frontend_addressbook')}) | raw }}
{% elseif results|length > 1 %}
{{ 'ab_search_multiple_results' | trans({'%link%': path('notaris_frontend_addressbook')}) | raw }}
{% endif %}
</div>
</div>
{% else %}
<span class=\"u-margin-bottom-small u-margin-top-large u-m u-display--block\" {% if app.request.query.get('query') is null and app.request.query.all('queryLocation') is null %}style=\"display: none\"{% endif %}>{{ 'ab_search_no_results_bottom' | trans | raw }}</span>
{% endif %}
</section>
</div>
</section>
{% endblock %}
{% block extrajs %}
<script src=\"/adminassets/libs/jqueryui/jquery-ui-1.10.4.custom.min.js\"></script>
<script>
var addressbookLocationSearchGroup = [];
var currentpage = 0;
initFormTabs();
initAddressbookSearchAutocomplete();
initAddressbookLocationSearchAutocomplete();
initPaging(currentpage);
initOrdering();
setLocationQuery();
function initAddressbookSearchAutocomplete() {
\$('#addressbookSearch').autocomplete({
minLength: 2,
delay: 500,
source: '{{ path('notaris_frontend_addressbook_autocomplete') }}',
appendTo: '#addressbook-menu-container',
response: function (event, ui) {
if (ui.content.length === 0) {
\$('.addressbook-results-empty').show();
return;
}
\$('.addressbook-results-empty').hide();
},
}).bind('focus', function () {
if (\$('.ui-autocomplete').children().length > 0) {
\$('.ui-autocomplete').show();
}
}).data('uiAutocomplete')._renderItem = function (ul, item) {
var regexpString = \$('#addressbookSearch').val();
regexpString = regexpString.replaceAll('a', '[aàâ]');
regexpString = regexpString.replaceAll('e', '[eéèêë]');
regexpString = regexpString.replaceAll('i', '[iìîï]');
regexpString = regexpString.replaceAll('o', '[oòô]');
regexpString = regexpString.replaceAll('u', '[uùûü]');
regexpString = regexpString.replaceAll('c', '[cç]');
var regexp = new RegExp('(' + regexpString + ')', 'gi');
var autocompleteOption = '<div><div class=\"addressbook-result-title\">' + '{{ 'zk_not_kantoor' | trans | raw }}' + ' ';
autocompleteOption += item.kantoor.replace(regexp, '<span class=\"addressbook-result-keyword\">\$1</span>');
item.addresses.forEach((address, index) => {
autocompleteOption += ' - ';
autocompleteOption += address.replace(regexp, '<span class=\"addressbook-result-keyword\">\$1</span>');
});
if (item.hasCalendar) {
autocompleteOption += ' - <span class=\"c-link-lookalike\">{{ 'zk_has_calendar' | trans }}</span>';
}
autocompleteOption += '</div><div>(';
item.notaris.forEach((notaris, index) => {
if (index > 0) {
autocompleteOption += ' - ';
}
autocompleteOption += '{{ 'zk_not_notaris_verwant' | trans | raw }}' + ' ' + notaris.replace(regexp, '<span class=\"addressbook-result-keyword\">\$1</span>');
});
autocompleteOption += ')</div></div>';
var listItem = \$('<li>').append(autocompleteOption);
listItem.on('click', () => {
var slug = '{{ path('notaris_frontend_search_notary_detail', {'slug': 'slug'}) }}';
slug = slug.replace('slug', item.slug);
window.location.href = slug;
});
return listItem.appendTo(ul);
};
\$('.addressbook-search-button').on('click', event => {
if (\$('#addressbookSearch').val().length === 0) {
\$('.addressbook-input-empty').show();
event.preventDefault();
}
});
}
function initPaging(page) {
currentpage = page;
var perpage = 25;
\$('a.not-active').hide();
\$('a.office-active').hide();
var query = 'a.office-active';
\$.each(\$(query), function (index, value) {
if (index >= page * perpage && index < page * perpage + perpage) {
\$(value).show();
}
});
var activecount = \$(query).length;
var pages = Math.ceil(activecount / perpage);
\$('form#choosetype strong').text(activecount);
\$('.prevnext-pages').html('');
if (pages == 1) {
return;
}
//show first pages
var html = '';
var vispages = 4;
var startpage = page - vispages / 2;
if (startpage < 0) {
startpage = 0;
} else {
vispages++;
}
var count = 0;
var index = 0;
if (page != 0) {
html += '<a href=\"\" data-page=' + (page - 1) + '>{{ \"vorige\" | trans | raw }}</a>';
}
if (startpage != 0) {
html += '<span>...</span>';
}
for (var i = startpage; i < pages; i++) {
count++;
if (count <= vispages) {
index = i;
if (i == page) {
html += '<span class=\"current\">' + (i + 1) + '</span>';
} else {
html += '<a href=\"\" data-page=' + i + '>' + (i + 1) + '</a>';
}
}
}
if (index < pages - 1) {
html += '<span>...</span>';
}
if (page < pages - 1) {
html += '<a href=\"\" data-page=' + (page + 1) + '>{{ \"volgende\" | trans | raw }}</a>';
}
\$('.prevnext-pages').html(html);
\$('.prevnext-pages a').click(function (e) {
initPaging(parseInt(\$(this).attr('data-page')));
e.preventDefault();
});
}
function initOrdering() {
\$('.ordering a').click(function (e) {
\$('.ordering a').removeClass('active');
\$(this).addClass('active');
currentpage = 0;
var elements = \$('a.not-active, a.office-active');
var elementsHtml = [];
\$('a.not-active, a.office-active').each(function () {
var obj = {object: \$(this), html: \$(this)[0].outerHTML};
elementsHtml.push(obj);
})
\$('#info-content').html('');
if (\$(this).attr('data-order') == 'name') {
var orderNameDirection;
if (\$(this).data('orderpos') == 'za') {
orderNameDirection = 'az';
} else {
orderNameDirection = 'za';
}
\$('#order-postal').data('orderpos', 'za');
\$('#order-city').data('orderpos', 'za');
\$(this).data('orderpos', orderNameDirection);
elementsHtml.sort(function (a, b) {
//sort on name
var x = \$(a.object).attr('data-name').toLowerCase();
var y = \$(b.object).attr('data-name').toLowerCase();
if (orderNameDirection == 'az') {
return x < y ? -1 : x > y ? 1 : 0;
} else {
return x > y ? -1 : x < y ? 1 : 0;
}
});
}
if (\$(this).attr('data-order') == 'postal') {
var orderZipDirection;
if (\$(this).data('orderpos') == 'za') {
orderZipDirection = 'az';
} else {
orderZipDirection = 'za';
}
\$('#order-name').data('orderpos', 'za');
\$('#order-city').data('orderpos', 'za');
\$(this).data('orderpos', orderZipDirection);
elementsHtml.sort(function (a, b) {
//sort on zip
var zipA = parseInt(\$(a.object).attr('data-postal'));
var zipB = parseInt(\$(b.object).attr('data-postal'));
if (zipA === zipB) {
//when zip is the same, sort on name
var x = \$(a.object).attr('data-name').toLowerCase();
var y = \$(b.object).attr('data-name').toLowerCase();
//return sort on name
if (orderZipDirection == 'az') {
return x < y ? -1 : x > y ? 1 : 0;
} else {
return x > y ? -1 : x < y ? 1 : 0;
}
}
//return sort on zip
if (orderZipDirection == 'az') {
return zipA - zipB;
} else {
return zipB - zipA;
}
});
}
if (\$(this).attr('data-order') == 'city') {
var orderCityDirection;
if (\$(this).data('orderpos') == 'za') {
orderCityDirection = 'az';
} else {
orderCityDirection = 'za';
}
\$('#order-name').data('orderpos', 'za');
\$('#order-postal').data('orderpos', 'za');
\$(this).data('orderpos', orderCityDirection);
elementsHtml.sort(function (a, b) {
//sort on city
var x = \$(a.object).attr('data-city').toLowerCase();
var y = \$(b.object).attr('data-city').toLowerCase();
if (x === y) {
//when city is the same, sort on zip
var zipA = parseInt(\$(a.object).attr('data-postal'));
var zipB = parseInt(\$(b.object).attr('data-postal'));
if (zipA === zipB) {
//when zip is the same, sort on name
var nameA = \$(a.object).attr('data-name').toLowerCase();
var nameB = \$(b.object).attr('data-name').toLowerCase();
//return sort on name
if (orderCityDirection == 'az') {
return nameA < nameB ? -1 : nameA > nameB ? 1 : 0;
} else {
return nameA > nameB ? -1 : nameA < nameB ? 1 : 0;
}
}
//return sort on zip
if (orderCityDirection == 'az') {
return zipA < zipB ? -1 : zipA > zipB ? 1 : 0;
} else {
return zipA > zipB ? -1 : zipA < zipB ? 1 : 0;
}
}
//return sort on city
if (orderCityDirection == 'az') {
return x < y ? -1 : x > y ? 1 : 0;
} else {
return x > y ? -1 : x < y ? 1 : 0;
}
});
}
for (var i = 0; i < elementsHtml.length; i++) {
\$('#info-content').append(elementsHtml[i].html);
}
initPaging(currentpage);
e.preventDefault();
});
}
function initFormTabs() {
\$('.tab-by-name').click(() => {
\$('.tab-by-name').addClass('active');
\$('.tab-by-name').removeClass('inactive');
\$('.tab-by-location').addClass('inactive');
\$('.tab-by-location').removeClass('active');
\$('.form-by-name').show();
\$('.form-by-location').hide();
});
\$('.tab-by-location').click(() => {
\$('.tab-by-name').addClass('inactive');
\$('.tab-by-name').removeClass('active');
\$('.tab-by-location').addClass('active');
\$('.tab-by-location').removeClass('inactive');
\$('.form-by-name').hide();
\$('.form-by-location').show();
});
}
function initAddressbookLocationSearchAutocomplete() {
\$('#addressbookLocationSearch').autocomplete({
minLength: 1,
delay: 500,
source: '{{ path('notaris_frontend_addressbook_autocomplete_location') }}',
appendTo: '#addressbook-location-menu-container',
response: function(event, ui) {
if (ui.content.length === 0) {
\$('.addressbook-location-results-empty2').show();
\$('.addressbook-location-selected-too-many').hide();
return;
}
\$('.addressbook-location-results-empty').hide();
\$('.addressbook-location-results-empty2').hide();
},
}).bind('focus', function () {
if (\$('.ui-autocomplete').children().length > 0) {
\$('.ui-autocomplete').show();
}
}).data('uiAutocomplete')._renderItem = function (ul, item) {
var regexpString = \$('#addressbookLocationSearch').val();
regexpString = regexpString.replaceAll('a', '[aàâ]');
regexpString = regexpString.replaceAll('e', '[eéèêë]');
regexpString = regexpString.replaceAll('i', '[iìîï]');
regexpString = regexpString.replaceAll('o', '[oòô]');
regexpString = regexpString.replaceAll('u', '[uùûü]');
regexpString = regexpString.replaceAll('c', '[cç]');
var regexp = new RegExp('(' + regexpString + ')', 'gi');
var autocompleteOption = '<div><div class=\"addressbook-result-title\">' + item.municipality.replace(regexp, '<span class=\"addressbook-result-keyword\">\$1</span>');
autocompleteOption += '</div><div>';
if (item.localities.length > 0) {
autocompleteOption += '(';
}
item.localities.forEach((locality, index) => {
if (index > 0) {
autocompleteOption += ', ';
}
autocompleteOption += locality.replace(regexp, '<span class=\"addressbook-result-keyword\">\$1</span>');
});
if (item.localities.length > 0) {
autocompleteOption += ')';
}
autocompleteOption += '</div></div>';
var listItem = \$('<li>').append(autocompleteOption);
listItem.on('click', () => {
if (addressbookLocationSearchGroup.length > 3) {
\$('.addressbook-location-results-empty').show();
return;
}
\$('.addressbook-location-results-empty').hide();
\$('.addressbook-location-results-empty2').hide();
\$('.addressbook-location-selected-too-many').hide();
addressbookLocationSearchGroup.push(item.municipality);
updateMunicipalitySelector();
\$('#addressbookLocationSearch').val('');
\$('#addressbookLocationSearch').attr('placeholder', '');
});
return listItem.appendTo(ul);
};
\$('.municipalities').click(() => {
\$('#addressbookLocationSearch').focus();
});
\$('.addressbook-search-location-button').on('click', event => {
if (addressbookLocationSearchGroup.length === 0) {
\$('.addressbook-location-results-empty2').show();
event.preventDefault();
}
});
}
function updateMunicipalitySelector() {
addressbookLocationSearchGroup = addressbookLocationSearchGroup.filter((v, i, a) => a.indexOf(v) === i);
\$('.addressbookLocationSearchGroup').remove();
\$('.municipalities').empty();
addressbookLocationSearchGroup.forEach((municipality, index) => {
\$('.form-by-location').append('<input type=\"hidden\" name=\"queryLocation[]\" class=\"addressbookLocationSearchGroup\" value=\"' + municipality + '\">');
\$('.municipalities').append('<span class=\"tag\">' + municipality + '<span class=\"tag-delete\" data-index=\"' + index + '\">×</span></span>');
});
\$('.tag-delete').off('click');
\$('.tag-delete').on('click', event => {
var index = \$(event.target).data('index');
addressbookLocationSearchGroup.splice(index, 1);
updateMunicipalitySelector();
if (addressbookLocationSearchGroup.length === 0) {
\$('#addressbookLocationSearch').attr('placeholder', '{{ 'ab_search_location_placeholder_name' | trans }}');
}
});
if (\$('.municipalities').height() < 45) {
\$('#addressbookLocationSearch').css('padding-top', 9);
\$('#addressbookLocationSearch').css('padding-left', \$('.municipalities').width() + 5);
\$('#addressbookLocationSearch').css('height', \$('.municipalities').height() + 8);
}
if (\$('.municipalities').height() >= 45 || \$('.municipalities').width() + 10 > \$('#addressbookLocationSearch').width()) {
\$('#addressbookLocationSearch').css('padding-left', 9);
\$('#addressbookLocationSearch').css('padding-top', \$('.municipalities').height() + 8);
\$('#addressbookLocationSearch').css('height', \$('.municipalities').height() + 48);
}
/*if (addressbookLocationSearchGroup.length > 0) {
\$('.addressbook-search-location-button').prop('disabled', false);
} else {
\$('.addressbook-search-location-button').prop('disabled', true);
}*/
}
function setLocationQuery() {
var urlParams = new URLSearchParams(window.location.search);
var queryLocation = urlParams.getAll('queryLocation[]');
var queryLocation2 = urlParams.get('query-location');
if (queryLocation.length > 0 || queryLocation2 !== null) {
\$('.tab-by-location').click();
queryLocation.forEach(location => {
addressbookLocationSearchGroup.push(location);
});
updateMunicipalitySelector();
}
}
</script>
{% endblock %}
{% block extracss %}
<style>
.addressbook-search-button, .addressbook-search-location-button {
width: 100%;
padding-top: 3px;
font-size: 13px;
border: 1px solid #8d8d8d;
cursor: pointer;
height: 40px;
}
ul.ui-autocomplete {
list-style: none;
background: white;
border: 1px solid #8d8d8d;
max-height: 386px;
overflow-y: auto;
width: 100% !important;
}
ul.ui-autocomplete li {
padding: 5px 10px;
border-bottom: 1px solid #8d8d8d;
cursor: pointer;
}
.addressbook-result-title {
font-weight: bold;
}
.addressbook-result-keyword {
color: #1db3c3;
}
.ui-helper-hidden-accessible {
display: none;
}
#addressbookSearch.ui-autocomplete-loading, #addressbookLocationSearch.ui-autocomplete-loading {
background: url(\"/images/lightbox/loading.gif\") no-repeat 99%;
background-size: 25px;
}
.tab-by-name, .tab-by-location {
display: inline-block;
width: 50%;
text-align: center;
padding: 10px 0;
font-weight: bold;
cursor: pointer;
background-color: #E9EDED;
font-size: 15px;
}
.tab-by-name.inactive, .tab-by-location.inactive {
background-color: #FFFFFF;
}
.municipalities {
display: inline-block;
position: absolute;
top: 7px;
left: 8px;
}
.municipalities .tag {
background-color: #6bcad4;
color: white;
padding: 4px 5px;
border-radius: 4px;
margin-right: 8px;
margin-bottom: 5px;
display: inline-block;
}
.municipalities .tag-delete {
margin-left: 10px;
font-size: 18px;
cursor: pointer;
}
.form-by-location-container {
position: relative;
}
.c-nav--subnav .c-nav__parent-item:hover .c-nav--subsubnav {
visibility: hidden !important;
}
.location-select {
width: 200px;
height: auto;
}
.form-by-name, .form-by-location {
background-color: #E9EDED;
}
#addressbook-menu-container {
position: absolute;
width: calc(100% - 40px);
}
#addressbook-location-menu-container {
position: absolute;
width: 100%;
}
.addressbook-search-location-button {
display: block;
margin-left: auto;
}
.results-filters {
background-color: #E9EDED;
}
.results-filters .active {
background-color: #FFFFFF;
}
.ordering a {
padding: 3px 6px;
}
.info-news-content .icon {
vertical-align: middle;
float: none !important;
display: inline-block !important;
height: auto !important;
}
.info-news-content .text {
float: none !important;
display: inline-block !important;
vertical-align: middle;
margin-left: 0 !important;
}
.results-footer {
background-color: #E9EDED;
}
.results-footer .current {
background-color: #FFFFFF;
}
.results-footer-text {
display: inline-block;
/*width: 76%;*/
padding: 0 20px 20px 20px;
}
.prevnext-pages {
display: inline-block;
/*width: 23% !important;*/
vertical-align: top;
padding-top: 20px !important;
}
.prevnext-pages span, .prevnext-pages a {
margin-right: 10px;
}
.results-header {
background-color: #00b3c4;
color: white;
}
@media screen and (min-width: 768px){
#addressbookSearch, #addressbookLocationSearch {
width: 79%;
}
.municipalities {
max-width: 79%;
}
#addressbook-menu-container {
width: calc(79% - 31px);
}
#addressbook-location-menu-container {
width: 79%;
}
.addressbook-search-button, .addressbook-search-location-button {
width: 20%;
}
}
</style>
{% endblock %}
", "@NotarisFrontend/addressbook/search.html.twig", "/data/sites/web/notarisdc-projectsbe/subsites/apps/default/releases/7/src/Notaris/FrontendBundle/Resources/views/addressbook/search.html.twig");
}
}