Files
dmtools/templates/art/index.html.twig
T
FrankandClaude Sonnet 5 ed22b81e97 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>
2026-09-06 16:53:49 +02:00

37 lines
1.6 KiB
Twig

{% extends 'base.html.twig' %}
{% block title %}Art · dmtools{% endblock %}
{% block body %}
<div class="d-flex justify-content-between align-items-center mb-3">
<h1 class="h3 mb-0">Art</h1>
<a href="{{ path('app_art_upload') }}" class="btn btn-primary btn-sm">Upload art</a>
</div>
{% if artworks is empty %}
<div class="card shadow-sm">
<div class="card-body text-center text-body-secondary py-5">
Nothing uploaded yet. Use <strong>Upload art</strong> to add maps, handouts or character pieces.
</div>
</div>
{% else %}
<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">
<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 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>
{% endif %}
{% endblock %}