Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ Per-release NetBox / Python compatibility lives in

## [Unreleased]

## [0.3.5] — 2026-05-19

### Fixed

- **TIA-598 strand colour badges now actually use their named colour.**
v0.3.4 added CSS overrides for `text-bg-blue` / `text-bg-black` /
`text-bg-white` — but they had no effect because NetBox's
`ChoiceFieldColumn` was rendering every TIA-598 colour as
`text-bg-secondary` (grey). Root cause: neither `Strand` nor `Tube`
defined a `get_color_color()` method, so the column couldn't look
up the badge colour from `TIA598ColorChoices`. Added the helper on
both models — colour codes now render in their actual colour
(Blue is blue, Orange is orange, Brown is brown, etc.).

## [0.3.4] — 2026-05-19

### Fixed
Expand Down Expand Up @@ -387,7 +401,8 @@ GPS markers.

- PyPI name-reservation placeholder. Not functional.

[Unreleased]: https://github.com/iamjohnnymac/netbox-osp/compare/v0.3.4...HEAD
[Unreleased]: https://github.com/iamjohnnymac/netbox-osp/compare/v0.3.5...HEAD
[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
[0.3.3]: https://github.com/iamjohnnymac/netbox-osp/releases/tag/v0.3.3
[0.3.2]: https://github.com/iamjohnnymac/netbox-osp/releases/tag/v0.3.2
Expand Down
2 changes: 1 addition & 1 deletion netbox_osp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.4"
version = "0.3.5"
author = "John McKean"
author_email = "33052970+iamjohnnymac@users.noreply.github.com"
base_url = "osp"
Expand Down
12 changes: 12 additions & 0 deletions netbox_osp/models/cables.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ def __str__(self):
def get_absolute_url(self):
return reverse("plugins:netbox_osp:tube", args=[self.pk])

def get_color_color(self):
"""NetBox's ChoiceFieldColumn looks up the badge colour by calling
get_<field>_color() on the model. Without this, the colour column
renders every value as `text-bg-secondary` (grey)."""
return TIA598ColorChoices.colors.get(self.color)

def save(self, *args, **kwargs):
if not self.color:
self.color = TIA598ColorChoices.for_position(self.number or 1)
Expand Down Expand Up @@ -238,6 +244,12 @@ def get_absolute_url(self):
def get_status_color(self):
return StrandStatusChoices.colors.get(self.status)

def get_color_color(self):
"""ChoiceFieldColumn / badge template tag both look up the badge
colour by calling get_<field>_color() on the model. Without this,
the strand colour code renders as `text-bg-secondary` (grey)."""
return TIA598ColorChoices.colors.get(self.color)

def save(self, *args, **kwargs):
if not self.color:
self.color = TIA598ColorChoices.for_position(self.position or 1)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "netbox-osp"
version = "0.3.4"
version = "0.3.5"
description = "Outside-plant fibre management for NetBox — cables, splice closures, fibre links with loss budgets, and an offline-capable Leaflet plant map."
authors = [{ name = "John McKean", email = "33052970+iamjohnnymac@users.noreply.github.com" }]
maintainers = [{ name = "John McKean", email = "33052970+iamjohnnymac@users.noreply.github.com" }]
Expand Down
Loading