From 5623671bada1674ce2243ca6375726bee3dd7d12 Mon Sep 17 00:00:00 2001 From: fsociety Date: Sun, 29 Sep 2024 22:27:07 +0200 Subject: [PATCH] feat: update layout and fix bugs in election related pages This commit includes various updates to improve the layout and user experience on election related pages. It includes changes in grid layout for better responsiveness, updates to text sizing and wrapping for better readability, and fixes bugs related to null values and unique key generation. --- .../election/[Election:year].blade.php | 16 ++++---- .../election/admin/[Election:year].blade.php | 2 +- .../association/election/index.blade.php | 2 +- .../views/pages/association/profile.blade.php | 37 ++++++++++++------- 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/resources/views/pages/association/election/[Election:year].blade.php b/resources/views/pages/association/election/[Election:year].blade.php index 35531ae..73a4db3 100644 --- a/resources/views/pages/association/election/[Election:year].blade.php +++ b/resources/views/pages/association/election/[Election:year].blade.php @@ -163,11 +163,11 @@ $signEvent = function ($event) { $profile = \App\Models\Profile::query() ->where('pubkey', $event['pubkey']) ->first() - ->toArray(); + ?->toArray(); $votedFor = \App\Models\Profile::query() ->where('pubkey', str($event['content'])->before(',')->toString()) ->first() - ->toArray(); + ?->toArray(); return [ 'id' => $event['id'], @@ -182,9 +182,7 @@ $signEvent = function ($event) { ]; }) ->sortByDesc('created_at') - ->unique(function ($event) { - return $event['pubkey'] . $event['type']; - }) + ->unique(fn ($event) => $event['pubkey'] . $event['type']) ->values(); @endphp @@ -361,7 +359,7 @@ $signEvent = function ($event) {
-
+
@if($isNotClosed) filter(fn ($event) => $event['pubkey'] === $currentPubkey)->firstWhere('type', $type); @endphp @if($votedResult) - Du hast "{{ $votedResult['votedFor']['name'] }}" gewählt + Du hast "{{ $votedResult['votedFor']['name'] ?? 'error' }}" gewählt @else Klicke auf den Kandidaten, den du wählen möchtest. @endif