Vinoteca: модуль, шаблон и компоненты интернет-магазина вина на 1С-Битрикс
This commit is contained in:
commit
bb7d8af290
469 files changed
+26426
No files matched your search
+11
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
|
||||
if (!empty($arResult["VINO_DESCRIPTION"])) {
|
||||
$GLOBALS["APPLICATION"]->SetPageProperty("description", $arResult["VINO_DESCRIPTION"]);
|
||||
}
|
||||
if (!empty($arResult["VINO_IMAGE"])) {
|
||||
$GLOBALS["APPLICATION"]->SetPageProperty("og_image", $arResult["VINO_IMAGE"]);
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
$MESS["VINO_BRAND_SINCE"] = "since #YEAR#";
|
||||
$MESS["VINO_BRAND_REGION"] = "Region";
|
||||
$MESS["VINO_BRAND_FOUNDED"] = "Founded";
|
||||
$MESS["VINO_BRAND_GRAPE"] = "Grape";
|
||||
$MESS["VINO_BRAND_FACTS"] = "Wines in the Vinoteca catalogue: #COUNT#.";
|
||||
$MESS["VINO_BRAND_META_TAIL"] = "All wines of the brand and their prices on one Vinoteca catalogue page.";
|
||||
$MESS["VINO_BRAND_META_TAIL_SHORT"] = "All wines of the brand on one page.";
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
$MESS["VINO_BRAND_SINCE"] = "od #YEAR#";
|
||||
$MESS["VINO_BRAND_REGION"] = "Region";
|
||||
$MESS["VINO_BRAND_FOUNDED"] = "Rok założenia";
|
||||
$MESS["VINO_BRAND_GRAPE"] = "Szczep";
|
||||
$MESS["VINO_BRAND_FACTS"] = "Liczba win w katalogu Vinoteca: #COUNT#.";
|
||||
$MESS["VINO_BRAND_META_TAIL"] = "Wszystkie wina marki i ich ceny na jednej stronie katalogu Vinoteca.";
|
||||
$MESS["VINO_BRAND_META_TAIL_SHORT"] = "Wszystkie wina marki na jednej stronie.";
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
$MESS["VINO_BRAND_SINCE"] = "с #YEAR#";
|
||||
$MESS["VINO_BRAND_REGION"] = "Регион";
|
||||
$MESS["VINO_BRAND_FOUNDED"] = "Основана";
|
||||
$MESS["VINO_BRAND_GRAPE"] = "Сорт";
|
||||
$MESS["VINO_BRAND_FACTS"] = "Вин в каталоге Vinoteca: #COUNT#.";
|
||||
$MESS["VINO_BRAND_META_TAIL"] = "Все вина бренда и их цены на одной странице каталога Vinoteca.";
|
||||
$MESS["VINO_BRAND_META_TAIL_SHORT"] = "Все вина бренда на одной странице.";
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
|
||||
\Bitrix\Main\Localization\Loc::loadMessages(__DIR__ . "/template.php");
|
||||
$arResult = \Jinove\Vinoteca\Catalog\LocalizedText::localizeItem($arResult, array("PREVIEW_TEXT", "DETAIL_TEXT"), array("COUNTRY", "REGION", "GRAPE"));
|
||||
|
||||
$brandUrl = VINO_HOST . $arResult["DETAIL_PAGE_URL"];
|
||||
$plainText = trim((string)preg_replace('/\s+/u', " ", strip_tags((string)$arResult["PREVIEW_TEXT"])));
|
||||
$propertyValue = static fn(string $code): string => trim((string)($arResult["PROPERTIES"][$code]["VALUE"] ?? ""));
|
||||
$picture = $arResult["DETAIL_PICTURE"];
|
||||
$wines = \Jinove\Vinoteca\Catalog\BrandSchema::wines((int)$arResult["ID"]);
|
||||
$place = implode(", ", array_filter([$propertyValue("COUNTRY"), $propertyValue("REGION")]));
|
||||
$facts = (string)\Bitrix\Main\Localization\Loc::getMessage("VINO_BRAND_FACTS", ["#COUNT#" => $wines["total"]]);
|
||||
$realText = $plainText;
|
||||
if ($plainText === "") {
|
||||
$arResult["~PREVIEW_TEXT"] = $facts;
|
||||
$arResult["PREVIEW_TEXT"] = htmlspecialcharsbx($facts);
|
||||
$plainText = (string)$arResult["~NAME"] . ": " . $place . ". " . $facts;
|
||||
} elseif (mb_strlen($plainText) < 120) {
|
||||
$plainText = rtrim($plainText, ".") . ". " . $facts;
|
||||
}
|
||||
if (mb_strlen($plainText) < 120) {
|
||||
$candidate = $plainText . " " . (string)\Bitrix\Main\Localization\Loc::getMessage($realText === "" ? "VINO_BRAND_META_TAIL" : "VINO_BRAND_META_TAIL_SHORT");
|
||||
$plainText = mb_strlen($candidate) <= 160 ? $candidate : $plainText;
|
||||
}
|
||||
if (mb_strlen($plainText) < 120 && $place !== "") {
|
||||
$candidate = $plainText . " " . $place . ".";
|
||||
$plainText = mb_strlen($candidate) <= 160 ? $candidate : $plainText;
|
||||
}
|
||||
$arResult["VINO_DESCRIPTION"] = \Jinove\Vinoteca\Seo::description($plainText, 160);
|
||||
$arResult["VINO_IMAGE"] = VINO_HOST . SITE_TEMPLATE_PATH . "/assets/media/og-catalog.jpg";
|
||||
$preview = $arResult["PREVIEW_PICTURE"];
|
||||
$arResult["VINO_SRCSET"] = !empty($preview["SRC"]) && !empty($picture["SRC"])
|
||||
? $preview["SRC"] . " " . (int)$preview["WIDTH"] . "w, " . $picture["SRC"] . " " . (int)$picture["WIDTH"] . "w"
|
||||
: "";
|
||||
$arResult["VINO_SCHEMA"] = \Jinove\Vinoteca\Catalog\BrandSchema::detail([
|
||||
"name" => (string)$arResult["~NAME"],
|
||||
"url" => $brandUrl,
|
||||
"path" => (string)$arResult["DETAIL_PAGE_URL"],
|
||||
"description" => $realText,
|
||||
"pageDescription" => $arResult["VINO_DESCRIPTION"],
|
||||
"logo" => !empty($picture["SRC"]) ? VINO_HOST . $picture["SRC"] : "",
|
||||
"logoWidth" => (int)($picture["WIDTH"] ?? 0),
|
||||
"logoHeight" => (int)($picture["HEIGHT"] ?? 0),
|
||||
"country" => \Jinove\Vinoteca\Catalog\BrandSchema::countryCode((string)($arResult["PROPERTIES"]["COUNTRY_EN"]["VALUE"] ?? "")) ?: $propertyValue("COUNTRY"),
|
||||
"region" => $propertyValue("REGION"),
|
||||
"founded" => $propertyValue("FOUNDED"),
|
||||
], $wines["items"], $wines["total"]);
|
||||
$this->__component->SetResultCacheKeys(["VINO_DESCRIPTION", "VINO_IMAGE"]);
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
use Bitrix\Main\Localization\Loc;
|
||||
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
|
||||
$prop = function ($code) use ($arResult) {
|
||||
return trim((string)($arResult["PROPERTIES"][$code]["VALUE"] ?? ""));
|
||||
};
|
||||
$country = $prop("COUNTRY");
|
||||
$region = $prop("REGION");
|
||||
$regionFull = $prop("REGION_FULL");
|
||||
$founded = $prop("FOUNDED");
|
||||
$grape = $prop("GRAPE");
|
||||
$kicker = array_filter(array($country, $region, $founded !== "" ? Loc::getMessage("VINO_BRAND_SINCE", array("#YEAR#" => $founded)) : ""));
|
||||
$pic = $arResult["DETAIL_PICTURE"];
|
||||
$this->AddEditAction($arResult["ID"], $arResult["EDIT_LINK"], CIBlock::GetArrayByID($arResult["IBLOCK_ID"], "ELEMENT_EDIT"));
|
||||
?>
|
||||
<script type="application/ld+json"><?= json_encode($arResult["VINO_SCHEMA"], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP) ?></script>
|
||||
<section class="vino-brand-detail" id="<?= $this->GetEditAreaId($arResult["ID"]) ?>">
|
||||
<div class="vino-wrap">
|
||||
<div class="vino-brand-hero">
|
||||
<div class="vino-brand-hero__text">
|
||||
<p class="vino-brand-hero__kicker"><?= htmlspecialcharsbx(implode(" · ", $kicker)) ?></p>
|
||||
<h1 class="vino-brand-hero__title"><?= htmlspecialcharsbx($arResult["~NAME"]) ?></h1>
|
||||
<dl class="vino-brand-hero__meta">
|
||||
<?php if ($regionFull !== ""): ?><div class="vino-brand-hero__meta-item"><dt class="vino-brand-hero__term"><?= Loc::getMessage("VINO_BRAND_REGION") ?></dt><dd class="vino-brand-hero__def"><?= htmlspecialcharsbx($regionFull) ?></dd></div><?php endif; ?>
|
||||
<?php if ($founded !== ""): ?><div class="vino-brand-hero__meta-item"><dt class="vino-brand-hero__term"><?= Loc::getMessage("VINO_BRAND_FOUNDED") ?></dt><dd class="vino-brand-hero__def"><?= htmlspecialcharsbx($founded) ?></dd></div><?php endif; ?>
|
||||
<?php if ($grape !== ""): ?><div class="vino-brand-hero__meta-item"><dt class="vino-brand-hero__term"><?= Loc::getMessage("VINO_BRAND_GRAPE") ?></dt><dd class="vino-brand-hero__def"><?= htmlspecialcharsbx($grape) ?></dd></div><?php endif; ?>
|
||||
</dl>
|
||||
<?php if ($arResult["PREVIEW_TEXT"] !== ""): ?><p class="vino-brand-hero__body"><?= $arResult["PREVIEW_TEXT"] ?></p><?php endif; ?>
|
||||
</div>
|
||||
<?php if (!empty($pic["SRC"])): ?><div class="vino-brand-hero__media"><img class="vino-brand-hero__img" src="<?= $pic["SRC"] ?>"<?= $arResult["VINO_SRCSET"] !== "" ? ' srcset="' . htmlspecialcharsbx($arResult["VINO_SRCSET"]) . '" sizes="(max-width: 760px) calc(100vw - 128px), 480px"' : "" ?> fetchpriority="high" width="<?= (int)$pic["WIDTH"] ?>" height="<?= (int)$pic["HEIGHT"] ?>" alt="<?= htmlspecialcharsbx($arResult["~NAME"]) ?>" decoding="async"></div><?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
$MESS["VINO_BRANDS_FILTER_COUNTRY"] = "Country";
|
||||
$MESS["VINO_BRANDS_FILTER_LETTER"] = "First letter of the name";
|
||||
$MESS["VINO_BRANDS_FILTER_ALL"] = "All";
|
||||
$MESS["VINO_BRANDS_FOUND"] = "Found: #COUNT#";
|
||||
$MESS["VINO_BRANDS_EMPTY"] = "No brands match these filters";
|
||||
$MESS["VINO_BRANDS_MORE"] = "Show more";
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
$MESS["VINO_BRANDS_FILTER_COUNTRY"] = "Kraj";
|
||||
$MESS["VINO_BRANDS_FILTER_LETTER"] = "Pierwsza litera nazwy";
|
||||
$MESS["VINO_BRANDS_FILTER_ALL"] = "Wszystkie";
|
||||
$MESS["VINO_BRANDS_FOUND"] = "Znaleziono: #COUNT#";
|
||||
$MESS["VINO_BRANDS_EMPTY"] = "Brak marek spełniających te kryteria";
|
||||
$MESS["VINO_BRANDS_MORE"] = "Pokaż więcej";
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
$MESS["VINO_BRANDS_FILTER_COUNTRY"] = "Страна";
|
||||
$MESS["VINO_BRANDS_FILTER_LETTER"] = "Первая буква названия";
|
||||
$MESS["VINO_BRANDS_FILTER_ALL"] = "Все";
|
||||
$MESS["VINO_BRANDS_FOUND"] = "Найдено: #COUNT#";
|
||||
$MESS["VINO_BRANDS_EMPTY"] = "Брендов с такими параметрами нет";
|
||||
$MESS["VINO_BRANDS_MORE"] = "Показать ещё";
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
|
||||
foreach ($arResult["ITEMS"] as $index => $item) {
|
||||
$arResult["ITEMS"][$index] = \Jinove\Vinoteca\Catalog\LocalizedText::localizeItem($item, array("PREVIEW_TEXT"), array("COUNTRY", "REGION", "GRAPE"));
|
||||
}
|
||||
|
||||
$schemaItems = [];
|
||||
foreach ($arResult["ITEMS"] as $item) {
|
||||
$schemaItems[] = ["name" => (string)$item["~NAME"], "url" => VINO_HOST . $item["DETAIL_PAGE_URL"]];
|
||||
}
|
||||
$arResult["VINO_SCHEMA"] = \Jinove\Vinoteca\Catalog\BrandSchema::list($schemaItems, (string)$GLOBALS["APPLICATION"]->GetTitle(false), (string)$GLOBALS["APPLICATION"]->GetPageProperty("description"));
|
||||
|
||||
$letters = [];
|
||||
$countries = [];
|
||||
foreach ($arResult["ITEMS"] as $index => $item) {
|
||||
$first = mb_strtoupper(mb_substr(trim((string)$item["~NAME"]), 0, 1));
|
||||
$letter = preg_match('/^\p{L}$/u', $first) ? $first : "0-9";
|
||||
$country = trim((string)($item["PROPERTIES"]["COUNTRY"]["~VALUE"] ?? ""));
|
||||
$arResult["ITEMS"][$index]["VINO_LETTER"] = $letter;
|
||||
$arResult["ITEMS"][$index]["VINO_COUNTRY"] = $country;
|
||||
$letters[$letter] = true;
|
||||
if ($country !== "") {
|
||||
$countries[$country] = ($countries[$country] ?? 0) + 1;
|
||||
}
|
||||
}
|
||||
ksort($letters);
|
||||
ksort($countries);
|
||||
$arResult["VINO_LETTERS"] = array_keys($letters);
|
||||
$arResult["VINO_COUNTRIES"] = $countries;
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
(function () {
|
||||
function init() {
|
||||
var root = document.querySelector('[data-brands-filter]');
|
||||
var grid = document.querySelector('[data-brands-grid]');
|
||||
if (!root || !grid) return;
|
||||
var items = [].slice.call(grid.querySelectorAll('[data-brand-letter]'));
|
||||
var countries = [].slice.call(root.querySelectorAll('[data-filter-country]'));
|
||||
var letters = [].slice.call(root.querySelectorAll('[data-filter-letter]'));
|
||||
var found = root.querySelector('[data-brands-found]');
|
||||
var empty = document.querySelector('[data-brands-empty]');
|
||||
var more = document.querySelector('[data-brands-more]');
|
||||
var mobile = window.matchMedia('(max-width: 760px)');
|
||||
var step = 8;
|
||||
var state = { country: '', letter: '', limit: step };
|
||||
|
||||
function matches(item, country, letter) {
|
||||
return (!country || item.getAttribute('data-brand-country') === country) && (!letter || item.getAttribute('data-brand-letter') === letter);
|
||||
}
|
||||
|
||||
function count(country, letter) {
|
||||
return items.filter(function (item) { return matches(item, country, letter); }).length;
|
||||
}
|
||||
|
||||
function render() {
|
||||
var matched = items.filter(function (item) { return matches(item, state.country, state.letter); });
|
||||
var shown = matched.length;
|
||||
var limit = mobile.matches ? state.limit : shown;
|
||||
items.forEach(function (item) {
|
||||
var index = matched.indexOf(item);
|
||||
item.hidden = index < 0 || index >= limit;
|
||||
});
|
||||
more.hidden = shown <= limit;
|
||||
countries.forEach(function (button) {
|
||||
var value = button.getAttribute('data-filter-country');
|
||||
var active = value === state.country;
|
||||
button.classList.toggle('vino-brands__chip--active', active);
|
||||
button.setAttribute('aria-pressed', active ? 'true' : 'false');
|
||||
button.disabled = !active && count(value, state.letter) === 0;
|
||||
});
|
||||
letters.forEach(function (button) {
|
||||
var value = button.getAttribute('data-filter-letter');
|
||||
var active = value === state.letter;
|
||||
button.classList.toggle('vino-brands__letter--active', active);
|
||||
button.setAttribute('aria-pressed', active ? 'true' : 'false');
|
||||
button.disabled = !active && count(state.country, value) === 0;
|
||||
});
|
||||
found.textContent = (state.country || state.letter) ? found.getAttribute('data-template').replace('#COUNT#', String(shown)) : '';
|
||||
empty.hidden = shown !== 0;
|
||||
}
|
||||
|
||||
countries.forEach(function (button) {
|
||||
button.addEventListener('click', function () {
|
||||
state.country = button.getAttribute('data-filter-country');
|
||||
state.limit = step;
|
||||
render();
|
||||
});
|
||||
});
|
||||
letters.forEach(function (button) {
|
||||
button.addEventListener('click', function () {
|
||||
var value = button.getAttribute('data-filter-letter');
|
||||
state.letter = state.letter === value ? '' : value;
|
||||
state.limit = step;
|
||||
render();
|
||||
});
|
||||
});
|
||||
more.addEventListener('click', function () {
|
||||
var from = state.limit;
|
||||
state.limit += step;
|
||||
render();
|
||||
var next = items.filter(function (item) { return matches(item, state.country, state.letter); })[from];
|
||||
if (next) next.focus({ preventScroll: true });
|
||||
});
|
||||
mobile.addEventListener('change', render);
|
||||
render();
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', init);
|
||||
} else {
|
||||
init();
|
||||
}
|
||||
})();
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
.vino-brands__filter {
|
||||
display: grid;
|
||||
gap: var(--space-4);
|
||||
margin: 0 0 var(--space-8);
|
||||
}
|
||||
.vino-brands__chips,
|
||||
.vino-brands__letters {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
.vino-brands__chip,
|
||||
.vino-brands__letter {
|
||||
min-height: 44px;
|
||||
padding: 0 var(--space-4);
|
||||
border: 1px solid var(--color-line);
|
||||
border-radius: var(--radius-sm);
|
||||
background: transparent;
|
||||
color: var(--color-text-muted);
|
||||
font: inherit;
|
||||
font-size: var(--text-15);
|
||||
cursor: pointer;
|
||||
transition: color var(--duration-fast) var(--ease-base), border-color var(--duration-fast) var(--ease-base), background-color var(--duration-fast) var(--ease-base), transform var(--duration-fast) var(--ease-base);
|
||||
}
|
||||
.vino-brands__letter {
|
||||
min-width: 44px;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
}
|
||||
.vino-brands__chip--active,
|
||||
.vino-brands__letter--active {
|
||||
border-color: var(--color-accent);
|
||||
background: var(--color-accent);
|
||||
color: var(--color-bg);
|
||||
}
|
||||
.vino-brands__chip:disabled,
|
||||
.vino-brands__letter:disabled {
|
||||
opacity: .35;
|
||||
cursor: default;
|
||||
}
|
||||
.vino-brands__chip:active:not(:disabled),
|
||||
.vino-brands__letter:active:not(:disabled) {
|
||||
transform: scale(.97);
|
||||
}
|
||||
.vino-brands__chip:focus-visible,
|
||||
.vino-brands__letter:focus-visible {
|
||||
outline: 2px solid var(--color-accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
.vino-brands__count {
|
||||
margin-left: var(--space-1);
|
||||
opacity: .7;
|
||||
}
|
||||
.vino-brands__found {
|
||||
margin: 0;
|
||||
min-height: calc(1em * var(--leading-ui));
|
||||
color: var(--color-text-muted);
|
||||
font-size: var(--text-15);
|
||||
line-height: var(--leading-ui);
|
||||
}
|
||||
.vino-brands__item[hidden],
|
||||
.vino-brands__empty[hidden] {
|
||||
display: none;
|
||||
}
|
||||
.vino-brands__empty {
|
||||
margin: var(--space-8) 0;
|
||||
color: var(--color-text-muted);
|
||||
font-size: var(--text-base);
|
||||
}
|
||||
@media (hover: hover) {
|
||||
.vino-brands__chip:hover:not(:disabled):not(.vino-brands__chip--active),
|
||||
.vino-brands__letter:hover:not(:disabled):not(.vino-brands__letter--active) {
|
||||
border-color: var(--color-accent);
|
||||
color: var(--color-text);
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
use Bitrix\Main\Localization\Loc;
|
||||
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
Loc::loadMessages(__FILE__);
|
||||
if (empty($arResult["ITEMS"])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$editLink = CIBlock::GetArrayByID($arResult["ID"], "ELEMENT_EDIT");
|
||||
$deleteLink = CIBlock::GetArrayByID($arResult["ID"], "ELEMENT_DELETE");
|
||||
?>
|
||||
<script type="application/ld+json"><?= json_encode($arResult["VINO_SCHEMA"], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP) ?></script>
|
||||
<section class="vino-section vino-brands">
|
||||
<div class="vino-wrap">
|
||||
<div>
|
||||
<div class="vino-brands__filter" data-brands-filter>
|
||||
<div class="vino-brands__chips" role="group" aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_BRANDS_FILTER_COUNTRY")) ?>">
|
||||
<button class="vino-brands__chip vino-brands__chip--active" type="button" data-filter-country="" aria-pressed="true"><?= Loc::getMessage("VINO_BRANDS_FILTER_ALL") ?></button>
|
||||
<?php foreach ($arResult["VINO_COUNTRIES"] as $country => $count): ?>
|
||||
<button class="vino-brands__chip" type="button" data-filter-country="<?= htmlspecialcharsbx($country) ?>" aria-pressed="false"><?= htmlspecialcharsbx($country) ?> <span class="vino-brands__count"><?= (int)$count ?></span></button>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<div class="vino-brands__letters" role="group" aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_BRANDS_FILTER_LETTER")) ?>">
|
||||
<?php foreach ($arResult["VINO_LETTERS"] as $letter): ?>
|
||||
<button class="vino-brands__letter" type="button" data-filter-letter="<?= htmlspecialcharsbx($letter) ?>" aria-pressed="false"><?= htmlspecialcharsbx($letter) ?></button>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<p class="vino-brands__found" role="status" aria-live="polite" data-brands-found data-template="<?= htmlspecialcharsbx(Loc::getMessage("VINO_BRANDS_FOUND")) ?>"></p>
|
||||
</div>
|
||||
<div class="vino-brands__grid" data-brands-grid>
|
||||
<?php foreach ($arResult["ITEMS"] as $index => $item):
|
||||
$this->AddEditAction($item["ID"], $item["EDIT_LINK"], $editLink);
|
||||
$this->AddDeleteAction($item["ID"], $item["DELETE_LINK"], $deleteLink);
|
||||
$place = implode(" · ", array_filter(array($item["PROPERTIES"]["COUNTRY"]["~VALUE"] ?? "", $item["PROPERTIES"]["REGION"]["~VALUE"] ?? "")));
|
||||
?>
|
||||
<a class="vino-brands__item<?= !empty($item["PREVIEW_PICTURE"]["SRC"]) ? " vino-brands__item--logo" : "" ?>" data-brand-letter="<?= htmlspecialcharsbx($item["VINO_LETTER"]) ?>" data-brand-country="<?= htmlspecialcharsbx($item["VINO_COUNTRY"]) ?>" id="<?= $this->GetEditAreaId($item["ID"]) ?>" href="<?= htmlspecialcharsbx($item["DETAIL_PAGE_URL"]) ?>"><?php if (!empty($item["PREVIEW_PICTURE"]["SRC"])): ?><img class="vino-brands__logo" src="<?= $item["PREVIEW_PICTURE"]["SRC"] ?>" width="<?= (int)$item["PREVIEW_PICTURE"]["WIDTH"] ?>" height="<?= (int)$item["PREVIEW_PICTURE"]["HEIGHT"] ?>" alt="" loading="<?= $index < 4 ? "eager" : "lazy" ?>" decoding="async"><?php endif; ?><strong class="vino-brands__name"><?= htmlspecialcharsbx($item["~NAME"]) ?></strong><span class="vino-brands__meta"><?= htmlspecialcharsbx($place) ?></span></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<button class="vino-btn vino-btn--outline vino-brands__more" type="button" data-brands-more hidden><?= Loc::getMessage("VINO_BRANDS_MORE") ?></button>
|
||||
<p class="vino-brands__empty" data-brands-empty hidden><?= Loc::getMessage("VINO_BRANDS_EMPTY") ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
use Bitrix\Main\Localization\Loc;
|
||||
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
?>
|
||||
<section class="vino-razdel-hero">
|
||||
<div class="vino-wrap">
|
||||
<?php \Jinove\Vinoteca\Breadcrumbs::show(array(array(Loc::getMessage("VINO_BRANDS_H1"), $arResult["FOLDER"]))); ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php
|
||||
$brandId = $APPLICATION->IncludeComponent("bitrix:news.detail", "", array(
|
||||
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
|
||||
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
|
||||
"ELEMENT_ID" => $arResult["VARIABLES"]["ELEMENT_ID"] ?? "",
|
||||
"ELEMENT_CODE" => $arResult["VARIABLES"]["ELEMENT_CODE"] ?? "",
|
||||
"FIELD_CODE" => $arParams["DETAIL_FIELD_CODE"],
|
||||
"PROPERTY_CODE" => $arParams["DETAIL_PROPERTY_CODE"],
|
||||
"DETAIL_URL" => $arResult["FOLDER"] . $arResult["URL_TEMPLATES"]["detail"],
|
||||
"CHECK_DATES" => $arParams["CHECK_DATES"],
|
||||
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
|
||||
"CACHE_TIME" => $arParams["CACHE_TIME"],
|
||||
"CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
|
||||
"SET_TITLE" => "Y",
|
||||
"SET_BROWSER_TITLE" => "N",
|
||||
"SET_META_KEYWORDS" => "N",
|
||||
"SET_META_DESCRIPTION" => "N",
|
||||
"SET_LAST_MODIFIED" => "N",
|
||||
"INCLUDE_IBLOCK_INTO_CHAIN" => "N",
|
||||
"ADD_SECTIONS_CHAIN" => "N",
|
||||
"ADD_ELEMENT_CHAIN" => "Y",
|
||||
"SET_CANONICAL_URL" => "N",
|
||||
"SET_STATUS_404" => $arParams["SET_STATUS_404"],
|
||||
"SHOW_404" => $arParams["SHOW_404"],
|
||||
"FILE_404" => $arParams["FILE_404"],
|
||||
"MESSAGE_404" => $arParams["MESSAGE_404"],
|
||||
"USE_PERMISSIONS" => "N",
|
||||
"DISPLAY_TOP_PAGER" => "N",
|
||||
"DISPLAY_BOTTOM_PAGER" => "N",
|
||||
), $component);
|
||||
if (!$brandId) {
|
||||
return;
|
||||
}
|
||||
$brandName = $APPLICATION->GetTitle(false);
|
||||
$APPLICATION->SetPageProperty("title", Loc::getMessage("VINO_BRAND_META_TITLE", array("#NAME#" => htmlspecialcharsbx($brandName))));
|
||||
$GLOBALS["brandFilter"] = array("PROPERTY_BRAND" => (int)$brandId);
|
||||
?>
|
||||
<?php \Bitrix\Main\Page\Asset::getInstance()->addJs(SITE_TEMPLATE_PATH . "/assets/js/vino-slider.js"); ?>
|
||||
<section class="vino-razdel-sec vino-brand-wines">
|
||||
<div class="vino-wrap">
|
||||
<div class="vino-brand-wines__head">
|
||||
<h2 class="vino-brand-wines__title"><?= Loc::getMessage("VINO_BRAND_WINES", array("#NAME#" => htmlspecialcharsbx($brandName))) ?></h2>
|
||||
<div class="vino-slider__nav">
|
||||
<button type="button" class="vino-arrow" data-slider-prev="brand-wines" aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_BRAND_PREV")) ?>"><svg class="vino-arrow__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 6l-6 6 6 6"></path></svg></button>
|
||||
<button type="button" class="vino-arrow" data-slider-next="brand-wines" aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_BRAND_NEXT")) ?>"><svg class="vino-arrow__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"></path></svg></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="vino-slider__viewport" data-slider="brand-wines">
|
||||
<div class="vino-slider__track">
|
||||
<?php $APPLICATION->IncludeComponent("bitrix:catalog.top", "vinoteca-row", array(
|
||||
"IBLOCK_TYPE" => "catalog",
|
||||
"IBLOCK_ID" => VINO_CATALOG_IBLOCK,
|
||||
"ELEMENT_COUNT" => "24",
|
||||
"ELEMENT_SORT_FIELD" => "SORT",
|
||||
"ELEMENT_SORT_ORDER" => "ASC",
|
||||
"ELEMENT_SORT_FIELD2" => "ID",
|
||||
"ELEMENT_SORT_ORDER2" => "DESC",
|
||||
"FILTER_NAME" => "brandFilter",
|
||||
"PROPERTY_CODE" => array("WINE_COLOR", "SUGAR", "VOLUME", "REGION", "COUNTRY"),
|
||||
"PRICE_CODE" => array("BASE"),
|
||||
"PRICE_VAT_INCLUDE" => "Y",
|
||||
"CONVERT_CURRENCY" => "N",
|
||||
"HIDE_NOT_AVAILABLE" => "N",
|
||||
"DETAIL_URL" => SITE_DIR . "catalog/#SECTION_CODE#/#ELEMENT_CODE#/",
|
||||
"SECTION_URL" => SITE_DIR . "catalog/#SECTION_CODE#/",
|
||||
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
|
||||
"CACHE_TIME" => "3600",
|
||||
"CACHE_GROUPS" => "Y",
|
||||
"CACHE_FILTER" => "Y",
|
||||
), $component); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="vino-progress" data-slider-progress="brand-wines"><span class="vino-progress__bar"></span></div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
$MESS["VINO_BRANDS_H1"] = "Brands";
|
||||
$MESS["VINO_BRAND_META_TITLE"] = "#NAME# wines | Vinoteca";
|
||||
$MESS["VINO_BRAND_WINES"] = "#NAME# wines";
|
||||
$MESS["VINO_BRAND_PAGER_TITLE"] = "Wines";
|
||||
$MESS["VINO_BRAND_PREV"] = "Previous";
|
||||
$MESS["VINO_BRAND_NEXT"] = "Next";
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
$MESS["VINO_BRANDS_H1"] = "Brands";
|
||||
$MESS["VINO_BRANDS_HEADING"] = "Wine brands";
|
||||
$MESS["VINO_BRANDS_DESCRIPTION"] = "Wineries and houses from the Vinoteca catalogue: each brand has its own region, description and wines. Filter by country and first letter.";
|
||||
$MESS["VINO_BRANDS_PAGE_TITLE"] = "Wine brands and producers | Vinoteca";
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
$MESS["VINO_BRANDS_H1"] = "Marki";
|
||||
$MESS["VINO_BRAND_META_TITLE"] = "Wina #NAME# | Vinoteca";
|
||||
$MESS["VINO_BRAND_WINES"] = "Wina #NAME#";
|
||||
$MESS["VINO_BRAND_PAGER_TITLE"] = "Wina";
|
||||
$MESS["VINO_BRAND_PREV"] = "Wstecz";
|
||||
$MESS["VINO_BRAND_NEXT"] = "Dalej";
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
$MESS["VINO_BRANDS_H1"] = "Marki";
|
||||
$MESS["VINO_BRANDS_HEADING"] = "Marki wina";
|
||||
$MESS["VINO_BRANDS_DESCRIPTION"] = "Winnice i domy z katalogu Vinoteca: każda marka ma własny region, opis i wina. Filtr według kraju i pierwszej litery nazwy.";
|
||||
$MESS["VINO_BRANDS_PAGE_TITLE"] = "Marki i producenci wina | Vinoteca";
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
$MESS["VINO_BRANDS_H1"] = "Бренды";
|
||||
$MESS["VINO_BRAND_META_TITLE"] = "#NAME#: вина бренда | Vinoteca";
|
||||
$MESS["VINO_BRAND_WINES"] = "Вина #NAME#";
|
||||
$MESS["VINO_BRAND_PAGER_TITLE"] = "Вина";
|
||||
$MESS["VINO_BRAND_PREV"] = "Назад";
|
||||
$MESS["VINO_BRAND_NEXT"] = "Вперёд";
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
$MESS["VINO_BRANDS_H1"] = "Бренды";
|
||||
$MESS["VINO_BRANDS_HEADING"] = "Бренды вина";
|
||||
$MESS["VINO_BRANDS_DESCRIPTION"] = "Винодельни и дома из каталога Vinoteca: у каждого бренда свой регион, описание и вина. Фильтр по стране и первой букве названия.";
|
||||
$MESS["VINO_BRANDS_PAGE_TITLE"] = "Бренды и производители вина | Vinoteca";
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
use Bitrix\Main\Localization\Loc;
|
||||
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
|
||||
if ((int)($_GET["PAGEN_1"] ?? 0) > 1) {
|
||||
\Bitrix\Iblock\Component\Tools::process404("", true, true, true);
|
||||
}
|
||||
$APPLICATION->SetTitle(Loc::getMessage("VINO_BRANDS_H1"));
|
||||
$APPLICATION->SetPageProperty("title", Loc::getMessage("VINO_BRANDS_PAGE_TITLE"));
|
||||
$APPLICATION->SetPageProperty("description", Loc::getMessage("VINO_BRANDS_DESCRIPTION"));
|
||||
?>
|
||||
<section class="vino-razdel-hero">
|
||||
<div class="vino-wrap">
|
||||
<?php \Jinove\Vinoteca\Breadcrumbs::show(array(array(Loc::getMessage("VINO_BRANDS_H1")))); ?>
|
||||
<h1 class="vino-razdel-hero__title"><?= Loc::getMessage("VINO_BRANDS_HEADING") ?></h1>
|
||||
</div>
|
||||
</section>
|
||||
<?php $APPLICATION->IncludeComponent("bitrix:news.list", "", array(
|
||||
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
|
||||
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
|
||||
"NEWS_COUNT" => $arParams["NEWS_COUNT"],
|
||||
"SORT_BY1" => $arParams["SORT_BY1"],
|
||||
"SORT_ORDER1" => $arParams["SORT_ORDER1"],
|
||||
"SORT_BY2" => $arParams["SORT_BY2"],
|
||||
"SORT_ORDER2" => $arParams["SORT_ORDER2"],
|
||||
"FIELD_CODE" => $arParams["LIST_FIELD_CODE"],
|
||||
"PROPERTY_CODE" => $arParams["LIST_PROPERTY_CODE"],
|
||||
"DETAIL_URL" => $arResult["FOLDER"] . $arResult["URL_TEMPLATES"]["detail"],
|
||||
"CHECK_DATES" => $arParams["CHECK_DATES"],
|
||||
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
|
||||
"CACHE_TIME" => $arParams["CACHE_TIME"],
|
||||
"CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
|
||||
"SET_TITLE" => "N",
|
||||
"SET_BROWSER_TITLE" => "N",
|
||||
"SET_META_KEYWORDS" => "N",
|
||||
"SET_META_DESCRIPTION" => "N",
|
||||
"SET_LAST_MODIFIED" => "N",
|
||||
"SET_STATUS_404" => "N",
|
||||
"INCLUDE_IBLOCK_INTO_CHAIN" => "N",
|
||||
"ADD_SECTIONS_CHAIN" => "N",
|
||||
"DISPLAY_TOP_PAGER" => "N",
|
||||
"DISPLAY_BOTTOM_PAGER" => "N",
|
||||
), $component); ?>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
|
||||
if (!empty($arResult["VINO_DESCRIPTION"])) {
|
||||
$GLOBALS["APPLICATION"]->SetPageProperty("description", $arResult["VINO_DESCRIPTION"]);
|
||||
}
|
||||
if (!empty($arResult["VINO_TITLE"])) {
|
||||
$GLOBALS["APPLICATION"]->SetTitle($arResult["VINO_TITLE"]);
|
||||
$GLOBALS["APPLICATION"]->SetPageProperty("title", $arResult["VINO_TITLE"]);
|
||||
$GLOBALS["APPLICATION"]->AddChainItem($arResult["VINO_TITLE"], $arResult["DETAIL_PAGE_URL"]);
|
||||
}
|
||||
$GLOBALS["APPLICATION"]->SetPageProperty("og_type", "article");
|
||||
if (!empty($arResult["VINO_OG_IMAGE"])) {
|
||||
$GLOBALS["APPLICATION"]->SetPageProperty("og_image", $arResult["VINO_OG_IMAGE"]);
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
|
||||
$arResult = \Jinove\Vinoteca\News::card($arResult, array(480, 800, 1200));
|
||||
$picture = $arResult["VINO_PICTURE"];
|
||||
$arResult["VINO_DESCRIPTION"] = \Jinove\Vinoteca\Seo::description(trim((string)preg_replace('/\s+/u', " ", strip_tags((string)$arResult["~PREVIEW_TEXT"]))), 160);
|
||||
$arResult["VINO_OG_IMAGE"] = "";
|
||||
if ($picture) {
|
||||
$og = CFile::ResizeImageGet($picture["ID"], array("width" => 1200, "height" => 630), BX_RESIZE_IMAGE_EXACT, false);
|
||||
$arResult["VINO_OG_IMAGE"] = !empty($og["src"]) ? VINO_HOST . $og["src"] : "";
|
||||
}
|
||||
$published = $arResult["VINO_TIMESTAMP"];
|
||||
$modified = $arResult["TIMESTAMP_X"] ? \Bitrix\Main\Type\DateTime::createFromUserTime((string)$arResult["TIMESTAMP_X"])->getTimestamp() : 0;
|
||||
$arResult["VINO_SCHEMA"] = \Jinove\Vinoteca\ArticleSchema::detail(array(
|
||||
"path" => (string)$arResult["DETAIL_PAGE_URL"],
|
||||
"name" => (string)$arResult["~NAME"],
|
||||
"description" => $arResult["VINO_DESCRIPTION"],
|
||||
"published" => $published ? date(DATE_ATOM, $published) : "",
|
||||
"modified" => date(DATE_ATOM, max($modified, $published)),
|
||||
"words" => count(preg_split('/\s+/u', trim(strip_tags((string)$arResult["~DETAIL_TEXT"])), -1, PREG_SPLIT_NO_EMPTY)),
|
||||
"image" => $picture ? array("url" => VINO_HOST . $picture["SRC"], "width" => $picture["WIDTH"], "height" => $picture["HEIGHT"]) : array(),
|
||||
));
|
||||
$arResult["VINO_TITLE"] = (string)$arResult["~NAME"];
|
||||
$this->getComponent()->setResultCacheKeys(array("VINO_DESCRIPTION", "VINO_OG_IMAGE", "VINO_TITLE", "DETAIL_PAGE_URL"));
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
.vino-article {
|
||||
--vino-article-measure: 46rem;
|
||||
--vino-article-h2-size: clamp(1.375rem, 2.2vw, 1.75rem);
|
||||
--vino-article-media-ratio: 16 / 9;
|
||||
padding: var(--space-12) var(--gutter) var(--space-16);
|
||||
}
|
||||
.vino-article__head {
|
||||
max-width: var(--vino-article-measure);
|
||||
margin: 0 0 var(--space-10);
|
||||
}
|
||||
.vino-article__date {
|
||||
display: block;
|
||||
margin-bottom: var(--space-4);
|
||||
color: var(--color-text-faint);
|
||||
font-size: var(--text-13);
|
||||
letter-spacing: var(--tracking-ui);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.vino-article__title {
|
||||
margin: 0;
|
||||
color: var(--color-text);
|
||||
font-family: var(--font-serif);
|
||||
font-size: var(--fs-h2);
|
||||
font-weight: 400;
|
||||
line-height: var(--leading-tight);
|
||||
letter-spacing: var(--tracking-tight);
|
||||
}
|
||||
.vino-article__lead {
|
||||
margin: var(--space-6) 0 0;
|
||||
color: var(--color-text-muted);
|
||||
font-size: var(--text-19);
|
||||
line-height: var(--leading-text);
|
||||
}
|
||||
.vino-article__media {
|
||||
max-width: var(--vino-article-measure);
|
||||
margin: 0 0 var(--space-12);
|
||||
aspect-ratio: var(--vino-article-media-ratio);
|
||||
overflow: hidden;
|
||||
}
|
||||
.vino-article__img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
object-position: 50% 10%;
|
||||
}
|
||||
.vino-article__body {
|
||||
max-width: var(--vino-article-measure);
|
||||
margin: 0;
|
||||
color: color-mix(in srgb, var(--color-white) 82%, transparent);
|
||||
font-size: var(--text-17);
|
||||
line-height: var(--leading-long);
|
||||
}
|
||||
.vino-article__body p, .vino-article__body ul, .vino-article__body ol {
|
||||
margin: 0 0 var(--space-5);
|
||||
}
|
||||
.vino-article__body ul, .vino-article__body ol {
|
||||
padding-left: var(--space-6);
|
||||
}
|
||||
.vino-article__body li + li {
|
||||
margin-top: var(--space-2);
|
||||
}
|
||||
.vino-article__body h2 {
|
||||
margin: var(--space-10) 0 var(--space-4);
|
||||
color: var(--color-text);
|
||||
font-family: var(--font-serif);
|
||||
font-size: var(--vino-article-h2-size);
|
||||
font-weight: 400;
|
||||
line-height: var(--leading-title);
|
||||
}
|
||||
.vino-article__body a {
|
||||
color: var(--color-accent);
|
||||
text-decoration: underline;
|
||||
text-decoration-color: color-mix(in srgb, var(--color-accent) 45%, transparent);
|
||||
text-underline-offset: 3px;
|
||||
}
|
||||
.vino-article__body > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
@media (hover:hover) {
|
||||
.vino-article__body a:hover {
|
||||
text-decoration-color: var(--color-accent);
|
||||
}
|
||||
}
|
||||
@media (max-width:760px) {
|
||||
.vino-article {
|
||||
--vino-article-media-ratio: 4 / 3;
|
||||
padding-bottom: var(--space-12);
|
||||
}
|
||||
.vino-article__head {
|
||||
margin-bottom: var(--space-6);
|
||||
}
|
||||
.vino-article__lead {
|
||||
font-size: var(--text-17);
|
||||
}
|
||||
.vino-article__media {
|
||||
margin-bottom: var(--space-8);
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
|
||||
$this->AddEditAction($arResult["ID"], $arResult["EDIT_LINK"], CIBlock::GetArrayByID($arResult["IBLOCK_ID"], "ELEMENT_EDIT"));
|
||||
$picture = $arResult["VINO_PICTURE"];
|
||||
?>
|
||||
<script type="application/ld+json"><?= json_encode($arResult["VINO_SCHEMA"], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP) ?></script>
|
||||
<article class="vino-article" id="<?= $this->GetEditAreaId($arResult["ID"]) ?>">
|
||||
<div class="vino-wrap">
|
||||
<header class="vino-article__head">
|
||||
<?php if ($arResult["VINO_DATE"]): ?><time class="vino-article__date" datetime="<?= $arResult["VINO_DATE"]["ISO"] ?>"><?= $arResult["VINO_DATE"]["TEXT"] ?></time><?php endif; ?>
|
||||
<h1 class="vino-article__title"><?= htmlspecialcharsbx($arResult["~NAME"]) ?></h1>
|
||||
<?php if ((string)$arResult["~PREVIEW_TEXT"] !== ""): ?><p class="vino-article__lead"><?= htmlspecialcharsbx($arResult["~PREVIEW_TEXT"]) ?></p><?php endif; ?>
|
||||
</header>
|
||||
<?php if ($picture): ?>
|
||||
<figure class="vino-article__media">
|
||||
<img class="vino-article__img" src="<?= $picture["SRC"] ?>" srcset="<?= $picture["SRCSET"] ?>" sizes="(max-width: 760px) calc((100vw - 32px) * 1.34), min(100vw, 1280px)" width="<?= $picture["WIDTH"] ?>" height="<?= $picture["HEIGHT"] ?>" alt="<?= htmlspecialcharsbx($picture["ALT"]) ?>" decoding="async" fetchpriority="high">
|
||||
</figure>
|
||||
<?php endif; ?>
|
||||
<div class="vino-article__body"><?= $arResult["~DETAIL_TEXT"] ?></div>
|
||||
</div>
|
||||
</article>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
use Bitrix\Main\Localization\Loc;
|
||||
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
?>
|
||||
<section class="vino-razdel-hero">
|
||||
<div class="vino-wrap">
|
||||
<?php \Jinove\Vinoteca\Breadcrumbs::show(array(array(Loc::getMessage("VINO_NEWS_H1"), $arResult["FOLDER"]))); ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php
|
||||
$newsId = $APPLICATION->IncludeComponent("bitrix:news.detail", "", array(
|
||||
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
|
||||
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
|
||||
"ELEMENT_ID" => $arResult["VARIABLES"]["ELEMENT_ID"] ?? "",
|
||||
"ELEMENT_CODE" => $arResult["VARIABLES"]["ELEMENT_CODE"] ?? "",
|
||||
"FIELD_CODE" => $arParams["DETAIL_FIELD_CODE"],
|
||||
"PROPERTY_CODE" => $arParams["DETAIL_PROPERTY_CODE"],
|
||||
"DETAIL_URL" => $arResult["FOLDER"] . $arResult["URL_TEMPLATES"]["detail"],
|
||||
"CHECK_DATES" => $arParams["CHECK_DATES"],
|
||||
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
|
||||
"CACHE_TIME" => $arParams["CACHE_TIME"],
|
||||
"CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
|
||||
"SET_TITLE" => "N",
|
||||
"SET_BROWSER_TITLE" => "N",
|
||||
"SET_META_KEYWORDS" => "N",
|
||||
"SET_META_DESCRIPTION" => "N",
|
||||
"SET_LAST_MODIFIED" => "N",
|
||||
"INCLUDE_IBLOCK_INTO_CHAIN" => "N",
|
||||
"ADD_SECTIONS_CHAIN" => "N",
|
||||
"ADD_ELEMENT_CHAIN" => "N",
|
||||
"SET_CANONICAL_URL" => "N",
|
||||
"SET_STATUS_404" => $arParams["SET_STATUS_404"],
|
||||
"SHOW_404" => $arParams["SHOW_404"],
|
||||
"FILE_404" => $arParams["FILE_404"],
|
||||
"MESSAGE_404" => $arParams["MESSAGE_404"],
|
||||
"USE_PERMISSIONS" => "N",
|
||||
"DISPLAY_TOP_PAGER" => "N",
|
||||
"DISPLAY_BOTTOM_PAGER" => "N",
|
||||
), $component);
|
||||
if (!$newsId) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<section class="vino-section vino-news">
|
||||
<div class="vino-wrap vino-section__inner">
|
||||
<div class="vino-section__head">
|
||||
<h2 class="vino-section__title"><?= Loc::getMessage("VINO_NEWS_OTHER") ?></h2>
|
||||
<a class="vino-section__all vino-section__link" href="<?= $arResult["FOLDER"] ?>"><?= Loc::getMessage("VINO_NEWS_ALL") ?> <svg class="vino-section__link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"></path><path d="m12 5 7 7-7 7"></path></svg></a>
|
||||
</div>
|
||||
<div class="vino-section__body">
|
||||
<?php $APPLICATION->IncludeComponent("bitrix:news.list", "vinoteca-news", \Jinove\Vinoteca\News::otherParams((int)$newsId), $component); ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
$MESS["VINO_NEWS_H1"] = "Articles";
|
||||
$MESS["VINO_NEWS_OTHER"] = "More articles";
|
||||
$MESS["VINO_NEWS_ALL"] = "All articles";
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
$MESS["VINO_NEWS_H1"] = "Articles";
|
||||
$MESS["VINO_NEWS_HEADING"] = "Articles about wine";
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
$MESS["VINO_NEWS_H1"] = "Artykuły";
|
||||
$MESS["VINO_NEWS_OTHER"] = "Inne artykuły";
|
||||
$MESS["VINO_NEWS_ALL"] = "Wszystkie artykuły";
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
$MESS["VINO_NEWS_H1"] = "Artykuły";
|
||||
$MESS["VINO_NEWS_HEADING"] = "Artykuły o winie";
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
$MESS["VINO_NEWS_H1"] = "Статьи";
|
||||
$MESS["VINO_NEWS_OTHER"] = "Другие статьи";
|
||||
$MESS["VINO_NEWS_ALL"] = "Все статьи";
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
$MESS["VINO_NEWS_H1"] = "Статьи";
|
||||
$MESS["VINO_NEWS_HEADING"] = "Статьи о вине";
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
use Bitrix\Main\Localization\Loc;
|
||||
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
|
||||
$requested = \Bitrix\Main\Context::getCurrent()->getRequest()->getQuery("PAGEN_1");
|
||||
$page = 1;
|
||||
if ($requested !== null) {
|
||||
if ($requested === "1") {
|
||||
LocalRedirect(VINO_HOST . \Jinove\Vinoteca\News::folder(), true, "301 Moved Permanently");
|
||||
}
|
||||
if (!is_string($requested) || !ctype_digit($requested) || (int)$requested < 2 || (int)$requested > \Jinove\Vinoteca\News::pageCount()) {
|
||||
\Bitrix\Iblock\Component\Tools::process404("", true, true, true);
|
||||
|
||||
return;
|
||||
}
|
||||
$page = (int)$requested;
|
||||
}
|
||||
$meta = \Jinove\Vinoteca\News::pageMeta($page);
|
||||
$APPLICATION->SetTitle(Loc::getMessage("VINO_NEWS_HEADING"));
|
||||
$APPLICATION->SetPageProperty("title", $meta["title"]);
|
||||
$APPLICATION->SetPageProperty("description", $meta["description"]);
|
||||
if ($page > 1) {
|
||||
$APPLICATION->SetPageProperty("vino_canonical", $meta["canonical"]);
|
||||
}
|
||||
?>
|
||||
<section class="vino-razdel-hero">
|
||||
<div class="vino-wrap">
|
||||
<?php \Jinove\Vinoteca\Breadcrumbs::show(array(array(Loc::getMessage("VINO_NEWS_H1")))); ?>
|
||||
<h1 class="vino-razdel-hero__title"><?= Loc::getMessage("VINO_NEWS_HEADING") ?></h1>
|
||||
</div>
|
||||
</section>
|
||||
<section class="vino-news-feed">
|
||||
<div class="vino-wrap">
|
||||
<?php $APPLICATION->IncludeComponent("bitrix:news.list", \Jinove\Vinoteca\News::LIST_TEMPLATE, \Jinove\Vinoteca\News::listParams(), $component); ?>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,9 @@
|
||||
.vino-news-feed {
|
||||
--vino-news-feed-title-size: 1.875rem;
|
||||
padding: var(--space-head) var(--gutter) var(--space-16);
|
||||
}
|
||||
@media (max-width:760px) {
|
||||
.vino-news-feed {
|
||||
padding-bottom: var(--space-12);
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
|
||||
if (!empty($arResult["VINO_TITLE"])) {
|
||||
$GLOBALS["APPLICATION"]->SetTitle($arResult["VINO_TITLE"]);
|
||||
$GLOBALS["APPLICATION"]->SetPageProperty("title", $arResult["VINO_TITLE"]);
|
||||
$GLOBALS["APPLICATION"]->AddChainItem($arResult["VINO_TITLE"], $arResult["DETAIL_PAGE_URL"]);
|
||||
}
|
||||
if (!empty($arResult["VINO_DESCRIPTION"])) {
|
||||
$GLOBALS["APPLICATION"]->SetPageProperty("description", $arResult["VINO_DESCRIPTION"]);
|
||||
}
|
||||
if (!empty($arResult["VINO_OG_IMAGE"])) {
|
||||
$GLOBALS["APPLICATION"]->SetPageProperty("og_image", $arResult["VINO_OG_IMAGE"]);
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
$MESS["VINO_OFFER_CODE"] = "Promo code";
|
||||
$MESS["VINO_OFFER_COPY"] = "Copy";
|
||||
$MESS["VINO_OFFER_COPIED"] = "Copied";
|
||||
$MESS["VINO_OFFER_TERMS"] = "Terms";
|
||||
$MESS["VINO_OFFER_GO"] = "View wines";
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
$MESS["VINO_OFFER_CODE"] = "Kod rabatowy";
|
||||
$MESS["VINO_OFFER_COPY"] = "Kopiuj";
|
||||
$MESS["VINO_OFFER_COPIED"] = "Skopiowano";
|
||||
$MESS["VINO_OFFER_TERMS"] = "Warunki";
|
||||
$MESS["VINO_OFFER_GO"] = "Zobacz wina";
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
$MESS["VINO_OFFER_CODE"] = "Промокод";
|
||||
$MESS["VINO_OFFER_COPY"] = "Скопировать";
|
||||
$MESS["VINO_OFFER_COPIED"] = "Скопировано";
|
||||
$MESS["VINO_OFFER_TERMS"] = "Условия";
|
||||
$MESS["VINO_OFFER_GO"] = "Смотреть вина";
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
|
||||
$arResult = \Jinove\Vinoteca\Offers::card($arResult);
|
||||
$arResult["VINO_DESCRIPTION"] = \Jinove\Vinoteca\Seo::description(trim((string)preg_replace('/\s+/u', " ", strip_tags((string)$arResult["~PREVIEW_TEXT"]))), 160);
|
||||
$arResult["VINO_OG_IMAGE"] = "";
|
||||
if ($arResult["VINO_PICTURE"]) {
|
||||
$og = CFile::ResizeImageGet($arResult["VINO_PICTURE"]["ID"], array("width" => 1200, "height" => 630), BX_RESIZE_IMAGE_EXACT, false);
|
||||
$arResult["VINO_OG_IMAGE"] = !empty($og["src"]) ? VINO_HOST . $og["src"] : "";
|
||||
}
|
||||
$picture = $arResult["VINO_PICTURE"];
|
||||
$arResult["VINO_SIZES_FACTOR"] = $picture && $picture["HEIGHT"] > 0 ? round(max(1, ($picture["WIDTH"] / $picture["HEIGHT"]) / (4 / 3)), 2) : 1;
|
||||
$arResult["VINO_SCHEMA"] = \Jinove\Vinoteca\OfferSchema::detail(array(
|
||||
"path" => (string)$arResult["DETAIL_PAGE_URL"],
|
||||
"name" => (string)$arResult["~NAME"],
|
||||
"description" => $arResult["VINO_DESCRIPTION"],
|
||||
"start" => \Jinove\Vinoteca\OfferSchema::date((string)($arResult["ACTIVE_FROM"] ?? "")),
|
||||
"end" => \Jinove\Vinoteca\OfferSchema::date((string)($arResult["DATE_ACTIVE_TO"] ?? $arResult["ACTIVE_TO"] ?? "")),
|
||||
"image" => $picture ? array("url" => VINO_HOST . $picture["SRC"], "width" => $picture["WIDTH"], "height" => $picture["HEIGHT"]) : array(),
|
||||
));
|
||||
$arResult["VINO_TITLE"] = (string)$arResult["~NAME"];
|
||||
$this->getComponent()->setResultCacheKeys(array("VINO_DESCRIPTION", "VINO_OG_IMAGE", "VINO_TITLE", "DETAIL_PAGE_URL"));
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
(function (run) {
|
||||
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run);
|
||||
else run();
|
||||
})(function () {
|
||||
document.addEventListener('click', function (event) {
|
||||
var button = event.target.closest('[data-offer-copy]');
|
||||
if (!button) return;
|
||||
var box = button.parentNode;
|
||||
var code = box.querySelector('.vino-offer__code-value');
|
||||
var status = box.querySelector('[data-offer-status]');
|
||||
var done = function () {
|
||||
clearTimeout(button.vinoTimer);
|
||||
button.textContent = button.getAttribute('data-copied');
|
||||
button.classList.add('vino-offer__copy--done');
|
||||
if (status) status.textContent = button.getAttribute('data-copied');
|
||||
button.vinoTimer = setTimeout(function () {
|
||||
button.textContent = button.getAttribute('data-copy-label');
|
||||
button.classList.remove('vino-offer__copy--done');
|
||||
if (status) status.textContent = '';
|
||||
}, 2000);
|
||||
};
|
||||
var select = function () {
|
||||
if (!code) return;
|
||||
var range = document.createRange();
|
||||
range.selectNodeContents(code);
|
||||
var selection = window.getSelection();
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
};
|
||||
if (!navigator.clipboard) {
|
||||
select();
|
||||
return;
|
||||
}
|
||||
navigator.clipboard.writeText(button.getAttribute('data-offer-copy')).then(done, select);
|
||||
});
|
||||
});
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
.vino-offer {
|
||||
--vino-offer-gap: var(--space-12);
|
||||
padding: var(--space-12) var(--gutter) 0;
|
||||
}
|
||||
.vino-offer__inner {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||
gap: var(--vino-offer-gap);
|
||||
align-items: start;
|
||||
}
|
||||
.vino-offer__media {
|
||||
margin: 0;
|
||||
aspect-ratio: 4 / 3;
|
||||
overflow: hidden;
|
||||
}
|
||||
.vino-offer__img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
.vino-offer__body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: var(--space-5);
|
||||
}
|
||||
.vino-offer__title {
|
||||
margin: 0;
|
||||
font-family: var(--font-serif);
|
||||
font-size: var(--fs-h2);
|
||||
font-weight: 400;
|
||||
line-height: var(--leading-tight);
|
||||
letter-spacing: var(--tracking-tight);
|
||||
}
|
||||
.vino-offer__until {
|
||||
margin: 0;
|
||||
color: var(--color-text-faint);
|
||||
font-size: var(--text-13);
|
||||
letter-spacing: var(--tracking-ui);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.vino-offer__lead {
|
||||
margin: 0;
|
||||
color: var(--color-text-muted);
|
||||
font-size: var(--text-19);
|
||||
line-height: var(--leading-text);
|
||||
}
|
||||
.vino-offer__code {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-3) var(--space-4);
|
||||
padding: var(--space-4) var(--space-5);
|
||||
border: 1px dashed color-mix(in srgb, var(--color-accent) 55%, transparent);
|
||||
}
|
||||
.vino-offer__code-label {
|
||||
color: var(--color-text-faint);
|
||||
font-size: var(--text-13);
|
||||
letter-spacing: var(--tracking-ui);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.vino-offer__code-value {
|
||||
color: var(--color-accent);
|
||||
font-family: var(--font-sans);
|
||||
font-size: var(--text-19);
|
||||
font-weight: 600;
|
||||
letter-spacing: var(--tracking-sm);
|
||||
}
|
||||
.vino-offer__copy {
|
||||
min-height: var(--size-tap);
|
||||
padding: 0 var(--space-4);
|
||||
border: 1px solid var(--color-line);
|
||||
background: transparent;
|
||||
color: var(--color-text);
|
||||
font: inherit;
|
||||
font-size: var(--text-13);
|
||||
letter-spacing: var(--tracking-sm);
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
transition: border-color var(--duration-fast) var(--ease-base), color var(--duration-fast) var(--ease-base);
|
||||
}
|
||||
.vino-offer__copy--done {
|
||||
border-color: var(--color-accent);
|
||||
color: var(--color-accent);
|
||||
}
|
||||
.vino-offer__terms {
|
||||
width: 100%;
|
||||
padding-top: var(--space-5);
|
||||
border-top: 1px solid var(--color-line);
|
||||
}
|
||||
.vino-offer__terms-title {
|
||||
margin: 0 0 var(--space-3);
|
||||
font-family: var(--font-serif);
|
||||
font-size: var(--fs-h4);
|
||||
font-weight: 400;
|
||||
}
|
||||
.vino-offer__terms-text {
|
||||
color: var(--color-text-muted);
|
||||
font-size: var(--text-base);
|
||||
line-height: var(--leading-long);
|
||||
}
|
||||
.vino-offer__terms-text p, .vino-offer__terms-text ul {
|
||||
margin: 0 0 var(--space-3);
|
||||
}
|
||||
.vino-offer__terms-text ul {
|
||||
padding-left: var(--space-5);
|
||||
}
|
||||
.vino-offer__terms-text > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
@media (hover:hover) {
|
||||
.vino-offer__copy:hover {
|
||||
border-color: var(--color-accent);
|
||||
color: var(--color-accent);
|
||||
}
|
||||
}
|
||||
@media (max-width:980px) {
|
||||
.vino-offer {
|
||||
--vino-offer-gap: var(--space-8);
|
||||
}
|
||||
.vino-offer__inner {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
@media (max-width:760px) {
|
||||
.vino-offer {
|
||||
padding-top: var(--space-8);
|
||||
}
|
||||
.vino-offer__lead {
|
||||
font-size: var(--text-base);
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
use Bitrix\Main\Localization\Loc;
|
||||
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
|
||||
$this->AddEditAction($arResult["ID"], $arResult["EDIT_LINK"], CIBlock::GetArrayByID($arResult["IBLOCK_ID"], "ELEMENT_EDIT"));
|
||||
$picture = $arResult["VINO_PICTURE"];
|
||||
$offer = $arResult["VINO_OFFER"];
|
||||
?>
|
||||
<script type="application/ld+json"><?= json_encode($arResult["VINO_SCHEMA"], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP) ?></script>
|
||||
<article class="vino-offer" id="<?= $this->GetEditAreaId($arResult["ID"]) ?>">
|
||||
<div class="vino-wrap vino-offer__inner">
|
||||
<?php if ($picture): ?>
|
||||
<figure class="vino-offer__media">
|
||||
<img class="vino-offer__img" src="<?= $picture["SRC"] ?>" srcset="<?= $picture["SRCSET"] ?>" sizes="(max-width: 980px) calc((100vw - 32px) * <?= $arResult["VINO_SIZES_FACTOR"] ?>), calc(50vw * <?= $arResult["VINO_SIZES_FACTOR"] ?>)" width="<?= $picture["WIDTH"] ?>" height="<?= $picture["HEIGHT"] ?>" alt="<?= htmlspecialcharsbx($picture["ALT"]) ?>" fetchpriority="high" decoding="async">
|
||||
</figure>
|
||||
<?php endif; ?>
|
||||
<div class="vino-offer__body">
|
||||
<?php if ($offer["badge"] !== ""): ?><span class="vino-badge"><?= htmlspecialcharsbx($offer["badge"]) ?></span><?php endif; ?>
|
||||
<h1 class="vino-offer__title"><?= htmlspecialcharsbx($arResult["~NAME"]) ?></h1>
|
||||
<p class="vino-offer__until"><?= htmlspecialcharsbx($arResult["VINO_UNTIL"]) ?></p>
|
||||
<?php if ((string)$arResult["~PREVIEW_TEXT"] !== ""): ?><p class="vino-offer__lead"><?= htmlspecialcharsbx($arResult["~PREVIEW_TEXT"]) ?></p><?php endif; ?>
|
||||
<?php foreach ($offer["coupons"] as $coupon): ?>
|
||||
<div class="vino-offer__code">
|
||||
<span class="vino-offer__code-label"><?= Loc::getMessage("VINO_OFFER_CODE") ?></span>
|
||||
<b class="vino-offer__code-value"><?= htmlspecialcharsbx($coupon) ?></b>
|
||||
<button class="vino-offer__copy" type="button" data-offer-copy="<?= htmlspecialcharsbx($coupon) ?>" data-copy-label="<?= htmlspecialcharsbx((string)Loc::getMessage("VINO_OFFER_COPY")) ?>" data-copied="<?= htmlspecialcharsbx((string)Loc::getMessage("VINO_OFFER_COPIED")) ?>"><?= Loc::getMessage("VINO_OFFER_COPY") ?></button>
|
||||
<span class="vino-sr-only" aria-live="polite" data-offer-status></span>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php if ((string)$arResult["~DETAIL_TEXT"] !== ""): ?>
|
||||
<div class="vino-offer__terms">
|
||||
<h2 class="vino-offer__terms-title"><?= Loc::getMessage("VINO_OFFER_TERMS") ?></h2>
|
||||
<div class="vino-offer__terms-text"><?= $arResult["~DETAIL_TEXT"] ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<a class="vino-btn vino-offer__go" href="#vino-offers-wines"><?= Loc::getMessage("VINO_OFFER_GO") ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
use Bitrix\Main\Localization\Loc;
|
||||
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
\Jinove\Vinoteca\Offers::refresh();
|
||||
?>
|
||||
<section class="vino-razdel-hero">
|
||||
<div class="vino-wrap">
|
||||
<?php \Jinove\Vinoteca\Breadcrumbs::show(array(array(Loc::getMessage("VINO_OFFERS_H1"), $arResult["FOLDER"]))); ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php
|
||||
$offerId = $APPLICATION->IncludeComponent("bitrix:news.detail", "", array(
|
||||
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
|
||||
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
|
||||
"ELEMENT_ID" => $arResult["VARIABLES"]["ELEMENT_ID"] ?? "",
|
||||
"ELEMENT_CODE" => $arResult["VARIABLES"]["ELEMENT_CODE"] ?? "",
|
||||
"FIELD_CODE" => $arParams["DETAIL_FIELD_CODE"],
|
||||
"PROPERTY_CODE" => $arParams["DETAIL_PROPERTY_CODE"],
|
||||
"DETAIL_URL" => $arResult["FOLDER"] . $arResult["URL_TEMPLATES"]["detail"],
|
||||
"CHECK_DATES" => $arParams["CHECK_DATES"],
|
||||
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
|
||||
"CACHE_TIME" => $arParams["CACHE_TIME"],
|
||||
"CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
|
||||
"SET_TITLE" => "N",
|
||||
"SET_BROWSER_TITLE" => "N",
|
||||
"SET_META_KEYWORDS" => "N",
|
||||
"SET_META_DESCRIPTION" => "N",
|
||||
"SET_LAST_MODIFIED" => "N",
|
||||
"INCLUDE_IBLOCK_INTO_CHAIN" => "N",
|
||||
"ADD_SECTIONS_CHAIN" => "N",
|
||||
"ADD_ELEMENT_CHAIN" => "N",
|
||||
"SET_CANONICAL_URL" => "N",
|
||||
"SET_STATUS_404" => $arParams["SET_STATUS_404"],
|
||||
"SHOW_404" => $arParams["SHOW_404"],
|
||||
"FILE_404" => $arParams["FILE_404"],
|
||||
"MESSAGE_404" => $arParams["MESSAGE_404"],
|
||||
"USE_PERMISSIONS" => "N",
|
||||
"DISPLAY_TOP_PAGER" => "N",
|
||||
"DISPLAY_BOTTOM_PAGER" => "N",
|
||||
), $component);
|
||||
if (!$offerId) {
|
||||
return;
|
||||
}
|
||||
$offer = \Jinove\Vinoteca\Offers::summary(\Jinove\Vinoteca\Offers::discountIdsOf((int)$offerId));
|
||||
$offerPath = $arResult["FOLDER"] . $arResult["VARIABLES"]["ELEMENT_CODE"] . "/";
|
||||
?>
|
||||
<section class="vino-razdel-sec vino-offers-wines" id="vino-offers-wines">
|
||||
<div class="vino-wrap">
|
||||
<h2 class="vino-offers-wines__title"><?= Loc::getMessage("VINO_OFFERS_THIS_WINES") ?></h2>
|
||||
<?php if ($offer["active"]): ?>
|
||||
<?php $APPLICATION->IncludeComponent("bitrix:catalog.section", "vinoteca", \Jinove\Vinoteca\Offers::wineParams($offer["products"], $offer["sections"], $offerPath, $offerPath), $component); ?>
|
||||
<?php else: ?>
|
||||
<p class="vino-offers-wines__empty"><?= Loc::getMessage("VINO_OFFERS_ENDED") ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php \Jinove\Vinoteca\Offers::canonical($offerPath); ?>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
$MESS["VINO_OFFERS_H1"] = "Offers";
|
||||
$MESS["VINO_OFFERS_THIS_WINES"] = "Wines in this offer";
|
||||
$MESS["VINO_OFFERS_ENDED"] = "This offer has ended.";
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
$MESS["VINO_OFFERS_H1"] = "Offers";
|
||||
$MESS["VINO_OFFERS_PAGE_TITLE"] = "Wine offers and discounts: promo codes and selections";
|
||||
$MESS["VINO_OFFERS_DESCRIPTION"] = "Current Vinoteca offers: up to 20% off selected wines, a promo code for red wines and single-wine deals. Discounted prices show on the card and in the cart.";
|
||||
$MESS["VINO_OFFERS_LEAD"] = "Discounts are applied in the cart automatically, and promo codes are entered there too. This is a demo site: orders are not fulfilled.";
|
||||
$MESS["VINO_OFFERS_WINES"] = "All discounted wines";
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
$MESS["VINO_OFFERS_H1"] = "Promocje";
|
||||
$MESS["VINO_OFFERS_THIS_WINES"] = "Wina objęte promocją";
|
||||
$MESS["VINO_OFFERS_ENDED"] = "Promocja zakończona.";
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
$MESS["VINO_OFFERS_H1"] = "Promocje";
|
||||
$MESS["VINO_OFFERS_PAGE_TITLE"] = "Promocje i rabaty na wino: kody rabatowe i zestawienia";
|
||||
$MESS["VINO_OFFERS_DESCRIPTION"] = "Aktualne promocje Vinoteki: do 20% taniej na wybrane wina, kod rabatowy na wina czerwone i oferty na pojedyncze wina. Cena po rabacie na karcie i w koszyku.";
|
||||
$MESS["VINO_OFFERS_LEAD"] = "Rabat nalicza się w koszyku automatycznie, tam też wpisuje się kod rabatowy. Strona demonstracyjna: zamówienia nie są realizowane.";
|
||||
$MESS["VINO_OFFERS_WINES"] = "Wszystkie wina w promocji";
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
$MESS["VINO_OFFERS_H1"] = "Акции";
|
||||
$MESS["VINO_OFFERS_THIS_WINES"] = "Вина по акции";
|
||||
$MESS["VINO_OFFERS_ENDED"] = "Акция завершена.";
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
$MESS["VINO_OFFERS_H1"] = "Акции";
|
||||
$MESS["VINO_OFFERS_PAGE_TITLE"] = "Акции и скидки на вино: промокоды и подборки";
|
||||
$MESS["VINO_OFFERS_DESCRIPTION"] = "Текущие акции Винотеки: скидки до 20% на подборку вин, промокод на красные вина и отдельные предложения. Цена со скидкой видна в карточке и корзине.";
|
||||
$MESS["VINO_OFFERS_LEAD"] = "Скидка считается в корзине автоматически, промокод вводится там же. Сайт демонстрационный: заказы не выполняются.";
|
||||
$MESS["VINO_OFFERS_WINES"] = "Все вина со скидкой";
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
use Bitrix\Main\Localization\Loc;
|
||||
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
|
||||
$APPLICATION->SetTitle(Loc::getMessage("VINO_OFFERS_H1"));
|
||||
$APPLICATION->SetPageProperty("title", Loc::getMessage("VINO_OFFERS_PAGE_TITLE"));
|
||||
$APPLICATION->SetPageProperty("description", Loc::getMessage("VINO_OFFERS_DESCRIPTION"));
|
||||
$automatic = \Jinove\Vinoteca\Offers::automatic();
|
||||
?>
|
||||
<section class="vino-razdel-hero">
|
||||
<div class="vino-wrap">
|
||||
<?php \Jinove\Vinoteca\Breadcrumbs::show(array(array(Loc::getMessage("VINO_OFFERS_H1")))); ?>
|
||||
<h1 class="vino-razdel-hero__title"><?= Loc::getMessage("VINO_OFFERS_H1") ?></h1>
|
||||
<p class="vino-razdel-hero__lead"><?= Loc::getMessage("VINO_OFFERS_LEAD") ?></p>
|
||||
</div>
|
||||
</section>
|
||||
<section class="vino-offers-page">
|
||||
<div class="vino-wrap">
|
||||
<?php $APPLICATION->IncludeComponent("bitrix:news.list", "vinoteca-offers", \Jinove\Vinoteca\Offers::listParams(), $component); ?>
|
||||
</div>
|
||||
</section>
|
||||
<section class="vino-razdel-sec vino-offers-wines" id="vino-offers-wines">
|
||||
<div class="vino-wrap">
|
||||
<h2 class="vino-offers-wines__title"><?= Loc::getMessage("VINO_OFFERS_WINES") ?></h2>
|
||||
<?php $APPLICATION->IncludeComponent("bitrix:catalog.section", "vinoteca", \Jinove\Vinoteca\Offers::wineParams($automatic["products"], $automatic["sections"], \Jinove\Vinoteca\Offers::folder(), \Jinove\Vinoteca\Offers::folder()), $component); ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php \Jinove\Vinoteca\Offers::canonical(\Jinove\Vinoteca\Offers::folder()); ?>
|
||||
@@ -0,0 +1,22 @@
|
||||
.vino-offers-page {
|
||||
padding: var(--space-head) var(--gutter) 0;
|
||||
}
|
||||
.vino-offers-wines {
|
||||
padding-top: var(--space-16);
|
||||
}
|
||||
.vino-offers-wines__title {
|
||||
margin: 0 0 var(--space-head);
|
||||
font-family: var(--font-serif);
|
||||
font-size: var(--fs-h2);
|
||||
font-weight: 400;
|
||||
line-height: var(--leading-tight);
|
||||
}
|
||||
.vino-offers-wines__empty {
|
||||
margin: 0;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
@media (max-width:760px) {
|
||||
.vino-offers-wines {
|
||||
padding-top: var(--space-12);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user