Vinoteca: модуль, шаблон и компоненты интернет-магазина вина на 1С-Битрикс
This commit is contained in:
commit
bb7d8af290
469 files changed
+26426
No files matched your search
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
use Bitrix\Main\Localization\Loc;
|
||||
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
|
||||
Loc::loadMessages(__FILE__);
|
||||
$text = static fn(string $key): string => htmlspecialcharsbx((string)Loc::getMessage($key));
|
||||
$stats = [
|
||||
["value" => $arResult["WINES"], "label" => Loc::getMessagePlural("VINO_ABOUT_WINES", $arResult["WINES"]), "url" => $arResult["CATALOG_URL"]],
|
||||
["value" => $arResult["BRANDS"], "label" => Loc::getMessagePlural("VINO_ABOUT_BRANDS", $arResult["BRANDS"]), "url" => $arResult["BRANDS_URL"]],
|
||||
];
|
||||
$steps = ["ASK", "PAY", "PICKUP"];
|
||||
$note = static function (string $step): string {
|
||||
$line = htmlspecialcharsbx((string)Loc::getMessage("VINO_ABOUT_" . $step . "_D"));
|
||||
$label = htmlspecialcharsbx((string)Loc::getMessage("VINO_ABOUT_" . $step . "_LINK"));
|
||||
if ($step === "ASK") {
|
||||
$link = '<button class="vino-about__accent-link" type="button" data-sommelier-open>' . $label . '</button>';
|
||||
} elseif ($step === "PICKUP") {
|
||||
$link = '<a class="vino-about__accent-link" href="#vino-about-where">' . $label . '</a>';
|
||||
} else {
|
||||
return $line;
|
||||
}
|
||||
|
||||
return str_replace("#LINK#", $link, $line);
|
||||
};
|
||||
?>
|
||||
<div class="vino-about">
|
||||
<section class="vino-about__panel vino-about__panel--intro">
|
||||
<div class="vino-about__inner vino-about__inner--intro">
|
||||
<div class="vino-about__copy">
|
||||
<?php \Jinove\Vinoteca\Breadcrumbs::show(array(array($arResult["TITLE"]))); ?>
|
||||
<h1 class="vino-about__title"><?= htmlspecialcharsbx($arResult["TITLE"]) ?></h1>
|
||||
<p class="vino-about__lead"><?= str_replace("#ACCENT#", '<span class="vino-about__accent">' . $text("VINO_ABOUT_ACCENT") . '</span>', $text("VINO_ABOUT_LEAD")) ?></p>
|
||||
<p class="vino-about__text"><?= $text("VINO_ABOUT_LEAD_2") ?></p>
|
||||
</div>
|
||||
<img class="vino-about__photo" src="<?= SITE_TEMPLATE_PATH ?>/assets/media/about-intro-1400.webp" srcset="<?= SITE_TEMPLATE_PATH ?>/assets/media/about-intro-800.webp 800w, <?= SITE_TEMPLATE_PATH ?>/assets/media/about-intro-1400.webp 1400w" sizes="(max-width: 760px) 100vw, 50vw" width="1400" height="933" alt="<?= $text("VINO_ABOUT_PHOTO_ALT") ?>" fetchpriority="high" decoding="async">
|
||||
</div>
|
||||
</section>
|
||||
<?php if ($arResult["WINES"] > 0): ?>
|
||||
<section class="vino-about__panel vino-about__panel--deep">
|
||||
<div class="vino-about__inner vino-about__inner--center">
|
||||
<h2 class="vino-about__heading"><?= $text("VINO_ABOUT_FACTS_TITLE") ?></h2>
|
||||
<ul class="vino-about__stats">
|
||||
<?php foreach ($stats as $stat): ?>
|
||||
<li class="vino-about__stat">
|
||||
<span class="vino-about__stat-value"><?= (int)$stat["value"] ?></span>
|
||||
<a class="vino-about__stat-label" href="<?= htmlspecialcharsbx($stat["url"]) ?>"><?= htmlspecialcharsbx($stat["label"]) ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php if ($arResult["TYPES"]): ?>
|
||||
<ul class="vino-about__types">
|
||||
<?php foreach ($arResult["TYPES"] as $type): ?>
|
||||
<li class="vino-about__type">
|
||||
<span class="vino-about__type-value"><?= (int)$type["COUNT"] ?></span>
|
||||
<a class="vino-about__type-link" href="<?= htmlspecialcharsbx($type["URL"]) ?>"><?= htmlspecialcharsbx($type["NAME"]) ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
<section class="vino-about__panel vino-about__panel--soft">
|
||||
<div class="vino-about__inner vino-about__inner--center">
|
||||
<h2 class="vino-about__heading"><?= $text("VINO_ABOUT_HOW_TITLE") ?></h2>
|
||||
<ol class="vino-about__flow">
|
||||
<?php foreach ($steps as $index => $step): ?>
|
||||
<?php if ($index > 0): ?><li class="vino-about__arrow" aria-hidden="true">→</li><?php endif; ?>
|
||||
<li class="vino-about__stage">
|
||||
<span class="vino-about__word"><?= $text("VINO_ABOUT_" . $step . "_T") ?></span>
|
||||
<span class="vino-about__note"><?= $note($step) ?></span>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</div>
|
||||
</section>
|
||||
<section class="vino-about__panel vino-about__panel--deep" id="vino-about-where">
|
||||
<div class="vino-about__inner vino-about__inner--where">
|
||||
<div class="vino-about__where">
|
||||
<h2 class="vino-about__heading"><?= $text("VINO_ABOUT_WHERE_TITLE") ?></h2>
|
||||
<dl class="vino-about__list">
|
||||
<div class="vino-about__row">
|
||||
<dt class="vino-about__term"><?= $text("VINO_ABOUT_ADDRESS_T") ?></dt>
|
||||
<dd class="vino-about__def"><?= $text("VINO_ABOUT_ADDRESS_D") ?></dd>
|
||||
</div>
|
||||
<?php if ($arResult["PHONE"] !== ""): ?>
|
||||
<div class="vino-about__row">
|
||||
<dt class="vino-about__term"><?= $text("VINO_ABOUT_PHONE_T") ?></dt>
|
||||
<dd class="vino-about__def"><a class="vino-about__link" href="tel:<?= htmlspecialcharsbx($arResult["PHONE"]) ?>"><?= htmlspecialcharsbx($arResult["PHONE_LABEL"]) ?></a></dd>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($arResult["EMAIL"] !== ""): ?>
|
||||
<div class="vino-about__row">
|
||||
<dt class="vino-about__term"><?= $text("VINO_ABOUT_EMAIL_T") ?></dt>
|
||||
<dd class="vino-about__def"><a class="vino-about__link" href="mailto:<?= htmlspecialcharsbx($arResult["EMAIL"]) ?>"><?= htmlspecialcharsbx($arResult["EMAIL"]) ?></a></dd>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</dl>
|
||||
<div class="vino-about__actions">
|
||||
<button class="vino-btn" type="button" data-sommelier-open><?= $text("VINO_ABOUT_ASK") ?></button>
|
||||
<a class="vino-btn vino-btn--outline" href="<?= htmlspecialcharsbx($arResult["CATALOG_URL"]) ?>"><?= $text("VINO_ABOUT_CATALOG") ?></a>
|
||||
</div>
|
||||
<a class="vino-about__accent-link" href="<?= htmlspecialcharsbx($arResult["MAP_URL"]) ?>" target="_blank" rel="noopener noreferrer"><?= $text("VINO_ABOUT_MAP") ?></a>
|
||||
</div>
|
||||
<div class="vino-about__map-wrap">
|
||||
<div class="vino-about__map" data-map data-lat="<?= (float)$arResult["MAP"]["LAT"] ?>" data-lon="<?= (float)$arResult["MAP"]["LON"] ?>" data-zoom="<?= (int)$arResult["MAP"]["ZOOM"] ?>" data-style="<?= htmlspecialcharsbx($arResult["MAP"]["STYLE"]) ?>" data-lang="<?= LANGUAGE_ID ?>" data-lib-js="<?= SITE_TEMPLATE_PATH ?>/assets/vendor/maplibre/maplibre-gl.js" data-lib-css="<?= SITE_TEMPLATE_PATH ?>/assets/vendor/maplibre/maplibre-gl.css" data-text-windows="<?= $text("VINO_ABOUT_MAP_WINDOWS") ?>" data-text-mac="<?= $text("VINO_ABOUT_MAP_MAC") ?>" data-text-mobile="<?= $text("VINO_ABOUT_MAP_MOBILE") ?>" data-text-zoom-in="<?= $text("VINO_ABOUT_MAP_ZOOM_IN") ?>" data-text-zoom-out="<?= $text("VINO_ABOUT_MAP_ZOOM_OUT") ?>" data-text-stub="<?= $text("VINO_ABOUT_MAP_STUB") ?>" data-text-fail="<?= $text("VINO_ABOUT_MAP_FAIL") ?>" role="region" aria-label="<?= $text("VINO_ABOUT_MAP_LABEL") ?>">
|
||||
<div class="vino-about__map-canvas" data-map-canvas></div>
|
||||
<div class="vino-about__map-stub" data-map-stub>
|
||||
<p class="vino-about__map-note" data-map-note><?= $text("VINO_ABOUT_MAP_STUB") ?></p>
|
||||
<button class="vino-btn vino-btn--outline" type="button" data-map-allow><?= $text("VINO_ABOUT_MAP_ALLOW") ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<script type="application/ld+json"><?= json_encode($arResult["SCHEMA"], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG) ?></script>
|
||||
Reference in new issue
Block a user