{% extends 'TroikaRealEstateBundle:Default:layout.html.twig' %}
{% block keywords %}
{% if seo.metaKeywords is defined %}
{{ seo.metaKeywords }}
{% endif %}
{% endblock %}
{% block description %}
{% if seo.metaDescription is defined %}
{{ seo.metaDescription }}
{% endif %}
{% endblock %}
{% block title %}
{% if seo.title is defined %}
{{ seo.title }}
{% endif %}
{% endblock %}
{% block main %}
<style>
#text + div > ul > li.select-dropdown-item:first-child {
display: none !important;
}
</style>
<a class="kpoisku" href="/"><i class="fa fa-chevron-left" aria-hidden="true"></i> К поиску
недвижимости</a>
<div id="content" class="content content__catalog-map complexes">
<div class="wrapper mhuck-vverkh">
<ul class="hb hide__phone hide__tablet hbtmfix">
<li><a href="/">Элитная недвижимость</a></li>
<li><a href="/elit_kvartiry">Продажа городской недвижимости</a></li>
<li class="current">Элитные новостройки</li>
</ul>
{% if seo.seoLabelFirst is defined %}
{{ seo.seoLabelFirst }}
{% endif %}
<div id="layout" class="layout layout__catalog layout__catalog-map layout__column-left"
style="margin-top: 0px; height: auto !important;">
<div class="layout-column-left">
{% block sort %}
{% endblock %}
<div class="cards cards__list" id="layout-items">
{% block list_item %}
{% endblock %}
</div>
<div class="pages hide_maps">
{{ knp_pagination_render(complexes) }}
</div>
<div class="seo__text">
{% if seo.seoLabelSecond is defined %}
{{ seo.seoLabelSecond | raw }}
{% endif %}
</div>
</div>
<div class="layout-column-right filter-column forHuck">
<div class="close_hucked hide__phone hide__desktop">X</div>
<div class="panel panel__white panel__tabs panel__catalog"
style="border-top: solid #c2b2a9 4px;padding-top: 22px; margin-top: 0px; padding-bottom: 0px !important;">
<!--
<ul class="tabs tabs__main tabs__column-2">
<li class="tabs-item {% if app.request.attributes.get('query') ends with "_arenda" %} {% else %} active{% endif %}">
<a
class="inherit-link" href="/complex">Продажа</a></li>
<li class="tabs-item {% if app.request.attributes.get('query') ends with "_arenda" %} active{% endif %}"><a
class="inherit-link"
href="/commercial_nedvigimost_arenda">Аренда</a>
</li>
</ul>
-->
<div class="panel-action" id="big-search" style="margin-top: 0px;">
<i class="fa fa-search"></i>
поиск по параметрам
</div>
<div class="panel-container inverse">
<select name="text" id="text" data-placeholder="введите название" autocomplete="on"
style="display: none;">
<option value="введите название" style="display:none">введите название</option>
{% for c in cs %}
<option value="{{ c }}" {% if c == f_c %} selected {% endif %} >{{ c }}</option>
{% endfor %}
</select>
</div>
<select name="district" id="district" multiple data-placeholder="выбрать район" autocomplete="on"
style="display: none;">
{% for district in districts %}
<option
value="{{ district.id }}" {% if "" ~ district.id in f_district %} selected {% endif %}>{{ district.name }}</option>
{% endfor %}
</select>
<select name="subway" id="subway" multiple data-placeholder="выбрать метро" autocomplete="on"
style="display: none;">
{% for subway in subways %}
<option
value="{{ subway.id }}" {% if "" ~ subway.id in f_subway %} selected {% endif %}>{{ subway.name }}</option>
{% endfor %}
</select>
<select name="type" id="type" data-placeholder="выбрать тип недвижимости" multiple autocomplete="on"
style="display: none;">
{% for type in types %}
<option
value="{{ type.id }}" {% if "" ~ type.id in f_type %} selected {% endif %}>{{ type.name }}</option>
{% endfor %}
</select>
<select name="stage" id="stage" data-placeholder="выбрать готовность" multiple autocomplete="on"
style="display: none;">
{% for stage in stages %}
<option
value="{{ stage.id }}" {% if "" ~ stage.id in f_stage %} selected {% endif %}>{{ stage.name }}</option>
{% endfor %}
</select>
<div class="panel-action hide__phone_slow" id="reset" {% if (f_c) %}style="display: block"{% endif %}><a
style="color: #a8a69c !important;" href="/complex"><i class="fa fa-repeat"></i> сброс фильтра</a>
</div>
<div class="hr hr__dotted hide__phone"></div>
<div class="panel-callback hide__phone">
<p>Мы подберем для вас<br>лучшие варианты</p>
<a href="#" data-button="боковая панель" class="btn__question">оставить заявку</a>
</div>
<div class="panel-action hide__phone"><a style="color: #a8a69c !important;" href="/elit_kvartiry"><i
class="fa fa-arrow-circle-left"></i> вернуться к поиску недвижимости</a></div>
</div>
</div>
<div style="clear:both"></div>
</div>
</div>
</div>
<script type="text/javascript">
var filter = {
'subway': [],
'district': [],
'type': [],
'stage': [],
'text': '',
'page': 1
};
var t = false;
var goMakeRequest = function () {
var s = [];
$.get('/complex_filter', filter, function (result) {
$('#layout-items').html(result);
var it = parseInt($('#hidcount').text());
$('#count').text(it);
if (it > 10) {
$('.pages').show();
$('.pages').html('');
$('.pages').append('<a data-page="1" href="?page=1" class="pages-first">первая</a>');
for (var i = 1; i <= Math.ceil(it / 10); i++) {
var ss = (i == filter.page) ? 'active' : '';
$('.pages').append('<a data-page="' + i + '" href="/complex?page=' + i + '" class="pages-item ' + ss + '">' + i + '</a>');
}
$('.pages').append('<a data-page="' + Math.ceil(it / 10) + '" href="?page=' + Math.ceil(it / 10) + '" class="pages-last">последняя</a>');
} else {
$('.pages').hide();
}
var str = $.param(filter);
if (str) str = '?' + str;
history.pushState(null, null, '/complex' + str);
});
};
$(document).ready(function () {
$('#subway').change(function () {
var v = $(this).val() ? $(this).val() : [];
filter.subway = v;
filter.page = 1;
goMakeRequest();
});
$('#district').change(function () {
var v = $(this).val() ? $(this).val() : [];
filter.district = v;
filter.page = 1;
goMakeRequest();
});
$('#type').change(function () {
var v = $(this).val() ? $(this).val() : [];
filter.type = v;
filter.page = 1;
goMakeRequest();
});
$('#stage').change(function () {
var v = $(this).val() ? $(this).val() : [];
filter.stage = v;
filter.page = 1;
goMakeRequest();
});
$('#text').change(function (e) {
filter.text = $(this).val();
filter.page = 1;
goMakeRequest();
$('#reset').show();
if ($(window).height() < 450) $('.complexes h1').attr('style', 'margin-top:-218px');
});
$('.pages').on('click', '.pages-item', function (e) {
e.preventDefault();
filter.page = parseInt($(this).data('page'));
$('.pages-item.active').removeClass('active');
$(this).addClass('active');
var body = $('html, body');
body.stop().animate({scrollTop: 0}, 1200, 'swing', function () {
});
goMakeRequest();
});
});
</script>
<style>
@media (min-width: 450px) {
tr.price_mobile {
display: none;
}
}
.price_mobile td {
font-weight: bolder;
padding-top: 10px;
font-size: 15px;
}
{% if (f_c) %}
@media (max-width: 500px) {
.complexes h1 {
margin-top: -218px;
}
}
{% endif %}
</style>
{% endblock %}