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;
|
||||
|
||||
protected static string $resource = PhotoGeoDataResource::class;
|
||||
protected ?string $heading = 'Lägg till bild';
|
||||
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class EditPhotoGeoData extends EditRecord
|
|||
use HandlesImageMetadata;
|
||||
|
||||
protected static string $resource = PhotoGeoDataResource::class;
|
||||
protected ?string $heading = 'Redigera bild';
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ use Filament\Resources\Pages\ListRecords;
|
|||
class ListPhotoGeoData extends ListRecords
|
||||
{
|
||||
protected static string $resource = PhotoGeoDataResource::class;
|
||||
protected ?string $heading = '';
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,8 +10,10 @@ use Filament\Schemas\Schema;
|
|||
use EduardoRibeiroDev\FilamentLeaflet\Fields\MapPicker;
|
||||
use EduardoRibeiroDev\FilamentLeaflet\Enums\TileLayer;
|
||||
|
||||
|
||||
class PhotoGeoDataForm
|
||||
{
|
||||
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
|
|
@ -22,24 +24,30 @@ class PhotoGeoDataForm
|
|||
->columnSpan('full')
|
||||
->disk('public')
|
||||
->directory('photos')
|
||||
->image(),
|
||||
->image()
|
||||
->helperText('Förklaring...'),
|
||||
TextInput::make('title')
|
||||
->label('Rubrik')
|
||||
->columnSpan('full')
|
||||
->required(),
|
||||
->required()
|
||||
->helperText('Förklaring...'),
|
||||
TextInput::make('uploaded_by')
|
||||
->label('Uppladdat av')
|
||||
->columnSpan('full')
|
||||
->required(),
|
||||
->required()
|
||||
->helperText('Förklaring...'),
|
||||
DatePicker::make('captured_at')
|
||||
->label('Datum då foto togs')
|
||||
->columnSpan('full'),
|
||||
->columnSpan('full')
|
||||
->helperText('Förklaring...'),
|
||||
TextInput::make('desc')
|
||||
->label('Kort beskrivning')
|
||||
->columnSpan('full'),
|
||||
->columnSpan('full')
|
||||
->helperText('Förklaring...'),
|
||||
Textarea::make('story')
|
||||
->label('Berättelse')
|
||||
->columnSpanFull(),
|
||||
->columnSpanFull()
|
||||
->helperText('Förklaring...'),
|
||||
MapPicker::make('location')
|
||||
->label('Plats')
|
||||
->height(400)
|
||||
|
|
@ -49,7 +57,16 @@ class PhotoGeoDataForm
|
|||
->tileLayersUrl(TileLayer::OpenStreetMap)
|
||||
->columnSpanFull()
|
||||
->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\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Filament\Models\Contracts\FilamentUser;
|
||||
use Filament\Panel;
|
||||
|
||||
#[Fillable(['name', 'email', 'password','role'])]
|
||||
#[Hidden(['password', 'remember_token'])]
|
||||
class User extends Authenticatable
|
||||
class User extends Authenticatable implements FilamentUser
|
||||
{
|
||||
/** @use HasFactory<UserFactory> */
|
||||
use HasFactory, Notifiable;
|
||||
|
||||
public function canAccessPanel(Panel $panel): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ use App\Filament\Resources\PhotoGeoData\PhotoGeoDataResource;
|
|||
use Filament\Support\Facades\FilamentView;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Filament\View\PanelsRenderHook;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
|
||||
|
||||
class AdminPanelProvider extends PanelProvider
|
||||
{
|
||||
|
|
@ -57,6 +59,7 @@ class AdminPanelProvider extends PanelProvider
|
|||
->widgets([
|
||||
|
||||
])
|
||||
->brandName(fn () => Request::routeIs('filament.*.auth.login') ? '' : '')
|
||||
->middleware([
|
||||
EncryptCookies::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' => [
|
||||
|
||||
'label' => 'Ny :label',
|
||||
'label' => 'Ny bild',
|
||||
|
||||
'modal' => [
|
||||
|
||||
'heading' => 'Skapa :label',
|
||||
'heading' => 'Lägg till bild',
|
||||
|
||||
'actions' => [
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
return [
|
||||
|
||||
'title' => 'Skapa :label',
|
||||
'title' => 'Lägg till bild',
|
||||
|
||||
'breadcrumb' => 'Skapa',
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
return [
|
||||
|
||||
'title' => 'Redigera :label',
|
||||
'title' => 'Redigera bild',
|
||||
|
||||
'breadcrumb' => 'Redigera',
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
return [
|
||||
|
||||
'title' => 'Visa :label',
|
||||
'title' => 'Visa bild',
|
||||
|
||||
'breadcrumb' => 'Visa',
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue