Vinoteca: wine shop on 1C-Bitrix (module, template, components, pages)
This commit is contained in:
commit
52795535ae
586 files changed
+27619
No files matched your search
+5
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
$MESS["VINO_PAGER_LABEL"] = "Catalogue pages";
|
||||
$MESS["VINO_PAGER_OF"] = "of";
|
||||
$MESS["VINO_PAGER_PREV"] = "Previous page";
|
||||
$MESS["VINO_PAGER_NEXT"] = "Next page";
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
$MESS["VINO_PAGER_LABEL"] = "Strony katalogu";
|
||||
$MESS["VINO_PAGER_OF"] = "z";
|
||||
$MESS["VINO_PAGER_PREV"] = "Poprzednia strona";
|
||||
$MESS["VINO_PAGER_NEXT"] = "Następna strona";
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
$MESS["VINO_PAGER_LABEL"] = "Страницы каталога";
|
||||
$MESS["VINO_PAGER_OF"] = "из";
|
||||
$MESS["VINO_PAGER_PREV"] = "Предыдущая страница";
|
||||
$MESS["VINO_PAGER_NEXT"] = "Следующая страница";
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
.vino-pager {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
margin-top: var(--vino-pager-gap, var(--space-12));
|
||||
padding-top: var(--space-8);
|
||||
border-top: 1px solid var(--color-line);
|
||||
text-align: center;
|
||||
flex-direction: column;
|
||||
gap: var(--space-4);
|
||||
}
|
||||
.vino-pager__count {
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
color: var(--color-text-muted);
|
||||
font-size: var(--text-15);
|
||||
}
|
||||
.vino-pager__list {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: var(--space-2);
|
||||
flex-wrap: wrap;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.vino-pager__item, .vino-pager__nav {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: var(--size-tap);
|
||||
height: var(--size-tap);
|
||||
padding: 0 var(--space-3);
|
||||
border: 1px solid var(--color-line);
|
||||
border-radius: 0;
|
||||
font-family: var(--font-sans);
|
||||
font-size: var(--text-15);
|
||||
font-weight: 500;
|
||||
color: var(--color-text);
|
||||
text-decoration: none;
|
||||
transition: border-color var(--duration-fast) var(--ease-base), color var(--duration-fast) var(--ease-base), background-color var(--duration-fast) var(--ease-base);
|
||||
}
|
||||
@media (hover:hover) {
|
||||
.vino-pager__item:hover, .vino-pager__nav:hover {
|
||||
border-color: var(--color-accent);
|
||||
color: var(--color-accent);
|
||||
}
|
||||
}
|
||||
.vino-pager__item:focus-visible, .vino-pager__nav:focus-visible {
|
||||
outline: none;
|
||||
border-color: var(--color-accent);
|
||||
box-shadow: var(--shadow-focus);
|
||||
}
|
||||
.vino-pager__item--current {
|
||||
background: var(--color-accent);
|
||||
border-color: var(--color-accent);
|
||||
color: var(--color-on-accent);
|
||||
cursor: default;
|
||||
}
|
||||
.vino-pager__icon {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
.vino-pager__gap {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 24px;
|
||||
height: var(--size-tap);
|
||||
color: var(--color-text-faint);
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
use Bitrix\Main\Localization\Loc;
|
||||
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();
|
||||
|
||||
if ($arResult["NavRecordCount"] == 0 || ($arResult["NavPageCount"] == 1 && $arResult["NavShowAll"] == false)) return;
|
||||
|
||||
$qs = ($arResult["NavQueryString"] != "" ? $arResult["NavQueryString"] . "&" : "");
|
||||
$qsFull = ($arResult["NavQueryString"] != "" ? "?" . $arResult["NavQueryString"] : "");
|
||||
$url = $arResult["sUrlPath"];
|
||||
$num = $arResult["NavNum"];
|
||||
$cur = (int)$arResult["NavPageNomer"];
|
||||
$cnt = (int)$arResult["NavPageCount"];
|
||||
|
||||
$link = function ($page) use ($url, $qs, $qsFull, $num) {
|
||||
return $page <= 1 && $qs === "" ? $url . $qsFull : $url . "?" . $qs . "PAGEN_" . $num . "=" . $page;
|
||||
};
|
||||
?>
|
||||
<nav class="vino-pager" aria-label="<?= htmlspecialcharsbx((string)($arResult["NavTitle"] ?: Loc::getMessage("VINO_PAGER_LABEL"))) ?>">
|
||||
<p class="vino-pager__count"><?= $arResult["NavFirstRecordShow"] ?>–<?= $arResult["NavLastRecordShow"] ?> <?= Loc::getMessage("VINO_PAGER_OF") ?> <?= $arResult["NavRecordCount"] ?></p>
|
||||
<ul class="vino-pager__list">
|
||||
<?php if ($cur > 1): ?>
|
||||
<li><a class="vino-pager__nav" href="<?= $link($cur - 1) ?>" rel="prev" aria-label="<?= Loc::getMessage("VINO_PAGER_PREV") ?>">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="vino-pager__icon"><path d="M15 6l-6 6 6 6"></path></svg>
|
||||
</a></li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$pages = array();
|
||||
for ($i = 1; $i <= $cnt; $i++) {
|
||||
if ($i == 1 || $i == $cnt || abs($i - $cur) <= 2) $pages[] = $i;
|
||||
}
|
||||
$prev = 0;
|
||||
foreach ($pages as $p):
|
||||
if ($prev && $p - $prev > 1): ?>
|
||||
<li><span class="vino-pager__gap" aria-hidden="true">…</span></li>
|
||||
<?php endif;
|
||||
$prev = $p;
|
||||
if ($p == $cur): ?>
|
||||
<li><span class="vino-pager__item vino-pager__item--current" aria-current="page"><?= $p ?></span></li>
|
||||
<?php else: ?>
|
||||
<li><a class="vino-pager__item" href="<?= $link($p) ?>"><?= $p ?></a></li>
|
||||
<?php endif;
|
||||
endforeach; ?>
|
||||
|
||||
<?php if ($cur < $cnt): ?>
|
||||
<li><a class="vino-pager__nav" href="<?= $link($cur + 1) ?>" rel="next" aria-label="<?= Loc::getMessage("VINO_PAGER_NEXT") ?>">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="vino-pager__icon"><path d="M9 6l6 6-6 6"></path></svg>
|
||||
</a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</nav>
|
||||
Reference in new issue
Block a user