Files
RomhackPlaza/resources/views/components/entry-card.blade.php
2026-06-23 19:24:38 +02:00

54 lines
2.4 KiB
PHP

<div class="entry-card">
<div class="entry-cover-wrapper">
<span class="entry-badge">{{ $entry->getRealPlatform()?->name ?? 'Unknown' }}</span>
@if( $entry->main_image )
<img src="{{ Storage::url($entry->main_image) }}">
@else
<i data-lucide="image" size="40" color="var(--border)"></i>
@endif
</div>
<div class="entry-card-info">
<a href="{{ route('entries.show', [ 'section' => $entry->type, 'entry' => $entry ] ) }}" class="entry-card-title">{{ $entry->title ?? $entry->complete_title }}</a>
<div class="entry-card-author">
@forelse( $entry->authors as $author)
@if($loop->first)By @endif
{{ $author-> name }}
@if( !$loop->last ), @endif
@empty
No authors
@endforelse
</div>
<div style="margin-bottom:10px">
<span class="badge {{ $entry->type }}">{{ \App\View\Components\EntryCard::ENTRY_TYPES_BADGE[$entry->type] ?? $entry->type }}</span>
@if( section_must_be('romhacks', $entry->type ) )
@foreach( $entry->modifications as $modif )
<span class="badge orange">{{ $modif->name }}</span>
@endforeach
@elseif( section_must_be( 'translations', $entry->type ) )
@foreach( $entry->languages as $lang )
<span class="badge orange">{{ $lang->name }}</span>
@endforeach
@elseif( section_must_be( 'utilities', $entry->type ) )
@foreach( $entry->categories as $category )
<span class="badge orange">{{ $category->name }}</span>
@endforeach
@endif
@if( $entry->status_id )
<span class="badge">{{ $entry->status->name }}</span>
@endif
@if( $entry->level_id )
<span class="badge">{{ $entry->level->name }}</span>
@endif
@if( section_must_not_be( 'translations', $entry->type ) )
@foreach( $entry->languages as $lang )
<span class="badge">{{ $lang->name }}</span>
@endforeach
@endif
</div>
<div class="entry-card-meta">
<span><i data-lucide="download" size="12"></i> x</span>
<span>Added: {{ $entry->created_at->format('y-m-d') }}</span>
</div>
</div>
</div>