Offers by their own rules, seasonal photos per section, theme authoring tooling
- Special offers: kinds (rule, fixed dates, gap filler), package price, priority, highlight;
GapFinder detects calendar gaps (optionally waiving the minimum stay); OfferShowcase decides
what the website advertises and prices fixed dates/gaps with PriceCalculator; offers section
shows them side by side, as a list or rotating; hero can show the top offer. Appearances no
longer carry a featured offer.
- Sections get stable ids; appearances set photos per section ("Bilder je Baustein") and
sections can be limited to appearances. Photo pickers show thumbnails everywhere.
- Themes: themes:make (scaffold, never overwrites), themes:check (contract, build, markup,
colours, external resources, WCAG contrast), themes:preview (signed links per page and
appearance), signed ?theme= preview and preview action in the site form, inherited colour
tokens in the admin. Base CSS split into theme.css + reusable theme-base.css.
- docs/THEME-ERSTELLUNG.md: binding guide for building additional themes elsewhere.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bc77b64ea7
commit
7d0bc93abc
50 files changed
+2805
-259
No files matched your search
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('special_offers', function (Blueprint $table) {
|
||||
$table->string('kind', 20)->default('rule')->after('name');
|
||||
$table->unsignedSmallInteger('max_gap_nights')->nullable()->after('max_nights');
|
||||
$table->boolean('waives_min_stay')->default(false)->after('max_gap_nights');
|
||||
$table->integer('priority')->default(0)->after('is_combinable');
|
||||
$table->boolean('is_featured')->default(false)->after('priority');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('special_offers', function (Blueprint $table) {
|
||||
$table->dropColumn(['kind', 'max_gap_nights', 'waives_min_stay', 'priority', 'is_featured']);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Offers are advertised by their own rules now (OfferShowcase) instead of per appearance;
|
||||
* appearances get photos per section instead.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('appearances', function (Blueprint $table) {
|
||||
$table->dropConstrainedForeignId('featured_offer_id');
|
||||
$table->json('section_photos')->nullable()->after('hero_photo_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('appearances', function (Blueprint $table) {
|
||||
$table->dropColumn('section_photos');
|
||||
$table->foreignId('featured_offer_id')->nullable()->constrained('special_offers')->nullOnDelete();
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Page;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Existing pages: every placed section gets its stable id (see Page::assignSectionIds).
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
DB::table('pages')->orderBy('id')->each(function (object $page): void {
|
||||
$sections = json_decode((string) $page->sections, true);
|
||||
if (! is_array($sections)) {
|
||||
return;
|
||||
}
|
||||
|
||||
DB::table('pages')->where('id', $page->id)->update(['sections' => json_encode(Page::assignSectionIds($sections))]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Ids are harmless when rolling back; nothing to undo.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user