Skip to content

Commit

Permalink
Fixed code style
Browse files Browse the repository at this point in the history
  • Loading branch information
tabuna authored and github-actions[bot] committed Dec 24, 2024
1 parent f42b355 commit 4dae2cf
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions app/Orchid/Screens/SecretSantaScreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use App\Models\SecretSantaParticipant;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
use Orchid\Screen\Actions\Link;
use Orchid\Screen\Actions\ModalToggle;
use Orchid\Screen\Components\Cells\DateTimeSplit;
Expand Down Expand Up @@ -72,29 +71,28 @@ public function layout(): array
Select::make('participant.status')
->title('Статус участника')
->options([
'new' => 'Новый',
'pending' => 'Ожидает',
'new' => 'Новый',
'pending' => 'Ожидает',
'in_progress' => 'В процессе',
'done' => 'Завершён',
'done' => 'Завершён',
])
->empty('Выберите статус')
->help('Укажите текущий статус участия.'),
]))
->method('update')
->deferred('loadParticipant'),


Layout::table('participants', [
TD::make('user.name', 'Пользователь (Санта)')
->render(fn(SecretSantaParticipant $participant) => ModalToggle::make($participant->user->name)
->render(fn (SecretSantaParticipant $participant) => ModalToggle::make($participant->user->name)
->modalTitle($participant->user->name)
->modal('edit-participant', [
'participant' => $participant
'participant' => $participant,
])
),

TD::make('receiver', 'Получатель')
->render(fn(SecretSantaParticipant $participant) => $participant->receiver?->user->name ?? 'Не назначен'
->render(fn (SecretSantaParticipant $participant) => $participant->receiver?->user->name ?? 'Не назначен'
),

/*
Expand All @@ -107,7 +105,7 @@ public function layout(): array
->width(200),

TD::make('receiver.telegram', 'Telegram')
->render(fn(SecretSantaParticipant $participant) => $participant->receiver?->telegram
->render(fn (SecretSantaParticipant $participant) => $participant->receiver?->telegram
? Link::make($participant->receiver?->telegram)->href("https://t.me/{$participant->receiver?->telegram}")
: ''
),
Expand All @@ -117,7 +115,7 @@ public function layout(): array
TD::make('receiver.phone', 'Номер телефона'),

TD::make('status', 'Статус')
->render(fn(SecretSantaParticipant $participant) => $participant->status === 'done'
->render(fn (SecretSantaParticipant $participant) => $participant->status === 'done'
? '✅ Завершён'
: '⏳ Ожидает'
),
Expand All @@ -133,20 +131,20 @@ public function layout(): array

/**
* @param SecretSantaParticipant $participant
*
* @return SecretSantaParticipant[]
*/
public function loadParticipant(SecretSantaParticipant $participant)
{
return [
'participant' => $participant
'participant' => $participant,
];
}


public function update(Request $request, SecretSantaParticipant $participant): void
{
$participant->fill($request->input('participant'))->save();

Toast::info("Информация обновлена");
Toast::info('Информация обновлена');
}
}

0 comments on commit 4dae2cf

Please sign in to comment.