From 2b437c017319ccc9fee4b2a601271a66afdf6ad7 Mon Sep 17 00:00:00 2001 From: ro Date: Mon, 4 Mar 2024 20:06:36 -0600 Subject: [PATCH] added page listing template, fixed sub menu items moved the page listing template over and made all of the apropriate changes so the CSS lines up as it should there was also a minor issue that was keeping the sub menu for the start pages from displaying so that was fixed --- app/Http/Controllers/DashController.php | 17 +++- resources/views/back/book.blade.php | 78 +++++++++++++++++++ resources/views/includes/nav.blade.php | 4 +- .../views/includes/submenu-settings.blade.php | 6 +- routes/web.php | 1 + 5 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 resources/views/back/book.blade.php diff --git a/app/Http/Controllers/DashController.php b/app/Http/Controllers/DashController.php index 40fac6b..e227a1f 100644 --- a/app/Http/Controllers/DashController.php +++ b/app/Http/Controllers/DashController.php @@ -24,7 +24,22 @@ class DashController extends Controller return view('back.start', [ "status" => $status, "result" => $result, - "title" => "Fipamo Dash" + "title" => "Start" + ]); + } + + public function book($pageFilter = 'all', $pageNum = '1') + { + $status = session('handle') !== null ? true : false; + $result = []; + if ($status) { + $result = $this->pages->getPage($pageNum, 4, $pageFilter); + } + return view('back.book', [ + "status" => $status, + "result" => $result, + "currentPage" => $pageNum, + "title" => "Pages" ]); } } diff --git a/resources/views/back/book.blade.php b/resources/views/back/book.blade.php new file mode 100644 index 0000000..5d805f5 --- /dev/null +++ b/resources/views/back/book.blade.php @@ -0,0 +1,78 @@ +@extends('frame') + +@section('title', 'Pages') + + @section('main-content') +
+
+ {{ $result['paginate']['sort'] }} + Pages +
+
+ + + + + + + + + +
+
+ @foreach($result['pages'] as $page) + @php + $type = ''; + $file = ''; + isset($page['media'][0]['type']) ? $type = $page['media'][0]['type'] : $type = ''; + isset($page['media'][0]['file']) ? $file = $page['media'][0]['file'] : $file = ''; + @endphp + @if($type =='mp4') + +
+ +
+ @include('includes.recent-meta') +
+
+
+ @else + +
+
+ @include('includes.recent-meta') +
+
+
+ @endif + @endforeach + @if($result['numOfPages']) +
+ + + + + {{ $currentPage }} + of + {{ $result['numOfPages'] }} + + + + +
+ @endif +
+ @endsection diff --git a/resources/views/includes/nav.blade.php b/resources/views/includes/nav.blade.php index 3984908..fd6fa91 100644 --- a/resources/views/includes/nav.blade.php +++ b/resources/views/includes/nav.blade.php @@ -2,7 +2,7 @@ @if($title == "Settings" ) @include('includes.submenu-settings') @elseif($title == "Start" ) - @include('includes.submenu-settings') + @include('includes.submenu-start') @endif - diff --git a/routes/web.php b/routes/web.php index cdb4aa0..9f80fc7 100644 --- a/routes/web.php +++ b/routes/web.php @@ -27,5 +27,6 @@ Route::post("/login", [AuthController::class, 'enter']); //back Route::group(['prefix' => 'dashboard'], function () { Route::get("/", [DashController::class, 'start']); + Route::get("/pages/{pageFilter?}/{pageNum?}", [DashController::class, 'book']); Route::get("/logout", [AuthController::class, 'exit']); });