From 27499b34d0263e4e7429292517acb8d37ee2c8d2 Mon Sep 17 00:00:00 2001 From: Mateja Date: Sat, 31 Oct 2020 11:17:51 +0100 Subject: Add SpecialCallsController and titles to views. --- app/Http/Controllers/PagesController.php | 52 ++++++------------------- app/Http/Controllers/SpecialCallsController.php | 43 ++++++++++++++++++++ resources/views/layouts/app.blade.php | 2 +- resources/views/pages/activities.blade.php | 2 + resources/views/pages/callsigns.blade.php | 2 + resources/views/pages/gallery.blade.php | 2 + resources/views/pages/index.blade.php | 2 + resources/views/pages/login.blade.php | 2 + resources/views/pages/news.blade.php | 2 + resources/views/pages/reservations.blade.php | 2 + resources/views/pages/reserve.blade.php | 2 + resources/views/pages/sponsoring.blade.php | 2 + routes/web.php | 8 ++-- 13 files changed, 79 insertions(+), 44 deletions(-) create mode 100644 app/Http/Controllers/SpecialCallsController.php diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index f42ae3e..c30f923 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -18,11 +18,6 @@ class PagesController extends Controller return view('pages.index'); } - public function sponsoring(Request $request) - { - return view('pages.sponsoring'); - } - public function news(Request $request) { $news = Post::all(); @@ -36,44 +31,15 @@ class PagesController extends Controller return view('pages.gallery'); } - public function login(Request $request) - { - return view('pages.login'); - } - - public function logout(Request $request) - { - Auth::logout(); - return Redirect::back(); - } - - public function activities(Request $request) - { - return view('pages.activities'); - } - - public function reserve(Request $request) + public function sponsoring(Request $request) { - return view('pages.reserve'); + return view('pages.sponsoring'); } - public function reserveForm(Request $request) + // LOGIN SYSTEM + public function login(Request $request) { - $validatedData = $request->validate([ - 'scall' => 'required|alphanum', - 'sdate' => 'required|date', - 'stime' => 'required', - 'edate' => 'required|date', - 'etime' => 'required', - 'freqs' => 'required', - 'modes' => 'required', - 'ocall' => 'required|alphanum', - 'oname' => 'required', - 'email' => 'required|email', - 'phone' => ['required', 'regex:/^[0-9 ]+$/'], - ]); - - return redirect('reserve')->with('status', 'Reservation submitted.'); + return view('pages.login'); } public function loginForm(Request $request) @@ -107,8 +73,14 @@ class PagesController extends Controller else return Redirect::back() ->withErrors(['failed' => ['Bad credentials!']]); } - + public function logout(Request $request) + { + Auth::logout(); + return Redirect::back(); + } + + // NOTES //public function services() //{ ////$title = 'Some title'; diff --git a/app/Http/Controllers/SpecialCallsController.php b/app/Http/Controllers/SpecialCallsController.php new file mode 100644 index 0000000..3a3ab89 --- /dev/null +++ b/app/Http/Controllers/SpecialCallsController.php @@ -0,0 +1,43 @@ +validate([ + 'scall' => 'required|alphanum', + 'sdate' => 'required|date', + 'stime' => 'required', + 'edate' => 'required|date', + 'etime' => 'required', + 'freqs' => 'required', + 'modes' => 'required', + 'ocall' => 'required|alphanum', + 'oname' => 'required', + 'email' => 'required|email', + 'phone' => ['required', 'regex:/^[0-9 ]+$/'], + ]); + + return redirect('reserve')->with('status', 'Reservation submitted.'); + } +} diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 13e2c6a..07b8d8a 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -8,7 +8,7 @@ - Main page + YOTA - @yield('title') @include('inc.navbar') diff --git a/resources/views/pages/activities.blade.php b/resources/views/pages/activities.blade.php index 6521759..ac2b04d 100644 --- a/resources/views/pages/activities.blade.php +++ b/resources/views/pages/activities.blade.php @@ -1,5 +1,7 @@ @extends('layouts.app') +@section('title', 'Special Calls - Activities') + @section('content') @if (1==2)
diff --git a/resources/views/pages/callsigns.blade.php b/resources/views/pages/callsigns.blade.php index 2afe0dd..10cea68 100644 --- a/resources/views/pages/callsigns.blade.php +++ b/resources/views/pages/callsigns.blade.php @@ -1,5 +1,7 @@ @extends('layouts.app') +@section('title', 'Callsigns administration') + @section('content') CALLSIGNS ADMINISTRATION @endsection diff --git a/resources/views/pages/gallery.blade.php b/resources/views/pages/gallery.blade.php index c566186..84b8daf 100644 --- a/resources/views/pages/gallery.blade.php +++ b/resources/views/pages/gallery.blade.php @@ -1,5 +1,7 @@ @extends('layouts.app') +@section('title', 'Gallery') + @section('content')
YOTA camp diff --git a/resources/views/pages/index.blade.php b/resources/views/pages/index.blade.php index eeb7b56..22e6a6c 100644 --- a/resources/views/pages/index.blade.php +++ b/resources/views/pages/index.blade.php @@ -1,5 +1,7 @@ @extends('layouts.app') +@section('title', 'Home') + @section('jumbotron') {{--
--}}
diff --git a/resources/views/pages/login.blade.php b/resources/views/pages/login.blade.php index 473c23f..3fbc995 100644 --- a/resources/views/pages/login.blade.php +++ b/resources/views/pages/login.blade.php @@ -1,5 +1,7 @@ @extends('layouts.app') +@section('title', 'Login') + @section('content') @if (session('status'))
diff --git a/resources/views/pages/news.blade.php b/resources/views/pages/news.blade.php index 5e4453f..44d0202 100644 --- a/resources/views/pages/news.blade.php +++ b/resources/views/pages/news.blade.php @@ -1,5 +1,7 @@ @extends('layouts.app') +@section('title', 'News') + @section('content') @foreach($news as $post)
diff --git a/resources/views/pages/reservations.blade.php b/resources/views/pages/reservations.blade.php index 3901ed0..a444f55 100644 --- a/resources/views/pages/reservations.blade.php +++ b/resources/views/pages/reservations.blade.php @@ -1,5 +1,7 @@ @extends('layouts.app') +@section('title', 'Reservations') + @section('content')
diff --git a/resources/views/pages/reserve.blade.php b/resources/views/pages/reserve.blade.php index 163fea0..f0d6fe8 100644 --- a/resources/views/pages/reserve.blade.php +++ b/resources/views/pages/reserve.blade.php @@ -1,5 +1,7 @@ @extends('layouts.app') +@section('title', 'Make reservation') + @section('content') @if (session('status'))
diff --git a/resources/views/pages/sponsoring.blade.php b/resources/views/pages/sponsoring.blade.php index 4b79934..cf2a872 100644 --- a/resources/views/pages/sponsoring.blade.php +++ b/resources/views/pages/sponsoring.blade.php @@ -1,5 +1,7 @@ @extends('layouts.app') +@section('title', 'Sponsoring') + @section('content')

If you are willing to be one of the sponsors of the event and help us set the high standards for Balkan YOTA camp, feel free to contact Goran YT7AW hajosevic at gmail . com

As part of the camp and presentations will be dedicated to already experienced HAM radio operators, this is a great opportunity to present your company and products in the region. Additionally a banner and link to your website will be made available here.

diff --git a/routes/web.php b/routes/web.php index 7a156a4..4c20032 100644 --- a/routes/web.php +++ b/routes/web.php @@ -2,6 +2,7 @@ use Illuminate\Support\Facades\Route; use App\Http\Controllers\PagesController; +use App\Http\Controllers\SpecialCallsController; /* |-------------------------------------------------------------------------- @@ -34,9 +35,10 @@ Route::get('/', [PagesController::class, 'index'])->name('home'); Route::get('/news', [PagesController::class, 'news'])->name('news'); Route::get('/gallery', [PagesController::class, 'gallery'])->name('gallery'); Route::get('/sponsoring', [PagesController::class, 'sponsoring'])->name('sponsoring'); -Route::get('/activities', [PagesController::class, 'activities'])->name('activities'); -Route::get('/reserve', [PagesController::class, 'reserve'])->name('reserve'); -Route::post('/reserve', [PagesController::class, 'reserveForm'])->name('reserveForm'); + +Route::get('/special-calls', [SpecialCallsController::class, 'activities'])->name('activities'); +Route::get('/special-calls/reserve', [SpecialCallsController::class, 'reserve'])->name('reserve'); +Route::post('/special-calls/reserve', [SpecialCallsController::class, 'reserveForm'])->name('reserveForm'); Route::get('/login', [PagesController::class, 'login'])->name('login'); Route::post('/login', [PagesController::class, 'loginForm'])->name('loginForm'); -- cgit v1.2.3