From f75d7cfca1a4787b31114866301196f2fca4bdfa Mon Sep 17 00:00:00 2001 From: iamjohnnymac <33052970+iamjohnnymac@users.noreply.github.com> Date: Tue, 19 May 2026 09:42:31 +0800 Subject: [PATCH 1/2] fix: drop duplicate 'Trace this core' inline include on strand detail (v0.3.8) v0.3.7 wired plugin_right_page into strand.html, which made the StrandTraceButton PluginTemplateExtension fire and render the trace button. The template also kept the pre-v0.3.1 inline include of the button as a workaround, so the button rendered twice. Removed the inline include + updated the extension's docstring. --- CHANGELOG.md | 15 ++++++++++++++- netbox_osp/__init__.py | 2 +- netbox_osp/template_content.py | 6 +++--- netbox_osp/templates/netbox_osp/strand.html | 6 ++++-- pyproject.toml | 2 +- 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6b63ad..832648a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,18 @@ Per-release NetBox / Python compatibility lives in ## [Unreleased] +## [0.3.8] — 2026-05-19 + +### Fixed + +- **"Trace this core" button no longer appears twice on the Strand + detail page.** v0.3.7 wired the `plugin_right_page` slot into + `strand.html`, which made the `StrandTraceButton` + `PluginTemplateExtension` fire — but the template also kept the + pre-v0.3.1 inline `{% include 'netbox_osp/inc/trace_button.html' %}` + workaround, so the button rendered twice. Removed the inline + include; the extension is now the single source of truth. + ## [0.3.7] — 2026-05-19 Three audit fixes bundled together. @@ -426,7 +438,8 @@ GPS markers. - PyPI name-reservation placeholder. Not functional. -[Unreleased]: https://github.com/iamjohnnymac/netbox-osp/compare/v0.3.7...HEAD +[Unreleased]: https://github.com/iamjohnnymac/netbox-osp/compare/v0.3.8...HEAD +[0.3.8]: https://github.com/iamjohnnymac/netbox-osp/releases/tag/v0.3.8 [0.3.7]: https://github.com/iamjohnnymac/netbox-osp/releases/tag/v0.3.7 [0.3.5]: https://github.com/iamjohnnymac/netbox-osp/releases/tag/v0.3.5 [0.3.4]: https://github.com/iamjohnnymac/netbox-osp/releases/tag/v0.3.4 diff --git a/netbox_osp/__init__.py b/netbox_osp/__init__.py index c31a1c1..fce330f 100644 --- a/netbox_osp/__init__.py +++ b/netbox_osp/__init__.py @@ -5,7 +5,7 @@ class NetBoxOspConfig(PluginConfig): name = "netbox_osp" verbose_name = "NetBox OSP" description = "Outside-plant fibre management — cables, splice closures, fibre links with loss budgets, and an offline-capable Leaflet plant map." - version = "0.3.7" + version = "0.3.8" author = "John McKean" author_email = "33052970+iamjohnnymac@users.noreply.github.com" base_url = "osp" diff --git a/netbox_osp/template_content.py b/netbox_osp/template_content.py index ddbdf0a..8509fe2 100644 --- a/netbox_osp/template_content.py +++ b/netbox_osp/template_content.py @@ -110,9 +110,9 @@ def right_page(self): class StrandTraceButton(_TraceButtonMixin, PluginTemplateExtension): """Inject the trace button onto netbox-osp Strand detail pages. - Some installs disable template extensions on plugin pages — for - those, the strand.html template embeds the button directly via - {% include %}. This extension covers the standard case. + Since v0.3.1 wired plugin_right_page into strand.html this extension + is the only path; the pre-v0.3.1 inline {% include %} workaround was + removed in v0.3.8 to avoid drawing the button twice. """ models = ["netbox_osp.strand"] _trace_url_view_name = "plugins:netbox_osp:strand_trace" diff --git a/netbox_osp/templates/netbox_osp/strand.html b/netbox_osp/templates/netbox_osp/strand.html index 660e155..50e83b0 100644 --- a/netbox_osp/templates/netbox_osp/strand.html +++ b/netbox_osp/templates/netbox_osp/strand.html @@ -22,8 +22,10 @@