feat(profile): add username + preferred_locale; wire to Inertia + middleware
- DB: users.username (unique), users.preferred_locale (default from app.locale) - Backend: validation, model fillable; share supportedLocales; SetLocaleFromUser - Frontend: profile page fields + types - Filament: SuperAdmin profile page with username/language feat(admin-nav): move Tasks to Bibliothek and add menu labels fix(tasks-table): show localized title/emotion/event type; add translated headers feat(l10n): add missing table headers for emotions and event types; normalize en/de files refactor: tidy translations for tasks/emotions/event types
This commit is contained in:
@@ -9,7 +9,12 @@ use App\Models\Event;
|
||||
|
||||
class EventsActiveToday extends BaseWidget
|
||||
{
|
||||
protected static ?string $heading = 'Events active today';
|
||||
protected static ?string $heading = null;
|
||||
|
||||
public function getHeading()
|
||||
{
|
||||
return __('admin.widgets.events_active_today.heading');
|
||||
}
|
||||
protected ?string $pollingInterval = '60s';
|
||||
|
||||
public function table(Tables\Table $table): Tables\Table
|
||||
@@ -29,11 +34,13 @@ class EventsActiveToday extends BaseWidget
|
||||
->limit(10)
|
||||
)
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('id')->label('#')->width('60px'),
|
||||
Tables\Columns\TextColumn::make('slug')->label('Slug')->searchable(),
|
||||
Tables\Columns\TextColumn::make('id')->label(__('admin.common.hash'))->width('60px'),
|
||||
Tables\Columns\TextColumn::make('slug')->label(__('admin.common.slug'))->searchable(),
|
||||
Tables\Columns\TextColumn::make('date')->date(),
|
||||
Tables\Columns\TextColumn::make('uploads_today')->label('Uploads today')->numeric(),
|
||||
Tables\Columns\TextColumn::make('uploads_today')->label(__('admin.common.uploads_today'))->numeric(),
|
||||
])
|
||||
->paginated(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,12 @@ use Filament\Actions;
|
||||
|
||||
class RecentPhotosTable extends BaseWidget
|
||||
{
|
||||
protected static ?string $heading = 'Recent uploads';
|
||||
protected static ?string $heading = null;
|
||||
|
||||
public function getHeading()
|
||||
{
|
||||
return __('admin.widgets.recent_uploads.heading');
|
||||
}
|
||||
protected int|string|array $columnSpan = 'full';
|
||||
|
||||
public function table(Tables\Table $table): Tables\Table
|
||||
@@ -21,22 +26,23 @@ class RecentPhotosTable extends BaseWidget
|
||||
->limit(10)
|
||||
)
|
||||
->columns([
|
||||
Tables\Columns\ImageColumn::make('thumbnail_path')->label('Thumb')->circular(),
|
||||
Tables\Columns\TextColumn::make('id')->label('#'),
|
||||
Tables\Columns\TextColumn::make('event_id')->label('Event'),
|
||||
Tables\Columns\TextColumn::make('likes_count')->label('Likes'),
|
||||
Tables\Columns\ImageColumn::make('thumbnail_path')->label(__('admin.common.thumb'))->circular(),
|
||||
Tables\Columns\TextColumn::make('id')->label(__('admin.common.hash')),
|
||||
Tables\Columns\TextColumn::make('event_id')->label(__('admin.common.event')),
|
||||
Tables\Columns\TextColumn::make('likes_count')->label(__('admin.common.likes')),
|
||||
Tables\Columns\TextColumn::make('created_at')->since(),
|
||||
])
|
||||
->actions([
|
||||
Actions\Action::make('feature')
|
||||
->label('Feature')
|
||||
->label(__('admin.photos.actions.feature'))
|
||||
->visible(fn(Photo $record) => ! (bool)($record->is_featured ?? 0))
|
||||
->action(fn(Photo $record) => $record->update(['is_featured' => 1])),
|
||||
Actions\Action::make('unfeature')
|
||||
->label('Unfeature')
|
||||
->label(__('admin.photos.actions.unfeature'))
|
||||
->visible(fn(Photo $record) => (bool)($record->is_featured ?? 0))
|
||||
->action(fn(Photo $record) => $record->update(['is_featured' => 0])),
|
||||
])
|
||||
->paginated(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,12 @@ use App\Models\Tenant;
|
||||
|
||||
class TopTenantsByUploads extends BaseWidget
|
||||
{
|
||||
protected static ?string $heading = 'Top tenants by uploads';
|
||||
protected static ?string $heading = null;
|
||||
|
||||
public function getHeading()
|
||||
{
|
||||
return __('admin.widgets.top_tenants_by_uploads.heading');
|
||||
}
|
||||
protected ?string $pollingInterval = '60s';
|
||||
|
||||
public function table(Tables\Table $table): Tables\Table
|
||||
@@ -21,10 +26,11 @@ class TopTenantsByUploads extends BaseWidget
|
||||
->limit(5)
|
||||
)
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('id')->label('#')->width('60px'),
|
||||
Tables\Columns\TextColumn::make('name')->label('Tenant')->searchable(),
|
||||
Tables\Columns\TextColumn::make('photos_count')->label('Uploads')->numeric(),
|
||||
Tables\Columns\TextColumn::make('id')->label(__('admin.common.hash'))->width('60px'),
|
||||
Tables\Columns\TextColumn::make('name')->label(__('admin.common.tenant'))->searchable(),
|
||||
Tables\Columns\TextColumn::make('photos_count')->label(__('admin.common.uploads'))->numeric(),
|
||||
])
|
||||
->paginated(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class UploadsPerDayChart extends ChartWidget
|
||||
{
|
||||
protected ?string $heading = 'Uploads (14 days)';
|
||||
protected ?string $heading = null;
|
||||
protected ?string $maxHeight = '220px';
|
||||
protected ?string $pollingInterval = '60s';
|
||||
|
||||
@@ -35,7 +34,7 @@ class UploadsPerDayChart extends ChartWidget
|
||||
'labels' => $labels,
|
||||
'datasets' => [
|
||||
[
|
||||
'label' => 'Uploads',
|
||||
'label' => __('admin.common.uploads'),
|
||||
'data' => $data,
|
||||
'borderColor' => '#f59e0b',
|
||||
'backgroundColor' => 'rgba(245, 158, 11, 0.2)',
|
||||
@@ -49,4 +48,9 @@ class UploadsPerDayChart extends ChartWidget
|
||||
{
|
||||
return 'line';
|
||||
}
|
||||
}
|
||||
|
||||
public function getHeading(): string|\Illuminate\Contracts\Support\Htmlable|null
|
||||
{
|
||||
return __('admin.widgets.uploads_per_day.heading');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user