fn() => $projectProposal, 'isAllowed' => false, 'currentPubkey' => null, 'currentPleb' => null, 'reasons' => fn() => Vote::query() ->where('project_proposal_id', $this->projectProposal->id) ->where('value', false) ->get(), 'ownVoteExists' => false, 'boardVotes' => fn() => Vote::query() ->where('project_proposal_id', $this->projectProposal->id) ->whereHas('einundzwanzigPleb', fn($q) => $q->whereIn('npub', config('einundzwanzig.config.current_board'))) ->where('value', true) ->get(), 'otherVotes' => fn() => Vote::query() ->where('project_proposal_id', $this->projectProposal->id) ->whereDoesntHave( 'einundzwanzigPleb', fn($q) => $q->whereIn('npub', config('einundzwanzig.config.current_board')), ) ->where('value', true) ->get(), ]); on([ 'nostrLoggedIn' => function ($pubkey) { $this->currentPubkey = $pubkey; $this->currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $pubkey)->first(); if ($this->currentPleb->association_status->value < 2) { return $this->js('alert("Du bist hierzu nicht berechtigt.")'); } $this->isAllowed = true; $this->ownVoteExists = Vote::query() ->where('project_proposal_id', $this->projectProposal->id) ->where('einundzwanzig_pleb_id', $this->currentPleb->id) ->exists(); }, 'nostrLoggedOut' => function () { $this->isAllowed = false; $this->currentPubkey = null; $this->currentPleb = null; }, ]); $approve = function () { Vote::query()->updateOrCreate([ 'project_proposal_id' => $this->projectProposal->id, 'einundzwanzig_pleb_id' => $this->currentPleb->id, ], [ 'value' => true, ]); $this->form->reset(); $this->ownVoteExists = true; $this->boardVotes = Vote::query() ->where('project_proposal_id', $this->projectProposal->id) ->where('value', false) ->get(); $this->otherVotes = Vote::query() ->where('project_proposal_id', $this->projectProposal->id) ->where('value', false) ->get(); }; $notApprove = function () { $this->form->validate(); Vote::query()->updateOrCreate([ 'project_proposal_id' => $this->projectProposal->id, 'einundzwanzig_pleb_id' => $this->currentPleb->id, ], [ 'value' => false, 'reason' => $this->form->reason, ]); $this->form->reset(); $this->ownVoteExists = true; $this->reasons = Vote::query() ->where('project_proposal_id', $this->projectProposal->id) ->where('value', false) ->get(); }; ?> > @volt
{{ $projectProposal->created_at->format('D d M, Y') }}

{{ $projectProposal->name }}

{!! $projectProposal->description !!}
User 04
Eingereicht von
{{ $projectProposal->einundzwanzigPleb->profile->name }}
{{ number_format($projectProposal->support_in_sats, 0, ',', '.') }} Sats
Meetup

Ablehnungen ({{ count($reasons) }})

    @foreach($reasons as $reason)
  • {{ $reason->einundzwanzigPleb->profile->name }}
    {{ $reason->einundzwanzigPleb->profile->name }}
    {{ $reason->reason }}
  • @endforeach
@if(!$ownVoteExists)
@else

Du hast bereits abgestimmt.

@endif
Zustimmungen des Vorstands ({{ count($boardVotes) }})
    @foreach($boardVotes as $vote)
  • {{ $vote->einundzwanzigPleb->profile->name }}
    {{ $vote->einundzwanzigPleb->profile->name }}
  • @endforeach
Zustimmungen der übrigen Mitglieder ({{ count($otherVotes) }})
    @foreach($otherVotes as $vote)
  • {{ $vote->einundzwanzigPleb->profile->name }}
    {{ $vote->einundzwanzigPleb->profile->name }}
  • @endforeach
@endvolt