diff --git a/app/Filament/Pages/Reserve.php b/app/Filament/Pages/Reserve.php index 51c6daf..e392d86 100644 --- a/app/Filament/Pages/Reserve.php +++ b/app/Filament/Pages/Reserve.php @@ -51,14 +51,17 @@ class Reserve extends BasePage implements HasTable protected string $view = 'filament.pages.reserve'; - protected static ?string $title = 'Reservera spel'; + public function getTitle(): string + { + return __('Reserve games'); + } public static function table(Table $table): Table { return $table ->query( Item::where('can_be_loaned', true)->whereIn('type', ["game", "literature"])) - ->emptyStateHeading('Inga resultat') + ->emptyStateHeading(__('No results')) ->searchable(true) ->columns([ Grid::make() @@ -67,11 +70,11 @@ class Reserve extends BasePage implements HasTable Stack::make([ TextColumn::make('reserved') ->weight(FontWeight::Bold) - ->formatStateUsing(fn (string $state): string => $state ? 'Utlånad' : 'Tillgänglig') + ->formatStateUsing(fn (string $state): string => $state ? __('On loan') : __('Available')) ->color(fn($record) => $record->reserved ? 'danger' : 'success' ) ->badge(), ImageColumn::make('image') - ->label('Bild') + ->label(__('Image')) ->disk('public') ->size('100%') ->extraImgAttributes([ @@ -80,29 +83,29 @@ class Reserve extends BasePage implements HasTable ]), //->visibility('private'), TextColumn::make('desc') - ->label('Beskrivning') + ->label(__('Description')) ->sortable() ->searchable() ->weight(FontWeight::Bold) ->size(TextSize::Large), Stack::make([ TextColumn::make('players') - ->label('Antal spelare') - ->default('Ingen uppgift') + ->label(__('Players')) + ->default(__('No information')) ->sortable() - ->prefix('Spelare: '), + ->prefix(__('Players') . ': '), //->suffix(' st'), TextColumn::make('play_time') - ->label('Speltid') + ->label(__('Play time')) ->sortable() - ->default('Ingen uppgift') - ->prefix('Speltid (min): '), + ->default(__('No information')) + ->prefix(__('Play time (min)') . ': '), //->suffix(' min'), TextColumn::make('age') - ->label('Ålder') + ->label(__('Age')) ->sortable() - ->default('Ingen uppgift') - ->prefix('Ålder: ') + ->default(__('No information')) + ->prefix(__('Age') . ': ') //->suffix(' år'), ]) ->extraAttributes(['class' => 'reserve-card-meta']) @@ -129,7 +132,7 @@ class Reserve extends BasePage implements HasTable Filter::make('filters') ->form([ Select::make('type') - ->label('Typ') + ->label(__('Type')) ->live() ->options([ 'game' => __('Game'), @@ -137,13 +140,13 @@ class Reserve extends BasePage implements HasTable ]), Select::make('category_id') ->multiple() - ->label('Kategorier Litteratur') + ->label(__('Category literature')) ->options(Category::all()->whereIn('type', 'literature')->pluck('name', 'id')) ->hidden(fn ($get): string => $get('type') == 'game' || $get('type') == ''), Select::make('category_id') ->multiple() - ->label('Kategorier Spel') + ->label(__('Category games')) ->options(Category::all()->whereIn('type', 'game')->pluck('name', 'id')) ->hidden(fn ($get): string => $get('type') == 'literature' || $get('type') == ''), ]) @@ -164,30 +167,30 @@ class Reserve extends BasePage implements HasTable ]) ->columnSpan(2), Filter::make('reserved') - ->label('Tillgänglig') + ->label(__('Available')) ->query(fn (Builder $query): Builder => $query->where('reserved', false)) ->columnSpanFull() ->toggle() ],layout: FiltersLayout::AboveContent) ->actions([ Action::make('reserve') - ->label('Reservera') + ->label(__('Reserve')) ->button() ->color('primary') ->form([ TextInput::make('username') - ->label('Namn') + ->label(__('Name')) ->required(), TextInput::make('email') - ->label('Email') + ->label(__('Email')) ->email() ->required(), TextInput::make('phone') - ->label('Telefonnummer') - ->tel() + ->label(__('Phone')) + ->tel() ->required(), Checkbox::make('gdpr') - ->label('Genom att checka i denna rutan godkänner du att vi lagrar din mailadress och telefonnummer.') + ->label(__('By checking this box you agree that we store your email address and phone number.')) ->accepted(), ]) ->action(function (array $data, Item $record): void { @@ -204,8 +207,8 @@ class Reserve extends BasePage implements HasTable Mail::to(env('MAIL_TO_ADDRESS')) ->send(new ReservationCreated($reservation)); Notification::make() - ->title('Spelet är reserverat!') - ->body('Ett bekräftelsemail har skickats till emailadressen du uppgav. Läs det för mer info om utlämning av spelet.') + ->title(__('The game is reserved!')) + ->body(__('A confirmation email has been sent to the address you provided. Read it for more information about collecting the game.')) ->success() ->seconds(10) ->send(); diff --git a/app/Filament/Resources/ItemResource.php b/app/Filament/Resources/ItemResource.php index 0481922..29cdb0d 100644 --- a/app/Filament/Resources/ItemResource.php +++ b/app/Filament/Resources/ItemResource.php @@ -341,7 +341,7 @@ class ItemResource extends Resource ->tel() ->required(), Checkbox::make('gdpr') - ->label('Genom att checka i denna rutan godkänner du att vi lagrar din mailadress och telefonnummer.') + ->label(__('By checking this box you agree that we store your email address and phone number.')) ->accepted(), ]) ->action(function (array $data, Item $record): void { diff --git a/app/Filament/Resources/ReserveditemResource.php b/app/Filament/Resources/ReserveditemResource.php index 6510811..5aff6eb 100644 --- a/app/Filament/Resources/ReserveditemResource.php +++ b/app/Filament/Resources/ReserveditemResource.php @@ -66,11 +66,13 @@ class ReserveditemResource extends Resource ->required(), TextInput::make('email') ->label('Email') + ->translateLabel() ->default(null) ->email() ->required(), TextInput::make('phone') ->label('Phone') + ->translateLabel() ->default(null) ->tel() ->required(), @@ -104,10 +106,12 @@ class ReserveditemResource extends Resource ->icon('heroicon-m-user'), TextColumn::make('email') ->label('Email') + ->translateLabel() ->sortable() ->icon('heroicon-m-envelope'), TextColumn::make('phone') ->label('Phone') + ->translateLabel() ->sortable() ->icon('heroicon-m-phone'), TextColumn::make('reserved_date') diff --git a/app/Filament/Resources/ReserveditemResourceUser.php b/app/Filament/Resources/ReserveditemResourceUser.php index 5469308..6a0a78f 100644 --- a/app/Filament/Resources/ReserveditemResourceUser.php +++ b/app/Filament/Resources/ReserveditemResourceUser.php @@ -41,6 +41,7 @@ class ReserveditemResourceUser extends Resource ->schema([ Select::make('item_id') ->label('Choose an item to reserve') + ->translateLabel() ->relationship( name: 'item', titleAttribute: 'desc', @@ -62,21 +63,27 @@ class ReserveditemResourceUser extends Resource ->columns([ TextColumn::make('items.desc') ->label('Name') + ->translateLabel() ->sortable(), TextColumn::make('username') ->label('User') + ->translateLabel() ->sortable(), TextColumn::make('reserved_date') ->label('Reserved date') + ->translateLabel() ->sortable(), TextColumn::make('delivered_date') ->label('Delivery date') + ->translateLabel() ->sortable(), TextColumn::make('return_date') ->label('Return date') + ->translateLabel() ->sortable(), TextColumn::make('returned_date') ->label('Returned') + ->translateLabel() ->sortable(), ]) ->filters([ diff --git a/app/Providers/Filament/AdminPanelProvider.php b/app/Providers/Filament/AdminPanelProvider.php index 9c02682..25986f1 100644 --- a/app/Providers/Filament/AdminPanelProvider.php +++ b/app/Providers/Filament/AdminPanelProvider.php @@ -27,6 +27,7 @@ class AdminPanelProvider extends PanelProvider ->id('admin') ->path('/') ->login() + ->favicon(asset('img/favicon-32.png') . '?v=2') ->colors([ 'primary' => Color::hex('#0080bb'), ]) diff --git a/app/Providers/Filament/PublicPanelProvider.php b/app/Providers/Filament/PublicPanelProvider.php index 6e26ac2..718fe37 100644 --- a/app/Providers/Filament/PublicPanelProvider.php +++ b/app/Providers/Filament/PublicPanelProvider.php @@ -29,7 +29,10 @@ class PublicPanelProvider extends PanelProvider ->brandName('vBytes') ->brandLogo(asset('img/logo.png')) ->brandLogoHeight('2rem') + // ?v= tvingar webbläsare att hämta om ikonen; höj siffran vid byte + ->favicon(asset('img/favicon-32.png') . '?v=2') ->topNavigation() + ->navigation(false) ->darkMode(true) ->renderHook( PanelsRenderHook::TOPBAR_END, diff --git a/lang/sv.json b/lang/sv.json new file mode 100644 index 0000000..739d5ab --- /dev/null +++ b/lang/sv.json @@ -0,0 +1,66 @@ +{ + "A confirmation email has been sent to the address you provided. Read it for more information about collecting the game.": "Ett bekräftelsemail har skickats till emailadressen du uppgav. Läs det för mer info om utlämning av spelet.", + "Acquisition date": "Inköpsdatum", + "Age": "Ålder", + "Available": "Tillgänglig", + "By checking this box you agree that we store your email address and phone number.": "Genom att checka i denna rutan godkänner du att vi lagrar din mailadress och telefonnummer.", + "Can be loaned": "Kan lånas", + "Categories": "Kategorier", + "Category": "Kategori", + "Category games": "Kategorier Spel", + "Category id": "Kategori", + "Category items": "Kategorier Prylar", + "Category literature": "Kategorier Litteratur", + "Choose an item to reserve": "Välj en post att reservera", + "Cost": "Pris", + "Create new": "Skapa ny", + "Delivered": "Utlämnad", + "Delivered date": "Utlämningsdatum", + "Delivery date": "Utlämningsdatum", + "Desc": "Beskrivning", + "Description": "Beskrivning", + "Email": "Email", + "Game": "Spel", + "Image": "Bild", + "Inventory": "Inventarie", + "Is admin": "Administratör", + "Item": "Pryl", + "Item id": "Post", + "Literature": "Litteratur", + "Loanable": "Kan lånas", + "More info": "Mer info", + "Most reserved game": "Mest reserverade spel", + "Name": "Namn", + "No information": "Ingen uppgift", + "No results": "Inga resultat", + "On loan": "Utlånad", + "Password": "Lösenord", + "Phone": "Telefonnummer", + "Play time": "Speltid", + "Play time (min)": "Speltid (min)", + "Players": "Spelare", + "Price": "Pris", + "Quantity": "Antal", + "Reservation": "Reservation", + "Reservation date": "Reservationsdatum", + "Reservations": "Reservationer", + "Reservations at the moment": "Aktuella reservationer", + "Reservations over time": "Reservationer över tid", + "Reserve": "Reservera", + "Reserve games": "Reservera spel", + "Reserved": "Reserverad", + "Reserved date": "Reservationsdatum", + "Return date": "Återlämningsdatum", + "Returned": "Återlämnad", + "Returned date": "Återlämnad datum", + "The game is reserved!": "Spelet är reserverat!", + "Total amount of games": "Antal spel", + "Total amount of items": "Antal prylar", + "Total amount of literature": "Antal litteratur", + "Total number of users": "Antal användare", + "Type": "Typ", + "User": "Användare", + "Username": "Namn", + "Users": "Användare", + "Welcome! Here you can reserve games that you would like to borrow.": "Välkommen! Här kan du reservera spel som du gärna vill låna." +} diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..d1fc037 Binary files /dev/null and b/public/apple-touch-icon.png differ diff --git a/public/favicon.ico b/public/favicon.ico index 703898e..36d923f 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/img/apple-touch-icon.png b/public/img/apple-touch-icon.png new file mode 100644 index 0000000..d1fc037 Binary files /dev/null and b/public/img/apple-touch-icon.png differ diff --git a/public/img/favicon-16.png b/public/img/favicon-16.png new file mode 100644 index 0000000..e712526 Binary files /dev/null and b/public/img/favicon-16.png differ diff --git a/public/img/favicon-32.png b/public/img/favicon-32.png new file mode 100644 index 0000000..251088e Binary files /dev/null and b/public/img/favicon-32.png differ diff --git a/public/img/favicon-mark-16.png b/public/img/favicon-mark-16.png new file mode 100644 index 0000000..28079cb Binary files /dev/null and b/public/img/favicon-mark-16.png differ diff --git a/public/img/favicon-mark-32.png b/public/img/favicon-mark-32.png new file mode 100644 index 0000000..921fe05 Binary files /dev/null and b/public/img/favicon-mark-32.png differ diff --git a/public/img/logo-mark.png b/public/img/logo-mark.png new file mode 100644 index 0000000..a24ab3e Binary files /dev/null and b/public/img/logo-mark.png differ diff --git a/resources/views/app.blade.php b/resources/views/app.blade.php index 856bcf2..ce6c1e6 100644 --- a/resources/views/app.blade.php +++ b/resources/views/app.blade.php @@ -6,6 +6,11 @@ {{ config('app.name', 'Laravel') }} + + + + + diff --git a/resources/views/filament/pages/reserve.blade.php b/resources/views/filament/pages/reserve.blade.php index 4d416b7..0c56729 100644 --- a/resources/views/filament/pages/reserve.blade.php +++ b/resources/views/filament/pages/reserve.blade.php @@ -26,7 +26,7 @@

- Välkommen! Här kan du reservera spel som du gärna vill låna. + {{ __('Welcome! Here you can reserve games that you would like to borrow.') }}

{{ $this->table }}