map-content-projects.php
1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?
/** @var $item \SH\Entities\Project */
/** @var $region \SH\Entities\ProjectRegion */
?>
<? foreach($arResult['ITEMS'] as $item) { ?>
<?
$square = $item->getSquare();
$floors = $item->getFloorCount();
$bedrooms = $item->getBedroomCount();
?>
<div class="map-project js-map-project" data-id="<?= $item->ID ?>">
<? if($pic = $item->getPreviewImage()) { ?>
<figure class="map-project-image responsive-image"><img src="<?= $pic ?>" alt="<?= $item->getImgAlt() ?>"></figure>
<? } ?>
<div class="map-project-content">
<? if(/*$item->hasDetail()*/ 1 == 2) { ?>
<a href="<?= $item->getUrl() ?>" class="map-project-title"><?= $item->getName() ?></a>
<? } else { ?>
<h3 class="map-project-title"><?= $item->getName() ?></h3>
<? } ?>
<? if($val = $item->getRegion()) { ?>
<div class="map-project-location"><?= $val ?></div>
<? } ?>
<? if($square || $floors || $bedrooms) { ?>
<div class="map-project-specs">
<? if($square) { ?>
<span class="map-project-specs-item _square"><?= $square ?> м<sup>2</sup></span>
<? } ?>
<? if($floors) { ?>
<span class="map-project-specs-item _floors"><?= num_to_string($floors, 'этаж', 'этажа', 'этажей') ?></span>
<? } ?>
<? if($bedrooms) { ?>
<span class="map-project-specs-item _bedrooms"><?= num_to_string($bedrooms, 'спальня', 'спальни', 'спален') ?></span>
<? } ?>
</div>
<? } ?>
<? if($val = $item->getText()) { ?>
<div class="map-project-text-wrap">
<p class="map-project-text"><?= $val ?></p>
<div class='map-text-toggler big-button'>Читать полностью</div>
</div>
<? } ?>
<? if(/*$item->hasDetail()*/ 1 == 2) { ?>
<a href="<?= $item->getUrl() ?>" class="map-project-link big-button">Подробнее о проекте</a>
<? } ?>
</div>
</div>
<? } ?>