From bf31b9f00178b834e366fb770b67d50bf665f799 Mon Sep 17 00:00:00 2001 From: HolgerHatGarKeineNode Date: Sun, 18 Jan 2026 23:28:27 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Integrate=20Flux=20modals=20for=20m?= =?UTF-8?q?ember=20acceptance=20and=20rejection=20actions,=20refactor=20re?= =?UTF-8?q?lated=20Livewire=20methods,=20and=20improve=20Blade=20table=20s?= =?UTF-8?q?tructure=20for=20consistency=20and=20UX.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Livewire/EinundzwanzigPlebTable.php | 76 ++++++++--------- resources/views/components/detail.blade.php | 81 ++++++++----------- .../association/members/admin.blade.php | 36 +++++++++ 3 files changed, 102 insertions(+), 91 deletions(-) diff --git a/app/Livewire/EinundzwanzigPlebTable.php b/app/Livewire/EinundzwanzigPlebTable.php index c94179a..14f0a5f 100644 --- a/app/Livewire/EinundzwanzigPlebTable.php +++ b/app/Livewire/EinundzwanzigPlebTable.php @@ -164,58 +164,54 @@ class EinundzwanzigPlebTable extends PowerGridComponent return []; } + public ?int $confirmAcceptId = null; + + public ?int $confirmDeleteId = null; + #[\Livewire\Attributes\On('accept')] public function accept($rowId): void { - $pleb = EinundzwanzigPleb::query() - ->with('profile') - ->findOrFail($rowId); - $this->dialog()->confirm([ - 'title' => 'Bist du sicher?', - 'description' => 'Möchtest du '.$pleb->profile->name.' wirklich akzeptieren?', - 'acceptLabel' => 'Ja, akzeptieren', - 'method' => 'acceptPleb', - 'params' => $rowId, - ]); + $this->confirmAcceptId = $rowId; + $this->modal('confirm-accept-pleb')->show(); } #[\Livewire\Attributes\On('delete')] public function delete($rowId): void { - $pleb = EinundzwanzigPleb::query() - ->with('profile') - ->findOrFail($rowId); - $this->dialog()->confirm([ - 'title' => 'Bist du sicher?', - 'description' => 'Möchtest du '.$pleb->profile->name.' wirklich löschen?', - 'acceptLabel' => 'Ja, lösche', - 'method' => 'deletePleb', - 'params' => $rowId, - ]); + $this->confirmDeleteId = $rowId; + $this->modal('confirm-delete-pleb')->show(); } - public function acceptPleb($rowId) + public function acceptPleb(): void { - $pleb = EinundzwanzigPleb::query()->findOrFail($rowId); - $for = $pleb->application_for; - $text = $pleb->application_text; - $pleb->association_status = AssociationStatus::from($for); - $pleb->application_for = null; - $pleb->archived_application_text = $text; - $pleb->application_text = null; - $pleb->save(); + if ($this->confirmAcceptId) { + $pleb = EinundzwanzigPleb::query()->findOrFail($this->confirmAcceptId); + $for = $pleb->application_for; + $text = $pleb->application_text; + $pleb->association_status = AssociationStatus::from($for); + $pleb->application_for = null; + $pleb->archived_application_text = $text; + $pleb->application_text = null; + $pleb->save(); - $this->fillData(); + $this->confirmAcceptId = null; + $this->modal('confirm-accept-pleb')->close(); + $this->fillData(); + } } - public function deletePleb($rowId) + public function deletePleb(): void { - $pleb = EinundzwanzigPleb::query()->findOrFail($rowId); - $pleb->application_for = null; - $pleb->application_text = null; - $pleb->save(); + if ($this->confirmDeleteId) { + $pleb = EinundzwanzigPleb::query()->findOrFail($this->confirmDeleteId); + $pleb->application_for = null; + $pleb->application_text = null; + $pleb->save(); - $this->fillData(); + $this->confirmDeleteId = null; + $this->modal('confirm-delete-pleb')->close(); + $this->fillData(); + } } public function actions(EinundzwanzigPleb $row): array @@ -224,16 +220,12 @@ class EinundzwanzigPlebTable extends PowerGridComponent Button::add('delete') ->slot('Löschen') ->id() - ->class( - 'btn bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 hover:border-gray-300 dark:hover:border-gray-600 text-red-500', - ) + ->class('px-3 py-1.5 text-sm font-medium rounded-md border transition-colors bg-white dark:bg-zinc-800 border-zinc-200 dark:border-zinc-700 text-red-600 dark:text-red-500 hover:bg-red-50 dark:hover:bg-red-950') ->dispatch('delete', ['rowId' => $row->id]), Button::add('accept') ->slot('Akzeptieren') ->id() - ->class( - 'btn bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 hover:border-gray-300 dark:hover:border-gray-600 text-green-500', - ) + ->class('px-3 py-1.5 text-sm font-medium rounded-md border transition-colors bg-white dark:bg-zinc-800 border-zinc-200 dark:border-zinc-700 text-emerald-600 dark:text-emerald-500 hover:bg-emerald-50 dark:hover:bg-emerald-950') ->dispatch('accept', ['rowId' => $row->id]), ]; } diff --git a/resources/views/components/detail.blade.php b/resources/views/components/detail.blade.php index dde6da2..f5c326f 100644 --- a/resources/views/components/detail.blade.php +++ b/resources/views/components/detail.blade.php @@ -1,58 +1,41 @@
- @if($row->application_text ) -
-
-
- - - -
{{ $row->application_text }}
-
-
-
+ + {{ $row->application_text }} + @endif
-

- bisherige Zahlungen

- - - - - - - - - - - - - @foreach($row->paymentEvents as $payment) - - - - + bisherige Zahlungen + +
-
Satoshis
-
-
{{ $payment->amount }}
-
-
{{ $payment->year }}
-
-
{{ $payment->event_id }}
-
+ + + + + - @endforeach + + + @foreach($row->payment_events as $payment) + + + + + + @endforeach
+
Satoshis
+
+
Jahr
+
+
Event-ID
+
+
{{ $payment->amount }}
+
+
{{ $payment->year }}
+
+
{{ $payment->event_id }}
+
diff --git a/resources/views/livewire/association/members/admin.blade.php b/resources/views/livewire/association/members/admin.blade.php index 0d97187..3e00b98 100644 --- a/resources/views/livewire/association/members/admin.blade.php +++ b/resources/views/livewire/association/members/admin.blade.php @@ -86,4 +86,40 @@ new class extends Component {
@endif + + +
+
+ Mitglied akzeptieren + + Bist du sicher, dass du dieses Mitglied akzeptieren möchtest? + +
+
+ + + Abbrechen + + Ja, akzeptieren +
+
+
+ + +
+
+ Bewerbung ablehnen + + Bist du sicher, dass du diese Bewerbung ablehnen möchtest? + +
+
+ + + Abbrechen + + Ja, ablehnen +
+
+