mirror of
https://github.com/netbox-community/netbox.git
synced 2025-09-06 06:13:36 -06:00
#18204: Misc cleanup
This commit is contained in:
parent
cd3f930e19
commit
4044ae8f8a
@ -40,9 +40,8 @@ __all__ = (
|
||||
|
||||
IMAGEATTACHMENT_IMAGE = """
|
||||
{% if record.image %}
|
||||
<a class="image-preview" href="{{ record.image.url }}" target="_blank">
|
||||
<i class="mdi mdi-image"></i>
|
||||
</a>
|
||||
<a href="{{ record.image.url }}" target="_blank" class="image-preview" data-bs-placement="top">
|
||||
<i class="mdi mdi-image"></i></a>
|
||||
{% endif %}
|
||||
<a href="{{ record.get_absolute_url }}">{{ record }}</a>
|
||||
"""
|
||||
@ -236,6 +235,7 @@ class ImageAttachmentTable(NetBoxTable):
|
||||
image = columns.TemplateColumn(
|
||||
verbose_name=_('Image'),
|
||||
template_code=IMAGEATTACHMENT_IMAGE,
|
||||
attrs={'td': {'class': 'text-nowrap'}}
|
||||
)
|
||||
name = tables.Column(
|
||||
verbose_name=_('Name'),
|
||||
@ -255,7 +255,7 @@ class ImageAttachmentTable(NetBoxTable):
|
||||
verbose_name=_('Object Type'),
|
||||
)
|
||||
parent = tables.Column(
|
||||
verbose_name=_('Parent'),
|
||||
verbose_name=_('Object'),
|
||||
linkify=True,
|
||||
orderable=False,
|
||||
)
|
||||
|
@ -6,7 +6,7 @@
|
||||
{% trans "Images" %}
|
||||
{% if perms.extras.add_imageattachment %}
|
||||
<div class="card-actions">
|
||||
<a href="{% url 'extras:imageattachment_add' %}?object_type={{ object|content_type_id }}&object_id={{ object.pk }}" class="btn btn-ghost-primary btn-sm">
|
||||
<a href="{% url 'extras:imageattachment_add' %}?object_type={{ object|content_type_id }}&object_id={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-ghost-primary btn-sm">
|
||||
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Attach an image" %}
|
||||
</a>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user