Repository: netbox-community/netbox
Pull request: Allow plugins to extend objectchange view

### Fixes: #16353

Allows plugins to extend objectchange view with panels


Problem statement:
Allow plugins to extend objectchange.html (changeview) template
### NetBox version

v4.0.3

### Feature type

Change to existing functionality

### Proposed functionality

Allow plugins to use the `PluginTemplateExtension` feature to extend the objectchange.html (changeview) template with additional panels. (/netbox/netbox/templates/extras/objectchange.html)

I've tested this locally and it is as simple as adding `{% load plugins %}` to the template along with the panel placements
eg:
```
<div class="row">
  <div class="col col-md-12">
    {% plugin_full_width_page object %}
  </div>
</div>
```

### Use case

I have an internal plugin that I wish to add some panels to the changelog view that will point out some business-related information about changes.

### Database changes

N/A

### External dependencies

N/A

Hints from issue discussion:
If accepted I am happy to make the PR for this
@ITJamie sounds good, will assign it to you.

Commit message: replace tabs with spaces

Patch to review:
diff --git a/netbox/templates/extras/objectchange.html b/netbox/templates/extras/objectchange.html
index 368a7182147..a914b1ca326 100644
--- a/netbox/templates/extras/objectchange.html
+++ b/netbox/templates/extras/objectchange.html
@@ -1,5 +1,6 @@
 {% extends 'generic/object.html' %}
 {% load helpers %}
+{% load plugins %}
 {% load i18n %}
 
 {% block title %}{{ object }}{% endblock %}
@@ -144,6 +145,14 @@ <h5 class="card-header">{% trans "Post-Change Data" %}</h5>
         </div>
     </div>
 </div>
+<div class="row mb-3">
+  <div class="col col-md-6">
+    {% plugin_left_page object %}
+  </div>
+  <div class="col col-md-6">
+    {% plugin_right_page object %}
+  /div>
+</div>
 <div class="row mb-3">
     <div class="col col-md-12">
         {% include 'inc/panel_table.html' with table=related_changes_table heading='Related Changes' panel_class='default' %}
@@ -158,4 +167,9 @@ <h5 class="card-header">{% trans "Post-Change Data" %}</h5>
         {% endif %}
     </div>
 </div>
+<div class="row">
+  <div class="col col-md-12">
+    {% plugin_full_width_page object %}
+  </div>
+</div>
 {% endblock %}


Code review comments:
diff_hunk: @@ -144,6 +145,14 @@ <h5 class="card-header">{% trans "Post-Change Data" %}</h5>
         </div>
     </div>
 </div>
+<div class="row mb-3">
+  <div class="col col-md-6">
+    {% plugin_left_page object %}
+  </div>
+  <div class="col col-md-6">
+    {% plugin_right_page object %}
+  /div>
path: netbox/templates/extras/objectchange.html
text: @user1:
Fix HTML tag.
```suggestion
  </div>
```

diff_hunk: @@ -144,6 +145,14 @@ <h5 class="card-header">{% trans "Post-Change Data" %}</h5>
         </div>
     </div>
 </div>
+<div class="row mb-3">
path: netbox/templates/extras/objectchange.html
text: @user1:
The `<div>` elements with class `row` should not have class `mb-3` applied as it results in extraneous vertical margin between cards. (It should have been removed from the existing elements during the v4.0 UI overhaul.)

@author:
Would you like me to remove `mb-3` from all the others in this template?

@user1:
Yes, but I'll do it real quick.