mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Closes #8175: Display parent object when attaching an image
This commit is contained in:
parent
542534aeba
commit
1987647cc3
@ -6,6 +6,7 @@
|
||||
|
||||
* [#6782](https://github.com/netbox-community/netbox/issues/6782) - Enable the inclusion of custom links in tables
|
||||
* [#8100](https://github.com/netbox-community/netbox/issues/8100) - Add "other" choice for FHRP group protocol
|
||||
* [#8175](https://github.com/netbox-community/netbox/issues/8175) - Display parent object when attaching an image
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
@ -472,6 +472,7 @@ class ObjectChangeLogView(View):
|
||||
class ImageAttachmentEditView(generic.ObjectEditView):
|
||||
queryset = ImageAttachment.objects.all()
|
||||
model_form = forms.ImageAttachmentForm
|
||||
template_name = 'extras/imageattachment_edit.html'
|
||||
|
||||
def alter_obj(self, instance, request, args, kwargs):
|
||||
if not instance.pk:
|
||||
|
16
netbox/templates/extras/imageattachment_edit.html
Normal file
16
netbox/templates/extras/imageattachment_edit.html
Normal file
@ -0,0 +1,16 @@
|
||||
{% extends 'generic/object_edit.html' %}
|
||||
{% load helpers %}
|
||||
|
||||
{% block form_fields %}
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-3 col-form-label text-lg-end required">
|
||||
{{ obj.parent|meta:"verbose_name"|bettertitle }}
|
||||
</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="form-control-plaintext">
|
||||
<a href="{{ obj.parent.get_absolute_url }}" class="">{{ obj.parent }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ block.super }}
|
||||
{% endblock form_fields %}
|
Loading…
Reference in New Issue
Block a user