[PR #19919] [MERGED] Closes #19591: Establish dedicated tab for image attachments #15756

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19919
Author: @jeremystretch
Created: 7/21/2025
Status: Merged
Merged: 7/31/2025
Merged by: @jeremystretch

Base: featureHead: 19591-image-attachments-tab


📝 Commits (9)

📊 Changes

13 files changed (+119 additions, -8 deletions)

View changed files

📝 .gitignore (+1 -0)
📝 base_requirements.txt (+4 -0)
📝 netbox/extras/models/models.py (+14 -0)
netbox/media/devicetype-images/.gitignore (+0 -2)
netbox/media/image-attachments/.gitignore (+0 -2)
📝 netbox/netbox/models/features.py (+4 -0)
📝 netbox/netbox/settings.py (+1 -0)
📝 netbox/netbox/views/generic/feature_views.py (+37 -1)
📝 netbox/project-static/dist/netbox.css (+1 -1)
📝 netbox/project-static/styles/custom/_misc.scss (+8 -0)
📝 netbox/templates/extras/imageattachment.html (+2 -2)
netbox/templates/extras/object_imageattachments.html (+46 -0)
📝 requirements.txt (+1 -0)

📄 Description

Closes: #19591

  • Introduce sorl-thumbnail as a new dependency
  • Register ObjectImageAttachmentsView for objects which support image attachments
  • Render thumbnails for each attached image under the new "Images" tab
  • Add an html_tag property to ImageAttachment for convenience

🔄 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/19919 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 7/21/2025 **Status:** ✅ Merged **Merged:** 7/31/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `19591-image-attachments-tab` --- ### 📝 Commits (9) - [`3827431`](https://github.com/netbox-community/netbox/commit/3827431a530a550fdeeccf561f60a7e2b6222e36) Initial work on #19591 - [`22dfa87`](https://github.com/netbox-community/netbox/commit/22dfa87c3ceef19ad8b897f08445bb9a06cfcbfb) Ignore images cache directory - [`d55eff5`](https://github.com/netbox-community/netbox/commit/d55eff58b94b75fb55102fce84e7d1fd9e94db35) Clean up thumbnails layout - [`a1ffb31`](https://github.com/netbox-community/netbox/commit/a1ffb314313107277bf904ef55b754befdd86c57) Include "add attachment" button - [`bbf8da2`](https://github.com/netbox-community/netbox/commit/bbf8da2f1c3b393b819eccb23030d5002040c37c) Clean up ObjectImageAttachmentsView - [`12701af`](https://github.com/netbox-community/netbox/commit/12701afd7481ae7bfed87b9972a79246475be12e) Add html_tag property to ImageAttachment - [`054cb37`](https://github.com/netbox-community/netbox/commit/054cb37b0b9205d05e593819b7d90c7fb334262b) Misc cleanup - [`88a6e37`](https://github.com/netbox-community/netbox/commit/88a6e3720693c5b58c984ffa2d9539dc2eeb9081) Collapse .gitignore files for /media - [`806d374`](https://github.com/netbox-community/netbox/commit/806d3740984e16db1308dd986d229840bcf2e1dd) Fix conditional in template ### 📊 Changes **13 files changed** (+119 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -0) 📝 `base_requirements.txt` (+4 -0) 📝 `netbox/extras/models/models.py` (+14 -0) ➖ `netbox/media/devicetype-images/.gitignore` (+0 -2) ➖ `netbox/media/image-attachments/.gitignore` (+0 -2) 📝 `netbox/netbox/models/features.py` (+4 -0) 📝 `netbox/netbox/settings.py` (+1 -0) 📝 `netbox/netbox/views/generic/feature_views.py` (+37 -1) 📝 `netbox/project-static/dist/netbox.css` (+1 -1) 📝 `netbox/project-static/styles/custom/_misc.scss` (+8 -0) 📝 `netbox/templates/extras/imageattachment.html` (+2 -2) ➕ `netbox/templates/extras/object_imageattachments.html` (+46 -0) 📝 `requirements.txt` (+1 -0) </details> ### 📄 Description ### Closes: #19591 - Introduce [sorl-thumbnail](https://github.com/jazzband/sorl-thumbnail) as a new dependency - Register ObjectImageAttachmentsView for objects which support image attachments - Render thumbnails for each attached image under the new "Images" tab - Add an `html_tag` property to ImageAttachment for convenience --- <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:23:52 +01:00
adam closed this issue 2025-12-30 00:23:52 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15756