From 0c26d8db8f603c8884c6072268c2c5c89987d0d8 Mon Sep 17 00:00:00 2001 From: Mark Gregory Date: Mon, 27 Jul 2026 08:39:20 +0100 Subject: [PATCH] Visual header, body, and footer composition screen. * Drag-and-drop section ordering with automatic saving. * Add existing reusable documents to regions. * Remove placements without deleting documents. * Create independent page-specific copies. * Shared-document usage warnings. * Document creation, duplication, deletion protection and filtering. * Draft and published document states. * Document and placement scheduling. * Authenticated homepage preview. * Draft sections displayed in preview with a clear draft marker. * Content Composer added to the administration sidebar. * Public rendering now respects: * Publication status * Future publication dates * Expiry dates * Placement start and end dates * Enabled state * Original Saasland homepage remains as the fallback when no composition exists. --- Modules/Content/Console/InstallSaaslandContent.php | 14 ++++++++++++++ .../Stylist/Tests/Feature/WelcomeThemeViewTest.php | 3 ++- resources/themes/saasland/views/home.blade.php | 10 +++++++++- storage/framework/cache/.gitignore | 3 +++ storage/framework/cache/data/.gitignore | 2 ++ storage/framework/sessions/.gitignore | 2 ++ storage/framework/views/.gitignore | 2 ++ 7 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 storage/framework/cache/.gitignore create mode 100644 storage/framework/cache/data/.gitignore create mode 100644 storage/framework/sessions/.gitignore diff --git a/Modules/Content/Console/InstallSaaslandContent.php b/Modules/Content/Console/InstallSaaslandContent.php index 371729d..67fd9e0 100644 --- a/Modules/Content/Console/InstallSaaslandContent.php +++ b/Modules/Content/Console/InstallSaaslandContent.php @@ -3,6 +3,7 @@ namespace Modules\Content\Console; use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Schema; use Modules\Content\Models\ContentDocument; use Modules\Content\Models\ContentType; use Modules\Content\Models\PageContent; @@ -14,6 +15,19 @@ final class InstallSaaslandContent extends Command public function handle(): int { + $requiredTables = ['content_types', 'content_documents', 'page_content']; + $missingTables = array_values(array_filter( + $requiredTables, + static fn (string $table): bool => ! Schema::hasTable($table), + )); + + if ($missingTables !== []) { + $this->components->error('Content composition tables are missing: '.implode(', ', $missingTables).'.'); + $this->components->info('Run php artisan migrate before installing the Saasland composition.'); + + return self::FAILURE; + } + DB::transaction(function (): void { if ($this->option('force')) PageContent::query()->where('page_key','home')->delete(); $definitions = $this->definitions(); diff --git a/Modules/Stylist/Tests/Feature/WelcomeThemeViewTest.php b/Modules/Stylist/Tests/Feature/WelcomeThemeViewTest.php index 5323843..ec7624b 100644 --- a/Modules/Stylist/Tests/Feature/WelcomeThemeViewTest.php +++ b/Modules/Stylist/Tests/Feature/WelcomeThemeViewTest.php @@ -15,6 +15,7 @@ final class WelcomeThemeViewTest extends TestCase { $this->get('/') ->assertOk() - ->assertViewIs('stylist-theme-saasland::home'); + ->assertViewIs('stylist-theme-saasland::home') + ->assertSee('Transform Your Business With Our SaaS Solution'); } } diff --git a/resources/themes/saasland/views/home.blade.php b/resources/themes/saasland/views/home.blade.php index f08bd71..e6ca458 100644 --- a/resources/themes/saasland/views/home.blade.php +++ b/resources/themes/saasland/views/home.blade.php @@ -13,6 +13,14 @@ @if($hasComposition) {!! $contentRenderer->renderRegion($pageKey, 'body') !!} @else - @include('stylist-theme-saasland::legacy-home-content') + @include('stylist-theme-saasland::legacy-home-content', [ + 'enabled' => fn (string $key, bool $default = true) => filter_var($themeSettings[$key] ?? $default, FILTER_VALIDATE_BOOL), + 'heroTitle' => filled($themeSettings['hero_title'] ?? null) + ? $themeSettings['hero_title'] + : 'Transform Your Business With Our SaaS Solution', + 'heroText' => filled($themeSettings['hero_description'] ?? null) + ? $themeSettings['hero_description'] + : 'Streamline operations, boost productivity, and improve customer satisfaction with one connected platform built for modern teams.', + ]) @endif @endsection diff --git a/storage/framework/cache/.gitignore b/storage/framework/cache/.gitignore new file mode 100644 index 0000000..01e4a6c --- /dev/null +++ b/storage/framework/cache/.gitignore @@ -0,0 +1,3 @@ +* +!data/ +!.gitignore diff --git a/storage/framework/cache/data/.gitignore b/storage/framework/cache/data/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/framework/cache/data/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/sessions/.gitignore b/storage/framework/sessions/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/framework/sessions/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/views/.gitignore b/storage/framework/views/.gitignore index e69de29..d6b7ef3 100644 --- a/storage/framework/views/.gitignore +++ b/storage/framework/views/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore