plebs = $this->loadPlebs(); } protected $listeners = [ 'nostrLoggedOut' => 'handleNostrLoggedOut', 'nostrLoggedIn' => 'handleNostrLoggedIn', ]; public function mount(): void { if (NostrAuth::check()) { $this->currentPubkey = NostrAuth::pubkey(); $this->currentPleb = \App\Models\EinundzwanzigPleb::query() ->where('pubkey', $this->currentPubkey)->first(); $allowedPubkeys = [ '0adf67475ccc5ca456fd3022e46f5d526eb0af6284bf85494c0dd7847f3e5033', '430169631f2f0682c60cebb4f902d68f0c71c498fd1711fd982f052cf1fd4279', '7acf30cf60b85c62b8f654556cc21e4016df8f5604b3b6892794f88bb80d7a1d', 'f240be2b684f85cc81566f2081386af81d7427ea86250c8bde6b7a8500c761ba', '19e358b8011f5f4fc653c565c6d4c2f33f32661f4f90982c9eedc292a8774ec3', 'acbcec475a1a4f9481939ecfbd1c3d111f5b5a474a39ae039bbc720fdd305bec', ]; if (in_array($this->currentPubkey, $allowedPubkeys, true)) { $this->isAllowed = true; } } $this->plebs = $this->loadPlebs(); } private function loadPlebs() { $query = EinundzwanzigPleb::query() ->with([ 'profile', 'paymentEvents' => fn ($query) => $query ->where('year', date('Y')) ->where('paid', true), ]); if ($this->search) { $query->where(function ($query) { $query->whereHas('profile', function ($query) { $query->where('name', 'ilike', '%'.$this->search.'%'); })->orWhere('npub', 'like', '%'.$this->search.'%'); }); } if ($this->showPaidOnly) { $query->whereHas('paymentEvents', fn ($query) => $query ->where('year', date('Y')) ->where('paid', true) ); } return $query->tap(fn ($query) => $this->sortBy ? $query->orderBy($this->sortBy, $this->sortDirection) : $query) ->get(); } public function sort(string $column): void { if ($this->sortBy === $column) { $this->sortDirection = $this->sortDirection === 'asc' ? 'desc' : 'asc'; } else { $this->sortBy = $column; $this->sortDirection = 'asc'; } $this->plebs = $this->loadPlebs(); } public function togglePaidFilter(): void { $this->showPaidOnly = !$this->showPaidOnly; $this->plebs = $this->loadPlebs(); } public function openPaymentModal(int $plebId): void { $this->selectedPlebId = $plebId; Flux::modal('payment-details')->show(); } public function accept($rowId): void { $this->confirmAcceptId = $rowId; Flux::modal('confirm-accept-pleb')->show(); } public function delete($rowId): void { $this->confirmDeleteId = $rowId; Flux::modal('confirm-delete-pleb')->show(); } public function acceptPleb(): void { 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->confirmAcceptId = null; Flux::modal('confirm-accept-pleb')->close(); } } public function deletePleb(): void { if ($this->confirmDeleteId) { $pleb = EinundzwanzigPleb::query()->findOrFail($this->confirmDeleteId); $pleb->application_for = null; $pleb->application_text = null; $pleb->save(); $this->confirmDeleteId = null; Flux::modal('confirm-delete-pleb')->close(); } } public function closePaymentModal(): void { $this->selectedPlebId = null; Flux::modal('payment-details')->close(); } #[Computed] public function selectedPleb(): ?EinundzwanzigPleb { return EinundzwanzigPleb::with(['paymentEvents'])->find($this->selectedPlebId); } }; ?>
@if($isAllowed)
{{ $showPaidOnly ? 'Alle anzeigen' : 'Nur Bezahlt' }}
Avatar Name Aktueller Status Beitrag {{ date('Y') }} Aktionen @foreach ($this->plebs as $pleb)
{{ $pleb->profile?->name ?: $pleb->profile?->display_name ?? '' }} Nostr Profile
{{ $pleb->association_status->label() }} @if($pleb->paymentEvents->count() > 0 && $pleb->paymentEvents->first()->paid) {{ number_format($pleb->paymentEvents->first()->amount, 0, ',', '.') }} @else keine Zahlung vorhanden @endif
@if($pleb->application_for) @endif
@endforeach
@else
Mitglieder können nicht bearbeitet werden

Zugriff auf die Mitgliederverwaltung ist nur für spezielle autorisierte Benutzer möglich.

@if(!NostrAuth::check()) Bitte melde dich zunächst mit Nostr an. @else Dein Benutzer-Account ist nicht für diese Funktion autorisiert. Bitte kontaktiere den Vorstand, wenn du Zugriff benötigst. @endif

@endif @if($this->selectedPleb)
Zahlungsdetails {{ $this->selectedPleb->profile?->name ?: $this->selectedPleb->profile?->display_name ?? 'Unbekannt' }}
@if($this->selectedPleb->application_text) {{ $this->selectedPleb->application_text }} @endif
Bisherige Zahlungen @if($this->selectedPleb->paymentEvents->count() > 0) Satoshis Jahr Event-ID @foreach($this->selectedPleb->paymentEvents as $payment) {{ $payment->amount }} {{ $payment->year }} {{ $payment->event_id }} @endforeach @else Keine Zahlungen gefunden @endif
Schließen
@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