refactor: unify artwork card rendering
This commit is contained in:
@@ -3,10 +3,14 @@
|
||||
<div class="thumb-card effect2">
|
||||
@php
|
||||
$t = \App\Services\ThumbnailPresenter::present($upload, 'md');
|
||||
$card = [
|
||||
'id' => $t['id'] ?? null,
|
||||
'title' => $t['title'] ?? 'Artwork',
|
||||
'thumb' => $t['url'] ?? null,
|
||||
'thumb_srcset' => $t['srcset'] ?? null,
|
||||
];
|
||||
@endphp
|
||||
<a href="/art/{{ $t['id'] }}/{{ Str::slug($t['title'] ?: 'artwork') }}" title="{{ $t['title'] }}" class="thumb-link">
|
||||
<img src="{{ $t['url'] }}" @if(!empty($t['srcset'])) srcset="{{ $t['srcset'] }}" @endif alt="{{ $t['title'] }}" class="img-responsive">
|
||||
</a>
|
||||
<x-artwork-card :art="$card" />
|
||||
</div>
|
||||
@endforeach
|
||||
</div> <!-- end .gallery-grid -->
|
||||
|
||||
Reference in New Issue
Block a user