[PR #20737] [MERGED] Closes #20204: Introduce modular template components #16033

Closed
opened 2025-12-30 00:25:25 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20737
Author: @jeremystretch
Created: 11/3/2025
Status: Merged
Merged: 11/10/2025
Merged by: @bctiemann

Base: featureHead: 20204-template-components


📝 Commits (10+)

📊 Changes

60 files changed (+2060 additions, -1279 deletions)

View changed files

docs/plugins/development/ui-components.md (+148 -0)
📝 mkdocs.yml (+1 -0)
netbox/dcim/ui/__init__.py (+0 -0)
netbox/dcim/ui/panels.py (+189 -0)
📝 netbox/dcim/views.py (+266 -1)
netbox/extras/ui/panels.py (+68 -0)
netbox/netbox/ui/__init__.py (+0 -0)
netbox/netbox/ui/actions.py (+157 -0)
netbox/netbox/ui/attrs.py (+344 -0)
netbox/netbox/ui/layout.py (+94 -0)
netbox/netbox/ui/panels.py (+341 -0)
📝 netbox/netbox/views/generic/object_views.py (+3 -0)
📝 netbox/templates/dcim/device.html (+0 -374)
netbox/templates/dcim/device/attrs/ipaddress.html (+10 -0)
netbox/templates/dcim/device/attrs/parent_device.html (+10 -0)
netbox/templates/dcim/device/attrs/rack.html (+14 -0)
netbox/templates/dcim/device/attrs/total_weight.html (+3 -0)
📝 netbox/templates/dcim/devicetype.html (+0 -111)
📝 netbox/templates/dcim/location.html (+0 -97)
📝 netbox/templates/dcim/manufacturer.html (+0 -35)

...and 40 more files

📄 Description

Closes: #20204

  • Implement new Layout, Row, and Column components to replace boilerplate HTML in templates
  • Introduce a set of Panels to render cards containing content
  • Introduce a set of ObjectAttributes for use within ObjectAttributePanels
  • Define programmatic layouts for a number of object views under dcim

TODO

  • Write plugin development documentation for UI components
  • Delete the relevant HTML from templates which have been replaced with layouts
  • Annotate start & end of panel HTML within templates

🔄 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/20737 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 11/3/2025 **Status:** ✅ Merged **Merged:** 11/10/2025 **Merged by:** [@bctiemann](https://github.com/bctiemann) **Base:** `feature` ← **Head:** `20204-template-components` --- ### 📝 Commits (10+) - [`fd3a9a0`](https://github.com/netbox-community/netbox/commit/fd3a9a0c370d6b74a5255a9970b55f55827c6a9e) Initial work on #20204 - [`3890043`](https://github.com/netbox-community/netbox/commit/3890043b0616f15c5f6af78e81c3c37d0eed52df) Change approach for declaring object panels - [`d4783b7`](https://github.com/netbox-community/netbox/commit/d4783b7fbdee3be28649c461213e54d008475151) Refactor - [`7d993cc`](https://github.com/netbox-community/netbox/commit/7d993cc1416497f3139edc7e9b8d33ab2d954047) WIP - [`1acd567`](https://github.com/netbox-community/netbox/commit/1acd567706eeed03fe1f6c865c113301605f903c) Add site panel - [`83de784`](https://github.com/netbox-community/netbox/commit/83de78419632ccb74f75730cd80677f608933b54) Add region & site group panels - [`2a629d6`](https://github.com/netbox-community/netbox/commit/2a629d6f745b8e6840a9926326033ed10f326c8a) Enable panel inheritance; add location panel - [`90874ad`](https://github.com/netbox-community/netbox/commit/90874adf148ef300dd639f5aafa9a706dfa500dd) Add rack panel - [`eef9db5`](https://github.com/netbox-community/netbox/commit/eef9db5e5a4eb1ab35929ceddce46b0c31ab213d) Cleanup - [`3fd4664`](https://github.com/netbox-community/netbox/commit/3fd4664a7605257c8268582ee2db9ddedd08d9dd) Implement layout declaration under view ### 📊 Changes **60 files changed** (+2060 additions, -1279 deletions) <details> <summary>View changed files</summary> ➕ `docs/plugins/development/ui-components.md` (+148 -0) 📝 `mkdocs.yml` (+1 -0) ➕ `netbox/dcim/ui/__init__.py` (+0 -0) ➕ `netbox/dcim/ui/panels.py` (+189 -0) 📝 `netbox/dcim/views.py` (+266 -1) ➕ `netbox/extras/ui/panels.py` (+68 -0) ➕ `netbox/netbox/ui/__init__.py` (+0 -0) ➕ `netbox/netbox/ui/actions.py` (+157 -0) ➕ `netbox/netbox/ui/attrs.py` (+344 -0) ➕ `netbox/netbox/ui/layout.py` (+94 -0) ➕ `netbox/netbox/ui/panels.py` (+341 -0) 📝 `netbox/netbox/views/generic/object_views.py` (+3 -0) 📝 `netbox/templates/dcim/device.html` (+0 -374) ➕ `netbox/templates/dcim/device/attrs/ipaddress.html` (+10 -0) ➕ `netbox/templates/dcim/device/attrs/parent_device.html` (+10 -0) ➕ `netbox/templates/dcim/device/attrs/rack.html` (+14 -0) ➕ `netbox/templates/dcim/device/attrs/total_weight.html` (+3 -0) 📝 `netbox/templates/dcim/devicetype.html` (+0 -111) 📝 `netbox/templates/dcim/location.html` (+0 -97) 📝 `netbox/templates/dcim/manufacturer.html` (+0 -35) _...and 40 more files_ </details> ### 📄 Description ### Closes: #20204 - Implement new Layout, Row, and Column components to replace boilerplate HTML in templates - Introduce a set of Panels to render cards containing content - Introduce a set of ObjectAttributes for use within ObjectAttributePanels - Define programmatic layouts for a number of object views under `dcim` #### TODO - [x] Write plugin development documentation for UI components - [x] Delete the relevant HTML from templates which have been replaced with layouts - [x] Annotate start & end of panel HTML within templates --- <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-30 00:25:25 +01:00
adam closed this issue 2025-12-30 00:25:25 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#16033