UI and editing updates

This commit is contained in:
Mark Gregory
2026-07-27 13:24:42 +01:00
parent 4a32be068c
commit d297948fb9
7 changed files with 575 additions and 368 deletions
@@ -1 +1,3 @@
@include('stylist-theme-saasland::partials.footer')
@if (filter_var($data['enabled'] ?? true, FILTER_VALIDATE_BOOL))
@include('stylist-theme-saasland::partials.footer', ['footerContent' => $data])
@endif
@@ -1 +1,3 @@
@include('stylist-theme-saasland::partials.header')
@if (filter_var($data['enabled'] ?? true, FILTER_VALIDATE_BOOL))
@include('stylist-theme-saasland::partials.header', ['headerContent' => $data])
@endif
@@ -1,36 +1,43 @@
<footer class="footer">
@php
$footerContent = $footerContent ?? [];
$columns = collect($footerContent['columns'] ?? [])->filter(
fn (array $column): bool => filter_var($column['enabled'] ?? true, FILTER_VALIDATE_BOOL)
);
@endphp
<style>
.footer.cms-editable-footer .footer-grid{display:grid;grid-template-columns:minmax(280px,1.5fr) repeat(3,minmax(160px,1fr));gap:3rem;padding-block:4rem 2rem;align-items:start;}
.cms-editable-footer .footer-brand{max-width:36rem}.cms-editable-footer .footer-brand p{max-width:34rem;line-height:1.7;}
.cms-editable-footer .footer-column h3{margin:0 0 1rem;font-size:1rem}.cms-editable-footer .footer-column ul{display:grid;gap:.75rem;list-style:none;margin:0;padding:0;}
.cms-editable-footer .footer-column a{display:inline-flex;text-decoration:none}.cms-editable-footer .copyright{padding-block:1.5rem 2rem;}
@media(max-width:900px){.footer.cms-editable-footer .footer-grid{grid-template-columns:1fr;gap:2rem;padding-block:3rem 1.5rem}}
</style>
<footer class="footer cms-editable-footer">
<div class="wrap footer-grid">
<div class="footer-brand">
<a class="logo" href="{{ url('/') }}">{{ $siteTitle }}</a>
<p>{{ $siteDescription }}</p>
</div>
<div>
<b>Explore</b>
@foreach ($footerNavigation as $item)
<a href="{{ $item['url'] }}">{{ $item['label'] }}</a>
@endforeach
</div>
<div>
<b>Account</b>
@auth
<a href="{{ route('dashboard') }}">Dashboard</a>
@if (Route::has('profile.edit'))<a href="{{ route('profile.edit') }}">Profile</a>@endif
@else
@if (Route::has('login'))<a href="{{ route('login') }}">Log in</a>@endif
@if (Route::has('register'))<a href="{{ route('register') }}">Register</a>@endif
@endauth
</div>
<div>
<b>Connect</b>
@if ($facebookUrl)<a href="{{ $facebookUrl }}" target="_blank" rel="noopener">Facebook</a>@endif
@if ($xUrl)<a href="{{ $xUrl }}" target="_blank" rel="noopener">X</a>@endif
@if ($linkedinUrl)<a href="{{ $linkedinUrl }}" target="_blank" rel="noopener">LinkedIn</a>@endif
@unless($facebookUrl || $xUrl || $linkedinUrl)<a href="mailto:{{ config('mail.from.address') }}">Contact</a>@endunless
<a class="logo" href="{{ $footerContent['brand_url'] ?? url('/') }}">{{ $footerContent['brand_text'] ?? $siteTitle }}</a>
@if (! empty($footerContent['description'] ?? $siteDescription))
<p>{{ $footerContent['description'] ?? $siteDescription }}</p>
@endif
</div>
@foreach ($columns as $column)
<div class="footer-column">
<h3>{{ $column['heading'] ?? 'Links' }}</h3>
<ul>
@foreach (collect($column['links'] ?? [])->filter(fn (array $link): bool => filter_var($link['enabled'] ?? true, FILTER_VALIDATE_BOOL)) as $link)
<li><a href="{{ $link['url'] ?? '#' }}">{{ $link['label'] ?? 'Link' }}</a></li>
@endforeach
</ul>
</div>
@endforeach
</div>
<div class="wrap copyright">
<span>© {{ date('Y') }} {{ $siteTitle }}. All rights reserved.</span>
<a href="#top">Back to top ↑</a>
<span>{{ $footerContent['copyright'] ?? ('© '.date('Y').' '.$siteTitle.'. All rights reserved.') }}</span>
@if (filter_var($footerContent['show_back_to_top'] ?? true, FILTER_VALIDATE_BOOL))
<a href="#top">{{ $footerContent['back_to_top_label'] ?? 'Back to top ↑' }}</a>
@endif
</div>
</footer>
@@ -1,68 +1,83 @@
<header class="nav">
<a href="{{ url('/') }}" class="logo" aria-label="{{ $siteTitle }} home">
@if ($logoUrl)
<img src="{{ $logoUrl }}" alt="{{ $siteTitle }}">
@php
$headerContent = $headerContent ?? [];
$configuredLinks = collect($headerContent['links'] ?? []);
$navigationLinks = $configuredLinks->isNotEmpty()
? $configuredLinks
: collect($primaryNavigation ?? [])->map(fn (array $item): array => [
'enabled' => true,
'label' => $item['label'] ?? 'Link',
'url' => $item['url'] ?? '#',
]);
$navigationLinks = $navigationLinks->filter(
fn (array $link): bool => filter_var($link['enabled'] ?? true, FILTER_VALIDATE_BOOL)
);
@endphp
<style>
.nav.cms-editable-header{display:grid;grid-template-columns:minmax(220px,1fr) auto minmax(220px,1fr);align-items:center;gap:2rem;width:100%;}
.cms-editable-header .desktop-nav{display:flex;align-items:center;justify-content:center;gap:2rem;}
.cms-editable-header .nav-actions{justify-self:end;display:flex;align-items:center;gap:1rem;}
.cms-editable-header .cms-brand{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@media (max-width:900px){.nav.cms-editable-header{grid-template-columns:1fr auto}.cms-editable-header .desktop-nav{display:none}.cms-editable-header .nav-actions{grid-column:2}.cms-editable-header .account-name{display:none}}
</style>
<header class="nav cms-editable-header">
<a href="{{ $headerContent['brand_url'] ?? url('/') }}" class="logo cms-brand" aria-label="{{ $headerContent['brand_text'] ?? $siteTitle }} home">
@if (! empty($headerContent['logo_url'] ?? $logoUrl))
<img src="{{ $headerContent['logo_url'] ?? $logoUrl }}" alt="{{ $headerContent['brand_text'] ?? $siteTitle }}">
@else
{{ $siteTitle }}
{{ $headerContent['brand_text'] ?? $siteTitle }}
@endif
</a>
<nav class="desktop-nav" aria-label="Primary navigation">
@include('stylist-theme-saasland::partials.navigation-items', ['items' => $primaryNavigation])
</nav>
@if (filter_var($headerContent['show_navigation'] ?? true, FILTER_VALIDATE_BOOL) && $navigationLinks->isNotEmpty())
<nav class="desktop-nav" aria-label="Primary navigation">
@foreach ($navigationLinks as $link)
<a href="{{ $link['url'] ?? '#' }}">{{ $link['label'] ?? 'Link' }}</a>
@endforeach
</nav>
@endif
<div class="nav-actions">
@auth
<a class="nav-account" href="{{ route('dashboard') }}">Dashboard</a>
<div class="account-menu" x-data="{ accountOpen: false }">
<button type="button" class="account-trigger" @click="accountOpen = ! accountOpen" :aria-expanded="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('settings.profile'))
<a href="{{ route('settings.profile') }}">Account settings</a>
@endif
<form method="POST" action="{{ route('logout') }}">
@csrf
<button type="submit">Log out</button>
</form>
</div>
</div>
@else
@if (Route::has('login'))
<a class="nav-login" href="{{ route('login') }}">Log in</a>
@if (filter_var($headerContent['show_dashboard'] ?? true, FILTER_VALIDATE_BOOL) && Route::has('dashboard'))
<a class="nav-account" href="{{ route('dashboard') }}">{{ $headerContent['dashboard_label'] ?? 'Dashboard' }}</a>
@endif
@if (Route::has('register'))
<a class="btn primary nav-register" href="{{ route('register') }}">Get started</a>
@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" :aria-expanded="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('settings.profile'))<a href="{{ route('settings.profile') }}">Account settings</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') }}">{{ $headerContent['login_label'] ?? 'Log in' }}</a>
@endif
@if (filter_var($headerContent['show_registration'] ?? true, FILTER_VALIDATE_BOOL) && Route::has('register'))
<a class="btn primary nav-register" href="{{ route('register') }}">{{ $headerContent['registration_label'] ?? 'Get started' }}</a>
@endif
@endauth
<button class="menu" type="button" aria-label="Toggle navigation" :aria-expanded="menuOpen" @click="menuOpen = ! menuOpen">
<span></span><span></span><span></span>
</button>
@if (filter_var($headerContent['show_mobile_menu'] ?? true, FILTER_VALIDATE_BOOL))
<button class="menu" type="button" aria-label="Toggle navigation" :aria-expanded="menuOpen" @click="menuOpen = ! menuOpen"><span></span><span></span><span></span></button>
@endif
</div>
</header>
<div class="mobile-nav" x-show="menuOpen" x-cloak>
@include('stylist-theme-saasland::partials.navigation-items', ['items' => $primaryNavigation])
<div class="mobile-auth">
@auth
<a href="{{ route('dashboard') }}">Dashboard</a>
@if (Route::has('profile.edit'))
<a href="{{ route('profile.edit') }}">Profile</a>
@endif
<form method="POST" action="{{ route('logout') }}">
@csrf
<button type="submit">Log out</button>
</form>
@else
@if (Route::has('login'))<a href="{{ route('login') }}">Log in</a>@endif
@if (Route::has('register'))<a class="mobile-primary" href="{{ route('register') }}">Get started</a>@endif
@endauth
@if (filter_var($headerContent['show_mobile_menu'] ?? true, FILTER_VALIDATE_BOOL))
<div class="mobile-nav" x-show="menuOpen" x-cloak>
@foreach ($navigationLinks as $link)
<a href="{{ $link['url'] ?? '#' }}">{{ $link['label'] ?? 'Link' }}</a>
@endforeach
</div>
</div>
@endif