Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
cannycookie authored and github-actions[bot] committed Sep 3, 2023
1 parent 355187a commit 2019706
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function handle()
}

$this->info("All Done");

return Command::SUCCESS;
}
}
2 changes: 2 additions & 0 deletions src/Commands/MakeEmailTemplateResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ public function handle()
if (! file_exists($viewPath)) {
File::put($viewPath, $stub);
$this->info("Email template resource '{$name}'.blade.php created successfully.");

return Command::SUCCESS;
} else {
$this->error("Email template resource '{$name}'.blade.php already exists.");

return Command::FAILURE;
}

Expand Down
18 changes: 10 additions & 8 deletions src/Resources/EmailTemplateResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ public static function form(Form $form): Form
[
TextInput::make('key')
->afterStateUpdated(
fn(Set $set, ?string $state) => $set('key', Str::slug($state)))
fn (Set $set, ?string $state) => $set('key', Str::slug($state))
)
->label(__('vb-email-templates::email-templates.form-fields-labels.key'))
->hint(__('vb-email-templates::email-templates.form-fields-labels.key-hint'))
->required()
->unique(ignorable: fn($record) => $record),
->unique(ignorable: fn ($record) => $record),
Select::make('language')
->options($languages)
->default(config('email-templates.default_locale'))
Expand Down Expand Up @@ -108,7 +109,7 @@ public static function form(Form $form): Form
TiptapEditor::make('content')
->label(__('vb-email-templates::email-templates.form-fields-labels.content'))
->profile('default')
->default("<p>Dear ##user.firstname##, </p>")
->default("<p>Dear ##user.firstname##, </p>"),
]
),

Expand All @@ -122,7 +123,7 @@ public static function prepareLang()
{
return collect(config('email-templates.languages'))->mapWithKeys(function ($langVal, $langKey) {
return [
$langKey => '<span class="flag-icon flag-icon-'.$langVal["flag-icon"].'"></span> '.$langVal["display"]
$langKey => '<span class="flag-icon flag-icon-'.$langVal["flag-icon"].'"></span> '.$langVal["display"],
];
})->toArray();
}
Expand Down Expand Up @@ -198,6 +199,7 @@ public static function getRecipients()
return collect(config('email-templates.recipients'))->mapWithKeys(function ($recipient) {
$splitNamespace = explode('\\', $recipient);
$className = end($splitNamespace); // Get the class name without namespace

return [$className => $recipient]; // Use class name as key and full class name as value
})->toArray();
}
Expand Down Expand Up @@ -240,7 +242,7 @@ public static function table(Table $table): Table
}),
Tables\Actions\ViewAction::make()
->label("Preview")
->hidden(fn($record) => $record->trashed()),
->hidden(fn ($record) => $record->trashed()),
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
Tables\Actions\ForceDeleteAction::make(),
Expand All @@ -259,10 +261,10 @@ public static function table(Table $table): Table
public static function getPages(): array
{
return [
'index' => Pages\ListEmailTemplates::route('/'),
'index' => Pages\ListEmailTemplates::route('/'),
'create' => Pages\CreateEmailTemplate::route('/create'),
'edit' => Pages\EditEmailTemplate::route('/{record}/edit'),
'view' => Pages\PreviewEmailTemplate::route('/{record}'),
'edit' => Pages\EditEmailTemplate::route('/{record}/edit'),
'view' => Pages\PreviewEmailTemplate::route('/{record}'),
];
}

Expand Down

0 comments on commit 2019706

Please sign in to comment.