@@ -4,32 +4,34 @@
|
||||
data-fetch-url="{{ route('chat.messages') }}"
|
||||
data-send-url="{{ route('chat.send') }}"
|
||||
data-csrf="{{ csrf_token() }}"
|
||||
data-send-label="{{ __('Отправить') }}"
|
||||
data-restart-label="{{ __('Начать новый чат') }}"
|
||||
>
|
||||
<button class="pc-chat-toggle" type="button" data-chat-toggle>
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M4 5h16v10H8l-4 4V5zm2 2v7.17L7.17 13H18V7H6z"></path>
|
||||
</svg>
|
||||
<span>Чат</span>
|
||||
<span>{{ __('Чат') }}</span>
|
||||
</button>
|
||||
|
||||
<section class="pc-chat-panel" data-chat-panel hidden>
|
||||
<header class="pc-chat-header">
|
||||
<h3>Онлайн-чат</h3>
|
||||
<button class="pc-chat-close" type="button" data-chat-close aria-label="Свернуть чат">×</button>
|
||||
<h3>{{ __('Онлайн-чат') }}</h3>
|
||||
<button class="pc-chat-close" type="button" data-chat-close aria-label="{{ __('Свернуть чат') }}">×</button>
|
||||
</header>
|
||||
<p class="pc-chat-note" data-chat-note>Задайте вопрос — администратор ответит в этом окне.</p>
|
||||
<p class="pc-chat-note" data-chat-note>{{ __('Задайте вопрос — администратор ответит в этом окне.') }}</p>
|
||||
|
||||
<div class="pc-chat-messages" data-chat-messages></div>
|
||||
|
||||
<form class="pc-chat-form" data-chat-form>
|
||||
<textarea
|
||||
name="message"
|
||||
placeholder="Введите сообщение..."
|
||||
placeholder="{{ __('Введите сообщение...') }}"
|
||||
maxlength="2000"
|
||||
rows="3"
|
||||
required
|
||||
></textarea>
|
||||
<button class="pc-btn primary" type="submit">Отправить</button>
|
||||
<button class="pc-btn primary" type="submit">{{ __('Отправить') }}</button>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
@php
|
||||
$companyName = config('shop.company_name', config('app.name'));
|
||||
$companyDescription = config('shop.company_description');
|
||||
$companyDescription = __(config('shop.company_description'));
|
||||
$contactPhone = trim((string) config('shop.contact_phone'));
|
||||
$contactEmail = trim((string) config('shop.contact_email'));
|
||||
$contactTelegram = trim((string) config('shop.contact_telegram'));
|
||||
$contactHours = trim((string) config('shop.contact_hours'));
|
||||
$contactHours = trim((string) __(config('shop.contact_hours')));
|
||||
$telegramUrl = '';
|
||||
$phoneUrl = '';
|
||||
$emailUrl = '';
|
||||
@@ -32,28 +32,28 @@
|
||||
</div>
|
||||
<div class="pc-footer-columns">
|
||||
<div class="pc-footer-col">
|
||||
<h4>Каталог</h4>
|
||||
<h4>{{ __('Каталог') }}</h4>
|
||||
<ul class="pc-footer-list">
|
||||
<li><a href="{{ route('catalog.index') }}">Все категории</a></li>
|
||||
<li><a href="{{ route('catalog.category', 'processors') }}">Процессоры</a></li>
|
||||
<li><a href="{{ route('catalog.category', 'graphics-cards') }}">Видеокарты</a></li>
|
||||
<li><a href="{{ route('catalog.category', 'laptops') }}">Ноутбуки</a></li>
|
||||
<li><a href="{{ route('catalog.index') }}">{{ __('Все категории') }}</a></li>
|
||||
<li><a href="{{ route('catalog.category', 'processors') }}">{{ __('Процессоры') }}</a></li>
|
||||
<li><a href="{{ route('catalog.category', 'graphics-cards') }}">{{ __('Видеокарты') }}</a></li>
|
||||
<li><a href="{{ route('catalog.category', 'laptops') }}">{{ __('Ноутбуки') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="pc-footer-col">
|
||||
<h4>Покупателю</h4>
|
||||
<h4>{{ __('Покупателю') }}</h4>
|
||||
<ul class="pc-footer-list">
|
||||
<li><a href="{{ route('cart.index') }}">Корзина</a></li>
|
||||
<li><a href="{{ route('favorites.index') }}">Избранное</a></li>
|
||||
<li><a href="{{ route('compare.index') }}">Сравнение</a></li>
|
||||
<li><a href="{{ route('pages.shipping-payment') }}">Доставка и оплата</a></li>
|
||||
<li><a href="{{ route('cart.index') }}">{{ __('Корзина') }}</a></li>
|
||||
<li><a href="{{ route('favorites.index') }}">{{ __('Избранное') }}</a></li>
|
||||
<li><a href="{{ route('compare.index') }}">{{ __('Сравнение') }}</a></li>
|
||||
<li><a href="{{ route('pages.shipping-payment') }}">{{ __('Доставка и оплата') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="pc-footer-col">
|
||||
<h4>Контакты</h4>
|
||||
<h4>{{ __('Контакты') }}</h4>
|
||||
<div class="pc-footer-contact">
|
||||
@if ($phoneUrl !== '')
|
||||
<span>Телефон: <a href="{{ $phoneUrl }}">{{ $contactPhone }}</a></span>
|
||||
<span>{{ __('Телефон') }}: <a href="{{ $phoneUrl }}">{{ $contactPhone }}</a></span>
|
||||
@endif
|
||||
@if ($emailUrl !== '')
|
||||
<span>Email: <a href="{{ $emailUrl }}">{{ $contactEmail }}</a></span>
|
||||
@@ -69,7 +69,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="pc-footer-bottom">
|
||||
<span>(c) {{ date('Y') }} {{ $companyName }}. Все права защищены.</span>
|
||||
<span><a href="{{ route('pages.about') }}">О компании</a> / <a href="{{ route('pages.contacts') }}">Контакты</a></span>
|
||||
<span>{{ __('(c) :year :company. Все права защищены.', ['year' => date('Y'), 'company' => $companyName]) }}</span>
|
||||
<span><a href="{{ route('pages.about') }}">{{ __('О компании') }}</a> / <a href="{{ route('pages.contacts') }}">{{ __('Контакты') }}</a></span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -3,52 +3,90 @@
|
||||
$compareCount = count((array) session('compare', []));
|
||||
$cartCount = collect((array) session('cart', []))->sum(fn ($quantity) => (int) $quantity);
|
||||
$companyName = config('shop.company_name', config('app.name'));
|
||||
$supportedLocales = (array) config('app.supported_locales', []);
|
||||
$currentLocale = app()->getLocale();
|
||||
$currentLocaleData = $supportedLocales[$currentLocale] ?? $supportedLocales[config('app.locale', 'ru')] ?? [
|
||||
'native' => 'Русский',
|
||||
'short' => 'Рус',
|
||||
'flag' => '🇷🇺',
|
||||
];
|
||||
$navItems = [
|
||||
['label' => 'Главная', 'route' => route('home'), 'active' => request()->routeIs('home')],
|
||||
['label' => __('Главная'), 'route' => route('home'), 'active' => request()->routeIs('home')],
|
||||
[
|
||||
'label' => 'Каталог',
|
||||
'label' => __('Каталог'),
|
||||
'route' => route('catalog.index'),
|
||||
'active' => request()->routeIs('catalog.*') || request()->routeIs('products.show') || request()->routeIs('search.index'),
|
||||
],
|
||||
['label' => 'О нас', 'route' => route('pages.about'), 'active' => request()->routeIs('pages.about')],
|
||||
['label' => __('О нас'), 'route' => route('pages.about'), 'active' => request()->routeIs('pages.about')],
|
||||
[
|
||||
'label' => 'Доставка и оплата',
|
||||
'label' => __('Доставка и оплата'),
|
||||
'route' => route('pages.shipping-payment'),
|
||||
'active' => request()->routeIs('pages.shipping-payment'),
|
||||
],
|
||||
['label' => 'Контакты', 'route' => route('pages.contacts'), 'active' => request()->routeIs('pages.contacts')],
|
||||
['label' => __('Контакты'), 'route' => route('pages.contacts'), 'active' => request()->routeIs('pages.contacts')],
|
||||
];
|
||||
@endphp
|
||||
|
||||
<header class="pc-header pc-animate" style="--delay: 0s">
|
||||
<input type="checkbox" id="pc-mobile-menu-toggle" class="pc-mobile-menu-toggle">
|
||||
<label for="pc-mobile-menu-toggle" class="pc-hamburger" aria-label="Меню">
|
||||
<label for="pc-mobile-menu-toggle" class="pc-hamburger" aria-label="{{ __('Меню') }}">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</label>
|
||||
<div class="pc-mobile-menu-head">
|
||||
<label for="pc-mobile-menu-toggle" class="pc-mobile-menu-close" aria-label="Закрыть меню">×</label>
|
||||
<label for="pc-mobile-menu-toggle" class="pc-mobile-menu-close" aria-label="{{ __('Закрыть меню') }}">×</label>
|
||||
</div>
|
||||
<div class="pc-header-left">
|
||||
<a class="pc-logo" href="{{ route('home') }}">
|
||||
<span class="pc-logo-mark"></span>
|
||||
{{ $companyName }}
|
||||
</a>
|
||||
<a class="pc-btn pc-catalog-btn" href="{{ route('catalog.index') }}">Каталог</a>
|
||||
<a class="pc-btn pc-catalog-btn" href="{{ route('catalog.index') }}">{{ __('Каталог') }}</a>
|
||||
</div>
|
||||
<div class="pc-header-center">
|
||||
<form class="pc-search" action="{{ route('search.index') }}" method="get">
|
||||
<input type="text" name="q" placeholder="Поиск товаров по наименованию" value="{{ request('q') }}" />
|
||||
<button class="pc-search-submit" type="submit" aria-label="Искать">
|
||||
<input type="text" name="q" placeholder="{{ __('Поиск товаров по наименованию') }}" value="{{ request('q') }}" />
|
||||
<button class="pc-search-submit" type="submit" aria-label="{{ __('Искать') }}">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M15.5 14h-.79l-.28-.27a6 6 0 1 0-.71.71l.27.28v.79L20 20.5 21.5 19 15.5 14zm-5.5 0A4.5 4.5 0 1 1 10 5a4.5 4.5 0 0 1 0 9z"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="pc-header-tools">
|
||||
<details class="pc-lang-switcher" data-locale-switcher>
|
||||
<summary class="pc-lang-switcher-trigger" aria-label="{{ __('Выбор языка') }}">
|
||||
<span class="pc-lang-switcher-current">
|
||||
<span class="pc-lang-switcher-flag" aria-hidden="true">{{ $currentLocaleData['flag'] ?? '🌐' }}</span>
|
||||
<span class="pc-lang-switcher-label">{{ $currentLocaleData['short'] ?? strtoupper($currentLocale) }}</span>
|
||||
</span>
|
||||
<span class="pc-lang-switcher-chevron" aria-hidden="true">
|
||||
<svg viewBox="0 0 20 20">
|
||||
<path d="M5.3 7.8a1 1 0 0 1 1.4 0L10 11l3.3-3.2a1 1 0 1 1 1.4 1.4l-4 3.9a1 1 0 0 1-1.4 0l-4-3.9a1 1 0 0 1 0-1.4z"></path>
|
||||
</svg>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="pc-lang-switcher-menu">
|
||||
@foreach ($supportedLocales as $locale => $localeData)
|
||||
<form method="post" action="{{ route('locale.switch', $locale) }}" data-preserve-scroll="true">
|
||||
@csrf
|
||||
<button class="pc-lang-switcher-option {{ $locale === $currentLocale ? 'is-active' : '' }}" type="submit" @disabled($locale === $currentLocale)>
|
||||
<span class="pc-lang-switcher-option-main">
|
||||
<span class="pc-lang-switcher-flag" aria-hidden="true">{{ $localeData['flag'] ?? '🌐' }}</span>
|
||||
<span>{{ $localeData['native'] ?? strtoupper($locale) }}</span>
|
||||
</span>
|
||||
@if ($locale === $currentLocale)
|
||||
<span class="pc-lang-switcher-check" aria-hidden="true">•</span>
|
||||
@endif
|
||||
</button>
|
||||
</form>
|
||||
@endforeach
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
<div class="pc-header-icons">
|
||||
<a class="pc-icon-link" href="{{ route('favorites.index') }}" aria-label="Избранное">
|
||||
<a class="pc-icon-link" href="{{ route('favorites.index') }}" aria-label="{{ __('Избранное') }}">
|
||||
<span class="pc-icon">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M12 20s-7-4.5-9-9c-1.2-2.7.7-6 4.2-6 2 0 3.2 1 3.8 2 0.6-1 1.8-2 3.8-2 3.5 0 5.4 3.3 4.2 6-2 4.5-9 9-9 9z"></path>
|
||||
@@ -57,9 +95,9 @@
|
||||
<span class="pc-icon-count">{{ $favoritesCount }}</span>
|
||||
@endif
|
||||
</span>
|
||||
<span class="pc-icon-label">Избранное</span>
|
||||
<span class="pc-icon-label">{{ __('Избранное') }}</span>
|
||||
</a>
|
||||
<a class="pc-icon-link" href="{{ route('compare.index') }}" aria-label="Сравнение">
|
||||
<a class="pc-icon-link" href="{{ route('compare.index') }}" aria-label="{{ __('Сравнение') }}">
|
||||
<span class="pc-icon">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M5 4h3v16H5zM16 4h3v16h-3zM10.5 8h3v12h-3z"></path>
|
||||
@@ -68,9 +106,9 @@
|
||||
<span class="pc-icon-count">{{ $compareCount }}</span>
|
||||
@endif
|
||||
</span>
|
||||
<span class="pc-icon-label">Сравнение</span>
|
||||
<span class="pc-icon-label">{{ __('Сравнение') }}</span>
|
||||
</a>
|
||||
<a class="pc-icon-link" href="{{ route('cart.index') }}" aria-label="Корзина">
|
||||
<a class="pc-icon-link" href="{{ route('cart.index') }}" aria-label="{{ __('Корзина') }}">
|
||||
<span class="pc-icon">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M6 6h14l-2 9H8L6 6zm-2-2h3l1 2h-4zM9 20a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm8 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
|
||||
@@ -79,18 +117,18 @@
|
||||
<span class="pc-icon-count">{{ $cartCount }}</span>
|
||||
@endif
|
||||
</span>
|
||||
<span class="pc-icon-label">Корзина</span>
|
||||
<span class="pc-icon-label">{{ __('Корзина') }}</span>
|
||||
</a>
|
||||
<a class="pc-icon-link" href="{{ auth()->check() ? route('account') : route('login') }}" aria-label="Личный кабинет">
|
||||
<a class="pc-icon-link" href="{{ auth()->check() ? route('account') : route('login') }}" aria-label="{{ __('Личный кабинет') }}">
|
||||
<span class="pc-icon">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M12 12a4 4 0 1 0-4-4 4 4 0 0 0 4 4zm0 2c-4.4 0-8 2.2-8 5v1h16v-1c0-2.8-3.6-5-8-5z"></path>
|
||||
</svg>
|
||||
</span>
|
||||
<span class="pc-icon-label">{{ auth()->check() ? 'Кабинет' : 'Войти' }}</span>
|
||||
<span class="pc-icon-label">{{ auth()->check() ? __('Кабинет') : __('Войти') }}</span>
|
||||
</a>
|
||||
</div>
|
||||
<nav class="pc-header-nav" aria-label="Разделы сайта">
|
||||
<nav class="pc-header-nav" aria-label="{{ __('Разделы сайта') }}">
|
||||
@foreach ($navItems as $item)
|
||||
<a class="pc-header-nav-link {{ $item['active'] ? 'is-active' : '' }}" href="{{ $item['route'] }}">
|
||||
{{ $item['label'] }}
|
||||
|
||||
Reference in New Issue
Block a user