[PR #8586] [MERGED] Closes #8585: Support generic templates for plugins #13373

Closed
opened 2025-12-29 22:27:02 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/8586
Author: @jeremystretch
Created: 2/8/2022
Status: Merged
Merged: 2/8/2022
Merged by: @jeremystretch

Base: featureHead: template-cleanup


📝 Commits (6)

  • 624eda2 Clean up and document object, object list templates
  • b0039e9 Clean up and document object edit & delete templates
  • e796fd1 Clean up and document the bulk import/edit/delete templates
  • 1e55d06 Document the base layout template
  • 270288f Rename bulk operation templates
  • d9b7c01 Document templates supported for plugin use

📊 Changes

36 files changed (+422 additions, -218 deletions)

View changed files

docs/plugins/development/templates.md (+195 -0)
📝 docs/plugins/development/views.md (+1 -41)
📝 mkdocs.yml (+1 -0)
📝 netbox/dcim/views.py (+2 -5)
📝 netbox/netbox/views/generic/bulk_views.py (+11 -11)
📝 netbox/netbox/views/generic/object_views.py (+4 -10)
📝 netbox/templates/base/layout.html (+8 -0)
📝 netbox/templates/circuits/circuittermination_edit.html (+4 -4)
📝 netbox/templates/dcim/device/base.html (+1 -7)
📝 netbox/templates/dcim/device_component_edit.html (+9 -7)
📝 netbox/templates/dcim/device_edit.html (+5 -5)
📝 netbox/templates/dcim/device_import.html (+1 -1)
📝 netbox/templates/dcim/device_import_child.html (+1 -1)
📝 netbox/templates/dcim/devicetype/base.html (+1 -7)
📝 netbox/templates/dcim/interface_edit.html (+2 -2)
📝 netbox/templates/dcim/inventoryitem_bulk_delete.html (+1 -1)
📝 netbox/templates/dcim/inventoryitem_create.html (+3 -3)
📝 netbox/templates/dcim/moduletype.html (+0 -2)
📝 netbox/templates/dcim/moduletype/base.html (+1 -7)
📝 netbox/templates/extras/imageattachment_edit.html (+13 -10)

...and 16 more files

📄 Description

Closes: #8585

  • Rename bulk operation templates (removing the leading object_ portion of the name)
  • Clean up context data keys to be more robust (e.g. remove obj_type in favor of model)
  • Document blocks and context at the top of each template
  • Rename/refactor certain blocks to enhance flexibility
  • Add the templates to the plugins documentation

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/8586 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 2/8/2022 **Status:** ✅ Merged **Merged:** 2/8/2022 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `template-cleanup` --- ### 📝 Commits (6) - [`624eda2`](https://github.com/netbox-community/netbox/commit/624eda297f1e240061b02997ddec2b19ef99f1cf) Clean up and document object, object list templates - [`b0039e9`](https://github.com/netbox-community/netbox/commit/b0039e938e52a7c48fc1ad867f92ff14994a1c21) Clean up and document object edit & delete templates - [`e796fd1`](https://github.com/netbox-community/netbox/commit/e796fd1e119b6f6217e1aff5e80c6726a2cf6f61) Clean up and document the bulk import/edit/delete templates - [`1e55d06`](https://github.com/netbox-community/netbox/commit/1e55d064ab400655032672089cd63480faf626ec) Document the base layout template - [`270288f`](https://github.com/netbox-community/netbox/commit/270288f73001f40f1fbad4c792762bd0b6d0b0ab) Rename bulk operation templates - [`d9b7c01`](https://github.com/netbox-community/netbox/commit/d9b7c012a6f3b2ef16c6591174c1987738b7dd45) Document templates supported for plugin use ### 📊 Changes **36 files changed** (+422 additions, -218 deletions) <details> <summary>View changed files</summary> ➕ `docs/plugins/development/templates.md` (+195 -0) 📝 `docs/plugins/development/views.md` (+1 -41) 📝 `mkdocs.yml` (+1 -0) 📝 `netbox/dcim/views.py` (+2 -5) 📝 `netbox/netbox/views/generic/bulk_views.py` (+11 -11) 📝 `netbox/netbox/views/generic/object_views.py` (+4 -10) 📝 `netbox/templates/base/layout.html` (+8 -0) 📝 `netbox/templates/circuits/circuittermination_edit.html` (+4 -4) 📝 `netbox/templates/dcim/device/base.html` (+1 -7) 📝 `netbox/templates/dcim/device_component_edit.html` (+9 -7) 📝 `netbox/templates/dcim/device_edit.html` (+5 -5) 📝 `netbox/templates/dcim/device_import.html` (+1 -1) 📝 `netbox/templates/dcim/device_import_child.html` (+1 -1) 📝 `netbox/templates/dcim/devicetype/base.html` (+1 -7) 📝 `netbox/templates/dcim/interface_edit.html` (+2 -2) 📝 `netbox/templates/dcim/inventoryitem_bulk_delete.html` (+1 -1) 📝 `netbox/templates/dcim/inventoryitem_create.html` (+3 -3) 📝 `netbox/templates/dcim/moduletype.html` (+0 -2) 📝 `netbox/templates/dcim/moduletype/base.html` (+1 -7) 📝 `netbox/templates/extras/imageattachment_edit.html` (+13 -10) _...and 16 more files_ </details> ### 📄 Description ### Closes: #8585 - Rename bulk operation templates (removing the leading `object_` portion of the name) - Clean up context data keys to be more robust (e.g. remove `obj_type` in favor of `model`) - Document blocks and context at the top of each template - Rename/refactor certain blocks to enhance flexibility - Add the templates to the plugins documentation --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:27:02 +01:00
adam closed this issue 2025-12-29 22:27:03 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13373