navbar active route theming, move sidebar

main
Niisse 9 months ago
parent 0ba907abf6
commit 0e583d408c

@ -3,6 +3,7 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\Photo; use App\Models\Photo;
use App\Models\Tag;
use Illuminate\Http\Request; use Illuminate\Http\Request;
class PhotoController extends Controller class PhotoController extends Controller
@ -10,7 +11,8 @@ class PhotoController extends Controller
public function index() public function index()
{ {
return view('photos.index', [ return view('photos.index', [
'photos' => Photo::all() 'photos' => Photo::all(),
'tags' => Tag::limit(5)->get()
]); ]);
} }
} }

@ -3,13 +3,13 @@
@section('content') @section('content')
<div class="col-md-9 px-4"> <div class="col-md-9 px-4">
@include('home.photo-partial', ['tags' => $tags]) {{-- @include('home.photo-partial', ['tags' => $tags])--}}
@include('home.blog-partial') @include('home.blog-partial')
@foreach($posts as $post) @foreach($posts as $post)
<h2 class="mt-3">{{$post->title}}</h2> <h2 class="mt-0!">{{$post->title}}</h2>
<div class="mt-3 pr-2"> <div class="mt-3 pr-2">
<x-markdown> <x-markdown>
@ -37,11 +37,13 @@
</div> </div>
</div> </div>
<div class="pt-2"> <div class="pt-3 pb-1">
<hr> <hr>
</div> </div>
</div> </div>
@endforeach @endforeach
</div> </div>
@include('layouts.sidebar')
@endsection @endsection

@ -1,4 +1,4 @@
<h2 class="mt-3">A Blog Entry</h2> <h2 class="mt-0">A Blog Entry</h2>
<div class="mt-3 pr-2"> <div class="mt-3 pr-2">
<x-markdown> <x-markdown>

@ -25,7 +25,7 @@
</div> </div>
</div> </div>
<div class="pt-2"> <div class="pt-3 pb-1">
<hr> <hr>
</div> </div>
</div> </div>

@ -26,7 +26,7 @@
<div class="row"> <div class="row">
@yield('content') @yield('content')
@include('layouts.sidebar') {{-- @include('layouts.sidebar')--}}
</div> </div>
</div> </div>

@ -1,5 +1,15 @@
<div class="col-md-3 px-4"> <div class="col-md-3 px-4">
<div class="d-flex flex-column gap-3 px-2 pb-1"> <div class="d-flex flex-column gap-3 px-2 pb-1">
<div>
<h5>Recent Posts</h5>
<ol>
<li>Something</li>
<li>Other thing</li>
<li>A photo, perhaps</li>
</ol>
</div>
<div> <div>
<h5>Categories</h5> <h5>Categories</h5>
<div class="d-flex flex-column px-2 mb-3"> <div class="d-flex flex-column px-2 mb-3">

@ -19,57 +19,24 @@
<ul class="navbar-nav ms-auto"> <ul class="navbar-nav ms-auto">
<li class="nav-item"> <li class="nav-item">
<a href="" class="nav-link active">Home</a> <a href="{{route('home')}}" class="nav-link @if(request()->routeIs('home')) active @endif">Home</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a href="" class="nav-link">Blog</a> <a href="" class="nav-link @if(request()->routeIs('blog')) active @endif">Blog</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a href="" class="nav-link">Photography</a> <a href="{{route('photos')}}" class="nav-link @if(request()->routeIs('photos')) active @endif">Photography</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a href="" class="nav-link disabled">Music</a> <a href="" class="nav-link @if(request()->routeIs('music')) active @endif">Music</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a href="" class="nav-link">About</a> <a href="" class="nav-link @if(request()->routeIs('about')) active @endif">About</a>
</li> </li>
<!-- Authentication Links -->
{{-- @guest--}}
{{-- @if (Route::has('login'))--}}
{{-- <li class="nav-item">--}}
{{-- <a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>--}}
{{-- </li>--}}
{{-- @endif--}}
{{-- @if (Route::has('register'))--}}
{{-- <li class="nav-item">--}}
{{-- <a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>--}}
{{-- </li>--}}
{{-- @endif--}}
{{-- @else--}}
{{-- <li class="nav-item dropdown">--}}
{{-- <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>--}}
{{-- {{ Auth::user()->name }}--}}
{{-- </a>--}}
{{-- <div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">--}}
{{-- <a class="dropdown-item" href="{{ route('logout') }}"--}}
{{-- onclick="event.preventDefault();--}}
{{-- document.getElementById('logout-form').submit();">--}}
{{-- {{ __('Logout') }}--}}
{{-- </a>--}}
{{-- <form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">--}}
{{-- @csrf--}}
{{-- </form>--}}
{{-- </div>--}}
{{-- </li>--}}
{{-- @endguest--}}
</ul> </ul>
</div> </div>
</div> </div>

@ -1,6 +1,7 @@
<?php <?php
use App\Http\Controllers\HomeController; use App\Http\Controllers\HomeController;
use App\Http\Controllers\PhotoController;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
/* /*
@ -19,3 +20,4 @@ use Illuminate\Support\Facades\Route;
//Auth::routes(); //Auth::routes();
Route::get('/', [HomeController::class, 'index'])->name('home'); Route::get('/', [HomeController::class, 'index'])->name('home');
Route::get('/photos', [PhotoController::class, 'index'])->name('photos');

Loading…
Cancel
Save