Skip to content

Commit

Permalink
Merge pull request #10 from alkrauss48/aaron-dev
Browse files Browse the repository at this point in the history
Various minor fixes
  • Loading branch information
alkrauss48 authored Mar 9, 2024
2 parents 76e5037 + c5c5d74 commit 2c8b391
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 38 deletions.
8 changes: 1 addition & 7 deletions app/Filament/Resources/PresentationResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Illuminate\Support\HtmlString;
use Illuminate\Support\Str;
use Illuminate\Validation\Rules\Unique;

Expand All @@ -39,12 +38,7 @@ public static function form(Form $form): Form
->schema([
Forms\Components\MarkdownEditor::make('content')
->required()
->helperText(new HtmlString(
'<strong>Note</strong>: It\'s recommended to edit content '
.'while using <strong>Light Theme</strong>; '
.'syntax highlighting for Dark Theme isn\'t fully supported yet. '
.'You can toggle your theme in the top right menu.'
))->columnSpan([
->columnSpan([
'md' => 2,
])->disableToolbarButtons([
'attachFiles',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Filament\Actions;
use Filament\Notifications\Notification;
use Filament\Resources\Pages\EditRecord;
use Illuminate\Support\HtmlString;
use Spatie\Browsershot\Browsershot;

class EditPresentation extends EditRecord
Expand All @@ -26,12 +27,24 @@ protected function getHeaderActions(): array
Actions\Action::make('Generate Thumbnail')
->icon('heroicon-o-camera')
->requiresConfirmation()
->modalHeading('Generate thumbnail')
->modalDescription(
->modalHeading('Generate a thumbnail of your first slide')
->modalIcon('heroicon-o-camera')
->modalIconColor('info')
->modalDescription(new HtmlString(
'This will overwrite any existing thumbnail that you have '
.'set for this presentation. Do you wish to continue?'
)->modalSubmitActionLabel('Yes, generate it')
.'<br><br><strong>Note:</strong> Your presentation must first be published.'
))->modalSubmitActionLabel('Generate it')
->action(function (Presentation $record) {
if (! $record->is_published) {
Notification::make()
->title('You must publish your presentation to generate a thumbnail.')
->danger()
->send();

return;
}

$tempPath = storage_path("temp/{$record->slug}-{$record->user->username}.jpg");

Browsershot::url(route('presentations.show', [
Expand Down
13 changes: 12 additions & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace App\Providers;

use Filament\Facades\Filament;
use Filament\Navigation\UserMenuItem;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
Expand All @@ -19,6 +21,15 @@ public function register(): void
*/
public function boot(): void
{
//
Filament::serving(function () {
Filament::registerUserMenuItems([
UserMenuItem::make()
->label('Helpful Videos')
->url(
'https://www.youtube.com/playlist?list=PLWXp2X5PBDOkzYGV3xd0zviD6xR8OoiFR',
shouldOpenInNewTab: true
)->icon('heroicon-s-play-circle'),
]);
});
}
}
Loading

0 comments on commit 2c8b391

Please # to comment.