Files
ABSDEV/resources/themes/saasland/views/partials/header.blade.php
T
2026-07-28 14:11:59 +01:00

53 lines
3.3 KiB
PHP

@php
$headerContent = $headerContent ?? [];
$menuLocation = $headerContent['menu_location'] ?? 'primary';
$navigationLinks = app(\Modules\Stylist\Support\FrontendNavigation::class)->location($menuLocation, $primaryNavigation ?? []);
$brandUrl = $siteSettings['site_url'] ?: url('/');
$mobileMenuId = 'saasland-mobile-navigation';
@endphp
<header class="nav cms-editable-header" data-saasland-header>
<a href="{{ $brandUrl }}" class="logo cms-brand" aria-label="{{ $siteTitle }} home">
@if ($logoUrl)<img src="{{ $logoUrl }}" alt="{{ $siteTitle }}">@else{{ $siteTitle }}@endif
</a>
@if (filter_var($headerContent['show_navigation'] ?? true, FILTER_VALIDATE_BOOL) && $navigationLinks)
<nav class="desktop-nav" aria-label="Primary navigation">
@foreach ($navigationLinks as $link)
<a href="{{ $link['url'] }}" @if($link['target']) target="{{ $link['target'] }}" rel="noopener" @endif>{{ $link['label'] }}</a>
@endforeach
</nav>
@endif
<div class="nav-actions">
@auth
@if (filter_var($headerContent['show_dashboard'] ?? true, FILTER_VALIDATE_BOOL) && Route::has('dashboard'))
<a class="nav-account" href="{{ route('dashboard') }}">{{ $siteSettings['dashboard_label'] }}</a>
@endif
@if (filter_var($headerContent['show_user_name'] ?? true, FILTER_VALIDATE_BOOL))
<div class="account-menu" x-data="{ accountOpen: false }"><button type="button" class="account-trigger" @click="accountOpen=!accountOpen"><span>{{ str(auth()->user()->name)->substr(0,1)->upper() }}</span><span class="account-name">{{ auth()->user()->name }}</span></button><div class="account-dropdown" x-show="accountOpen" @click.outside="accountOpen=false" x-cloak>@if(Route::has('profile.edit'))<a href="{{ route('profile.edit') }}">Profile</a>@endif @if(Route::has('logout'))<form method="POST" action="{{ route('logout') }}">@csrf<button type="submit">Log out</button></form>@endif</div></div>
@endif
@else
@if (filter_var($headerContent['show_login'] ?? true, FILTER_VALIDATE_BOOL) && Route::has('login'))<a class="nav-login" href="{{ route('login') }}">{{ $siteSettings['login_label'] }}</a>@endif
@if (filter_var($headerContent['show_registration'] ?? true, FILTER_VALIDATE_BOOL) && Route::has('register'))<a class="btn primary nav-register" href="{{ route('register') }}">{{ $siteSettings['registration_label'] }}</a>@endif
@endauth
@if (filter_var($headerContent['show_mobile_menu'] ?? true, FILTER_VALIDATE_BOOL))
<button
class="menu"
type="button"
aria-label="Open navigation"
aria-controls="{{ $mobileMenuId }}"
aria-expanded="false"
data-saasland-menu-toggle
><span></span><span></span><span></span></button>
@endif
</div>
</header>
@if (filter_var($headerContent['show_mobile_menu'] ?? true, FILTER_VALIDATE_BOOL))
<div id="{{ $mobileMenuId }}" class="mobile-nav" data-saasland-mobile-nav hidden>
@foreach($navigationLinks as $link)
<a href="{{ $link['url'] }}" @if($link['target']) target="{{ $link['target'] }}" rel="noopener" @endif>{{ $link['label'] }}</a>
@endforeach
</div>
@endif