Skip to content

Commit 5bfbca9

Browse files
authored
Fixes #20298: Add placeholder for failed image thumbnail generation (#20359)
1 parent 85689b2 commit 5bfbca9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

netbox/templates/extras/object_imageattachments.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@
2727
alt="{{ object.description|default:object.name }}"
2828
/>
2929
</a>
30+
{% empty %}
31+
<a href="{{ object.get_absolute_url }}" class="d-block text-decoration-none" title="{{ object.name }}">
32+
<div class="d-flex align-items-center justify-content-center rounded bg-light text-secondary border" style="width: 200px; height: 200px;">
33+
<div class="text-center">
34+
<i class="mdi mdi-image-broken-variant display-4"></i>
35+
<div class="small mt-2 text-dark">{% trans "Thumbnail cannot be generated" %}</div>
36+
<div class="small fw-bold text-dark">{% trans "Click to view original" %}</div>
37+
</div>
38+
</div>
39+
</a>
3040
{% endthumbnail %}
3141
<div class="text-center text-secondary text-truncate fs-5">
3242
{{ object }}

0 commit comments

Comments
 (0)