more fixes
This commit is contained in:
31
resources/views/news/_article_card.blade.php
Normal file
31
resources/views/news/_article_card.blade.php
Normal file
@@ -0,0 +1,31 @@
|
||||
{{-- Reusable article card partial --}}
|
||||
<div class="card h-100 border-0 shadow-sm news-card">
|
||||
@if($article->cover_url)
|
||||
<a href="{{ route('news.show', $article->slug) }}">
|
||||
<img src="{{ $article->cover_url }}" class="card-img-top"
|
||||
alt="{{ $article->title }}"
|
||||
style="height:180px;object-fit:cover;">
|
||||
</a>
|
||||
@endif
|
||||
<div class="card-body d-flex flex-column">
|
||||
@if($article->category)
|
||||
<a href="{{ route('news.category', $article->category->slug) }}"
|
||||
class="badge badge-primary mb-2 align-self-start">{{ $article->category->name }}</a>
|
||||
@endif
|
||||
|
||||
<h6 class="card-title mb-1">
|
||||
<a href="{{ route('news.show', $article->slug) }}" class="text-dark text-decoration-none">
|
||||
{{ $article->title }}
|
||||
</a>
|
||||
</h6>
|
||||
|
||||
@if($article->excerpt)
|
||||
<p class="card-text text-muted small flex-grow-1">{{ Str::limit($article->excerpt, 100) }}</p>
|
||||
@endif
|
||||
|
||||
<div class="text-muted small mt-2 d-flex justify-content-between">
|
||||
<span>{{ $article->published_at?->format('d M Y') }}</span>
|
||||
<span><i class="fas fa-eye mr-1"></i>{{ number_format($article->views) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user