36 lines
2.0 KiB
PHP
36 lines
2.0 KiB
PHP
@extends('layouts.nova')
|
|
|
|
@section('content')
|
|
<div class="container mx-auto py-8">
|
|
<h1 class="text-2xl font-semibold mb-4">My Gallery</h1>
|
|
|
|
@if($artworks->isEmpty())
|
|
<p class="text-sm text-gray-500">You have not uploaded any artworks yet.</p>
|
|
@else
|
|
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
|
|
@foreach($artworks as $art)
|
|
<div class="bg-panel p-3 rounded">
|
|
<a href="/art/{{ $art->id }}/{{ Illuminate\Support\Str::slug($art->title ?? 'art') }}">
|
|
<img src="{{ $art->thumbUrl('md') ?? 'https://files.skinbase.org/default/missing_md.webp' }}" alt="{{ $art->title }}" class="w-full h-36 object-cover rounded" />
|
|
</a>
|
|
<div class="mt-2 text-sm">
|
|
<a class="font-medium" href="/art/{{ $art->id }}/{{ Illuminate\Support\Str::slug($art->title ?? 'art') }}">{{ $art->title }}</a>
|
|
<div class="text-xs text-soft mt-1">Published: {{ optional($art->published_at)->format('Y-m-d') }}</div>
|
|
<div class="mt-2 flex gap-2">
|
|
<a href="{{ route('dashboard.artworks.edit', ['id' => $art->id]) }}" class="text-xs px-2 py-1 bg-black/10 rounded">Edit</a>
|
|
<form method="POST" action="{{ route('dashboard.artworks.destroy', ['id' => $art->id]) }}" onsubmit="return confirm('Really delete this artwork?');">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="text-xs px-2 py-1 bg-red-600 text-white rounded">Delete</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
|
|
<div class="mt-6">{{ $artworks->links() }}</div>
|
|
@endif
|
|
</div>
|
|
@endsection
|