- Reworked the tenant admin login page

- Updated the User model to implement Filament’s tenancy contracts
- Seeded a ready-to-use demo tenant (user, tenant, active package, purchase)
- Introduced a branded, translated 403 error page to replace the generic forbidden message for unauthorised admin hits
- Removed the public “Register” links from the marketing header
- hardened join event logic and improved error handling in the guest pwa.
This commit is contained in:
Codex Agent
2025-10-13 12:50:46 +02:00
parent 9394c3171e
commit 64a5411fb9
69 changed files with 5447 additions and 588 deletions

View File

@@ -5,6 +5,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ __('admin.shell.tenant_admin_title') }}</title>
<link rel="manifest" href="/manifest.json">
<meta name="theme-color" content="#f43f5e">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
@viteReactRefresh
@vite('resources/js/admin/main.tsx')
</head>

View File

@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ __('admin.errors.forbidden.title') }}</title>
@vite('resources/css/app.css')
</head>
<body class="min-h-screen bg-slate-950 text-slate-100">
<div class="flex min-h-screen items-center justify-center px-6 py-12">
<div class="max-w-lg rounded-3xl border border-white/10 bg-white/5 p-10 shadow-2xl backdrop-blur">
<p class="text-sm uppercase tracking-widest text-pink-400">403</p>
<h1 class="mt-2 text-3xl font-semibold text-white">{{ __('admin.errors.forbidden.title') }}</h1>
<p class="mt-4 text-base text-slate-200">{{ __('admin.errors.forbidden.message') }}</p>
<p class="mt-2 text-sm text-slate-400">{{ __('admin.errors.forbidden.hint') }}</p>
<div class="mt-8">
<a href="{{ url('/') }}" class="inline-flex items-center rounded-full bg-pink-500 px-5 py-2 text-sm font-semibold text-white shadow-lg transition hover:bg-pink-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-pink-500">
{{ __('admin.errors.forbidden.cta') }}
</a>
</div>
</div>
</div>
</body>
</html>

View File

@@ -1,16 +1,125 @@
<div class="space-y-3">
<div class="text-sm">{{ __('admin.events.join_link.link_label') }}</div>
<div class="rounded border bg-gray-50 p-2 text-sm dark:bg-gray-900">
<a href="{{ $link }}" target="_blank" class="underline">
{{ $link }}
<div class="space-y-5">
<div class="rounded-lg border border-amber-200 bg-amber-50 p-4 text-sm text-amber-800 dark:border-amber-400/60 dark:bg-amber-500/10 dark:text-amber-100">
<div class="flex flex-col gap-1">
<div class="text-xs font-semibold uppercase tracking-wide text-amber-600 dark:text-amber-300">{{ __('admin.events.join_link.event_label') }}</div>
<div class="text-base font-semibold text-amber-900 dark:text-amber-100">{{ $event->name }}</div>
</div>
<p class="mt-3 text-xs leading-relaxed text-amber-700 dark:text-amber-200">
{{ __('admin.events.join_link.deprecated_notice', ['slug' => $event->slug]) }}
</p>
<a
href="{{ url('/event-admin/events/' . $event->slug) }}"
target="_blank"
rel="noreferrer"
class="mt-3 inline-flex items-center gap-2 rounded bg-amber-600 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-white transition hover:bg-amber-700 focus:outline-none focus:ring-2 focus:ring-amber-500 focus:ring-offset-2 dark:hover:bg-amber-500"
>
{{ __('admin.events.join_link.open_admin') }}
</a>
</div>
<div class="text-sm">{{ __('admin.events.join_link.qr_code_label') }}</div>
<div class="flex items-center justify-center">
{!! \SimpleSoftwareIO\QrCode\Facades\QrCode::size(300)->generate($link) !!}
</div>
<div class="text-xs text-muted-foreground">
{!! __('admin.events.join_link.note_html') !!}
</div>
</div>
@if ($tokens->isEmpty())
<div class="rounded border border-amber-200 bg-amber-50 p-4 text-sm text-amber-800 dark:border-amber-400/60 dark:bg-amber-500/10 dark:text-amber-100">
{{ __('admin.events.join_link.no_tokens') }}
</div>
@else
<div class="space-y-4">
@foreach ($tokens as $token)
<div class="rounded-xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-700 dark:bg-slate-900/80">
<div class="flex flex-wrap items-center justify-between gap-3">
<div>
<div class="text-sm font-semibold text-slate-800 dark:text-slate-100">
{{ $token['label'] ?? __('admin.events.join_link.token_default', ['id' => $token['id']]) }}
</div>
<div class="text-xs text-slate-500 dark:text-slate-400">
{{ __('admin.events.join_link.token_usage', [
'usage' => $token['usage_count'],
'limit' => $token['usage_limit'] ?? '∞',
]) }}
</div>
</div>
<div>
@if ($token['is_active'])
<span class="rounded-full bg-emerald-100 px-3 py-1 text-xs font-medium text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-200">
{{ __('admin.events.join_link.token_active') }}
</span>
@else
<span class="rounded-full bg-slate-200 px-3 py-1 text-xs font-medium text-slate-700 dark:bg-slate-700 dark:text-slate-200">
{{ __('admin.events.join_link.token_inactive') }}
</span>
@endif
</div>
</div>
<div class="mt-3 space-y-2">
<div class="text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400">
{{ __('admin.events.join_link.link_label') }}
</div>
<div class="flex flex-wrap items-center gap-3">
<code class="rounded bg-slate-100 px-2 py-1 text-xs text-slate-700 dark:bg-slate-800 dark:text-slate-100">
{{ $token['url'] }}
</code>
<button
x-data
@click.prevent="navigator.clipboard.writeText('{{ $token['url'] }}')"
class="rounded border border-slate-200 px-2 py-1 text-xs font-medium text-slate-600 transition hover:bg-slate-100 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
>
{{ __('admin.events.join_link.copy_link') }}
</button>
</div>
</div>
@if (!empty($token['layouts']))
<div class="mt-4 space-y-3">
<div class="text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400">
{{ __('admin.events.join_link.layouts_heading') }}
</div>
<div class="grid gap-3 md:grid-cols-2">
@foreach ($token['layouts'] as $layout)
<div class="rounded-lg border border-slate-200 bg-slate-50 p-3 text-xs text-slate-700 dark:border-slate-700 dark:bg-slate-800/70 dark:text-slate-200">
<div class="font-semibold text-slate-900 dark:text-slate-100">
{{ $layout['name'] }}
</div>
@if (!empty($layout['subtitle']))
<div class="text-[11px] text-slate-500 dark:text-slate-400">
{{ $layout['subtitle'] }}
</div>
@endif
<div class="mt-2 flex flex-wrap gap-2">
@foreach ($layout['download_urls'] as $format => $href)
<a
href="{{ $href }}"
target="_blank"
rel="noreferrer"
class="inline-flex items-center gap-1 rounded border border-amber-300 bg-amber-100 px-2 py-1 text-[11px] font-medium text-amber-800 transition hover:bg-amber-200 dark:border-amber-500/50 dark:bg-amber-500/10 dark:text-amber-200 dark:hover:bg-amber-500/20"
>
{{ strtoupper($format) }}
</a>
@endforeach
</div>
</div>
@endforeach
</div>
</div>
@elseif(!empty($token['layouts_url']))
<div class="mt-4">
<a
href="{{ $token['layouts_url'] }}"
target="_blank"
rel="noreferrer"
class="inline-flex items-center gap-1 text-xs font-medium text-amber-700 underline decoration-dotted hover:text-amber-800 dark:text-amber-300"
>
{{ __('admin.events.join_link.layouts_fallback') }}
</a>
</div>
@endif
@if ($token['expires_at'])
<div class="mt-4 text-xs text-slate-500 dark:text-slate-400">
{{ __('admin.events.join_link.token_expiry', ['date' => \Carbon\Carbon::parse($token['expires_at'])->isoFormat('LLL')]) }}
</div>
@endif
</div>
@endforeach
</div>
@endif
</div>

View File

@@ -0,0 +1,206 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>{{ $eventName }} Einladungs-QR</title>
<style>
:root {
--accent: {{ $layout['accent'] }};
--secondary: {{ $layout['secondary'] }};
--text: {{ $layout['text'] }};
--badge: {{ $layout['badge'] }};
--container-padding: 48px;
--qr-size: 340px;
--background: {{ $backgroundStyle }};
}
* {
box-sizing: border-box;
}
html, body {
margin: 0;
padding: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: var(--text);
}
body {
min-height: 100%;
position: relative;
}
.layout-wrapper {
width: 100%;
height: 100%;
padding: var(--container-padding);
display: flex;
flex-direction: column;
justify-content: space-between;
background: var(--background);
}
.header {
display: flex;
flex-direction: column;
gap: 12px;
}
.badge {
display: inline-flex;
align-items: center;
gap: 10px;
background: var(--badge);
color: #fff;
padding: 10px 18px;
border-radius: 999px;
font-size: 15px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
width: fit-content;
}
.event-title {
font-size: 72px;
font-weight: 700;
line-height: 1.05;
margin: 0;
}
.subtitle {
font-size: 24px;
font-weight: 500;
color: rgba(17, 24, 39, 0.7);
margin: 0;
}
.content {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
gap: 40px;
margin-top: 48px;
align-items: center;
}
.info-card {
background: rgba(255, 255, 255, 0.65);
border-radius: 32px;
padding: 32px;
display: flex;
flex-direction: column;
gap: 18px;
box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}
.info-card h2 {
margin: 0;
font-size: 32px;
font-weight: 700;
}
.info-card p {
margin: 0;
font-size: 18px;
line-height: 1.6;
}
.instructions {
margin: 0;
padding-left: 22px;
display: flex;
flex-direction: column;
gap: 12px;
}
.instructions li {
font-size: 18px;
line-height: 1.5;
}
.link-box {
background: var(--secondary);
color: var(--text);
font-family: "Courier New", Courier, monospace;
border-radius: 16px;
padding: 18px 20px;
font-size: 18px;
word-break: break-all;
}
.qr-wrapper {
display: flex;
flex-direction: column;
align-items: center;
gap: 18px;
}
.qr-wrapper img {
width: var(--qr-size);
height: var(--qr-size);
}
.cta {
font-size: 20px;
font-weight: 600;
color: var(--accent);
text-transform: uppercase;
letter-spacing: 0.08em;
}
.footer {
margin-top: 48px;
display: flex;
justify-content: space-between;
align-items: flex-end;
font-size: 16px;
color: rgba(17, 24, 39, 0.6);
}
.footer strong {
color: var(--accent);
}
</style>
</head>
<body>
<div class="layout-wrapper">
<div class="header">
<span class="badge">Digitale Gästebox</span>
<h1 class="event-title">{{ $eventName }}</h1>
@if(!empty($layout['subtitle']))
<p class="subtitle">{{ $layout['subtitle'] }}</p>
@endif
</div>
<div class="content">
<div class="info-card">
<h2>So funktioniert&rsquo;s</h2>
<p>{{ $layout['description'] }}</p>
@if(!empty($layout['instructions']))
<ul class="instructions">
@foreach($layout['instructions'] as $step)
<li>{{ $step }}</li>
@endforeach
</ul>
@endif
<div>
<div class="cta">Alternative zum Einscannen</div>
<div class="link-box">{{ $tokenUrl }}</div>
</div>
</div>
<div class="qr-wrapper">
<img src="{{ $qrPngDataUri }}" alt="QR-Code zum Event {{ $eventName }}">
<div class="cta">Scan mich & starte direkt</div>
</div>
</div>
<div class="footer">
<div>
<strong>{{ config('app.name', 'Fotospiel') }}</strong> Gästebox & Fotochallenges
</div>
<div>Einladungsgültigkeit: {{ $joinToken->expires_at ? $joinToken->expires_at->isoFormat('LLL') : 'bis Widerruf' }}</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,159 @@
@php
$width = $layout['svg']['width'] ?? 1080;
$height = $layout['svg']['height'] ?? 1520;
$background = $layout['background'] ?? '#FFFFFF';
$gradient = $layout['background_gradient'] ?? null;
$gradientId = $gradient ? 'bg-gradient-'.uniqid() : null;
$accent = $layout['accent'] ?? '#000000';
$secondary = $layout['secondary'] ?? '#E5E7EB';
$textColor = $layout['text'] ?? '#111827';
$badgeColor = $layout['badge'] ?? $accent;
$instructions = $layout['instructions'] ?? [];
$description = $layout['description'] ?? '';
$subtitle = $layout['subtitle'] ?? '';
$titleLines = explode("\n", wordwrap($eventName, 18, "\n", true));
$subtitleLines = $subtitle !== '' ? explode("\n", wordwrap($subtitle, 36, "\n", true)) : [];
$descriptionLines = $description !== '' ? explode("\n", wordwrap($description, 40, "\n", true)) : [];
$instructionStartY = 870;
$instructionSpacing = 56;
if ($gradient) {
$angle = (float) ($gradient['angle'] ?? 180);
$angleRad = deg2rad($angle);
$x1 = 0.5 - cos($angleRad) / 2;
$y1 = 0.5 - sin($angleRad) / 2;
$x2 = 0.5 + cos($angleRad) / 2;
$y2 = 0.5 + sin($angleRad) / 2;
$x1Attr = number_format($x1, 4, '.', '');
$y1Attr = number_format($y1, 4, '.', '');
$x2Attr = number_format($x2, 4, '.', '');
$y2Attr = number_format($y2, 4, '.', '');
}
@endphp
<svg width="{{ $width }}" height="{{ $height }}" viewBox="0 0 {{ $width }} {{ $height }}" xmlns="http://www.w3.org/2000/svg">
<defs>
@if($gradientId)
<linearGradient id="{{ $gradientId }}" x1="{{ $x1Attr }}" y1="{{ $y1Attr }}" x2="{{ $x2Attr }}" y2="{{ $y2Attr }}">
@php
$stops = $gradient['stops'] ?? [];
$stopCount = max(count($stops) - 1, 1);
@endphp
@foreach($stops as $index => $stopColor)
@php
$offset = $stopCount > 0 ? ($index / $stopCount) * 100 : 0;
@endphp
<stop offset="{{ number_format($offset, 2, '.', '') }}%" stop-color="{{ $stopColor }}"/>
@endforeach
</linearGradient>
@endif
</defs>
<style>
.title-line {
font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
font-size: 82px;
font-weight: 700;
letter-spacing: -1px;
}
.subtitle-line {
font-family: 'Lora', 'Georgia', serif;
font-size: 32px;
font-weight: 500;
}
.description-line {
font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
font-size: 30px;
font-weight: 400;
line-height: 1.4;
}
.badge-text {
font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
font-size: 28px;
font-weight: 600;
letter-spacing: 4px;
text-transform: uppercase;
}
.instruction-bullet {
font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
font-size: 30px;
font-weight: 600;
}
.instruction-text {
font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
font-size: 30px;
font-weight: 400;
}
.small-label {
font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
font-size: 28px;
font-weight: 600;
letter-spacing: 3px;
text-transform: uppercase;
}
.link-text {
font-family: 'Courier New', monospace;
font-size: 30px;
}
.footer-text {
font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
font-size: 26px;
font-weight: 400;
}
.footer-strong {
font-weight: 700;
}
</style>
<rect x="0" y="0" width="{{ $width }}" height="{{ $height }}" fill="{{ $gradientId ? 'url(#'.$gradientId.')' : $background }}" />
<rect x="70" y="380" width="500" height="600" rx="46" fill="rgba(255,255,255,0.78)" />
<rect x="600" y="420" width="380" height="380" rx="36" fill="rgba(255,255,255,0.88)" />
<rect x="640" y="780" width="300" height="6" rx="3" fill="{{ $accent }}" opacity="0.6" />
<rect x="80" y="120" width="250" height="70" rx="35" fill="{{ $badgeColor }}" />
<text x="205" y="165" text-anchor="middle" fill="#FFFFFF" class="badge-text">Digitale Gästebox</text>
@foreach($titleLines as $index => $line)
<text x="80" y="{{ 260 + $index * 88 }}" fill="{{ $textColor }}" class="title-line">{{ e($line) }}</text>
@endforeach
@php
$subtitleOffset = 260 + count($titleLines) * 88 + 40;
@endphp
@foreach($subtitleLines as $index => $line)
<text x="80" y="{{ $subtitleOffset + $index * 44 }}" fill="{{ $secondary }}" class="subtitle-line">{{ e($line) }}</text>
@endforeach
@php
$descriptionOffset = $subtitleOffset + (count($subtitleLines) ? count($subtitleLines) * 44 + 60 : 40);
@endphp
@foreach($descriptionLines as $index => $line)
<text x="110" y="{{ $descriptionOffset + $index * 48 }}" fill="{{ $textColor }}" class="description-line">{{ e($line) }}</text>
@endforeach
<text x="120" y="760" fill="{{ $accent }}" class="small-label">SO FUNKTIONIERT'S</text>
@foreach($instructions as $index => $step)
@php
$lineY = $instructionStartY + $index * $instructionSpacing;
@endphp
<circle cx="120" cy="{{ $lineY - 18 }}" r="10" fill="{{ $accent }}" />
<text x="150" y="{{ $lineY }}" fill="{{ $textColor }}" class="instruction-text">{{ e($step) }}</text>
@endforeach
<text x="640" y="760" fill="{{ $accent }}" class="small-label">ALTERNATIVER LINK</text>
<rect x="630" y="790" width="320" height="120" rx="22" fill="rgba(0,0,0,0.08)" />
<text x="650" y="850" fill="{{ $textColor }}" class="link-text">{{ e($tokenUrl) }}</text>
<image href="{{ $qrPngDataUri }}" x="620" y="440" width="{{ $layout['qr']['size_px'] ?? 340 }}" height="{{ $layout['qr']['size_px'] ?? 340 }}" />
<text x="820" y="820" text-anchor="middle" fill="{{ $accent }}" class="small-label">JETZT SCANNEN</text>
<text x="120" y="{{ $height - 160 }}" fill="rgba(17,24,39,0.6)" class="footer-text">
<tspan class="footer-strong" fill="{{ $accent }}">{{ e(config('app.name', 'Fotospiel')) }}</tspan>
&nbsp; Gästebox & Fotochallenges
</text>
<text x="{{ $width - 120 }}" y="{{ $height - 160 }}" text-anchor="end" fill="rgba(17,24,39,0.6)" class="footer-text">
Einladung gültig: {{ $joinToken->expires_at ? $joinToken->expires_at->isoFormat('LLL') : 'bis Widerruf' }}
</text>
</svg>