Fixes #20298: Add placeholder for failed image thumbnail generation (#20359)
Some checks are pending
CI / build (20.x, 3.10) (push) Waiting to run
CI / build (20.x, 3.11) (push) Waiting to run
CI / build (20.x, 3.12) (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (none, actions) (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run

This commit is contained in:
Jason Novinger 2025-09-15 23:49:43 +00:00 committed by GitHub
parent 85689b25de
commit 5bfbca9a83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,6 +27,16 @@
alt="{{ object.description|default:object.name }}"
/>
</a>
{% empty %}
<a href="{{ object.get_absolute_url }}" class="d-block text-decoration-none" title="{{ object.name }}">
<div class="d-flex align-items-center justify-content-center rounded bg-light text-secondary border" style="width: 200px; height: 200px;">
<div class="text-center">
<i class="mdi mdi-image-broken-variant display-4"></i>
<div class="small mt-2 text-dark">{% trans "Thumbnail cannot be generated" %}</div>
<div class="small fw-bold text-dark">{% trans "Click to view original" %}</div>
</div>
</div>
</a>
{% endthumbnail %}
<div class="text-center text-secondary text-truncate fs-5">
{{ object }}