From 49c1ed4698e33625bf24328d8b8866f3497839ad Mon Sep 17 00:00:00 2001 From: Miguel Nogueira Date: Fri, 8 May 2020 01:45:29 +0100 Subject: [PATCH] Dynamic position rendering for homepage --- app/Http/Controllers/DashboardController.php | 3 - app/Http/Controllers/HomeController.php | 4 +- .../administration/positions.blade.php | 2 +- resources/views/home.blade.php | 115 ++++++++---------- 4 files changed, 56 insertions(+), 68 deletions(-) diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index 3b32ec6..672dd6c 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -3,9 +3,6 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; -use Illuminate\Support\Facades\Cache; -use Illuminate\Support\Facades\Http; -use Illuminate\Support\Facades\Log; class DashboardController extends Controller { diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index d26d33d..e1c4ba2 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Vacancy; use Illuminate\Http\Request; class HomeController extends Controller @@ -13,6 +14,7 @@ class HomeController extends Controller */ public function index() { - return view('home'); + return view('home') + ->with('positions', Vacancy::where('vacancyStatus', 'OPEN')->get()); } } diff --git a/resources/views/dashboard/administration/positions.blade.php b/resources/views/dashboard/administration/positions.blade.php index 4284637..15d4f54 100644 --- a/resources/views/dashboard/administration/positions.blade.php +++ b/resources/views/dashboard/administration/positions.blade.php @@ -174,7 +174,7 @@ {{$vacancy->id}} {{$vacancy->vacancyName}} - {{$vacancy->vacancyDescription}} + {{substr($vacancy->vacancyDescription, 0, 20)}}... {{$vacancy->discordRoleID}} {{$vacancy->permissionGroupName}} {{$vacancy->vacancyCount}} diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index e5647ec..5be0a57 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -19,86 +19,75 @@
-
+ @if (!$positions->isEmpty()) -
+ @foreach($positions as $position) -
+
-

Helper

+
+ +
+ +

{{$position->vacancyName}}

+
+ +
+ +

+ {{$position->vacancyDescription}} +

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

- Helpers are the basic building block of every network. They help keep things clean and organised, and report to Chat Moderators. -

+ @else -
+
- -
- -
- -
- -
-

Moderator

-
- -
- -

Moderators keep the network clean from cheaters, spam accounts, and abusive users. Their tasks include monitoring the anti-cheat logs, responding to reports and helping users.

- -
- - - -
- -
- -
- -
- -
-

Chat Moderator

-
- -
- -

Chat Moderators' primary goal is monitoring the in-game chat, Discord Channels, and engaging with the community, relieving Moderators of this duty.

- -
- - - -
- -
+ @endif