From 88921ded1e1476ecec3325c3d73db252b53861d4 Mon Sep 17 00:00:00 2001 From: Mateja Date: Tue, 17 Nov 2020 23:24:09 +0100 Subject: Drastically improved reservation form. --- app/Http/Controllers/ReservationsController.php | 36 ++++++- resources/views/pages/reserve.blade.php | 133 ++++-------------------- 2 files changed, 56 insertions(+), 113 deletions(-) diff --git a/app/Http/Controllers/ReservationsController.php b/app/Http/Controllers/ReservationsController.php index a11ea39..ae130fc 100644 --- a/app/Http/Controllers/ReservationsController.php +++ b/app/Http/Controllers/ReservationsController.php @@ -64,7 +64,41 @@ class ReservationsController extends Controller public function create(Request $request) { $signs = SpecialCall::all(); - return view('pages.reserve', compact('signs')); + + $freq_list = [ + '1.8 MHz', + '3.5 MHz', + '7 MHz', + '10 MHz', + '14 MHz', + '18 MHz', + '21 MHz', + '24 MHz', + '28 MHz', + '50 MHz', + '144 MHz', + '432 MHz', + '1.2 GHz', + '2.3 GHz' + ]; + + $mode_list = [ + 'CW' => 'CW', + 'SSB' => 'SSB', + 'FM' => 'FM', + 'RTTY' => 'RTTY', + 'MFSK' => 'MFSK (JT65, FT8...)', + 'IMAGING' => 'IMAGING (ATV, SSTV...)', + 'OTHER DIGITAL' => 'OTHER DIGITAL' + ]; + + $data = [ + 'signs' => $signs, + 'freq_list' => $freq_list, + 'mode_list' => $mode_list + ]; + + return view('pages.reserve', $data); } public function store(Request $request) diff --git a/resources/views/pages/reserve.blade.php b/resources/views/pages/reserve.blade.php index 244d70a..0395f8a 100644 --- a/resources/views/pages/reserve.blade.php +++ b/resources/views/pages/reserve.blade.php @@ -12,7 +12,7 @@ @endif @if ($errors->any())
- All fields must be filled! + All fields must be filled and conditions satisfied!
@endif
@@ -74,127 +74,36 @@ @enderror - -
- I will be active on bands: -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
+ +
+ I will be active on bands: +@foreach ($freq_list as $freq) +
+ + +
+@endforeach @error('freqs')
{{ $message }}
@enderror -
- - -
- I will use modes: +
-
- - -
- -
- - -
+ +
+ I will use modes: -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
+@foreach ($mode_list as $key => $value) +
+ + +
+@endforeach @error('modes')
{{ $message }}
@enderror -
+
-- cgit v1.2.3