release: v1.2.0 — каталог, email заказа, SEO, админ CSV
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
|||||||
|
# v1.2.0
|
||||||
|
|
||||||
|
**Дата:** 2026-05-16
|
||||||
|
|
||||||
|
## Каталог
|
||||||
|
|
||||||
|
- Сортировка: название, цена, новинки
|
||||||
|
- Фильтр «только со скидкой» и показ товаров без остатка
|
||||||
|
- Бейдж низкого остатка и блок «Вы недавно смотрели»
|
||||||
|
|
||||||
|
## Заказы
|
||||||
|
|
||||||
|
- Email-подтверждение заказа (нужен `SMTP_*` и `SITE_URL`)
|
||||||
|
- Вкладка «Заказы» в `/account`
|
||||||
|
|
||||||
|
## Прочее
|
||||||
|
|
||||||
|
- `robots.txt`, `sitemap.xml`
|
||||||
|
- Защита от перебора на login/register
|
||||||
|
- Админ: фильтр заказов, экспорт CSV
|
||||||
|
|
||||||
|
## Обновление
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /opt/shop/shop10 # или ваш SHOP_ROOT
|
||||||
|
git pull
|
||||||
|
bash scripts/server-update.sh
|
||||||
|
# или: npm install --omit=dev && systemctl restart shop
|
||||||
|
```
|
||||||
|
|
||||||
|
Переменные для писем и sitemap: `SITE_URL`, `SMTP_HOST`, `SMTP_FROM`.
|
||||||
@@ -1,5 +1,35 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.2.0] — 2026-05-16
|
||||||
|
|
||||||
|
Улучшения каталога, уведомлений и админки.
|
||||||
|
|
||||||
|
### Каталог и UX
|
||||||
|
|
||||||
|
- **Сортировка:** по названию, цене (↑/↓), дате добавления
|
||||||
|
- **Фильтры:** только товары со скидкой; показ позиций «нет в наличии»
|
||||||
|
- **Бейдж «Осталось N»** при остатке ≤ 5
|
||||||
|
- **Недавно просмотренные** товары на главной (сессия, до 8 позиций)
|
||||||
|
- **Meta description** на странице товара
|
||||||
|
|
||||||
|
### Заказы и почта
|
||||||
|
|
||||||
|
- **Письмо после оформления** заказа (SMTP или лог в консоль)
|
||||||
|
- Вкладка **«Заказы»** в личном кабинете
|
||||||
|
|
||||||
|
### SEO и безопасность
|
||||||
|
|
||||||
|
- **`/robots.txt`** и **`/sitemap.xml`**
|
||||||
|
- Заголовки **X-Content-Type-Options**, **X-Frame-Options**, **Referrer-Policy**
|
||||||
|
- **Rate limit** на вход и регистрацию (429 при превышении)
|
||||||
|
|
||||||
|
### Админка
|
||||||
|
|
||||||
|
- **Фильтр заказов** по статусу
|
||||||
|
- **Экспорт заказов в CSV**
|
||||||
|
|
||||||
|
[1.2.0]: https://git.evilfox.cc/test/shop10/releases/tag/v1.2.0
|
||||||
|
|
||||||
## [1.0.1] — 2026-05-17
|
## [1.0.1] — 2026-05-17
|
||||||
|
|
||||||
Патч после **v1.0.0**: капча, доработка обновления из админки.
|
Патч после **v1.0.0**: капча, доработка обновления из админки.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Shop
|
# Shop
|
||||||
|
|
||||||
**v1.0.1** — интернет-магазин на **Node.js** и **PostgreSQL 17**.
|
**v1.2.0** — интернет-магазин на **Node.js** и **PostgreSQL 17**.
|
||||||
|
|
||||||
Два способа установки: [Docker Compose](#docker-compose-рекомендуется-для-теста) | [без Docker (Ubuntu)](#postgresql-17-без-docker)
|
Два способа установки: [Docker Compose](#docker-compose-рекомендуется-для-теста) | [без Docker (Ubuntu)](#postgresql-17-без-docker)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "shop",
|
"name": "shop",
|
||||||
"version": "1.0.1",
|
"version": "1.2.0",
|
||||||
"description": "Интернет-магазин на Node.js с PostgreSQL 17",
|
"description": "Интернет-магазин на Node.js с PostgreSQL 17",
|
||||||
"main": "src/server.js",
|
"main": "src/server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
const buckets = new Map();
|
||||||
|
|
||||||
|
function rateLimit({ windowMs = 15 * 60 * 1000, max = 20, keyPrefix = '' }) {
|
||||||
|
return (req, res, next) => {
|
||||||
|
const ip = req.ip || req.socket?.remoteAddress || 'unknown';
|
||||||
|
const key = `${keyPrefix}:${ip}`;
|
||||||
|
const now = Date.now();
|
||||||
|
let entry = buckets.get(key);
|
||||||
|
if (!entry || now > entry.resetAt) {
|
||||||
|
entry = { count: 0, resetAt: now + windowMs };
|
||||||
|
buckets.set(key, entry);
|
||||||
|
}
|
||||||
|
entry.count += 1;
|
||||||
|
if (entry.count > max) {
|
||||||
|
return res.status(429).render('error', {
|
||||||
|
title: 'Слишком много запросов',
|
||||||
|
message: 'Подождите несколько минут и попробуйте снова.',
|
||||||
|
code: 429,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
next();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { rateLimit };
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
function securityHeaders(_req, res, next) {
|
||||||
|
res.setHeader('X-Content-Type-Options', 'nosniff');
|
||||||
|
res.setHeader('X-Frame-Options', 'SAMEORIGIN');
|
||||||
|
res.setHeader('Referrer-Policy', 'strict-origin-when-cross-origin');
|
||||||
|
res.setHeader('Permissions-Policy', 'camera=(), microphone=(), geolocation=()');
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { securityHeaders };
|
||||||
@@ -1336,3 +1336,105 @@ body:has(.cookie-banner) .main {
|
|||||||
margin: 0.5rem 0 0;
|
margin: 0.5rem 0 0;
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.catalog-toolbar {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1rem 1.5rem;
|
||||||
|
margin: 0 0 1.5rem;
|
||||||
|
padding: 0.75rem 1rem;
|
||||||
|
background: var(--surface-2);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.catalog-toolbar__field {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.catalog-toolbar__label {
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: var(--muted);
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.catalog-toolbar__check {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.4rem;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card__stock-badge {
|
||||||
|
position: absolute;
|
||||||
|
top: 0.5rem;
|
||||||
|
left: 0.5rem;
|
||||||
|
z-index: 2;
|
||||||
|
padding: 0.2rem 0.5rem;
|
||||||
|
font-size: 0.7rem;
|
||||||
|
font-weight: 600;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: rgba(253, 203, 110, 0.95);
|
||||||
|
color: #2d3436;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card__stock-badge--out {
|
||||||
|
background: rgba(99, 110, 114, 0.9);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card--out-of-stock {
|
||||||
|
opacity: 0.85;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card--out-of-stock .card__image {
|
||||||
|
filter: grayscale(0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.recently-viewed {
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recently-viewed__title {
|
||||||
|
margin: 0 0 0.75rem;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recently-viewed__grid {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.75rem;
|
||||||
|
overflow-x: auto;
|
||||||
|
padding-bottom: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recently-viewed__card {
|
||||||
|
flex: 0 0 120px;
|
||||||
|
padding: 0.5rem;
|
||||||
|
text-decoration: none;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recently-viewed__img {
|
||||||
|
width: 100%;
|
||||||
|
height: 72px;
|
||||||
|
object-fit: cover;
|
||||||
|
border-radius: 6px;
|
||||||
|
margin-bottom: 0.35rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recently-viewed__name {
|
||||||
|
display: block;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
line-height: 1.25;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-header__actions {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.75rem;
|
||||||
|
}
|
||||||
|
|||||||
@@ -47,11 +47,13 @@ function accountRender(res, options) {
|
|||||||
formatPrice,
|
formatPrice,
|
||||||
passkeys,
|
passkeys,
|
||||||
isAdmin,
|
isAdmin,
|
||||||
|
recentOrders,
|
||||||
} = options;
|
} = options;
|
||||||
res.render('account/index', {
|
res.render('account/index', {
|
||||||
title: 'Личный кабинет',
|
title: 'Личный кабинет',
|
||||||
user,
|
user,
|
||||||
orderCount,
|
orderCount,
|
||||||
|
recentOrders: recentOrders || [],
|
||||||
reservations: reservations || [],
|
reservations: reservations || [],
|
||||||
passkeys: passkeys || [],
|
passkeys: passkeys || [],
|
||||||
isAdmin: Boolean(isAdmin),
|
isAdmin: Boolean(isAdmin),
|
||||||
@@ -85,9 +87,17 @@ router.get(
|
|||||||
|
|
||||||
const passkeys = await webauthn.getCredentialsForUser(user.id);
|
const passkeys = await webauthn.getCredentialsForUser(user.id);
|
||||||
|
|
||||||
|
const { rows: recentOrders } = await query(
|
||||||
|
`SELECT id, status, total_cents, created_at
|
||||||
|
FROM orders WHERE user_id = $1
|
||||||
|
ORDER BY created_at DESC LIMIT 10`,
|
||||||
|
[user.id]
|
||||||
|
);
|
||||||
|
|
||||||
accountRender(res, {
|
accountRender(res, {
|
||||||
user,
|
user,
|
||||||
orderCount: countResult.rows[0].n,
|
orderCount: countResult.rows[0].n,
|
||||||
|
recentOrders,
|
||||||
reservations,
|
reservations,
|
||||||
passkeys,
|
passkeys,
|
||||||
isAdmin: user.role === ROLES.ADMIN,
|
isAdmin: user.role === ROLES.ADMIN,
|
||||||
|
|||||||
+45
-4
@@ -61,21 +61,62 @@ router.get(
|
|||||||
router.get(
|
router.get(
|
||||||
'/orders',
|
'/orders',
|
||||||
asyncHandler(async (req, res) => {
|
asyncHandler(async (req, res) => {
|
||||||
const { rows: orders } = await query(
|
const statusFilter = req.query.status || '';
|
||||||
`SELECT o.id, o.status, o.total_cents, o.created_at, o.customer_name, o.customer_email,
|
const allowed = ['pending', 'paid', 'shipped', 'cancelled'];
|
||||||
|
let sql = `
|
||||||
|
SELECT o.id, o.status, o.total_cents, o.created_at, o.customer_name, o.customer_email,
|
||||||
u.email AS account_email
|
u.email AS account_email
|
||||||
FROM orders o
|
FROM orders o
|
||||||
JOIN users u ON u.id = o.user_id
|
JOIN users u ON u.id = o.user_id
|
||||||
ORDER BY o.created_at DESC`
|
`;
|
||||||
);
|
const params = [];
|
||||||
|
if (statusFilter && allowed.includes(statusFilter)) {
|
||||||
|
sql += ' WHERE o.status = $1';
|
||||||
|
params.push(statusFilter);
|
||||||
|
}
|
||||||
|
sql += ' ORDER BY o.created_at DESC';
|
||||||
|
|
||||||
|
const { rows: orders } = await query(sql, params);
|
||||||
res.render('admin/orders', {
|
res.render('admin/orders', {
|
||||||
title: 'Заказы',
|
title: 'Заказы',
|
||||||
orders,
|
orders,
|
||||||
formatPrice,
|
formatPrice,
|
||||||
|
statusFilter,
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
router.get(
|
||||||
|
'/orders/export.csv',
|
||||||
|
asyncHandler(async (req, res) => {
|
||||||
|
const { rows } = await query(
|
||||||
|
`SELECT o.id, o.status, o.total_cents, o.created_at,
|
||||||
|
o.customer_name, o.customer_email, o.customer_phone, o.address
|
||||||
|
FROM orders o
|
||||||
|
ORDER BY o.created_at DESC`
|
||||||
|
);
|
||||||
|
const esc = (v) => `"${String(v ?? '').replace(/"/g, '""')}"`;
|
||||||
|
const lines = [
|
||||||
|
'id;status;total_rub;customer;email;phone;address;created_at',
|
||||||
|
...rows.map((o) =>
|
||||||
|
[
|
||||||
|
o.id,
|
||||||
|
o.status,
|
||||||
|
(o.total_cents / 100).toFixed(2),
|
||||||
|
esc(o.customer_name),
|
||||||
|
esc(o.customer_email),
|
||||||
|
esc(o.customer_phone),
|
||||||
|
esc(o.address),
|
||||||
|
new Date(o.created_at).toISOString(),
|
||||||
|
].join(';')
|
||||||
|
),
|
||||||
|
];
|
||||||
|
res.setHeader('Content-Type', 'text/csv; charset=utf-8');
|
||||||
|
res.setHeader('Content-Disposition', 'attachment; filename="orders.csv"');
|
||||||
|
res.send('\uFEFF' + lines.join('\n'));
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
router.post(
|
router.post(
|
||||||
'/orders/:id/status',
|
'/orders/:id/status',
|
||||||
asyncHandler(async (req, res) => {
|
asyncHandler(async (req, res) => {
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ const { requireCookieConsent } = require('../middleware/cookieConsent');
|
|||||||
const { ROLES } = require('../constants/roles');
|
const { ROLES } = require('../constants/roles');
|
||||||
const { asyncHandler } = require('../utils/asyncHandler');
|
const { asyncHandler } = require('../utils/asyncHandler');
|
||||||
const { verifyCaptcha } = require('../services/captcha');
|
const { verifyCaptcha } = require('../services/captcha');
|
||||||
|
const { rateLimit } = require('../middleware/rateLimit');
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
const authRateLimit = rateLimit({ windowMs: 15 * 60 * 1000, max: 30, keyPrefix: 'auth' });
|
||||||
|
|
||||||
router.use((req, res, next) => {
|
router.use((req, res, next) => {
|
||||||
const cart = getCart(req);
|
const cart = getCart(req);
|
||||||
@@ -25,6 +27,7 @@ router.get('/register', requireCookieConsent, (req, res) => {
|
|||||||
router.post(
|
router.post(
|
||||||
'/register',
|
'/register',
|
||||||
requireCookieConsent,
|
requireCookieConsent,
|
||||||
|
authRateLimit,
|
||||||
asyncHandler(async (req, res) => {
|
asyncHandler(async (req, res) => {
|
||||||
const { name, email, password, password2 } = req.body;
|
const { name, email, password, password2 } = req.body;
|
||||||
const values = { name, email };
|
const values = { name, email };
|
||||||
@@ -95,6 +98,7 @@ router.get('/login', requireCookieConsent, (req, res) => {
|
|||||||
router.post(
|
router.post(
|
||||||
'/login',
|
'/login',
|
||||||
requireCookieConsent,
|
requireCookieConsent,
|
||||||
|
authRateLimit,
|
||||||
asyncHandler(async (req, res) => {
|
asyncHandler(async (req, res) => {
|
||||||
const { email, password } = req.body;
|
const { email, password } = req.body;
|
||||||
const next = req.body.next || '/';
|
const next = req.body.next || '/';
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
const express = require('express');
|
||||||
|
const { query } = require('../db');
|
||||||
|
const { siteUrl } = require('../services/mail');
|
||||||
|
const { asyncHandler } = require('../utils/asyncHandler');
|
||||||
|
|
||||||
|
const router = express.Router();
|
||||||
|
|
||||||
|
router.get('/robots.txt', (_req, res) => {
|
||||||
|
const base = siteUrl();
|
||||||
|
res.type('text/plain').send(
|
||||||
|
`User-agent: *\nAllow: /\nDisallow: /admin\nDisallow: /account\nSitemap: ${base}/sitemap.xml\n`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
router.get(
|
||||||
|
'/sitemap.xml',
|
||||||
|
asyncHandler(async (_req, res) => {
|
||||||
|
const base = siteUrl();
|
||||||
|
const { rows: products } = await query(
|
||||||
|
`SELECT slug, created_at FROM products ORDER BY id`
|
||||||
|
);
|
||||||
|
const urls = [
|
||||||
|
{ loc: `${base}/`, priority: '1.0' },
|
||||||
|
{ loc: `${base}/cart`, priority: '0.5' },
|
||||||
|
];
|
||||||
|
for (const p of products) {
|
||||||
|
urls.push({
|
||||||
|
loc: `${base}/product/${p.slug}`,
|
||||||
|
lastmod: new Date(p.created_at).toISOString().slice(0, 10),
|
||||||
|
priority: '0.8',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const xml = `<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
${urls
|
||||||
|
.map(
|
||||||
|
(u) => ` <url>
|
||||||
|
<loc>${u.loc}</loc>
|
||||||
|
${u.lastmod ? `<lastmod>${u.lastmod}</lastmod>` : ''}
|
||||||
|
<priority>${u.priority}</priority>
|
||||||
|
</url>`
|
||||||
|
)
|
||||||
|
.join('\n')}
|
||||||
|
</urlset>`;
|
||||||
|
res.type('application/xml').send(xml);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = router;
|
||||||
+59
-3
@@ -8,6 +8,8 @@ const { buildCartPricing } = require('../services/pricing');
|
|||||||
const productPrice = require('../utils/productPrice');
|
const productPrice = require('../utils/productPrice');
|
||||||
const promoService = require('../services/promo');
|
const promoService = require('../services/promo');
|
||||||
const loyaltyService = require('../services/loyalty');
|
const loyaltyService = require('../services/loyalty');
|
||||||
|
const recentlyViewed = require('../services/recentlyViewed');
|
||||||
|
const { sendOrderConfirmationEmail } = require('../services/mail');
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
@@ -25,21 +27,36 @@ router.use((req, res, next) => {
|
|||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const EFFECTIVE_PRICE_SQL = `CASE
|
||||||
|
WHEN p.sale_price_cents IS NOT NULL
|
||||||
|
AND p.sale_price_cents < p.price_cents
|
||||||
|
AND (p.sale_ends_at IS NULL OR p.sale_ends_at > NOW())
|
||||||
|
THEN p.sale_price_cents
|
||||||
|
ELSE p.price_cents
|
||||||
|
END`;
|
||||||
|
|
||||||
router.get(
|
router.get(
|
||||||
'/',
|
'/',
|
||||||
asyncHandler(async (req, res) => {
|
asyncHandler(async (req, res) => {
|
||||||
const category = req.query.category || '';
|
const category = req.query.category || '';
|
||||||
const q = (req.query.q || '').trim();
|
const q = (req.query.q || '').trim();
|
||||||
|
const sort = req.query.sort || 'name';
|
||||||
|
const saleOnly = req.query.sale === '1';
|
||||||
|
const showAll = req.query.all === '1';
|
||||||
|
|
||||||
let sql = `
|
let sql = `
|
||||||
SELECT p.*, c.name AS category_name, c.slug AS category_slug
|
SELECT p.*, c.name AS category_name, c.slug AS category_slug,
|
||||||
|
(${EFFECTIVE_PRICE_SQL}) AS catalog_price_cents
|
||||||
FROM products p
|
FROM products p
|
||||||
LEFT JOIN categories c ON c.id = p.category_id
|
LEFT JOIN categories c ON c.id = p.category_id
|
||||||
WHERE p.stock > 0
|
WHERE 1=1
|
||||||
`;
|
`;
|
||||||
const params = [];
|
const params = [];
|
||||||
let n = 1;
|
let n = 1;
|
||||||
|
|
||||||
|
if (!showAll) {
|
||||||
|
sql += ' AND p.stock > 0';
|
||||||
|
}
|
||||||
if (category) {
|
if (category) {
|
||||||
sql += ` AND c.slug = $${n++}`;
|
sql += ` AND c.slug = $${n++}`;
|
||||||
params.push(category);
|
params.push(category);
|
||||||
@@ -49,10 +66,23 @@ router.get(
|
|||||||
params.push(`%${q}%`);
|
params.push(`%${q}%`);
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
sql += ' ORDER BY p.name';
|
if (saleOnly) {
|
||||||
|
sql += ` AND p.sale_price_cents IS NOT NULL
|
||||||
|
AND p.sale_price_cents < p.price_cents
|
||||||
|
AND (p.sale_ends_at IS NULL OR p.sale_ends_at > NOW())`;
|
||||||
|
}
|
||||||
|
|
||||||
|
const orderMap = {
|
||||||
|
name: 'p.name ASC',
|
||||||
|
price_asc: 'catalog_price_cents ASC, p.name ASC',
|
||||||
|
price_desc: 'catalog_price_cents DESC, p.name ASC',
|
||||||
|
newest: 'p.created_at DESC',
|
||||||
|
};
|
||||||
|
sql += ` ORDER BY ${orderMap[sort] || orderMap.name}`;
|
||||||
|
|
||||||
const { rows: products } = await query(sql, params);
|
const { rows: products } = await query(sql, params);
|
||||||
const { rows: categories } = await query('SELECT * FROM categories ORDER BY name');
|
const { rows: categories } = await query('SELECT * FROM categories ORDER BY name');
|
||||||
|
const recentProducts = await recentlyViewed.loadProducts(query, req.session);
|
||||||
|
|
||||||
res.render('home', {
|
res.render('home', {
|
||||||
title: 'Каталог',
|
title: 'Каталог',
|
||||||
@@ -60,6 +90,10 @@ router.get(
|
|||||||
categories,
|
categories,
|
||||||
activeCategory: category,
|
activeCategory: category,
|
||||||
searchQuery: q,
|
searchQuery: q,
|
||||||
|
sort,
|
||||||
|
saleOnly,
|
||||||
|
showAll,
|
||||||
|
recentProducts,
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -84,6 +118,8 @@ router.get(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
recentlyViewed.pushProduct(req.session, product.id);
|
||||||
|
|
||||||
let userReservation = null;
|
let userReservation = null;
|
||||||
if (req.session.userId) {
|
if (req.session.userId) {
|
||||||
const { rows: resRows } = await query(
|
const { rows: resRows } = await query(
|
||||||
@@ -116,8 +152,13 @@ router.get(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const metaDescription =
|
||||||
|
(product.description || product.name).replace(/\s+/g, ' ').trim().slice(0, 160) ||
|
||||||
|
product.name;
|
||||||
|
|
||||||
res.render('product', {
|
res.render('product', {
|
||||||
title: product.name,
|
title: product.name,
|
||||||
|
metaDescription,
|
||||||
product,
|
product,
|
||||||
userReservation,
|
userReservation,
|
||||||
error: errorMsg,
|
error: errorMsg,
|
||||||
@@ -343,6 +384,21 @@ router.post(
|
|||||||
req.session.cart = {};
|
req.session.cart = {};
|
||||||
delete req.session.appliedPromoCode;
|
delete req.session.appliedPromoCode;
|
||||||
delete req.session.loyaltyPointsToUse;
|
delete req.session.loyaltyPointsToUse;
|
||||||
|
|
||||||
|
const emailItems = items.map((item) => ({
|
||||||
|
name: item.name,
|
||||||
|
quantity: item.quantity,
|
||||||
|
lineFormatted: formatPrice(
|
||||||
|
(item.effective_price_cents ?? item.price_cents) * item.quantity
|
||||||
|
),
|
||||||
|
}));
|
||||||
|
sendOrderConfirmationEmail(
|
||||||
|
email.trim(),
|
||||||
|
orderId,
|
||||||
|
formatPrice(pricing.total),
|
||||||
|
emailItems
|
||||||
|
).catch((err) => console.error('order email:', err.message));
|
||||||
|
|
||||||
res.redirect(`/orders/${orderId}?success=1`);
|
res.redirect(`/orders/${orderId}?success=1`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
await client.query('ROLLBACK');
|
await client.query('ROLLBACK');
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ const reservationsRoutes = require('./routes/reservations');
|
|||||||
const passkeyRoutes = require('./routes/passkey');
|
const passkeyRoutes = require('./routes/passkey');
|
||||||
const stockAlertsRoutes = require('./routes/stock-alerts');
|
const stockAlertsRoutes = require('./routes/stock-alerts');
|
||||||
const promoRoutes = require('./routes/promo');
|
const promoRoutes = require('./routes/promo');
|
||||||
|
const seoRoutes = require('./routes/seo');
|
||||||
|
const { securityHeaders } = require('./middleware/securityHeaders');
|
||||||
|
|
||||||
const PORT = process.env.PORT || 3000;
|
const PORT = process.env.PORT || 3000;
|
||||||
const HOST = process.env.HOST || '0.0.0.0';
|
const HOST = process.env.HOST || '0.0.0.0';
|
||||||
@@ -44,6 +46,8 @@ async function start() {
|
|||||||
app.set('views', path.join(__dirname, 'views'));
|
app.set('views', path.join(__dirname, 'views'));
|
||||||
|
|
||||||
app.use(healthRoutes);
|
app.use(healthRoutes);
|
||||||
|
app.use(securityHeaders);
|
||||||
|
app.use(seoRoutes);
|
||||||
app.use(express.static(path.join(__dirname, 'public')));
|
app.use(express.static(path.join(__dirname, 'public')));
|
||||||
app.use(express.urlencoded({ extended: true }));
|
app.use(express.urlencoded({ extended: true }));
|
||||||
app.use(express.json({ limit: '64kb' }));
|
app.use(express.json({ limit: '64kb' }));
|
||||||
|
|||||||
@@ -68,6 +68,28 @@ async function sendReservationEmail(to, productName, quantity, expiresAt) {
|
|||||||
return sendMail({ to, subject, text, html });
|
return sendMail({ to, subject, text, html });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function sendOrderConfirmationEmail(to, orderId, totalFormatted, items) {
|
||||||
|
const orderUrl = `${siteUrl()}/orders/${orderId}`;
|
||||||
|
const subject = `Заказ #${orderId} оформлен — Shop`;
|
||||||
|
const lines = items
|
||||||
|
.map((i) => `• ${i.name} × ${i.quantity} — ${i.lineFormatted}`)
|
||||||
|
.join('\n');
|
||||||
|
const text = `Спасибо за заказ #${orderId}!\n\n${lines}\n\nИтого: ${totalFormatted}\n\nСтатус: ${orderUrl}`;
|
||||||
|
const htmlItems = items
|
||||||
|
.map(
|
||||||
|
(i) =>
|
||||||
|
`<li>${i.name} × ${i.quantity} — <strong>${i.lineFormatted}</strong></li>`
|
||||||
|
)
|
||||||
|
.join('');
|
||||||
|
const html = `
|
||||||
|
<p>Спасибо за покупку! Заказ <strong>#${orderId}</strong> принят.</p>
|
||||||
|
<ul>${htmlItems}</ul>
|
||||||
|
<p><strong>Итого: ${totalFormatted}</strong></p>
|
||||||
|
<p><a href="${orderUrl}">Открыть заказ в личном кабинете</a></p>
|
||||||
|
`;
|
||||||
|
return sendMail({ to, subject, text, html });
|
||||||
|
}
|
||||||
|
|
||||||
async function sendStockAvailableEmail(to, productName, productUrl) {
|
async function sendStockAvailableEmail(to, productName, productUrl) {
|
||||||
const subject = `Снова в наличии: ${productName}`;
|
const subject = `Снова в наличии: ${productName}`;
|
||||||
const text = `Товар «${productName}» снова в наличии.\n\nПерейти: ${productUrl}`;
|
const text = `Товар «${productName}» снова в наличии.\n\nПерейти: ${productUrl}`;
|
||||||
@@ -85,5 +107,6 @@ module.exports = {
|
|||||||
sendPasswordResetEmail,
|
sendPasswordResetEmail,
|
||||||
sendReservationEmail,
|
sendReservationEmail,
|
||||||
sendStockAvailableEmail,
|
sendStockAvailableEmail,
|
||||||
|
sendOrderConfirmationEmail,
|
||||||
siteUrl,
|
siteUrl,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
const MAX = 8;
|
||||||
|
|
||||||
|
function getList(session) {
|
||||||
|
if (!session.recentlyViewed || !Array.isArray(session.recentlyViewed)) {
|
||||||
|
session.recentlyViewed = [];
|
||||||
|
}
|
||||||
|
return session.recentlyViewed;
|
||||||
|
}
|
||||||
|
|
||||||
|
function pushProduct(session, productId) {
|
||||||
|
const id = parseInt(productId, 10);
|
||||||
|
if (!id) return;
|
||||||
|
const list = getList(session).filter((x) => x !== id);
|
||||||
|
list.unshift(id);
|
||||||
|
session.recentlyViewed = list.slice(0, MAX);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function loadProducts(query, session) {
|
||||||
|
const ids = getList(session);
|
||||||
|
if (!ids.length) return [];
|
||||||
|
const placeholders = ids.map((_, i) => `$${i + 1}`).join(',');
|
||||||
|
const { rows } = await query(
|
||||||
|
`SELECT p.*, c.name AS category_name, c.slug AS category_slug
|
||||||
|
FROM products p
|
||||||
|
LEFT JOIN categories c ON c.id = p.category_id
|
||||||
|
WHERE p.id IN (${placeholders})`,
|
||||||
|
ids
|
||||||
|
);
|
||||||
|
const byId = new Map(rows.map((p) => [p.id, p]));
|
||||||
|
return ids.map((id) => byId.get(id)).filter(Boolean);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { pushProduct, loadProducts, MAX };
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
<a href="/account?tab=password" class="account-tabs__link <%= activeTab === 'password' ? 'account-tabs__link--active' : '' %>">Смена пароля</a>
|
<a href="/account?tab=password" class="account-tabs__link <%= activeTab === 'password' ? 'account-tabs__link--active' : '' %>">Смена пароля</a>
|
||||||
<a href="/account?tab=passkey" class="account-tabs__link <%= activeTab === 'passkey' ? 'account-tabs__link--active' : '' %>">Passkey</a>
|
<a href="/account?tab=passkey" class="account-tabs__link <%= activeTab === 'passkey' ? 'account-tabs__link--active' : '' %>">Passkey</a>
|
||||||
<a href="/account?tab=reservations" class="account-tabs__link <%= activeTab === 'reservations' ? 'account-tabs__link--active' : '' %>">Бронирования</a>
|
<a href="/account?tab=reservations" class="account-tabs__link <%= activeTab === 'reservations' ? 'account-tabs__link--active' : '' %>">Бронирования</a>
|
||||||
|
<a href="/account?tab=orders" class="account-tabs__link <%= activeTab === 'orders' ? 'account-tabs__link--active' : '' %>">Заказы</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<% if (activeTab === 'profile') { %>
|
<% if (activeTab === 'profile') { %>
|
||||||
@@ -71,6 +72,40 @@
|
|||||||
</section>
|
</section>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
|
<% if (activeTab === 'orders') { %>
|
||||||
|
<section class="card account-section">
|
||||||
|
<h2>Последние заказы</h2>
|
||||||
|
<% if (!recentOrders.length) { %>
|
||||||
|
<p class="muted">Заказов пока нет. <a href="/">Перейти в каталог</a></p>
|
||||||
|
<% } else { %>
|
||||||
|
<table class="cart-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>№</th>
|
||||||
|
<th>Дата</th>
|
||||||
|
<th>Статус</th>
|
||||||
|
<th>Сумма</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% const statusLabels = { pending: 'Ожидает', paid: 'Оплачен', shipped: 'Отправлен', cancelled: 'Отменён' }; %>
|
||||||
|
<% recentOrders.forEach(o => { %>
|
||||||
|
<tr>
|
||||||
|
<td>#<%= o.id %></td>
|
||||||
|
<td><%= new Date(o.created_at).toLocaleString('ru-RU') %></td>
|
||||||
|
<td><span class="status status--<%= o.status %>"><%= statusLabels[o.status] || o.status %></span></td>
|
||||||
|
<td><%= formatPrice(o.total_cents) %></td>
|
||||||
|
<td><a href="/orders/<%= o.id %>">Подробнее</a></td>
|
||||||
|
</tr>
|
||||||
|
<% }) %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p class="account-actions"><a href="/orders" class="btn btn--ghost">Все заказы</a></p>
|
||||||
|
<% } %>
|
||||||
|
</section>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
<% if (activeTab === 'reservations') { %>
|
<% if (activeTab === 'reservations') { %>
|
||||||
<section class="card account-section">
|
<section class="card account-section">
|
||||||
<h2>Мои бронирования</h2>
|
<h2>Мои бронирования</h2>
|
||||||
|
|||||||
@@ -1,11 +1,25 @@
|
|||||||
<%- include('../partials/layout-start') %>
|
<%- include('../partials/layout-start') %>
|
||||||
|
<% const statusLabels = { pending: 'Ожидает', paid: 'Оплачен', shipped: 'Отправлен', cancelled: 'Отменён' }; %>
|
||||||
|
|
||||||
<div class="admin-header">
|
<div class="admin-header">
|
||||||
<h1>Заказы</h1>
|
<h1>Заказы</h1>
|
||||||
|
<div class="admin-header__actions">
|
||||||
|
<a href="/admin/orders/export.csv" class="btn btn--ghost btn--sm">Экспорт CSV</a>
|
||||||
<%- include('../partials/admin-nav', { adminNav: 'orders' }) %>
|
<%- include('../partials/admin-nav', { adminNav: 'orders' }) %>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% const statusLabels = { pending: 'Ожидает', paid: 'Оплачен', shipped: 'Отправлен', cancelled: 'Отменён' }; %>
|
<form class="catalog-toolbar" method="get" action="/admin/orders">
|
||||||
|
<label class="catalog-toolbar__field">
|
||||||
|
<span class="catalog-toolbar__label">Статус</span>
|
||||||
|
<select name="status" class="input input--sm" onchange="this.form.submit()">
|
||||||
|
<option value="">Все</option>
|
||||||
|
<% ['pending','paid','shipped','cancelled'].forEach(s => { %>
|
||||||
|
<option value="<%= s %>" <%= statusFilter === s ? 'selected' : '' %>><%= statusLabels[s] %></option>
|
||||||
|
<% }) %>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</form>
|
||||||
|
|
||||||
<table class="cart-table">
|
<table class="cart-table">
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
+65
-3
@@ -1,4 +1,16 @@
|
|||||||
<%- include('partials/layout-start') %>
|
<%- include('partials/layout-start') %>
|
||||||
|
<%
|
||||||
|
function catalogHref(extra) {
|
||||||
|
const p = new URLSearchParams();
|
||||||
|
if (searchQuery) p.set('q', searchQuery);
|
||||||
|
if (saleOnly) p.set('sale', '1');
|
||||||
|
if (showAll) p.set('all', '1');
|
||||||
|
if (sort && sort !== 'name') p.set('sort', sort);
|
||||||
|
if (extra && extra.category) p.set('category', extra.category);
|
||||||
|
const s = p.toString();
|
||||||
|
return s ? '/?' + s : '/';
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
<section class="hero">
|
<section class="hero">
|
||||||
<h1>Каталог товаров</h1>
|
<h1>Каталог товаров</h1>
|
||||||
@@ -7,20 +19,60 @@
|
|||||||
|
|
||||||
<% if (categories.length) { %>
|
<% if (categories.length) { %>
|
||||||
<nav class="categories" aria-label="Категории">
|
<nav class="categories" aria-label="Категории">
|
||||||
<a href="/" class="chip <%= !activeCategory ? 'chip--active' : '' %>">Все</a>
|
<a href="<%= catalogHref() %>" class="chip <%= !activeCategory ? 'chip--active' : '' %>">Все</a>
|
||||||
<% categories.forEach(c => { %>
|
<% categories.forEach(c => { %>
|
||||||
<a href="/?category=<%= c.slug %>" class="chip <%= activeCategory === c.slug ? 'chip--active' : '' %>"><%= c.name %></a>
|
<a href="<%= catalogHref({ category: c.slug }) %>" class="chip <%= activeCategory === c.slug ? 'chip--active' : '' %>"><%= c.name %></a>
|
||||||
<% }) %>
|
<% }) %>
|
||||||
</nav>
|
</nav>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
|
<form class="catalog-toolbar" method="get" action="/">
|
||||||
|
<% if (searchQuery) { %><input type="hidden" name="q" value="<%= searchQuery %>"><% } %>
|
||||||
|
<% if (activeCategory) { %><input type="hidden" name="category" value="<%= activeCategory %>"><% } %>
|
||||||
|
<label class="catalog-toolbar__field">
|
||||||
|
<span class="catalog-toolbar__label">Сортировка</span>
|
||||||
|
<select name="sort" class="input input--sm" onchange="this.form.submit()">
|
||||||
|
<option value="name" <%= sort === 'name' ? 'selected' : '' %>>По названию</option>
|
||||||
|
<option value="price_asc" <%= sort === 'price_asc' ? 'selected' : '' %>>Цена ↑</option>
|
||||||
|
<option value="price_desc" <%= sort === 'price_desc' ? 'selected' : '' %>>Цена ↓</option>
|
||||||
|
<option value="newest" <%= sort === 'newest' ? 'selected' : '' %>>Сначала новые</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
<label class="catalog-toolbar__check">
|
||||||
|
<input type="checkbox" name="sale" value="1" <%= saleOnly ? 'checked' : '' %> onchange="this.form.submit()">
|
||||||
|
Только со скидкой
|
||||||
|
</label>
|
||||||
|
<label class="catalog-toolbar__check">
|
||||||
|
<input type="checkbox" name="all" value="1" <%= showAll ? 'checked' : '' %> onchange="this.form.submit()">
|
||||||
|
Показать нет в наличии
|
||||||
|
</label>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<% if (recentProducts && recentProducts.length) { %>
|
||||||
|
<section class="recently-viewed">
|
||||||
|
<h2 class="recently-viewed__title">Вы недавно смотрели</h2>
|
||||||
|
<div class="recently-viewed__grid">
|
||||||
|
<% recentProducts.forEach(p => { %>
|
||||||
|
<a href="/product/<%= p.slug %>" class="recently-viewed__card card">
|
||||||
|
<% if (p.image_url) { %>
|
||||||
|
<img src="<%= p.image_url %>" alt="" class="recently-viewed__img" loading="lazy">
|
||||||
|
<% } %>
|
||||||
|
<span class="recently-viewed__name"><%= p.name %></span>
|
||||||
|
</a>
|
||||||
|
<% }) %>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
<% if (!products.length) { %>
|
<% if (!products.length) { %>
|
||||||
<p class="empty">Товары не найдены. Попробуйте другой запрос.</p>
|
<p class="empty">Товары не найдены. Попробуйте другой запрос.</p>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<% products.forEach(p => { %>
|
<% products.forEach(p => { %>
|
||||||
<% const onSale = isSaleActive(p); %>
|
<% const onSale = isSaleActive(p); %>
|
||||||
<article class="card<%= onSale ? ' card--sale' : '' %>">
|
<% const outOfStock = p.stock <= 0; %>
|
||||||
|
<% const lowStock = !outOfStock && p.stock <= 5; %>
|
||||||
|
<article class="card<%= onSale ? ' card--sale' : '' %><%= outOfStock ? ' card--out-of-stock' : '' %>">
|
||||||
<a href="/product/<%= p.slug %>" class="card__image-wrap">
|
<a href="/product/<%= p.slug %>" class="card__image-wrap">
|
||||||
<% if (onSale) { %>
|
<% if (onSale) { %>
|
||||||
<span class="card__sale-ribbon" aria-hidden="true">
|
<span class="card__sale-ribbon" aria-hidden="true">
|
||||||
@@ -28,6 +80,12 @@
|
|||||||
−<%= salePercent(p) %>%
|
−<%= salePercent(p) %>%
|
||||||
</span>
|
</span>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
<% if (lowStock) { %>
|
||||||
|
<span class="card__stock-badge">Осталось <%= p.stock %></span>
|
||||||
|
<% } %>
|
||||||
|
<% if (outOfStock) { %>
|
||||||
|
<span class="card__stock-badge card__stock-badge--out">Нет в наличии</span>
|
||||||
|
<% } %>
|
||||||
<% if (p.image_url) { %>
|
<% if (p.image_url) { %>
|
||||||
<img src="<%= p.image_url %>" alt="<%= p.name %>" class="card__image" loading="lazy">
|
<img src="<%= p.image_url %>" alt="<%= p.name %>" class="card__image" loading="lazy">
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
@@ -40,6 +98,7 @@
|
|||||||
<% } %>
|
<% } %>
|
||||||
<h2 class="card__title"><a href="/product/<%= p.slug %>"><%= p.name %></a></h2>
|
<h2 class="card__title"><a href="/product/<%= p.slug %>"><%= p.name %></a></h2>
|
||||||
<%- include('partials/product-price', { product: p, priceSize: 'md' }) %>
|
<%- include('partials/product-price', { product: p, priceSize: 'md' }) %>
|
||||||
|
<% if (!outOfStock) { %>
|
||||||
<form action="/cart/add" method="post" class="card__form">
|
<form action="/cart/add" method="post" class="card__form">
|
||||||
<input type="hidden" name="product_id" value="<%= p.id %>">
|
<input type="hidden" name="product_id" value="<%= p.id %>">
|
||||||
<input type="hidden" name="redirect" value="/cart">
|
<input type="hidden" name="redirect" value="/cart">
|
||||||
@@ -48,6 +107,9 @@
|
|||||||
В корзину
|
В корзину
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
<% } else { %>
|
||||||
|
<a href="/product/<%= p.slug %>" class="btn btn--ghost btn--block">Подробнее</a>
|
||||||
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
<% }) %>
|
<% }) %>
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
</main>
|
</main>
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<p>© <%= new Date().getFullYear() %> Shop · <a href="/cookies/policy">Cookies</a></p>
|
<p>© <%= new Date().getFullYear() %> Shop ·
|
||||||
|
<a href="/orders">Заказы</a> ·
|
||||||
|
<a href="/sitemap.xml">Карта сайта</a> ·
|
||||||
|
<a href="/cookies/policy">Cookies</a>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
<%- include('cookie-banner') %>
|
<%- include('cookie-banner') %>
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title><%= title %> — Shop</title>
|
<title><%= title %> — Shop</title>
|
||||||
|
<% if (typeof metaDescription !== 'undefined' && metaDescription) { %>
|
||||||
|
<meta name="description" content="<%= metaDescription %>">
|
||||||
|
<% } %>
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap" rel="stylesheet">
|
||||||
|
|||||||
Reference in New Issue
Block a user