{% if topBar is not null %}
<nav>
{% include "top-bar.html.twig" %}
</nav>
{% endif %}
{% set isLoggedinUser = is_granted("IS_AUTHENTICATED_REMEMBERED") %}
{% set isUserControlMenuEnabled = isEnabledFeature('web.user.control.menu') %}
{% set userImgUrl = asset('images/Navbar/ic_profile_gray.svg') %}
{% set iconSize = 22 %}
{% set userImgClass = "icon-collapse icon" %}
{% if app.user %}
{% set userName = app.user.fullName %}
{% if app.user.personalPhoto %}
{% set userImgUrl = custom_vich_uploader_asset(app.user.personalPhoto, 'file') | thumbnail('logo') %}
{% set userImgClass = "w-100 h-100" %}
{% elseif app.user.logo %}
{% set userImgUrl = custom_vich_uploader_asset(app.user.logo, 'file') | thumbnail('logo')%}
{% set userImgClass = "w-100 h-100" %}
{% endif %}
{% endif %}
{% set isHomePage = app.request.attributes.get('_route') == 'homepage' %}
{% set hasBetaVersion = (isEnabledKSAnewHome is defined and isEnabledKSAnewHome) and isHomePage %}
<div class="navbar-margin-selector" id="navbar" {% if isLoggedinUser %}ng-content-loaded{% endif %}>
<nav class="simple-navbar navbar navbar-expand-lg navbar-light">
<div class="simple-navbar__container container">
<div class="d-flex align-items-center simple-navbar__brand ">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#sidebar" aria-controls="sidebar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="simple-navbar__brand_img" href="{{ path('homepage') }}" alt="navbar brand"></a>
{% if hasBetaVersion %}
<span class="badge expo-badge simple-navbar__bg-badge">{{ 'layout.beta_badge'|trans }}</span>
{% endif %}
</div>
<div class="collapse navbar-collapse navbar-parent p-0" id="sidebar" data-parent="#navbar">
<div class="nav-container">
<a class="nav-container__close-button hidden">x</a>
<a class="simple-navbar__brand_img simple-navbar__brand_img_side-nav hidden" href="{{ path('homepage') }}" alt="side brand"></a>
<ul class="simple-navbar__navbar-nav mr-auto responsive-side-nav">
<li class="dropdown simple-navbar__item">
<a href="#" class="icon-btn simple-navbar__icon-btn dropdown-toggle icon-btn_baby-blue-hover gtm-btn-more" data-toggle="collapse" data-target="#collapseOne" aria-controls="collapseOne" aria-expanded="false">
<img class="simple-navbar__item_icon icon" src="{{ asset('images/home/ic_search.png') }}" />
{{ 'home_page.find.title'|trans }}
</a>
<ul class="collapse simple-navbar__dropdown-menu simple-navbar__dropdown-menu_side-menu" id="collapseOne">
<li>
{% set name = "home_page.find.properties.title"|trans %}
<a href="{{url("property_type_search",{section_slug:"for-sale",property_type_slug:"property-type"})}}" class="icon-btn simple-navbar__icon-btn gtm-btn-search">
<img class="simple-navbar__icon-btn_img" src="{{ asset('images/home/ic_listing.svg') }}" />
{{ name }}
</a>
</li>
<li>
{% set name = isEgyptSite ? 'home_page.find.compounds.title'|trans : 'layout.ksa_compounds_title'|trans %}
{% set url = isEnabledFeature('web.compounds.adviser') ? path('compound_adviser') : path('compound_search') %}
<a href="{{ url }}" class="icon-btn simple-navbar__icon-btn gtm-btn-compound-search">
<img class="simple-navbar__icon-btn_img" src="{{ asset('images/home/ic_compounds.svg') }}" />
{{ name }}
</a>
</li>
{% if isEgyptSite %}
{% set name = "home_page.find.expo.title"|trans %}
{% set url = path('expo_landing') %}
<li>
<a href="{{ url }}" class="gtm-btn-expo simple-navbar__icon-btn">
<img class="simple-navbar__icon-btn_img" src="{{ asset('images/home/ic_expo.svg') }}" />
{{ name }}
</a>
</li>
{% endif %}
{% if get_setting('features', 'mortgage')%}
{% set name = 'home_page.find.mortgage.title'|trans %}
{% set url = getMortgageRequestLink() %}
<li>
<a class="icon-btn simple-navbar__icon-btn gtm-btn-services-rating" href="{{ url }}" rel="nofollow" target="_blank">
<img class="simple-navbar__icon-btn_img" src="{{ asset('images/home/ic_money_blue.svg') }}" />
{{ name }}
</a>
</li>
{% endif %}
</ul>
</li>
{% if isEgyptSite %}
<li class="dropdown dropdown-mobile-shown simple-navbar__item">
<a href="#" class="icon-btn simple-navbar__icon-btn dropdown-toggle icon-btn_baby-blue-hover gtm-btn-
more" data-toggle="collapse" data-target="#collapseTwo" aria-controls="collapseTwo" aria-expanded="false" >
<img class="simple-navbar__item_icon icon" src="{{ asset('images/home/ic_emblem_black.svg') }}" />
{{ 'home_page.know.title'|trans }}
</a>
<ul class="collapse simple-navbar__dropdown-menu simple-navbar__dropdown-menu_side-menu dropdown-mobile-shown__link" id="collapseTwo">
{% if get_setting('features', 'estimates') %}
{% set name = 'home_page.know.valuations.title'|trans %}
{% set url = "https://i.aqarmap.com/estimates/step1.php" %}
<li>
<a class="icon-btn simple-navbar__icon-btn gtm-btn-services-rating" href="{{url}}" rel="nofollow">
<img class="simple-navbar__icon-btn_img" src="{{ asset('images/home/ic_evaluate_property.svg') }}" />
{{ name }}
</a>
</li>
{% endif %}
{% if get_setting('features', 'neighborhoods') %}
{% set name = 'home_page.know.prices_guide.title'|trans %}
{% set url = path('neighborhood_all_locations')%}
<li>
<a class="icon-btn simple-navbar__icon-btn gtm-btn-prices-guide" href="{{url}}">
<img class="simple-navbar__icon-btn_img" src="{{ asset('images/home/ic_money.svg') }}" />
{{ name }}
</a>
</li>
{% endif %}
{% if get_setting('features', 'discussions') %}
{% set name = 'home_page.know.neighbors.title'|trans %}
{% set url = path('neighborhood_discussion_list') %}
<li>
<a class="gtm-btn-discussion-main-title simple-navbar__icon-btn" href="{{ url }}">
<img class="simple-navbar__icon-btn_img" src="{{ asset('images/home/ic_ask_neighbors.svg') }}" />
{{ name }}
</a>
</li>
{% endif %}
{% if isEnabledFeature('web.agents.section') %}
{% set name = 'home_page.know.top_agents.title'|trans %}
{% set url = path('aqarmap_agents_search') %}
<li>
<a class="gtm-btn-agents simple-navbar__icon-btn" href="{{ url }}">
<img class="simple-navbar__icon-btn_img" src="{{ asset('images/home/ic_agent.svg') }}" />
{{ name }}
</a>
</li>
{% endif %}
{% if get_setting('features', 'exhibits_guide') %}
<li>
<a href="{{ aqarmap_exhibits_guide_url }}"
target="_blank"
class="gtm-btn-exhibits-guide simple-navbar__icon-btn">
<img class="simple-navbar__icon-btn_img" src="{{ asset('images/home/calendar.svg') }}" />
{{ 'home_page.know.exhibits.title'|trans }}
</a>
</li>
{% endif %}
{% if get_setting('features', 'real_estate_index') %}
{% set name = 'home_page.know.index.title'|trans %}
{% set url = "https://index.aqarmap.com/" %}
<li>
<a href="{{url}}" class="gtm-btn-services-aqarmap-index simple-navbar__icon-btn" rel="nofollow">
<img class="simple-navbar__icon-btn_img" src="{{ asset('images/home/ic_index.svg') }}" />
{{ name }}
</a>
</li>
{% endif %}
{% if get_setting('features', 'advice') %}
{% set name = 'home_page.know.advice.title'|trans %}
{% set url = aqarmap_advice_url ~ '/' ~ app.request.locale ~ '/' %}
<li>
<a href="{{url}}" class="gtm-btn-advice simple-navbar__icon-btn">
<img class="simple-navbar__icon-btn_img" src="{{ asset('images/home/ic_idea.svg') }}" />
{{name}}
</a>
</li>
{% endif %}
<li>
{% set name = 'home_page.know.market_research.title'|trans %}
{% set url = 'https://i.aqarmap.com/research/' %}
<a class="icon-btn simple-navbar__icon-btn gtm-btn-services-rating" href="{{url}}" rel="nofollow">
<img class="simple-navbar__icon-btn_img" src="{{ asset('images/home/ic_market_research.svg') }}" />
{{ name }}
</a>
</li>
{% if get_setting('features', 'estimates') %}
{% set name = 'home_page.know.know_more.title'|trans %}
{% set url = 'https://i.aqarmap.com/knowmore/' %}
<li>
<a class="icon-btn simple-navbar__icon-btn gtm-btn-services-rating" href="{{url}}" rel="nofollow">
<img class="simple-navbar__icon-btn_img" src="{{ asset('images/home/ic_emblem.svg') }}" />
{{ name }}
</a>
</li>
{% endif %}
</ul>
</li>
{% endif %}
<li class="dropdown simple-navbar__item">
<a href="#" class="icon-btn simple-navbar__icon-btn dropdown-toggle icon-btn_baby-blue-hover gtm-btn-more" data-toggle="collapse" data-target="#collapseThree" aria-controls="collapseThree" aria-expanded="false">
<img class="simple-navbar__item_icon icon" src="{{ asset('images/home/ic_sell_property.svg') }}" />
{{ 'home_page.list.title'|trans }}
</a>
<ul class="collapse simple-navbar__dropdown-menu simple-navbar__dropdown-menu_side-menu " id="collapseThree">
<li>
{% set name = 'home_page.list.list_home.title'|trans %}
<a href="{{ path('listing_initialize') }}" class="icon-btn simple-navbar__icon-btn" rel="nofollow">
<img class="simple-navbar__icon-btn_img" src="{{ asset('images/home/ic_sell_property.svg') }}" />
{{ name }}
</a>
</li>
<li>
{% set name = 'home_page.list.list_company.title'|trans %}
{% set url = app.request.locale == locale ? joinUsARURL : joinUsENURL %}
<a class="icon-btn simple-navbar__icon-btn gtm-btn-joinus" href="{{url}}" rel="nofollow" target="_blank">
<img class="simple-navbar__icon-btn_img" src="{{ asset('images/home/ic_Companies_Registration.svg') }}" />
{{ name }}
</a>
</li>
</ul>
</li>
</ul>
<ul class="nav simple-navbar__navbar-nav navbar-right responsive-side-nav">
<li class="dropdown simple-navbar__item">
<a href="#" class="dropdown-toggle icon-btn simple-navbar__icon-btn" data-toggle="dropdown">
{% if get_setting('general', 'country') == 'EG' %}
<img class="img-responsive" src="/images/egypt.svg"
width="{{ iconSize }}" />
{% else %}
<img class="img-responsive" src="/images/Saudi-flag.svg"
width="{{ iconSize }}" />
{% endif %}
</a>
<ul class="dropdown-menu simple-navbar__dropdown-menu simple-navbar__dropdown-menu_side-menu simple-navbar__dropdown-menu_drop-top">
<li class="simple-navbar__item">
{% set ksaLabel = 'layout.countries.ksa'|trans %}
{% set egyptLabel = 'layout.countries.egypt'|trans %}
{% if get_setting('general', 'country') == 'EG' %}
<a class="icon-btn simple-navbar__icon-btn" href="https://ksa.aqarmap.com">
<img class="img-responsive" src="/images/Saudi-flag.svg" width="{{ iconSize }}" />
<span class="mx-3">{{ ksaLabel}}</span>
</a>
{% else %}
<a class="icon-btn simple-navbar__icon-btn" href="https://aqarmap.com.eg/">
<img class="img-responsive" src="/images/egypt.svg"
width="{{ iconSize }}" />
<span class="mx-3">{{ egyptLabel }}</span>
</a>
{% endif %}
</li>
</ul>
</li>
<li class="simple-navbar__item">
{% if app.request.get('_locale') == 'en' %}
{% set parameters = not removeParametersLanguageSwitcher ? app.request.requesturi|trim(path(app.request.get('_route'), app.request.get('_route_params')|merge({'_locale': 'en'}))) : '' %}
{% set arLabel = 'layout.arabic'|trans %}
<a class="icon-btn simple-navbar__icon-btn" href="{{ path(app.request.get('_route'), app.request.get('_route_params')|merge({'_locale': 'ar'}))~parameters }}">
<span class="text-line">{{ arLabel}}</span>
</a>
{% else %}
{% set parametersAr = not removeParametersLanguageSwitcher ? app.request.requesturi|trim(path(app.request.get('_route'), app.request.get('_route_params')|merge({'_locale': 'ar'}))) : '' %}
{% set enLabel = 'layout.english'|trans %}
<a class="icon-btn simple-navbar__icon-btn" href="{{ path(app.request.get('_route'), app.request.get('_route_params')|merge({'_locale': 'en'}))~parametersAr }}"
>
<span class="text-line">{{ enLabel }}</span>
</a>
{% endif %}
</li>
{% if app.request.attributes.get('_route') not in ['compound_adviser_search_results', 'compound_adviser', 'search', 'property_type_search', 'compound_search'] %}
<li class="simple-navbar__item">
<a class="gtm-btn-report icon-btn simple-navbar__icon-btn"
href="{{ path('aqarmap_feedback_get') }}"
target="_blank" rel="nofollow">
{{ 'problem.help'|trans }}
</a>
</li>
{% endif %}
</ul>
</div>
</div>
<ul class="nav simple-navbar__navbar-nav ">
{% if isUserControlMenuEnabled %}
<li class="dropdown simple-navbar__icon-btn_list-item d-flex align-items-center">
<button class="collapse-btn w-100 m-0 border-0 user-menu-btn" aria-label="userMenu"
data-toggle="collapse"
data-target="#userControlCollapse"
{% if isLoggedinUser %}
ng-click="drawUserDataMenu()"
{% endif %}
>
<div class="icon-btn simple-navbar__icon-btn_circle-btn border-0 m-0 ">
<img class="{{userImgClass}}" src="{{userImgUrl}}" alt="User Image" />
</div>
{% if isLoggedinUser %}
<div class="user-menu-btn__name text"> {{userName}}</div>
{% endif %}
<div class="icon-btn icon-btn simple-navbar__icon-btn simple-navbar__icon-btn_arrow">
<img class="icon-collapse icon" src="{{ asset('images/Navbar/ic_chevron_down.svg')}}" alt="Drop down" />
</div>
</button>
<div class="collapse time-circle-trigger simple-navbar__dropdown-menu simple-navbar__dropdown-menu_desktop-user-control simple-navbar__dropdown-menu_dir-reverse p-0" id="userControlCollapse">
{% include "@AqarmapMain/Navbar/userControlMenu.html.twig" %}
</div>
</li>
{% else %}
{% if isLoggedinUser %}
{% if is_granted('ROLE_PREVIOUS_ADMIN') and is_granted('ROLE_SWITCH_ACCOUNT') %}
<li class="simple-navbar__icon-btn_list-item">
<a class="icon-btn simple-navbar__icon-btn" href="{{ path('homepage', {'_want_to_be_this_user': '_exit'}) }}"
rel="nofollow">
Switch back
</a>
</li>
{% endif %}
{% else %}
<li class="login-mob-btn simple-navbar__icon-btn_list-item">
<a id="te-login-button" class="icon-btn simple-navbar__icon-btn simple-navbar__icon-btn_login-btn" href="{{ path('app_login') }}"
rel="nofollow">
{{ 'home_page.signin'|trans }}
</a>
</li>
{% endif %}
{% endif %}
</ul>
</div>
</nav>
{% if isUXVersion and isLoggedinUser and not isUserControlMenuEnabled %}
<nav class="simple-navbar navbar navbar-default down-navbar">
<div class="container">
<div class="d-flex w-100">
{% include "@AqarmapMain/Navbar/sub-header.html.twig" %}
</div>
</div>
</nav>
{% endif %}
</div>