diff --git a/modules/settings/index.js b/modules/settings/index.js index 5d5ce3d..345146a 100644 --- a/modules/settings/index.js +++ b/modules/settings/index.js @@ -6,7 +6,10 @@ let db; const DEFAULT_SETTINGS = { review_code: 'GUEST2026', review_min_length: '20', - review_ip_cooldown_minutes: '5' + review_ip_cooldown_minutes: '5', + hotel_phone_primary: '89409270080', + hotel_phone_additional: '', + hotel_max_link: 'kalugin66' }; function init(database) { @@ -201,6 +204,49 @@ function setupRoutes(app, authenticateToken, requireAdmin) { }); }); }); + + app.get('/api/admin/settings/phones', authenticateToken, requireAdmin, (req, res) => { + getAll((err, settings) => { + if (err) return res.status(500).json({ error: 'Database error' }); + res.json({ + primary: settings.hotel_phone_primary || '', + additional: settings.hotel_phone_additional || '', + maxLink: settings.hotel_max_link || '' + }); + }); + }); + + app.put('/api/admin/settings/phones', authenticateToken, requireAdmin, (req, res) => { + const { primary, additional, maxLink } = req.body; + if (!primary || primary.length < 5) { + return res.status(400).json({ error: 'Основной номер должен содержать минимум 5 цифр' }); + } + const updates = []; + updates.push(['hotel_phone_primary', primary]); + updates.push(['hotel_phone_additional', additional || '']); + updates.push(['hotel_max_link', maxLink || '']); + let processed = 0; + updates.forEach(([key, value]) => { + set(key, value, (err) => { + if (err) console.error('Phone settings update error:', err); + processed++; + if (processed === updates.length) { + res.json({ message: 'Настройки телефонов сохранены' }); + } + }); + }); + }); + + app.get('/api/config', (req, res) => { + getAll((err, settings) => { + if (err) return res.status(500).json({ error: 'Database error' }); + res.json({ + phone_primary: settings.hotel_phone_primary || '89409270080', + phone_additional: settings.hotel_phone_additional || '', + max_link: settings.hotel_max_link || 'kalugin66' + }); + }); + }); } module.exports = { init, get, set, getAll, getReviewCode, setReviewCode, checkIpCooldown, setupRoutes }; diff --git a/modules/translations/index.js b/modules/translations/index.js index cad1dd4..18d1cda 100644 --- a/modules/translations/index.js +++ b/modules/translations/index.js @@ -184,6 +184,9 @@ const translations = { 'hero.subtitle': 'Ваш идеальный отдых на берегу Чёрного моря в самом сердце Абхазии. Комфорт, природа и гостеприимство — всё, что нужно для незабываемого отпуска.', 'hero.btn_rooms': 'Выбрать номер', 'hero.btn_call': 'Позвонить', + 'hero.btn_whatsapp': 'Написать в WhatsApp', + 'hero.btn_telegram': 'Написать в Telegram', + 'hero.btn_max': 'Написать в Max', 'hero.stat_sea': 'мин до моря', 'hero.stat_categories': 'категории', 'hero.stat_guests': 'довольных гостей', @@ -507,6 +510,9 @@ const translations = { 'hero.subtitle': 'Your perfect getaway on the Black Sea coast in the heart of Abkhazia. Comfort, nature and hospitality — everything you need for an unforgettable vacation.', 'hero.btn_rooms': 'Choose a Room', 'hero.btn_call': 'Call Us', + 'hero.btn_whatsapp': 'Write on WhatsApp', + 'hero.btn_telegram': 'Write on Telegram', + 'hero.btn_max': 'Write on Max', 'hero.stat_sea': 'min to the sea', 'hero.stat_categories': 'categories', 'hero.stat_guests': 'happy guests', @@ -833,6 +839,9 @@ const translations = { 'hero.subtitle': 'Уара уидеалтә ԥсынчыра Амшын Еиқәаҵәа аԥшаҳәаҿы Аԥсны агәҭаны. Акомфорт, аԥсабареи асасӡреи — ахымԥада-ҳәада аусумҭазы иахәҭоу зегьы.', 'hero.btn_rooms': 'Апалаҭа алхразы', 'hero.btn_call': 'Аҭелефон асра', + 'hero.btn_whatsapp': 'WhatsApp ала аҩра', + 'hero.btn_telegram': 'Telegram ала аҩра', + 'hero.btn_max': 'Max ала аҩра', 'hero.stat_sea': 'мин амшын ахь', 'hero.stat_categories': 'акатегориақәа', 'hero.stat_guests': 'изызҳауа асасцәа', diff --git a/public/admin.html b/public/admin.html index a1c0df6..ed6b1e6 100644 --- a/public/admin.html +++ b/public/admin.html @@ -468,11 +468,38 @@ tr.row-checkout-today { background: #fef2f2 !important; border-left: 4px solid # Загрузка... - - + +
+

Телефоны и контакты

+
+

+ + Основной номер используется для звонков, WhatsApp и Telegram. Дополнительный отображается через запятую рядом с основным. +

+
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+
+ +

Кодовое слово для отзывов

@@ -2472,6 +2499,32 @@ async function sendTestEmail() { } catch(err) { showToast(err.message, 'error'); } } +// Phone settings +async function loadPhoneSettings() { + try { + const data = await api('/api/admin/settings/phones'); + document.getElementById('phonePrimary').value = data.primary || ''; + document.getElementById('phoneAdditional').value = data.additional || ''; + document.getElementById('phoneMaxLink').value = data.maxLink || ''; + } catch(e) {} +} + +async function savePhoneSettings() { + const data = { + primary: document.getElementById('phonePrimary').value.trim(), + additional: document.getElementById('phoneAdditional').value.trim(), + maxLink: document.getElementById('phoneMaxLink').value.trim() + }; + if (!data.primary) { + showToast('Основной номер обязателен', 'error'); + return; + } + try { + await api('/api/admin/settings/phones', { method: 'PUT', body: JSON.stringify(data) }); + showToast('Настройки телефонов сохранены'); + } catch(err) { showToast(err.message, 'error'); } +} + // Export async function exportCSV() { const status = document.getElementById('filterStatus').value; @@ -2501,6 +2554,7 @@ async function loadSettings() { } catch(e) {} loadSecurityKeys(); loadEmailSettings(); + loadPhoneSettings(); } // Show room modal with images diff --git a/public/css/style.css b/public/css/style.css index 39e18eb..7d8ceba 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -298,6 +298,83 @@ h1, h2, h3, h4 { border-color: #fff; transform: translateY(-3px); } +.btn-whatsapp { + background: #25D366; + color: #fff; + border: none; + padding: clamp(10px, 2vw, 15px) clamp(20px, 4vw, 40px); + border-radius: 50px; + font-weight: 700; + font-size: clamp(0.85rem, 1.2vw, 1rem); + letter-spacing: 0.5px; + transition: all 0.3s ease; + text-decoration: none; + display: inline-flex; + align-items: center; + gap: 8px; +} +.btn-whatsapp:hover { + background: #1ebe57; + transform: translateY(-3px); + box-shadow: 0 10px 30px rgba(37,211,102,0.4); + color: #fff; +} +.btn-telegram { + background: #0088cc; + color: #fff; + border: none; + padding: clamp(10px, 2vw, 15px) clamp(20px, 4vw, 40px); + border-radius: 50px; + font-weight: 700; + font-size: clamp(0.85rem, 1.2vw, 1rem); + letter-spacing: 0.5px; + transition: all 0.3s ease; + text-decoration: none; + display: inline-flex; + align-items: center; + gap: 8px; +} +.btn-telegram:hover { + background: #0077b5; + transform: translateY(-3px); + box-shadow: 0 10px 30px rgba(0,136,204,0.4); + color: #fff; +} +.btn-max { + background: #471AFF; + color: #fff; + border: none; + padding: clamp(10px, 2vw, 15px) clamp(20px, 4vw, 40px); + border-radius: 50px; + font-weight: 700; + font-size: clamp(0.85rem, 1.2vw, 1rem); + letter-spacing: 0.5px; + transition: all 0.3s ease; + text-decoration: none; + display: inline-flex; + align-items: center; + gap: 8px; +} +.btn-max:hover { + background: #3b15d9; + transform: translateY(-3px); + box-shadow: 0 10px 30px rgba(71,26,255,0.4); + color: #fff; +} +.max-icon-circle { + display: inline-flex; + align-items: center; + justify-content: center; + width: 1.4em; + height: 1.4em; + border-radius: 50%; + background: #fff; + color: #471AFF; + font-weight: 800; + font-size: 0.85em; + line-height: 1; + flex-shrink: 0; +} .hero-stats { position: absolute; bottom: clamp(20px, 5vw, 60px); @@ -1380,7 +1457,7 @@ h1, h2, h3, h4 { font-size: 0.65rem; padding: 5px 12px; } - .btn-gold, .btn-outline-white { + .btn-gold, .btn-outline-white, .btn-whatsapp, .btn-telegram, .btn-max { padding: 10px 18px; font-size: 0.8rem; } diff --git a/public/index.html b/public/index.html index ad51027..eb9781c 100644 --- a/public/index.html +++ b/public/index.html @@ -60,7 +60,10 @@

Ваш идеальный отдых на берегу Чёрного моря в самом сердце Абхазии. Комфорт, природа и гостеприимство — всё, что нужно для незабываемого отпуска.

Выбрать номер - Позвонить + Позвонить + W + T + M M
@@ -537,7 +540,7 @@

Забронируйте номер прямо сейчас!

Лучшие цены гарантированы при бронировании напрямую. Позвоните Рауфу Алексеевичу или оставьте заявку.

- 8 (940) 927-00-80 + 8 (940) 927-00-80
@@ -591,7 +594,7 @@

Домашняя кухня — отдельная достопримечательность гостиницы. Свежие местные продукты, абхазские и русские блюда, приготовленные с душой — абиц, ачапа, хачапури, шашлык и многое другое. Чистые номера, искренняя улыбка и внимание к каждой детали — это то, что делает Hotel 777 особенным.

- + 8 (940) 927-00-80 @@ -628,7 +631,7 @@
Телефон
-
8 (940) 927-00-80
+
8 (940) 927-00-80
@@ -646,7 +649,7 @@
- + Написать Рауфу в WhatsApp
@@ -680,7 +683,7 @@ - +
@@ -709,7 +712,7 @@

- Или позвоните Рауфу Алексеевичу: 8 (940) 927-00-80 + Или позвоните Рауфу Алексеевичу: 8 (940) 927-00-80

@@ -823,6 +826,56 @@ +