['icon' => 'fa-crown', 'title' => 'Präsidium'], 'board' => ['icon' => 'fa-users', 'title' => 'Vizepräsidium'], ]; $loadedEvents = collect($events) ->map(function($event) { $profile = \App\Models\Profile::query() ->where('pubkey', $event['pubkey']) ->first() ?->toArray(); $votedFor = \App\Models\Profile::query() ->where('pubkey', str($event['content'])->before(',')->toString()) ->first() ?->toArray(); return [ 'id' => $event['id'], 'kind' => $event['kind'], 'content' => $event['content'], 'pubkey' => $event['pubkey'], 'tags' => $event['tags'], 'created_at' => $event['created_at'], 'profile' => $profile, 'votedFor' => $votedFor, 'type' => str($event['content'])->after(',')->toString(), ]; }) ->sortByDesc('created_at') ->unique(fn ($event) => $event['pubkey'] . $event['type']) ->values(); $loadedBoardEvents = collect($boardEvents) ->map(function($event) { $profile = \App\Models\Profile::query() ->where('pubkey', $event['pubkey']) ->first() ?->toArray(); $votedFor = \App\Models\Profile::query() ->where('pubkey', str($event['content'])->before(',')->toString()) ->first() ?->toArray(); return [ 'id' => $event['id'], 'kind' => $event['kind'], 'content' => $event['content'], 'pubkey' => $event['pubkey'], 'tags' => $event['tags'], 'created_at' => $event['created_at'], 'profile' => $profile, 'votedFor' => $votedFor, 'type' => str($event['content'])->after(',')->toString(), ]; }) ->sortByDesc('created_at') ->values(); ?>
Plebs
  • A
    $p): ?> filter(fn ($e) => $e['pubkey'] === $pleb['pubkey'])->firstWhere('type', $name); ?>
candidates, true, 512, JSON_THROW_ON_ERROR)) ->map(function ($c) use ($loadedEvents, $currentPubkey) { $candidates = \App\Models\Profile::query() ->whereIn('pubkey', $c['c']) ->get() ->map(function ($p) use ($loadedEvents, $c, $currentPubkey) { $votedClass = ' bg-green-500/20 text-green-700'; $notVotedClass = ' bg-gray-500/20 text-gray-100'; $hasVoted = $loadedEvents ->filter(fn($e) => $e['type'] === $c['type'] && $e['pubkey'] === $currentPubkey) ->firstWhere('votedFor.pubkey', $p->pubkey); return [ 'pubkey' => $p->pubkey, 'name' => $p->name, 'picture' => $p->picture, 'votedClass' => $hasVoted ? $votedClass : $notVotedClass, ]; }); return [ 'type' => $c['type'], 'c' => $c['c'], 'candidates' => $candidates, ]; }); $electionConfigBoard = collect(json_decode($election->candidates, true, 512, JSON_THROW_ON_ERROR)) ->map(function ($c) use ($loadedBoardEvents, $currentPubkey) { $candidates = \App\Models\Profile::query() ->whereIn('pubkey', $c['c']) ->get() ->map(function ($p) use ($loadedBoardEvents, $c, $currentPubkey) { $votedClass = ' bg-green-500/20 text-green-700'; $notVotedClass = ' bg-gray-500/20 text-gray-100'; $hasVoted = $loadedBoardEvents ->filter(fn($e) => $e['type'] === $c['type'] && $e['pubkey'] === $currentPubkey) ->firstWhere('votedFor.pubkey', $p->pubkey); return [ 'pubkey' => $p->pubkey, 'name' => $p->name, 'picture' => $p->picture, 'votedClass' => $hasVoted ? $votedClass : $notVotedClass, 'hasVoted' => $hasVoted, ]; }); return [ 'type' => $c['type'], 'c' => $c['c'], 'candidates' => $candidates, ]; }); ?>

Wahlen

Wahl des Präsidiums

filter(fn ($event) => $event['pubkey'] === $currentPubkey)->firstWhere('type', 'presidency'); ?> Du hast "" gewählt Wähle deinen Kandidaten für das Präsidium.
firstWhere('type', 'presidency')['candidates'] ?? [] as $c): ?>
wire:click="vote('', 'presidency')" class=" cursor-pointer text-xs inline-flex font-medium rounded-full text-center px-2.5 py-1">
<?php echo e($c['name']); ?>

Wahl der übrigen Vorstandsmitglieder

Klicke auf den Kandidaten, um seine Position als Vorstandsmitglied zu bestätigen.
firstWhere('type', 'board')['candidates'] ?? [] as $c): ?>
wire:click="vote('', 'board', true)" class=" cursor-pointer text-xs inline-flex font-medium rounded-full text-center px-2.5 py-1">
<?php echo e($c['name']); ?>

Wahlen

Du bist nicht berechtigt, die Wahlen einzusehen.