diff --git a/app/Filament/Admin/Resources/CareerApplications/Schemas/CareerApplicationForm.php b/app/Filament/Admin/Resources/CareerApplications/Schemas/CareerApplicationForm.php index 7778cae..f4412c9 100644 --- a/app/Filament/Admin/Resources/CareerApplications/Schemas/CareerApplicationForm.php +++ b/app/Filament/Admin/Resources/CareerApplications/Schemas/CareerApplicationForm.php @@ -13,6 +13,9 @@ use Illuminate\Support\Facades\Hash; use Filament\Actions\Action; use Filament\Schemas\Components\Utilities\Set; use Illuminate\Support\Str; +use Filament\Schemas\Components\Tabs; +use Filament\Schemas\Components\Tabs\Tab; +use Filament\Schemas\Components\View; class CareerApplicationForm { @@ -20,108 +23,126 @@ class CareerApplicationForm { return $schema ->components([ - TextInput::make('name') - ->label(__('career.name')) - ->required() - ->disabled(), - - TextInput::make('email') - ->label(__('career.email')) - ->email() - ->required() - ->disabled(), - - TextInput::make('phone') - ->label(__('career.phone')) - ->disabled(), - - FileUpload::make('cv_path') - ->label(__('career.cv')) - ->disk('public') - ->directory('cvs') - ->required() - ->disabled() - ->downloadable(), - - Textarea::make('message') - ->label(__('career.message')) - ->disabled() - ->columnSpanFull(), - - Select::make('status') - ->label(__('career.status')) - ->options([ - 'pending' => __('career.pending'), - 'reviewed' => __('career.reviewed'), - 'rejected' => __('career.rejected'), - 'accepted' => __('career.accepted'), - 'waiting_document' => __('career.waiting_document'), - ]) - ->required(), + Tabs::make('Tabs') + ->tabs([ + Tab::make('Kişisel ve Başvuru Bilgileri') + ->icon('heroicon-m-user') + ->schema([ + TextInput::make('name') + ->label(__('career.name')) + ->required() + ->disabled(), + + TextInput::make('email') + ->label(__('career.email')) + ->email() + ->required() + ->disabled(), + + TextInput::make('phone') + ->label(__('career.phone')) + ->disabled(), + + Select::make('status') + ->label(__('career.status')) + ->options([ + 'pending' => __('career.pending'), + 'reviewed' => __('career.reviewed'), + 'rejected' => __('career.rejected'), + 'accepted' => __('career.accepted'), + 'waiting_document' => __('career.waiting_document'), + ]) + ->required(), - Section::make('Stajyer Giriş Bilgileri & Belgeleri') - ->description('Stajyerin sisteme giriş yapabilmesi için kullanıcı adı, şifre belirleyin ve imzalı staj formunu yükleyin.') - ->collapsible() - ->schema([ - TextInput::make('username') - ->label('Kullanıcı Adı') - ->unique(ignoreRecord: true) - ->nullable(), - - TextInput::make('password') - ->label('Şifre') - ->password() - ->revealable() - ->dehydrateStateUsing(fn ($state) => filled($state) ? Hash::make($state) : null) - ->dehydrated(fn ($state) => filled($state)) - ->placeholder('Şifreyi değiştirmek istemiyorsanız boş bırakın') - ->nullable() - ->suffixAction( - Action::make('generatePassword') - ->icon('heroicon-m-arrow-path') - ->action(fn (Set $set) => $set('password', Str::random(12))) - ), - - FileUpload::make('to_be_signed_internship_form_path') - ->label('İmzalanacak Staj Formu (Stajyerden)') - ->disk('public') - ->directory('to_be_signed_interns') - ->downloadable() - ->nullable(), + Textarea::make('message') + ->label(__('career.message')) + ->disabled() + ->columnSpanFull(), + ])->columns(2), - FileUpload::make('signed_internship_form_path') - ->label('İmzalı Staj Formu') - ->disk('public') - ->directory('signed_interns') - ->downloadable() - ->nullable(), + Tab::make('Staj Belgeleri & Giriş Bilgileri') + ->icon('heroicon-m-document-text') + ->schema([ + FileUpload::make('cv_path') + ->label(__('career.cv')) + ->disk('public') + ->directory('cvs') + ->required() + ->disabled() + ->downloadable(), - DatePicker::make('internship_start_date') - ->label('Staj Başlangıç Tarihi') - ->live() - ->afterStateUpdated(function ($state, $get, Set $set) { - if ($state && $get('internship_total_days')) { - self::calculateEndDate($state, $get('internship_total_days'), $set); - } elseif ($state && $get('internship_end_date')) { - self::calculateTotalDays($state, $get('internship_end_date'), $set); - } - }) - ->nullable(), - - DatePicker::make('internship_end_date') - ->label('Staj Bitiş Tarihi') - ->live() - ->afterStateUpdated(fn ($state, $get, Set $set) => self::calculateTotalDays($get('internship_start_date'), $state, $set)) - ->nullable(), + TextInput::make('username') + ->label('Kullanıcı Adı') + ->unique(ignoreRecord: true) + ->nullable(), + + TextInput::make('password') + ->label('Şifre') + ->password() + ->revealable() + ->dehydrateStateUsing(fn ($state) => filled($state) ? Hash::make($state) : null) + ->dehydrated(fn ($state) => filled($state)) + ->placeholder('Şifreyi değiştirmek istemiyorsanız boş bırakın') + ->nullable() + ->suffixAction( + Action::make('generatePassword') + ->icon('heroicon-m-arrow-path') + ->action(fn (Set $set) => $set('password', Str::random(12))) + ), + + FileUpload::make('to_be_signed_internship_form_path') + ->label('İmzalanacak Staj Formu (Stajyerden)') + ->disk('public') + ->directory('to_be_signed_interns') + ->downloadable() + ->nullable(), - TextInput::make('internship_total_days') - ->label('Toplam Staj Süresi (İş Günü)') - ->numeric() - ->live() - ->afterStateUpdated(fn ($state, $get, Set $set) => self::calculateEndDate($get('internship_start_date'), $state, $set)) - ->nullable(), - ]) - ->columnSpanFull(), + FileUpload::make('signed_internship_form_path') + ->label('İmzalı Staj Formu') + ->disk('public') + ->directory('signed_interns') + ->downloadable() + ->nullable(), + + DatePicker::make('internship_start_date') + ->label('Staj Başlangıç Tarihi') + ->live() + ->afterStateUpdated(function ($state, $get, Set $set) { + if ($state && $get('internship_total_days')) { + self::calculateEndDate($state, $get('internship_total_days'), $set); + } elseif ($state && $get('internship_end_date')) { + self::calculateTotalDays($state, $get('internship_end_date'), $set); + } + }) + ->nullable(), + + DatePicker::make('internship_end_date') + ->label('Staj Bitiş Tarihi') + ->live() + ->afterStateUpdated(fn ($state, $get, Set $set) => self::calculateTotalDays($get('internship_start_date'), $state, $set)) + ->nullable(), + + TextInput::make('internship_total_days') + ->label('Toplam Staj Süresi (İş Günü)') + ->numeric() + ->live() + ->afterStateUpdated(fn ($state, $get, Set $set) => self::calculateEndDate($get('internship_start_date'), $state, $set)) + ->nullable(), + ])->columns(2), + + Tab::make('Staj Günlüğü') + ->icon('heroicon-m-squares-plus') + ->schema([ + TextInput::make('github_repo') + ->label('GitHub Depo URL\'si') + ->url() + ->nullable() + ->live(), + + // View::make('filament.components.intern-journal-timeline') + // ->columnSpanFull() + ]) + ])->columnSpanFull() ]); } diff --git a/resources/views/filament/components/intern-journal-timeline.blade.php b/resources/views/filament/components/intern-journal-timeline.blade.php new file mode 100644 index 0000000..24c5ceb --- /dev/null +++ b/resources/views/filament/components/intern-journal-timeline.blade.php @@ -0,0 +1,288 @@ +@php + $githubRepo = $get('github_repo') ?? ($record ? $record->github_repo : null); + $uid = 'journal_' . uniqid(); +@endphp + +
+ + + + + + + + + + + + + + + + +