fixed main frontend

This commit is contained in:
Mark Gregory
2026-07-27 11:45:03 +01:00
parent 16e7c6d010
commit 4a32be068c
18 changed files with 1471 additions and 132 deletions
@@ -0,0 +1,34 @@
@if ((bool) ($data['enabled'] ?? true))
@php
$includeIds = collect(explode(',', (string) ($data['include_ids'] ?? '')))->map(static fn ($id) => (int) trim($id))->filter();
$excludeIds = collect(explode(',', (string) ($data['exclude_ids'] ?? '')))->map(static fn ($id) => (int) trim($id))->filter();
$items = collect(${latestBlogPosts} ?? [])
->when($includeIds->isNotEmpty(), static fn ($collection) => $collection->filter(static fn ($item) => $includeIds->contains((int) $item->id)))
->reject(static fn ($item) => $excludeIds->contains((int) $item->id))
->take(max(1, (int) ($data['limit'] ?? 3)));
@endphp
@if ($items->isNotEmpty())
<section class="section">
<div class="wrap">
<div class="heading">
@if (filled($data['eyebrow'] ?? null))<span>{{ $data['eyebrow'] }}</span>@endif
@if (filled($data['heading'] ?? null))<h2>{{ $data['heading'] }}</h2>@endif
@if (filled($data['description'] ?? null))<p>{{ $data['description'] }}</p>@endif
</div>
<div class="grid three">
@foreach ($items as $post)
<article class="card">
@if ($post->published_at)<b>{{ optional($post->published_at)->format('d M Y') }}</b>@endif
<h3>{{ $post->title }}</h3>
@if (filled($post->excerpt))<p>{{ $post->excerpt }}</p>@endif
@if (Route::has('blog.public.show'))
<a class="read-more" href="{{ route('blog.public.show', $post->slug) }}">Read article →</a>
@endif
</article>
@endforeach
</div>
</div>
</section>
@endif
@endif
@@ -0,0 +1,11 @@
@if ((bool) ($data['enabled'] ?? true))
<section class="cta" @if (filled($data['anchor'] ?? null)) id="{{ $data['anchor'] }}" @endif>
<div class="wrap">
@if (filled($data['heading'] ?? null))<h2>{{ $data['heading'] }}</h2>@endif
@if (filled($data['description'] ?? null))<p>{{ $data['description'] }}</p>@endif
@if (filled($data['button_label'] ?? null))
<a class="btn light" href="{{ $data['button_url'] ?? '#' }}">{{ $data['button_label'] }} →</a>
@endif
</div>
</section>
@endif
@@ -0,0 +1,32 @@
@if ((bool) ($data['enabled'] ?? true))
@php
$includeIds = collect(explode(',', (string) ($data['include_ids'] ?? '')))->map(static fn ($id) => (int) trim($id))->filter();
$excludeIds = collect(explode(',', (string) ($data['exclude_ids'] ?? '')))->map(static fn ($id) => (int) trim($id))->filter();
$items = collect($faqs ?? [])
->when($includeIds->isNotEmpty(), static fn ($collection) => $collection->filter(static fn ($item) => $includeIds->contains((int) $item->id)))
->reject(static fn ($item) => $excludeIds->contains((int) $item->id))
->take(max(1, (int) ($data['limit'] ?? 12)));
@endphp
@if ($items->isNotEmpty())
<section class="section">
<div class="wrap faq">
<div>
@if (filled($data['eyebrow'] ?? null))<span class="section-label">{{ $data['eyebrow'] }}</span>@endif
@if (filled($data['heading'] ?? null))<h2>{{ $data['heading'] }}</h2>@endif
@if (filled($data['description'] ?? null))<p>{{ $data['description'] }}</p>@endif
</div>
<div>
@foreach ($items as $faq)
<article>
<button type="button" @click="openFaq = openFaq === {{ (int) $faq->id }} ? null : {{ (int) $faq->id }}">
{{ $faq->question }}<span>+</span>
</button>
<p x-cloak x-show="openFaq === {{ (int) $faq->id }}">{{ $faq->answer }}</p>
</article>
@endforeach
</div>
</div>
</section>
@endif
@endif
@@ -0,0 +1,26 @@
@if ((bool) ($data['enabled'] ?? true))
@php
$items = collect($data['items'] ?? [])->filter(static fn ($item) => (bool) ($item['enabled'] ?? true));
@endphp
@if ($items->isNotEmpty())
<section class="section" id="features">
<div class="wrap">
<div class="heading">
@if (filled($data['eyebrow'] ?? null))<span>{{ $data['eyebrow'] }}</span>@endif
@if (filled($data['heading'] ?? null))<h2>{{ $data['heading'] }}</h2>@endif
@if (filled($data['description'] ?? null))<p>{{ $data['description'] }}</p>@endif
</div>
<div class="grid three">
@foreach ($items as $item)
<article class="card">
<b>{{ str_pad((string) $loop->iteration, 2, '0', STR_PAD_LEFT) }}</b>
<h3>{{ $item['title'] ?? '' }}</h3>
@if (filled($item['description'] ?? null))<p>{{ $item['description'] }}</p>@endif
</article>
@endforeach
</div>
</div>
</section>
@endif
@endif
@@ -0,0 +1,46 @@
@if ((bool) ($data['enabled'] ?? true))
@php
$metrics = collect($data['metrics'] ?? [])->filter(static fn ($metric) => (bool) ($metric['enabled'] ?? true));
@endphp
<section class="hero">
<div class="glow one"></div>
<div class="glow two"></div>
<div class="wrap hero-inner">
@if (filled($data['eyebrow'] ?? null))<span class="eyebrow">{{ $data['eyebrow'] }}</span>@endif
<h1>{{ $data['heading'] ?? $document->title }}</h1>
@if (filled($data['description'] ?? null))<p>{{ $data['description'] }}</p>@endif
@if (filled($data['primary_label'] ?? null) || filled($data['secondary_label'] ?? null))
<div class="actions">
@if (filled($data['primary_label'] ?? null))
<a class="btn primary" href="{{ $data['primary_url'] ?? '#' }}">{{ $data['primary_label'] }} →</a>
@endif
@if (filled($data['secondary_label'] ?? null))
<a class="btn secondary" href="{{ $data['secondary_url'] ?? '#' }}">{{ $data['secondary_label'] }}</a>
@endif
</div>
@endif
@if ((bool) ($data['show_metrics'] ?? false) && $metrics->isNotEmpty())
<div class="dashboard">
<div class="dash-top"><b>Performance overview</b><span>Live</span></div>
<div class="metrics">
@foreach ($metrics as $metric)
<article>
<small>{{ $metric['label'] ?? '' }}</small>
<strong>{{ $metric['value'] ?? '' }}</strong>
<em>{{ $metric['change'] ?? '' }}</em>
</article>
@endforeach
</div>
<div class="chart">
@foreach ($metrics as $metric)
<i style="height: {{ max(0, min(100, (int) ($metric['height'] ?? 50))) }}%"></i>
@endforeach
</div>
</div>
@endif
</div>
</section>
@endif
@@ -0,0 +1,34 @@
@if ((bool) ($data['enabled'] ?? true))
@php
$includeIds = collect(explode(',', (string) ($data['include_ids'] ?? '')))->map(static fn ($id) => (int) trim($id))->filter();
$excludeIds = collect(explode(',', (string) ($data['exclude_ids'] ?? '')))->map(static fn ($id) => (int) trim($id))->filter();
$items = collect(${latestNewsArticles} ?? [])
->when($includeIds->isNotEmpty(), static fn ($collection) => $collection->filter(static fn ($item) => $includeIds->contains((int) $item->id)))
->reject(static fn ($item) => $excludeIds->contains((int) $item->id))
->take(max(1, (int) ($data['limit'] ?? 3)));
@endphp
@if ($items->isNotEmpty())
<section class="section">
<div class="wrap">
<div class="heading">
@if (filled($data['eyebrow'] ?? null))<span>{{ $data['eyebrow'] }}</span>@endif
@if (filled($data['heading'] ?? null))<h2>{{ $data['heading'] }}</h2>@endif
@if (filled($data['description'] ?? null))<p>{{ $data['description'] }}</p>@endif
</div>
<div class="grid three">
@foreach ($items as $article)
<article class="card">
@if ($article->published_at)<b>{{ optional($article->published_at)->format('d M Y') }}</b>@endif
<h3>{{ $article->title }}</h3>
@if (filled($article->excerpt))<p>{{ $article->excerpt }}</p>@endif
@if (Route::has('news.public.show'))
<a class="read-more" href="{{ route('news.public.show', $article->slug) }}">Read update →</a>
@endif
</article>
@endforeach
</div>
</div>
</section>
@endif
@endif
@@ -0,0 +1,20 @@
@if ((bool) ($data['enabled'] ?? true))
<section class="section alt">
<div class="wrap">
<div class="content-card newsletter-panel">
<div>
@if (filled($data['eyebrow'] ?? null))<span class="section-label">{{ $data['eyebrow'] }}</span>@endif
@if (filled($data['heading'] ?? null))<h2>{{ $data['heading'] }}</h2>@endif
@if (filled($data['description'] ?? null))<p>{{ $data['description'] }}</p>@endif
</div>
@if (Route::has('newsletter.public.subscribe'))
<form method="POST" action="{{ route('newsletter.public.subscribe') }}">
@csrf
<input type="email" name="email" required placeholder="{{ $data['placeholder'] ?? 'you@example.com' }}" aria-label="Email address">
<button class="btn primary" type="submit">{{ $data['button_label'] ?? 'Subscribe' }}</button>
</form>
@endif
</div>
</div>
</section>
@endif
@@ -0,0 +1,53 @@
@if ((bool) ($data['enabled'] ?? true))
@php
$includeIds = collect(explode(',', (string) ($data['include_ids'] ?? '')))
->map(static fn ($id) => (int) trim($id))
->filter()
->values();
$excludeIds = collect(explode(',', (string) ($data['exclude_ids'] ?? '')))
->map(static fn ($id) => (int) trim($id))
->filter()
->values();
$items = collect($pricingPlans ?? [])
->when($includeIds->isNotEmpty(), static fn ($collection) => $collection->filter(
static fn ($item) => $includeIds->contains((int) $item->id)
))
->reject(static fn ($item) => $excludeIds->contains((int) $item->id))
->take(max(1, (int) ($data['limit'] ?? 6)));
@endphp
@if ($items->isNotEmpty())
<section class="section alt" id="pricing">
<div class="wrap">
<div class="heading">
@if (filled($data['eyebrow'] ?? null))<span>{{ $data['eyebrow'] }}</span>@endif
@if (filled($data['heading'] ?? null))<h2>{{ $data['heading'] }}</h2>@endif
@if (filled($data['description'] ?? null))<p>{{ $data['description'] }}</p>@endif
</div>
<div class="grid three pricing">
@foreach ($items as $plan)
<article class="card plan {{ $plan->is_featured ? 'featured' : '' }}">
@if ($plan->is_featured)<div class="popular">Most popular</div>@endif
<h3>{{ $plan->name }}</h3>
<strong>
@if ($plan->price !== null)
{{ $plan->currency === 'GBP' ? '£' : $plan->currency.' ' }}{{ rtrim(rtrim(number_format((float) $plan->price, 2), '0'), '.') }}
<small>/{{ $plan->billing_period ?: 'month' }}</small>
@else
Custom
@endif
</strong>
@if (filled($plan->description))<p>{{ $plan->description }}</p>@endif
@if (! empty($plan->features))
<ul>@foreach ((array) $plan->features as $feature)<li>{{ $feature }}</li>@endforeach</ul>
@endif
<a class="btn {{ $plan->is_featured ? 'primary' : 'secondary' }}" href="{{ $plan->cta_url ?: '#contact' }}">
{{ $plan->cta_label ?: 'Learn more' }}
</a>
</article>
@endforeach
</div>
</div>
</section>
@endif
@endif
@@ -0,0 +1,3 @@
@if ((bool) ($data['enabled'] ?? true))
@include('stylist-theme-saasland::partials.footer', ['footerContent' => $data])
@endif
@@ -0,0 +1,3 @@
@if ((bool) ($data['enabled'] ?? true))
@include('stylist-theme-saasland::partials.header', ['headerContent' => $data])
@endif
@@ -0,0 +1,31 @@
@if ((bool) ($data['enabled'] ?? true))
@php
$includeIds = collect(explode(',', (string) ($data['include_ids'] ?? '')))->map(static fn ($id) => (int) trim($id))->filter();
$excludeIds = collect(explode(',', (string) ($data['exclude_ids'] ?? '')))->map(static fn ($id) => (int) trim($id))->filter();
$items = collect($teamMembers ?? [])
->when($includeIds->isNotEmpty(), static fn ($collection) => $collection->filter(static fn ($item) => $includeIds->contains((int) $item->id)))
->reject(static fn ($item) => $excludeIds->contains((int) $item->id))
->take(max(1, (int) ($data['limit'] ?? 8)));
@endphp
@if ($items->isNotEmpty())
<section class="section alt">
<div class="wrap">
<div class="heading">
@if (filled($data['eyebrow'] ?? null))<span>{{ $data['eyebrow'] }}</span>@endif
@if (filled($data['heading'] ?? null))<h2>{{ $data['heading'] }}</h2>@endif
@if (filled($data['description'] ?? null))<p>{{ $data['description'] }}</p>@endif
</div>
<div class="grid three">
@foreach ($items as $member)
<article class="card">
<h3>{{ $member->name }}</h3>
@if (filled($member->job_title))<b>{{ $member->job_title }}</b>@endif
@if (filled($member->biography))<p>{{ $member->biography }}</p>@endif
</article>
@endforeach
</div>
</div>
</section>
@endif
@endif
@@ -0,0 +1,30 @@
@if ((bool) ($data['enabled'] ?? true))
@php
$includeIds = collect(explode(',', (string) ($data['include_ids'] ?? '')))->map(static fn ($id) => (int) trim($id))->filter();
$excludeIds = collect(explode(',', (string) ($data['exclude_ids'] ?? '')))->map(static fn ($id) => (int) trim($id))->filter();
$items = collect($testimonials ?? [])
->when($includeIds->isNotEmpty(), static fn ($collection) => $collection->filter(static fn ($item) => $includeIds->contains((int) $item->id)))
->reject(static fn ($item) => $excludeIds->contains((int) $item->id))
->take(max(1, (int) ($data['limit'] ?? 6)));
@endphp
@if ($items->isNotEmpty())
<section class="section">
<div class="wrap">
<div class="heading">
@if (filled($data['eyebrow'] ?? null))<span>{{ $data['eyebrow'] }}</span>@endif
@if (filled($data['heading'] ?? null))<h2>{{ $data['heading'] }}</h2>@endif
@if (filled($data['description'] ?? null))<p>{{ $data['description'] }}</p>@endif
</div>
<div class="grid three">
@foreach ($items as $testimonial)
<blockquote class="card">
“{{ $testimonial->content }}”
<footer>{{ $testimonial->name }}@if ($testimonial->company) · {{ $testimonial->company }}@endif</footer>
</blockquote>
@endforeach
</div>
</div>
</section>
@endif
@endif
@@ -0,0 +1,37 @@
@php($footerContent = $footerContent ?? [])
<footer class="footer">
<div class="wrap footer-grid">
<div class="footer-brand">
<a class="logo" href="{{ url('/') }}">{{ $siteTitle }}</a>
<p>{{ $footerContent['description'] ?? $siteDescription }}</p>
</div>
@if($footerContent['show_navigation'] ?? true)<div>
<b>Explore</b>
@foreach ($footerNavigation as $item)
<a href="{{ $item['url'] }}">{{ $item['label'] }}</a>
@endforeach
</div>@endif
@if($footerContent['show_account_links'] ?? true)<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>@endif
@if($footerContent['show_social_links'] ?? true)<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
</div>@endif
</div>
<div class="wrap copyright">
<span>© {{ date('Y') }} {{ $siteTitle }}. {{ $footerContent['copyright'] ?? 'All rights reserved.' }}</span>
@if($footerContent['show_back_to_top'] ?? true)<a href="#top">Back to top ↑</a>@endif
</div>
</footer>
@@ -0,0 +1,69 @@
@php($headerContent = $headerContent ?? [])
<header class="nav">
<a href="{{ url('/') }}" class="logo" aria-label="{{ $siteTitle }} home">
@if ($logoUrl)
<img src="{{ $logoUrl }}" alt="{{ $siteTitle }}">
@else
{{ $siteTitle }}
@endif
</a>
@if($headerContent['show_navigation'] ?? true)<nav class="desktop-nav" aria-label="Primary navigation">
@include('stylist-theme-saasland::partials.navigation-items', ['items' => $primaryNavigation])
</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 (($headerContent['show_login'] ?? true) && Route::has('login'))
<a class="nav-login" href="{{ route('login') }}">{{ $headerContent['login_label'] ?? 'Log in' }}</a>
@endif
@if (($headerContent['show_registration'] ?? true) && 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>
</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
</div>
</div>