diff --git a/netbox/extras/tables/tables.py b/netbox/extras/tables/tables.py index 822448ec6..d14ed22fd 100644 --- a/netbox/extras/tables/tables.py +++ b/netbox/extras/tables/tables.py @@ -37,6 +37,15 @@ __all__ = ( 'WebhookTable', ) +IMAGEATTACHMENT_IMAGE = """ +{% if record.image %} + + + +{% endif %} +{{ record }} +""" + NOTIFICATION_ICON = """ """ @@ -223,9 +232,9 @@ class ImageAttachmentTable(NetBoxTable): verbose_name=_('ID'), linkify=False ) - image = tables.Column( + image = columns.TemplateColumn( verbose_name=_('Image'), - linkify=True, + template_code=IMAGEATTACHMENT_IMAGE, ) name = tables.Column( verbose_name=_('Name'), @@ -261,9 +270,6 @@ class ImageAttachmentTable(NetBoxTable): ) default_columns = ('image', 'object_type', 'parent', 'description', 'dimensions', 'size') - def render_image(self, record): - return str(record) - def render_size(self, value): return filesizeformat(value)