photo visibility for demo events, hardened the demo mode. fixed dark/light mode toggle and notification bell toggle. fixed photo upload page sizes & header visibility.

This commit is contained in:
Codex Agent
2025-12-18 21:14:24 +01:00
parent 7c4067b32b
commit 53ec427e6e
25 changed files with 965 additions and 102 deletions

View File

@@ -11,9 +11,9 @@ use App\Models\Task;
use App\Models\TaskCollection;
use App\Models\Tenant;
use App\Services\EventJoinTokenService;
use Illuminate\Support\Facades\Crypt;
use Illuminate\Database\Seeder;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Crypt;
use Illuminate\Support\Facades\Schema;
class DemoEventSeeder extends Seeder
@@ -111,15 +111,30 @@ class DemoEventSeeder extends Seeder
private function ensureJoinToken(Event $event, string $label, ?string $token = null): void
{
if ($event->joinTokens()->exists()) {
$existingToken = $event->joinTokens()->latest('id')->first();
if ($existingToken) {
$metadata = $existingToken->metadata ?? [];
if (! array_key_exists('demo_read_only', $metadata)) {
$metadata['demo_read_only'] = true;
$existingToken->metadata = $metadata;
$existingToken->save();
}
}
return;
}
$attributes = ['label' => $label];
$metadata = ['demo_read_only' => true];
if ($token) {
$attributes['metadata'] = ['seeded' => true, 'plain_token' => $token];
$metadata = array_merge($metadata, ['seeded' => true, 'plain_token' => $token]);
}
$attributes = [
'label' => $label,
'metadata' => $metadata,
];
$tokenModel = app(EventJoinTokenService::class)->createToken($event, $attributes);
if ($token) {