114 lines
7.5 KiB
PHP
114 lines
7.5 KiB
PHP
<!-- Header -->
|
|
<header class="sticky top-0 z-10 bg-white/80 backdrop-blur-md border-b border-gray-200">
|
|
<div class="flex items-center justify-between h-16 px-4 md:px-6">
|
|
<!-- Mobile Menu Button -->
|
|
<button @click="sidebarOpen = !sidebarOpen" class="lg:hidden p-2 -ms-2 text-gray-500 hover:text-gray-900 rounded-lg hover:bg-gray-100">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/>
|
|
</svg>
|
|
</button>
|
|
|
|
<!-- Greeting + Date -->
|
|
<div class="hidden sm:flex flex-col">
|
|
<span class="text-sm font-medium text-gray-900">
|
|
@php
|
|
$hour = now()->hour;
|
|
$greeting = $hour < 12 ? __('common.good_morning') : ($hour < 18 ? __('common.good_afternoon') : __('common.good_evening'));
|
|
@endphp
|
|
{{ $greeting }}, {{ auth()->user()->name }}
|
|
</span>
|
|
<span class="text-xs text-gray-500">
|
|
{{ calendar_date(now()) }}
|
|
</span>
|
|
</div>
|
|
|
|
<!-- Right Side Actions -->
|
|
<div class="flex items-center gap-2">
|
|
|
|
<!-- Locale Switcher -->
|
|
<div x-data="{ open: false }" class="relative">
|
|
<button @click="open = !open" class="flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 hover:text-gray-900 bg-gray-50 hover:bg-gray-100 rounded-lg transition-colors">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
</svg>
|
|
<span>{{ app()->getLocale() === 'fa' ? 'فا' : 'EN' }}</span>
|
|
</button>
|
|
<div x-show="open" @click.away="open = false" x-transition
|
|
class="absolute end-0 mt-2 w-36 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50">
|
|
<form method="POST" action="{{ route('locale.update') }}">
|
|
@csrf
|
|
<button type="submit" name="locale" value="fa"
|
|
class="w-full text-start px-4 py-2 text-sm {{ app()->getLocale() === 'fa' ? 'bg-teal-50 text-teal-700 font-medium' : 'text-gray-700 hover:bg-gray-50' }}">
|
|
فارسی
|
|
</button>
|
|
</form>
|
|
<form method="POST" action="{{ route('locale.update') }}">
|
|
@csrf
|
|
<button type="submit" name="locale" value="en"
|
|
class="w-full text-start px-4 py-2 text-sm {{ app()->getLocale() === 'en' ? 'bg-teal-50 text-teal-700 font-medium' : 'text-gray-700 hover:bg-gray-50' }}">
|
|
English
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Calendar Switcher -->
|
|
<div x-data="{ open: false }" class="relative">
|
|
<button @click="open = !open" class="flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 hover:text-gray-900 bg-gray-50 hover:bg-gray-100 rounded-lg transition-colors">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
|
|
</svg>
|
|
<span>{{ session('calendar', 'jalali') === 'jalali' ? __('calendar.jalali') : __('calendar.gregorian') }}</span>
|
|
</button>
|
|
<div x-show="open" @click.away="open = false" x-transition
|
|
class="absolute end-0 mt-2 w-40 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50">
|
|
<form method="POST" action="{{ route('calendar.update') }}">
|
|
@csrf
|
|
<button type="submit" name="calendar" value="jalali"
|
|
class="w-full text-start px-4 py-2 text-sm {{ session('calendar', 'jalali') === 'jalali' ? 'bg-teal-50 text-teal-700 font-medium' : 'text-gray-700 hover:bg-gray-50' }}">
|
|
{{ __('calendar.jalali') }}
|
|
</button>
|
|
</form>
|
|
<form method="POST" action="{{ route('calendar.update') }}">
|
|
@csrf
|
|
<button type="submit" name="calendar" value="gregorian"
|
|
class="w-full text-start px-4 py-2 text-sm {{ session('calendar', 'gregorian') === 'gregorian' ? 'bg-teal-50 text-teal-700 font-medium' : 'text-gray-700 hover:bg-gray-50' }}">
|
|
{{ __('calendar.gregorian') }}
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Currency Switcher -->
|
|
<div x-data="{ open: false }" class="relative">
|
|
<button @click="open = !open" class="flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 hover:text-gray-900 bg-gray-50 hover:bg-gray-100 rounded-lg transition-colors">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
</svg>
|
|
<span>{{ strtoupper(session('currency', config('projectra.defaults.currency', 'IRR'))) }}</span>
|
|
</button>
|
|
<div x-show="open" @click.away="open = false" x-transition
|
|
class="absolute end-0 mt-2 w-44 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50">
|
|
@foreach(['IRR', 'USD', 'EUR', 'AED'] as $curr)
|
|
<form method="POST" action="{{ route('currency.update') }}">
|
|
@csrf
|
|
<button type="submit" name="currency" value="{{ $curr }}"
|
|
class="w-full text-start px-4 py-2 text-sm {{ session('currency', 'IRR') === $curr ? 'bg-teal-50 text-teal-700 font-medium' : 'text-gray-700 hover:bg-gray-50' }}">
|
|
{{ __('currency.code_' . strtolower($curr)) }} ({{ $curr }})
|
|
</button>
|
|
</form>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Notifications -->
|
|
<button class="relative p-2 text-gray-500 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"/>
|
|
</svg>
|
|
<span class="absolute top-1.5 end-1.5 w-2 h-2 bg-red-500 rounded-full"></span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</header>
|