Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed Nov 21, 2024
1 parent 065503e commit 454b4d3
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 14 deletions.
5 changes: 5 additions & 0 deletions app/Filament/Admin/Resources/CandidateResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use App\Models\Candidate;
use Filament\Forms\Components\ColorPicker;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\SpatieMediaLibraryFileUpload;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Resources\Resource;
Expand Down Expand Up @@ -55,6 +56,10 @@ public static function form(Form $form): Form
Select::make('party_id')
->relationship('party', 'name')
->label(__('app.field.party')),

SpatieMediaLibraryFileUpload::make('image')
->label(__('app.field.logo'))
->columnSpanFull(),
]);
}

Expand Down
5 changes: 5 additions & 0 deletions app/Filament/Admin/Resources/PartyResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use App\Models\Party;
use Filament\Facades\Filament;
use Filament\Forms\Components\ColorPicker;
use Filament\Forms\Components\SpatieMediaLibraryFileUpload;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Resources\Resource;
Expand Down Expand Up @@ -59,6 +60,10 @@ public static function form(Form $form): Form
ColorPicker::make('color')
->label(__('app.field.color'))
->required(),

SpatieMediaLibraryFileUpload::make('logo')
->label(__('app.field.logo'))
->columnSpanFull(),
]);
}

Expand Down
4 changes: 2 additions & 2 deletions app/Models/Candidate.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ public function registerMediaCollections(): void
->singleFile()
->registerMediaConversions(function () {
$this->addMediaConversion('thumb')
->fit(Fit::Contain, 64, 64)
->fit(Fit::Crop, 64, 64)
->keepOriginalImageFormat()
->optimize();

$this->addMediaConversion('large')
->fit(Fit::Contain, 256, 256)
->fit(Fit::Crop, 256, 256)
->keepOriginalImageFormat()
->optimize();
});
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Party.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ public function registerMediaCollections(): void
->singleFile()
->registerMediaConversions(function () {
$this->addMediaConversion('thumb')
->fit(Fit::Contain, 64, 64)
->fit(Fit::Crop, 64, 64)
->keepOriginalImageFormat()
->optimize();

$this->addMediaConversion('large')
->fit(Fit::Contain, 256, 256)
->fit(Fit::Crop, 256, 256)
->keepOriginalImageFormat()
->optimize();
});
Expand Down
24 changes: 14 additions & 10 deletions lang/ro/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,38 @@
'all' => 'Toate',

'field' => [
'acronym' => 'Acronim',
'aliases' => 'Aliasuri',
'color' => 'Culoare',
'country' => 'Țară',
'county' => 'Județ',
'created_at' => 'Creat la',
'cron' => 'Interval',
'date' => 'Dată',
'default_tab' => 'Tab implicit',
'email' => 'Email',
'id' => 'ID',
'siruta' => 'ID SIRUTA',
'image' => 'Imagine',
'initial_complement' => 'Înscriși pe listele complementare',
'initial_permanent' => 'Înscriși pe listele permanente',
'is_enabled' => 'Activ',
'is_live' => 'Live',
'is_visible' => 'Vizibil',
'job' => 'Job',
'last_run_at' => 'Ultima rulare',
'locality' => 'Localitate',
'location' => 'Locație',
'logo' => 'Logo',
'name' => 'Nume',
'party' => 'Partid',
'role' => 'Rol',
'subtitle' => 'Subtitlu',
'siruta' => 'ID SIRUTA',
'slug' => 'Slug',
'source_part' => 'Parte',
'source_password' => 'Parolă',
'source_url' => 'URL sursă',
'source_username' => 'Utilizator',
'subtitle' => 'Subtitlu',
'title' => 'Titlu',
'type' => 'Tip',
'updated_at' => 'Actualizat la',
Expand All @@ -39,14 +51,6 @@
'voters_supplement' => 'Votanți pe liste suplimentare',
'voters_total' => 'Total votanți',
'year' => 'An',
'job' => 'Job',
'cron' => 'Interval',
'source_url' => 'URL sursă',
'source_part' => 'Parte',
'source_username' => 'Utilizator',
'source_password' => 'Parolă',
'is_enabled' => 'Activ',
'last_run_at' => 'Ultima rulare',
],

'navigation' => [
Expand Down

0 comments on commit 454b4d3

Please sign in to comment.