Art: full-image thumbnails, detail page with copy-to-clipboard
- gallery thumbnails now object-fit: contain (whole image, letterboxed),
and a card links to the new detail page instead of the raw file
- /art/{id} detail page: large uncropped image, "Open full size",
"Delete" (moved here from the gallery), and "Copy image"
- clipboard Stimulus controller copies the image to the OS clipboard
(converts non-PNG via canvas) for pasting into WhatsApp etc.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,26 +18,17 @@
|
||||
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-lg-4 g-3">
|
||||
{% for art in artworks %}
|
||||
<div class="col">
|
||||
<div class="card shadow-sm h-100">
|
||||
<a href="{{ path('app_art_file', {id: art.id}) }}" target="_blank" rel="noopener">
|
||||
<img src="{{ path('app_art_file', {id: art.id}) }}" alt="{{ art.name }}"
|
||||
class="card-img-top object-fit-cover" style="height: 180px;"
|
||||
loading="lazy">
|
||||
</a>
|
||||
<div class="card-body py-2 d-flex justify-content-between align-items-start gap-2">
|
||||
<div class="min-w-0">
|
||||
<div class="fw-semibold text-truncate" title="{{ art.name }}">{{ art.name }}</div>
|
||||
<div class="text-body-secondary small">
|
||||
{{ art.uploadedAt|date('Y-m-d') }} · {{ (art.size / 1024)|round }} KB
|
||||
</div>
|
||||
</div>
|
||||
<form method="post" action="{{ path('app_art_delete', {id: art.id}) }}"
|
||||
onsubmit="return confirm('Delete “{{ art.name|e('js') }}”?')">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete-art-' ~ art.id) }}">
|
||||
<button class="btn btn-sm btn-outline-danger" title="Delete">×</button>
|
||||
</form>
|
||||
<a href="{{ path('app_art_show', {id: art.id}) }}" class="card shadow-sm h-100 text-decoration-none text-body">
|
||||
<div class="art-thumb">
|
||||
<img src="{{ path('app_art_file', {id: art.id}) }}" alt="{{ art.name }}" loading="lazy">
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body py-2">
|
||||
<div class="fw-semibold text-truncate" title="{{ art.name }}">{{ art.name }}</div>
|
||||
<div class="text-body-secondary small">
|
||||
{{ art.uploadedAt|date('Y-m-d') }} · {{ (art.size / 1024)|round }} KB
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user