Fixes and changes
This commit is contained in:
parent
369a9eb8e7
commit
734fc3395a
10 changed files with 44 additions and 13 deletions
|
|
@ -11,6 +11,8 @@ class CreatePhotoGeoData extends CreateRecord
|
||||||
use HandlesImageMetadata;
|
use HandlesImageMetadata;
|
||||||
|
|
||||||
protected static string $resource = PhotoGeoDataResource::class;
|
protected static string $resource = PhotoGeoDataResource::class;
|
||||||
|
protected ?string $heading = 'Lägg till bild';
|
||||||
|
|
||||||
|
|
||||||
protected function getRedirectUrl(): string
|
protected function getRedirectUrl(): string
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ class EditPhotoGeoData extends EditRecord
|
||||||
use HandlesImageMetadata;
|
use HandlesImageMetadata;
|
||||||
|
|
||||||
protected static string $resource = PhotoGeoDataResource::class;
|
protected static string $resource = PhotoGeoDataResource::class;
|
||||||
|
protected ?string $heading = 'Redigera bild';
|
||||||
|
|
||||||
protected function getHeaderActions(): array
|
protected function getHeaderActions(): array
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ use Filament\Resources\Pages\ListRecords;
|
||||||
class ListPhotoGeoData extends ListRecords
|
class ListPhotoGeoData extends ListRecords
|
||||||
{
|
{
|
||||||
protected static string $resource = PhotoGeoDataResource::class;
|
protected static string $resource = PhotoGeoDataResource::class;
|
||||||
|
protected ?string $heading = '';
|
||||||
|
|
||||||
protected function getHeaderActions(): array
|
protected function getHeaderActions(): array
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,10 @@ use Filament\Schemas\Schema;
|
||||||
use EduardoRibeiroDev\FilamentLeaflet\Fields\MapPicker;
|
use EduardoRibeiroDev\FilamentLeaflet\Fields\MapPicker;
|
||||||
use EduardoRibeiroDev\FilamentLeaflet\Enums\TileLayer;
|
use EduardoRibeiroDev\FilamentLeaflet\Enums\TileLayer;
|
||||||
|
|
||||||
|
|
||||||
class PhotoGeoDataForm
|
class PhotoGeoDataForm
|
||||||
{
|
{
|
||||||
|
|
||||||
public static function configure(Schema $schema): Schema
|
public static function configure(Schema $schema): Schema
|
||||||
{
|
{
|
||||||
return $schema
|
return $schema
|
||||||
|
|
@ -22,24 +24,30 @@ class PhotoGeoDataForm
|
||||||
->columnSpan('full')
|
->columnSpan('full')
|
||||||
->disk('public')
|
->disk('public')
|
||||||
->directory('photos')
|
->directory('photos')
|
||||||
->image(),
|
->image()
|
||||||
|
->helperText('Förklaring...'),
|
||||||
TextInput::make('title')
|
TextInput::make('title')
|
||||||
->label('Rubrik')
|
->label('Rubrik')
|
||||||
->columnSpan('full')
|
->columnSpan('full')
|
||||||
->required(),
|
->required()
|
||||||
|
->helperText('Förklaring...'),
|
||||||
TextInput::make('uploaded_by')
|
TextInput::make('uploaded_by')
|
||||||
->label('Uppladdat av')
|
->label('Uppladdat av')
|
||||||
->columnSpan('full')
|
->columnSpan('full')
|
||||||
->required(),
|
->required()
|
||||||
|
->helperText('Förklaring...'),
|
||||||
DatePicker::make('captured_at')
|
DatePicker::make('captured_at')
|
||||||
->label('Datum då foto togs')
|
->label('Datum då foto togs')
|
||||||
->columnSpan('full'),
|
->columnSpan('full')
|
||||||
|
->helperText('Förklaring...'),
|
||||||
TextInput::make('desc')
|
TextInput::make('desc')
|
||||||
->label('Kort beskrivning')
|
->label('Kort beskrivning')
|
||||||
->columnSpan('full'),
|
->columnSpan('full')
|
||||||
|
->helperText('Förklaring...'),
|
||||||
Textarea::make('story')
|
Textarea::make('story')
|
||||||
->label('Berättelse')
|
->label('Berättelse')
|
||||||
->columnSpanFull(),
|
->columnSpanFull()
|
||||||
|
->helperText('Förklaring...'),
|
||||||
MapPicker::make('location')
|
MapPicker::make('location')
|
||||||
->label('Plats')
|
->label('Plats')
|
||||||
->height(400)
|
->height(400)
|
||||||
|
|
@ -49,7 +57,16 @@ class PhotoGeoDataForm
|
||||||
->tileLayersUrl(TileLayer::OpenStreetMap)
|
->tileLayersUrl(TileLayer::OpenStreetMap)
|
||||||
->columnSpanFull()
|
->columnSpanFull()
|
||||||
->latitudeFieldName('lat')
|
->latitudeFieldName('lat')
|
||||||
->longitudeFieldName('lng'),
|
->longitudeFieldName('lng')
|
||||||
|
->helperText('Förklaring...'),
|
||||||
|
Textarea::make('metadata')
|
||||||
|
->label('Metadata (EXIF)')
|
||||||
|
->columnSpanFull()
|
||||||
|
->rows(10)
|
||||||
|
->disabled()
|
||||||
|
->dehydrated(false)
|
||||||
|
->formatStateUsing(fn ($state) => $state ? json_encode($state, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) : null)
|
||||||
|
->visible(fn ($record) => $record && filled($record->metadata)),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,21 @@ use Illuminate\Database\Eloquent\Attributes\Hidden;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
|
use Filament\Models\Contracts\FilamentUser;
|
||||||
|
use Filament\Panel;
|
||||||
|
|
||||||
#[Fillable(['name', 'email', 'password','role'])]
|
#[Fillable(['name', 'email', 'password','role'])]
|
||||||
#[Hidden(['password', 'remember_token'])]
|
#[Hidden(['password', 'remember_token'])]
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable implements FilamentUser
|
||||||
{
|
{
|
||||||
/** @use HasFactory<UserFactory> */
|
/** @use HasFactory<UserFactory> */
|
||||||
use HasFactory, Notifiable;
|
use HasFactory, Notifiable;
|
||||||
|
|
||||||
|
public function canAccessPanel(Panel $panel): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the attributes that should be cast.
|
* Get the attributes that should be cast.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,8 @@ use App\Filament\Resources\PhotoGeoData\PhotoGeoDataResource;
|
||||||
use Filament\Support\Facades\FilamentView;
|
use Filament\Support\Facades\FilamentView;
|
||||||
use Illuminate\Support\Facades\Blade;
|
use Illuminate\Support\Facades\Blade;
|
||||||
use Filament\View\PanelsRenderHook;
|
use Filament\View\PanelsRenderHook;
|
||||||
|
use Illuminate\Support\Facades\Request;
|
||||||
|
|
||||||
|
|
||||||
class AdminPanelProvider extends PanelProvider
|
class AdminPanelProvider extends PanelProvider
|
||||||
{
|
{
|
||||||
|
|
@ -57,6 +59,7 @@ class AdminPanelProvider extends PanelProvider
|
||||||
->widgets([
|
->widgets([
|
||||||
|
|
||||||
])
|
])
|
||||||
|
->brandName(fn () => Request::routeIs('filament.*.auth.login') ? '' : '')
|
||||||
->middleware([
|
->middleware([
|
||||||
EncryptCookies::class,
|
EncryptCookies::class,
|
||||||
AddQueuedCookiesToResponse::class,
|
AddQueuedCookiesToResponse::class,
|
||||||
|
|
|
||||||
4
lang/vendor/filament-actions/sv/create.php
vendored
4
lang/vendor/filament-actions/sv/create.php
vendored
|
|
@ -4,11 +4,11 @@ return [
|
||||||
|
|
||||||
'single' => [
|
'single' => [
|
||||||
|
|
||||||
'label' => 'Ny :label',
|
'label' => 'Ny bild',
|
||||||
|
|
||||||
'modal' => [
|
'modal' => [
|
||||||
|
|
||||||
'heading' => 'Skapa :label',
|
'heading' => 'Lägg till bild',
|
||||||
|
|
||||||
'actions' => [
|
'actions' => [
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'title' => 'Skapa :label',
|
'title' => 'Lägg till bild',
|
||||||
|
|
||||||
'breadcrumb' => 'Skapa',
|
'breadcrumb' => 'Skapa',
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'title' => 'Redigera :label',
|
'title' => 'Redigera bild',
|
||||||
|
|
||||||
'breadcrumb' => 'Redigera',
|
'breadcrumb' => 'Redigera',
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'title' => 'Visa :label',
|
'title' => 'Visa bild',
|
||||||
|
|
||||||
'breadcrumb' => 'Visa',
|
'breadcrumb' => 'Visa',
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue