<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();
$this->setFrameMode(true);
?>
<script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "Article",
        "headline": "<? echo $arResult["NAME"]; ?>",
        "description": "<? echo TruncateText(trim($arResult["DETAIL_TEXT"]), 150); ?>",
        "author": {
            "@type": "Person",
            "name": "<?= trim($arResult['ADD_OWNER']['NAME']) ?> <?= trim($arResult['ADD_OWNER']['LAST_NAME']) ?>"
        },
        "publisher": {
            "@type": "Organization",
            "name": "TECH доска объявлений",
            "logo": {
               "@type": "ImageObject",
               "url": "https://tech.bxstore.ru/local/templates/bulletinboard/img/LOGO.svg"
            }
        },
        "datePublished": "<?= $arResult['DATE_CREATE'] ?>"
    }
</script>
<section class="detail_bulletin_row">
    <div class="detail_bulletin_row_title">
        <h1>
            <? $APPLICATION->ShowTitle(false); ?>
        </h1>
        <div class="detail_bulletin_row_title_price">
            <? foreach ($arResult['ITEM_PRICES'] as $PRICE) { ?>
                <?= $PRICE['PRINT_BASE_PRICE'] ?>
            <? } ?>
            <button type="button" data-id="<?= $arResult['ID'] ?>" class="mibazarow_add_favor">
                <svg>
                    <use xlink:href="<?= SITE_TEMPLATE_PATH ?>/img/svgicons.svg#heart_empty"></use>
                </svg>
            </button>
        </div>

    </div>

    <article class="detail_bulletin_row_content">

        <div class="detail_bulletin_row_content_pict">
            <a href="<?= $arResult["DETAIL_PICTURE"]["SRC"] ?>" data-fancybox="images"
               data-caption="<?= $arResult["NAME"] ?>">
                <img src="<?= $arResult["DETAIL_PICTURE"]["SRC"] ?>" alt="<?= $arResult["NAME"] ?>"/>
            </a>
            <?php
            if (count($arResult["MORE_PHOTO"]) > 0) {
                ?>
                <div class="detail_bulletin_row_content_pict_other">
                    <? foreach ($arResult["MORE_PHOTO"] as $PHOTO) {
                        // todo применить ресайз к превьюхам
                        ?>
                        <a href="<?= $PHOTO["SRC"] ?>" data-fancybox="images"
                           data-caption="<?= $arResult["NAME"] ?>">
                            <img src="<?= $PHOTO["SRC"] ?>" width="200" alt="<?= $arResult["NAME"] ?>"/>
                        </a>
                    <? } ?>
                </div>
            <? } ?>
        </div>

        <div class="detail_bulletin_row_content_adress">
            <h2>Адрес:</h2>
            <p><? echo $arResult['PROPERTIES']['ATT_ADRESS']['VALUE'] ?>.</p>
        </div>
        <div class="detail_bulletin_row_content_description">
            <h3>Описание</h3>
            <strong>
                <? echo implode(', ', $arResult['PROPERTIES']['ATT_CONDITION']['VALUE_ENUM']) ?>.
                <? echo implode(', ', $arResult['PROPERTIES']['ATT_DILEVERY']['VALUE_ENUM']) ?>
            </strong>
            <?= $arResult["DETAIL_TEXT"] ?>
        </div>
    </article>
    <aside class="detail_bulletin_row_owner">
        <div class="position_sticker">
            <div class="detail_bulletin_row_owner_user">

                <img src="<?= $arResult['ADD_OWNER']['USER_PIC']['src'] ?>" alt="<?= $arResult['ADD_OWNER']['NAME'] ?>">
                <ul class="detail_bulletin_row_owner_user_info">
                    <li>
                        <strong>
                            <?= $arResult['ADD_OWNER']['NAME'] ?>
                            <?= $arResult['ADD_OWNER']['LAST_NAME'] ?>
                            <? if ($arResult['ADD_OWNER']['ONLINE']) {
                                ?>
                                <span class="user_is_online">
                                   &mdash; в сети
                                </span>
                                <?
                            } else {
                                ?>
                                <span class="user_not_online">
                                 &mdash; не в сети
                                </span>
                                <?
                            } ?>
                        </strong>
                    </li>
                    <li>
                        С нами с <?= $arResult['ADD_OWNER']['DATE_REGISTER'] ?>
                    </li>
                    <li><!-- todo на страницу всех объявлений юзера -->
                        Объявлений: <a href="/"><?= $arResult['ADD_OWNER']['COUNT_ADDS'] ?></a>
                    </li>
                </ul>
                <button class="btn btn_colored show_panel" type="button">
                    <span>Написать продавцу</span>
                </button>
            </div>
            <ul class="detail_bulletin_row_owner_bulletin">
                <li><i>ID объявления</i> <span><?= $arResult['ID'] ?></span></li>
                <li><i>Размещено</i> <span><?= $arResult['DATE_CREATE'] ?></span></li>
            </ul>
            <? if ($arResult['CREATED_BY'] === $USER->GetID()) { ?>
                <div class="detail_bulletin_row_owner_self">
                    <span>Это ваше объявление</span>
                    <a class="btn btn_not_colored" href="/personal/add_bulletin/?EDIT_ELEMENT=<?= $arResult['ID'] ?>">
                        Отредактировать
                    </a>
                </div>
            <? } ?>
        </div>
    </aside>
</section>




