navbar active route theming, move sidebar

main
Niisse 9 months ago
parent 0ba907abf6
commit 0e583d408c

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

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

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

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

@ -1,5 +1,15 @@
<div class="col-md-3 px-4">
<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>
<h5>Categories</h5>
<div class="d-flex flex-column px-2 mb-3">

@ -19,57 +19,24 @@
<ul class="navbar-nav ms-auto">
<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 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 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 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 class="nav-item">
<a href="" class="nav-link">About</a>
<a href="" class="nav-link @if(request()->routeIs('about')) active @endif">About</a>
</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>
</div>
</div>

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

Loading…
Cancel
Save