diff --git a/app/Filament/Resources/EventResource.php b/app/Filament/Resources/EventResource.php index bfb519b..8dbecc1 100644 --- a/app/Filament/Resources/EventResource.php +++ b/app/Filament/Resources/EventResource.php @@ -60,6 +60,18 @@ class EventResource extends Resource ->required() ->unique(ignoreRecord: true) ->maxLength(255), + TextInput::make('join_link_display') + ->label(__('admin.events.fields.join_link')) + ->afterStateHydrated(function (TextInput $component, ?Event $record) { + if (! $record) { + return; + } + $token = $record->joinTokens()->latest()->first(); + $component->state($token ? url('/e/'.$token->token) : '-'); + }) + ->readOnly() + ->dehydrated(false) + ->visibleOn('edit'), DatePicker::make('date') ->label(__('admin.events.fields.date')) ->required(), @@ -103,7 +115,6 @@ class EventResource extends Resource Tables\Columns\TextColumn::make('slug')->searchable(), Tables\Columns\TextColumn::make('date')->date(), Tables\Columns\IconColumn::make('is_active')->boolean(), - Tables\Columns\TextColumn::make('default_locale'), Tables\Columns\TextColumn::make('eventPackage.package.name') ->label(__('admin.events.table.package')) ->badge() @@ -116,22 +127,6 @@ class EventResource extends Resource ->badge() ->color(fn ($state) => $state < 1 ? 'danger' : 'success') ->getStateUsing(fn ($record) => $record->eventPackage?->remaining_photos ?? 0), - Tables\Columns\TextColumn::make('primary_join_token') - ->label(__('admin.events.table.join')) - ->getStateUsing(function ($record) { - $token = $record->joinTokens()->latest()->first(); - - return $token ? url('/e/'.$token->token) : __('admin.events.table.no_join_tokens'); - }) - ->description(function ($record) { - $total = $record->joinTokens()->count(); - - return $total > 0 - ? __('admin.events.table.join_tokens_total', ['count' => $total]) - : __('admin.events.table.join_tokens_missing'); - }) - ->copyable() - ->copyMessage(__('admin.events.messages.join_link_copied')), Tables\Columns\TextColumn::make('created_at')->since(), ]) ->filters([]) diff --git a/resources/lang/de/admin.php b/resources/lang/de/admin.php index b3f4275..71c3dc6 100644 --- a/resources/lang/de/admin.php +++ b/resources/lang/de/admin.php @@ -365,13 +365,15 @@ return [ 'default_locale' => 'Standardsprache', 'is_active' => 'Aktiv', 'settings' => 'Einstellungen', + 'join_link' => 'Einladungslink', ], 'table' => [ 'tenant' => 'Mandant', 'join' => 'Beitreten', 'join_tokens_total' => 'Einladungen: :count', - 'join_tokens_missing' => 'Noch keine Einladungen erstellt', 'package' => 'Paket', + 'used_photos' => 'Fotos', + 'remaining_photos' => 'Verbleibend', ], 'relation_managers' => [ 'event_packages' => [ diff --git a/resources/lang/en/admin.php b/resources/lang/en/admin.php index f9fd8fd..e5fa610 100644 --- a/resources/lang/en/admin.php +++ b/resources/lang/en/admin.php @@ -363,16 +363,16 @@ return [ 'date' => 'Event Date', 'type' => 'Event Type', 'default_locale' => 'Default Locale', - 'is_active' => 'Is Active', 'settings' => 'Settings', + 'join_link' => 'Invitation Link', ], 'table' => [ 'tenant' => 'Tenant', 'join' => 'Join', 'join_tokens_total' => 'Invitations: :count', - 'join_tokens_missing' => 'No invitations created yet', 'package' => 'Package', - ], + 'used_photos' => 'Used Photos', + 'remaining_photos' => 'Remaining', ], 'relation_managers' => [ 'event_packages' => [ 'title' => 'Event Packages', diff --git a/resources/views/filament/events/join-link.blade.php b/resources/views/filament/events/join-link.blade.php index b284068..2ce91de 100644 --- a/resources/views/filament/events/join-link.blade.php +++ b/resources/views/filament/events/join-link.blade.php @@ -13,7 +13,7 @@