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:
@@ -15,7 +15,7 @@ class ImportTasks extends Page
|
||||
{
|
||||
protected static string $resource = TaskResource::class;
|
||||
protected string $view = 'filament.resources.task-resource.pages.import-tasks';
|
||||
protected ?string $heading = 'Import Tasks (CSV)';
|
||||
protected ?string $heading = null;
|
||||
|
||||
public ?string $file = null;
|
||||
|
||||
@@ -23,7 +23,7 @@ class ImportTasks extends Page
|
||||
{
|
||||
return $form->schema([
|
||||
FileUpload::make('file')
|
||||
->label('CSV file')
|
||||
->label(__('admin.common.csv_file'))
|
||||
->acceptedFileTypes(['text/csv', 'text/plain'])
|
||||
->directory('imports')
|
||||
->required(),
|
||||
@@ -36,7 +36,7 @@ class ImportTasks extends Page
|
||||
|
||||
$path = $this->form->getState()['file'] ?? null;
|
||||
if (!$path || !Storage::disk('public')->exists($path)) {
|
||||
Notification::make()->danger()->title('File not found')->send();
|
||||
Notification::make()->danger()->title(__('admin.notifications.file_not_found'))->send();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -45,11 +45,16 @@ class ImportTasks extends Page
|
||||
|
||||
Notification::make()
|
||||
->success()
|
||||
->title("Imported {$ok} rows")
|
||||
->body($fail ? "{$fail} failed" : null)
|
||||
->title(__('admin.notifications.imported_rows', ['count' => $ok]))
|
||||
->body($fail ? __('admin.notifications.failed_count', ['count' => $fail]) : null)
|
||||
->send();
|
||||
}
|
||||
|
||||
public function getHeading(): string
|
||||
{
|
||||
return __('admin.tasks.import.heading');
|
||||
}
|
||||
|
||||
private function importTasksCsv(string $file): array
|
||||
{
|
||||
$handle = fopen($file, 'r');
|
||||
|
||||
Reference in New Issue
Block a user