Add (posts)

This commit is contained in:
2023-07-27 02:18:38 +08:00
parent 1c917b865d
commit e70195f4f7
15 changed files with 525 additions and 34 deletions

View File

@@ -13,23 +13,25 @@
<div class="container">
<h3 class="h4 fw-bold text-center mb-3">Featured Articles</h3>
<div class="row g-3 justify-content-center">
@for ($i = 1; $i <= 3; $i++)
@foreach($featured_posts as $post)
<div class="col-12 col-xl-3">
<a href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post' => str_random() ]) }}" class="text-decoration-none">
<div class="card shadow-sm">
<img src="https://placekitten.com/400/300" alt="" class="card-img-top">
<a href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post' => $post->slug]) }}" class="text-decoration-none">
<div class="card shadow-sm" style="height:100%;">
<div class="card-img-top ratio ratio-16x9">
<img src="{{ $post->featured_image }}" alt="">
</div>
<div class="card-body">
<p class="card-text fw-bold">Here is why a kitten catches mice faster than an adult cat.
</p>
<p class="card-text fw-bold">{{ $post->title }}</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-body-secondary">5 April 2023</small>
<small class="text-body-secondary">9 mins</small>
<small class="text-body-secondary">{{ $post->created_at->format('j F Y') }}</small>
{{-- <small class="text-body-secondary">9 min read</small> --}}
</div>
</div>
</div>
</a>
</div>
@endfor
@endforeach
</div>
</div>
@@ -37,25 +39,24 @@
<div class="container-fluid py-4">
<div class="container">
<div class="row justify-content-center">
<div class="col col-lg-9">
<div class="col col-md-12 col-lg-12 col-xl-11 col-xxl-9">
<h3 class="h4 fw-bold text-center mb-3">What's New in {{ get_country_name_by_iso($country_locale->country_iso) }}</h3>
<div class="row g-3">
@for ($i = 1; $i <= 12; $i++)
<div class="col-6">
@foreach ($latest_posts as $post)
<div class="col-lg-6">
<a href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post' => str_random() ]) }}" class="text-decoration-none">
<div class="card">
<div class="card" style="height:100%;">
<div class="row g-0">
<div class="col-md-4">
<img src="https://placekitten.com/400/300" class="img-fluid rounded-start"
alt="...">
<div class="col-md-5">
<div class="img-fluid rounded-start ratio ratio-16x9">
<img src="{{ $post->featured_image }}" alt="">
</div>
</div>
<div class="col-md-8">
<div class="col-md-7">
<div class="card-body">
<p class="card-title fw-bold">Here is why a kitten catches mice faster
than an adult cat.</p>
<p class="card-title fw-bold">H{{ $post->title }}</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-body-secondary">5 April 2023</small>
<small class="text-body-secondary">9 mins</small>
<small class="text-body-secondary">{{ $post->created_at->format('j F Y') }}</small>
</div>
</div>
</div>
@@ -63,7 +64,7 @@
</div>
</a>
</div>
@endfor
@endforeach
</div>
<div class="text-center py-3">