Add more invite background presets
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-23 22:54:54 +01:00
parent 14bb375674
commit 6bd75b0788
5 changed files with 91 additions and 3 deletions

View File

@@ -22,7 +22,14 @@ class EventJoinTokenLayoutController extends Controller
*/ */
private const BACKGROUND_PRESETS = [ private const BACKGROUND_PRESETS = [
'bg-blue-floral' => 'storage/layouts/backgrounds-portrait/bg-blue-floral.png', 'bg-blue-floral' => 'storage/layouts/backgrounds-portrait/bg-blue-floral.png',
'bg-artdeco' => 'storage/layouts/backgrounds-portrait/bg-artdeco.png',
'bg-eukalyptus-floral' => 'storage/layouts/backgrounds-portrait/bg-eukalyptus-floral.png',
'bg-eukalyptus-rahmen' => 'storage/layouts/backgrounds-portrait/bg-eukalyptus-rahmen.png',
'bg-eukalyptus' => 'storage/layouts/backgrounds-portrait/bg-eukalyptus.png',
'bg-goldframe' => 'storage/layouts/backgrounds-portrait/bg-goldframe.png', 'bg-goldframe' => 'storage/layouts/backgrounds-portrait/bg-goldframe.png',
'bg-jugendstil' => 'storage/layouts/backgrounds-portrait/bg-jugendstil.png',
'bg-kornblumen' => 'storage/layouts/backgrounds-portrait/bg-kornblumen.png',
'bg-kornblumen2' => 'storage/layouts/backgrounds-portrait/bg-kornblumen2.png',
'gr-green-floral' => 'storage/layouts/backgrounds-portrait/gr-green-floral.png', 'gr-green-floral' => 'storage/layouts/backgrounds-portrait/gr-green-floral.png',
]; ];

View File

@@ -1013,9 +1013,16 @@
"foldable": "{{paper}} {{orientation}} (doppelt A5/gespiegelt)" "foldable": "{{paper}} {{orientation}} (doppelt A5/gespiegelt)"
}, },
"backgroundPresets": { "backgroundPresets": {
"artDeco": "Art Déco",
"blueFloral": "Blau Floral", "blueFloral": "Blau Floral",
"eukalyptus": "Eukalyptus",
"eukalyptusFloral": "Eukalyptus Floral",
"eukalyptusFrame": "Eukalyptus Rahmen",
"goldFrame": "Goldrahmen", "goldFrame": "Goldrahmen",
"greenFloral": "Grün Floral" "greenFloral": "Grün Floral",
"jugendstil": "Jugendstil",
"kornblumen": "Kornblumen",
"kornblumenTwo": "Kornblumen II"
}, },
"gradientPresets": { "gradientPresets": {
"softLilac": "Sanftes Flieder", "softLilac": "Sanftes Flieder",

View File

@@ -1009,9 +1009,16 @@
"foldable": "{{paper}} {{orientation}} (double A5/mirrored)" "foldable": "{{paper}} {{orientation}} (double A5/mirrored)"
}, },
"backgroundPresets": { "backgroundPresets": {
"artDeco": "Art deco",
"blueFloral": "Blue floral", "blueFloral": "Blue floral",
"eukalyptus": "Eucalyptus",
"eukalyptusFloral": "Eucalyptus floral",
"eukalyptusFrame": "Eucalyptus frame",
"goldFrame": "Gold frame", "goldFrame": "Gold frame",
"greenFloral": "Green floral" "greenFloral": "Green floral",
"jugendstil": "Art nouveau",
"kornblumen": "Cornflowers",
"kornblumenTwo": "Cornflowers II"
}, },
"gradientPresets": { "gradientPresets": {
"softLilac": "Soft lilac", "softLilac": "Soft lilac",

View File

@@ -45,12 +45,54 @@ const BACKGROUND_PRESETS = [
labelKey: 'events.qr.backgroundPresets.blueFloral', labelKey: 'events.qr.backgroundPresets.blueFloral',
label: 'Blue Floral', label: 'Blue Floral',
}, },
{
id: 'bg-artdeco',
src: '/storage/layouts/backgrounds-portrait/bg-artdeco.png',
labelKey: 'events.qr.backgroundPresets.artDeco',
label: 'Art Deco',
},
{
id: 'bg-eukalyptus-floral',
src: '/storage/layouts/backgrounds-portrait/bg-eukalyptus-floral.png',
labelKey: 'events.qr.backgroundPresets.eukalyptusFloral',
label: 'Eucalyptus Floral',
},
{
id: 'bg-eukalyptus-rahmen',
src: '/storage/layouts/backgrounds-portrait/bg-eukalyptus-rahmen.png',
labelKey: 'events.qr.backgroundPresets.eukalyptusFrame',
label: 'Eucalyptus Frame',
},
{
id: 'bg-eukalyptus',
src: '/storage/layouts/backgrounds-portrait/bg-eukalyptus.png',
labelKey: 'events.qr.backgroundPresets.eukalyptus',
label: 'Eucalyptus',
},
{ {
id: 'bg-goldframe', id: 'bg-goldframe',
src: '/storage/layouts/backgrounds-portrait/bg-goldframe.png', src: '/storage/layouts/backgrounds-portrait/bg-goldframe.png',
labelKey: 'events.qr.backgroundPresets.goldFrame', labelKey: 'events.qr.backgroundPresets.goldFrame',
label: 'Gold Frame', label: 'Gold Frame',
}, },
{
id: 'bg-jugendstil',
src: '/storage/layouts/backgrounds-portrait/bg-jugendstil.png',
labelKey: 'events.qr.backgroundPresets.jugendstil',
label: 'Jugendstil',
},
{
id: 'bg-kornblumen',
src: '/storage/layouts/backgrounds-portrait/bg-kornblumen.png',
labelKey: 'events.qr.backgroundPresets.kornblumen',
label: 'Cornflowers',
},
{
id: 'bg-kornblumen2',
src: '/storage/layouts/backgrounds-portrait/bg-kornblumen2.png',
labelKey: 'events.qr.backgroundPresets.kornblumenTwo',
label: 'Cornflowers II',
},
{ {
id: 'gr-green-floral', id: 'gr-green-floral',
src: '/storage/layouts/backgrounds-portrait/gr-green-floral.png', src: '/storage/layouts/backgrounds-portrait/gr-green-floral.png',
@@ -755,7 +797,7 @@ function BackgroundStep({
return ( return (
<Pressable key={preset.id ?? preset.labelKey} onPress={() => onSelectPreset(preset.id)} style={{ width: '48%' }}> <Pressable key={preset.id ?? preset.labelKey} onPress={() => onSelectPreset(preset.id)} style={{ width: '48%' }}>
<YStack <YStack
aspectRatio={210 / 297} aspectRatio={CANVAS_WIDTH / CANVAS_HEIGHT}
maxHeight={220} maxHeight={220}
borderRadius={14} borderRadius={14}
overflow="hidden" overflow="hidden"

View File

@@ -0,0 +1,25 @@
<?php
namespace Tests\Unit;
use App\Http\Controllers\Api\Tenant\EventJoinTokenLayoutController;
use ReflectionClass;
use Tests\TestCase;
class EventJoinTokenLayoutControllerPresetsTest extends TestCase
{
public function test_background_preset_assets_exist(): void
{
$reflection = new ReflectionClass(EventJoinTokenLayoutController::class);
$presets = $reflection->getConstant('BACKGROUND_PRESETS');
$this->assertIsArray($presets);
$this->assertNotEmpty($presets);
foreach ($presets as $key => $path) {
$this->assertIsString($path);
$this->assertNotSame('', $path);
$this->assertFileExists(public_path($path), "Missing background asset for preset {$key}.");
}
}
}