From 4568d9e402f845682ac833d277b715e8a9d0e031 Mon Sep 17 00:00:00 2001 From: fsociety Date: Mon, 30 Sep 2024 20:27:18 +0200 Subject: [PATCH] feat: add voting feature toggle This commit introduces a new feature toggle 'voting' to enable/disable voting. It also includes minor formatting adjustments in election admin blade files. --- config/services.php | 2 ++ .../election/[Election:year].blade.php | 2 +- .../election/admin/[Election:year].blade.php | 29 +++++++++---------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/config/services.php b/config/services.php index b6dc748..12ee866 100644 --- a/config/services.php +++ b/config/services.php @@ -14,6 +14,8 @@ return [ | */ + 'voting' => env('ENABLE_VOTING', false), + 'relay' => env('NOSTR_RELAY'), 'nostr' => env('NOSTR_P'), diff --git a/resources/views/pages/association/election/[Election:year].blade.php b/resources/views/pages/association/election/[Election:year].blade.php index f8e3282..940d43e 100644 --- a/resources/views/pages/association/election/[Election:year].blade.php +++ b/resources/views/pages/association/election/[Election:year].blade.php @@ -44,7 +44,7 @@ mount(function () { ->get() ->toArray(); $this->loadEvents(); - if ($this->election->end_time->isPast()) { + if ($this->election->end_time->isPast() || !config('services.voting')) { $this->isNotClosed = false; } }); diff --git a/resources/views/pages/association/election/admin/[Election:year].blade.php b/resources/views/pages/association/election/admin/[Election:year].blade.php index 3208498..a4ad6fa 100644 --- a/resources/views/pages/association/election/admin/[Election:year].blade.php +++ b/resources/views/pages/association/election/admin/[Election:year].blade.php @@ -191,22 +191,21 @@ $loadEvents = function () {
- - @foreach($positions as $key => $position) -
-
-

{{ $position['title'] }} -

-
-
- - + @foreach($positions as $key => $position) +
+
+

{{ $position['title'] }} +

+
+
+ + +
-
- @endforeach + @endforeach