diff --git a/netbox/templates/extras/imageattachment.html b/netbox/templates/extras/imageattachment.html index 4f267cf23..8aefd095b 100644 --- a/netbox/templates/extras/imageattachment.html +++ b/netbox/templates/extras/imageattachment.html @@ -56,13 +56,8 @@

{% trans "Image" %}

- - {{ object.name }} + + {{ object.html_tag }}
diff --git a/netbox/templates/extras/object_imageattachments.html b/netbox/templates/extras/object_imageattachments.html index 46cb7ff99..70caaf041 100644 --- a/netbox/templates/extras/object_imageattachments.html +++ b/netbox/templates/extras/object_imageattachments.html @@ -1,35 +1,46 @@ {% extends base_template %} +{% load helpers %} {% load i18n %} {% load render_table from django_tables2 %} {% load thumbnail %} {% block extra_controls %} {% if perms.extras.add_imageattachment %} - - {% trans "Attach an Image" %} - + {% with viewname=object|viewname:"image-attachments" %} + + {% trans "Attach an Image" %} + + {% endwith %} {% endif %} {% endblock %} {% block content %} -
- {% for object in image_attachments %} -
- {% thumbnail object.image "200x200" crop="center" as tn %} - - {{ object.name }} - - {% endthumbnail %} -
- {{ object }} + {% if image_attachments %} +
+ {% for object in image_attachments %} +
+ {% thumbnail object.image "200x200" crop="center" as tn %} + + {{ object.description or object.name }} + + {% endthumbnail %} +
+ {{ object }} +
-
- {% endfor %} -
+ {% endfor %} +
+ {% else %} +
+ {% blocktrans with object_type=object|meta:"verbose_name" %} + No images have been attached to this {{ object_type }}. + {% endblocktrans %} +
+ {% endif %} {% endblock %}