{% set VILLA_ID_CONST = 16 %}
{% set APARTMENT_ID_CONST = 1 %}
{% set currency = get_setting('general', 'currency')|trans%}
{% set villaPrice = 0 %}
{% set apartmentPrice = 0 %}
<div id="neighborhood-statistics">
<div class="container">
<div class="page-header">
<div class="avg-prices-title" >
<h1 >{{ 'neighborhoods.prices_title'|trans({'%location%': location.title}, 'messages') }}</h1>
<p class="pull-right flip">
{{ 'neighborhoods.data_updated_at'|trans({'%date%': updatedDate|date("d-m-Y")|localizeddate('long', 'none', 'en')}) }}
<a target="_blank" href="{{ path('page_view', {'slug': 'neighborhoods-statistics-information'}) }}"><span class="fa fa-info-circle" aria-hidden="true"></span></a>
</p>
</div>
</div>
<div class="row">
<div class="col-md-5">
{% for statistic in location_statistics %}
{% set villaPrice = statistic.propertyType.id == VILLA_ID_CONST ? statistic.avgPrice : villaPrice %}
{% set apartmentPrice = statistic.propertyType.id == APARTMENT_ID_CONST ? statistic.avgPrice: apartmentPrice %}
{% if statistic.avgPrice %}
<div class="avg-price-widget-container">
<div class="d-flex align-items-center w-100">
<div class="stat-type">
<span>({{ statistic.propertyType.title }})</span>
</div>
<div class="avg-price-widget">
<span class="integer">
{{ statistic.avgPrice|number_format }}
<span class="sign">{{ get_setting('general', 'currency')|trans }}</span>
</span>
</div>
</div>
</div>
<p class="avg-price-sub-text">
{{ 'neighborhoods.headline.sub_header'|trans({
'%propertyType%': statistic.propertyType.title,
'%location%': location.title,
'%price%': statistic.avgPrice|number_format,
})
}}
<span class="sign">{{ get_setting('general', 'currency')|trans }}</span>
{{ "neighborhoods.headline.per_square_meter"|trans }}
</p>
{% endif %}
{% endfor %}
<div class="avg-prices-btns">
<a href="https://aqarmap.com/genie/" class="btn btn-block btn-warning large-price-btn btn-lg">{{ "neighborhoods.genie_button"|trans({'%location%': location.getNearestNeighborhood.title}, 'messages') }}</a>
<div class="row ">
<div class="search_add_btns col-xs-12 col-sm-6">
<a href="{{ path('search' ,{'location_slug' : location.slug, 'property_type_slug': 'apartment' , 'section_slug' : defaultSection.slug}) }}"
class="btn navigate-btn btn-block btn-primary btn-lg">
{{ "layout.services.search_listings"|trans }}
</a>
</div>
<div class="search_add_btns col-xs-12 col-sm-6">
<a href="{{ path('listing_initialize') }}" class="btn btn-block navigate-btn btn-primary btn-lg" rel="nofollow">
{{ "layout.add_listing"|trans }}
</a>
</div>
</div>
</div>
</div>
<div class="col-md-7 graph-container">
{% if isEnabledFeature('web.pricegraph.resize') %}
<div class="visible-sm visible-xs">
<canvas class="statistics" width="1" height="1"></canvas>
</div>
<div class="hidden-sm hidden-xs">
<canvas class="statistics"></canvas>
</div>
{% else %}
<canvas id="statistics"></canvas>
{% endif %}
<div class="graph-title"><h2>{{ "neighborhoods.average_price_increase"|trans }}</h2></div>
</div>
</div>
</div>
</div>