|
2 | 2 |
|
3 | 3 | namespace App\Orchid\Screens;
|
4 | 4 |
|
| 5 | +use App\Models\Post; |
5 | 6 | use App\Models\SecretSantaParticipant;
|
6 | 7 | use App\Models\User;
|
7 | 8 | use Illuminate\Http\Request;
|
@@ -84,38 +85,35 @@ public function layout(): array
|
84 | 85 | ->deferred('loadParticipant'),
|
85 | 86 |
|
86 | 87 | Layout::table('participants', [
|
87 |
| - TD::make('user.name', 'Пользователь (Санта)') |
| 88 | + TD::make('user.name', 'Санта') |
| 89 | + ->width(100) |
88 | 90 | ->render(fn (SecretSantaParticipant $participant) => ModalToggle::make($participant->user->name)
|
89 | 91 | ->modalTitle($participant->user->name)
|
90 | 92 | ->modal('edit-participant', [
|
91 |
| - 'participant' => $participant, |
| 93 | + 'participant' => $participant->id, |
92 | 94 | ])
|
93 | 95 | ),
|
94 | 96 |
|
95 | 97 | TD::make('receiver', 'Получатель')
|
| 98 | + ->width(100) |
96 | 99 | ->render(fn (SecretSantaParticipant $participant) => $participant->receiver?->user->name ?? 'Не назначен'
|
97 | 100 | ),
|
98 | 101 |
|
99 |
| - /* |
100 |
| - TD::make('santa', 'Санта') |
101 |
| - ->render(fn(SecretSantaParticipant $participant) => $participant->santa?->user->name ?? 'Не назначен' |
102 |
| - ), |
103 |
| - */ |
104 |
| - |
105 | 102 | TD::make('receiver.address', 'Адрес')
|
| 103 | + ->defaultHidden() |
106 | 104 | ->width(200),
|
107 | 105 |
|
108 |
| - TD::make('receiver.telegram', 'Telegram') |
109 |
| - ->render(fn (SecretSantaParticipant $participant) => $participant->receiver?->telegram |
110 |
| - ? Link::make($participant->receiver?->telegram)->href("https://t.me/{$participant->receiver?->telegram}") |
111 |
| - : '—' |
112 |
| - ), |
| 106 | + TD::make('receiver.telegram', 'Контакты') |
| 107 | + ->width(200) |
| 108 | + ->render(function (SecretSantaParticipant $participant) { |
| 109 | + return "<strong class='d-block'>".e($participant->receiver?->telegram).'</strong>' |
| 110 | + . "<span>".e($participant->receiver?->phone)."</span>"; |
| 111 | + }), |
113 | 112 |
|
114 | 113 | TD::make('receiver.tracking_number', 'Трек-номер'),
|
115 | 114 |
|
116 |
| - TD::make('receiver.phone', 'Номер телефона'), |
117 |
| - |
118 | 115 | TD::make('status', 'Статус')
|
| 116 | + ->width(100) |
119 | 117 | ->render(fn (SecretSantaParticipant $participant) => $participant->status === 'done'
|
120 | 118 | ? '✅ Завершён'
|
121 | 119 | : '⏳ Ожидает'
|
|
0 commit comments