From 0e583d408c6144eac0119a46a4f9f095c5e6a2d5 Mon Sep 17 00:00:00 2001 From: Niisse Date: Mon, 4 Mar 2024 15:57:18 +0100 Subject: [PATCH] navbar active route theming, move sidebar --- app/Http/Controllers/PhotoController.php | 4 +- resources/views/home.blade.php | 8 ++-- resources/views/home/blog-partial.blade.php | 2 +- resources/views/home/photo-partial.blade.php | 2 +- resources/views/layouts/app.blade.php | 2 +- resources/views/layouts/sidebar.blade.php | 10 +++++ resources/views/navbar.blade.php | 43 +++----------------- routes/web.php | 2 + 8 files changed, 28 insertions(+), 45 deletions(-) diff --git a/app/Http/Controllers/PhotoController.php b/app/Http/Controllers/PhotoController.php index 312343b..65066ac 100644 --- a/app/Http/Controllers/PhotoController.php +++ b/app/Http/Controllers/PhotoController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use App\Models\Photo; +use App\Models\Tag; use Illuminate\Http\Request; class PhotoController extends Controller @@ -10,7 +11,8 @@ class PhotoController extends Controller public function index() { return view('photos.index', [ - 'photos' => Photo::all() + 'photos' => Photo::all(), + 'tags' => Tag::limit(5)->get() ]); } } diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 5e1d697..6155080 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -3,13 +3,13 @@ @section('content')
- @include('home.photo-partial', ['tags' => $tags]) +{{-- @include('home.photo-partial', ['tags' => $tags])--}} @include('home.blog-partial') @foreach($posts as $post) -

{{$post->title}}

+

{{$post->title}}

@@ -37,11 +37,13 @@
-
+

@endforeach + @include('layouts.sidebar') + @endsection diff --git a/resources/views/home/blog-partial.blade.php b/resources/views/home/blog-partial.blade.php index 62e4bc0..c03add1 100644 --- a/resources/views/home/blog-partial.blade.php +++ b/resources/views/home/blog-partial.blade.php @@ -1,4 +1,4 @@ -

A Blog Entry

+

A Blog Entry

diff --git a/resources/views/home/photo-partial.blade.php b/resources/views/home/photo-partial.blade.php index f73ffc2..5184ab2 100644 --- a/resources/views/home/photo-partial.blade.php +++ b/resources/views/home/photo-partial.blade.php @@ -25,7 +25,7 @@
-
+

diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 2f5c05d..94106d4 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -26,7 +26,7 @@
@yield('content') - @include('layouts.sidebar') +{{-- @include('layouts.sidebar')--}}
diff --git a/resources/views/layouts/sidebar.blade.php b/resources/views/layouts/sidebar.blade.php index 5c71307..671a740 100644 --- a/resources/views/layouts/sidebar.blade.php +++ b/resources/views/layouts/sidebar.blade.php @@ -1,5 +1,15 @@
+ +
+
Recent Posts
+
    +
  1. Something
  2. +
  3. Other thing
  4. +
  5. A photo, perhaps
  6. +
+
+
Categories
diff --git a/resources/views/navbar.blade.php b/resources/views/navbar.blade.php index dcec47c..4ba9165 100644 --- a/resources/views/navbar.blade.php +++ b/resources/views/navbar.blade.php @@ -19,57 +19,24 @@
diff --git a/routes/web.php b/routes/web.php index 1bd7a16..9623ec1 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,6 +1,7 @@ name('home'); +Route::get('/photos', [PhotoController::class, 'index'])->name('photos');