map-content-projects.php 1.87 KB
<?
/** @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>
<? } ?>