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']); });