From a6715f10262e1ea8eddcaef75669562aa17061cd Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 27 Nov 2026 10:27:50 +0100 Subject: [PATCH] fix: single control for technician topology The technician version needed a scope pill plus a separate granularity selection; it is now enabled directly by choosing all/per site/per location. Co-Authored-By: Claude Opus 5.5 --- netbox_customer_export/__init__.py | 2 +- netbox_customer_export/forms.py | 5 ++--- .../locale/de/LC_MESSAGES/django.mo | Bin 23286 -> 23425 bytes .../locale/de/LC_MESSAGES/django.po | 4 ++-- netbox_customer_export/sections.py | 8 +++++--- .../netbox_customer_export/export.html | 2 +- pyproject.toml | 2 +- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/netbox_customer_export/__init__.py b/netbox_customer_export/__init__.py index 810fbb2..93cfce1 100644 --- a/netbox_customer_export/__init__.py +++ b/netbox_customer_export/__init__.py @@ -6,7 +6,7 @@ class CustomerExportConfig(PluginConfig): name = "netbox_customer_export" verbose_name = _("Customer Export") description = _("Export customer documentation as PDF or Word") - version = "0.20.1" + version = "0.20.2" author = "Claude" base_url = "customer-export" min_version = "4.6.8" diff --git a/netbox_customer_export/forms.py b/netbox_customer_export/forms.py index fdf930a..bf255b8 100644 --- a/netbox_customer_export/forms.py +++ b/netbox_customer_export/forms.py @@ -82,7 +82,6 @@ class ExportForm(forms.Form): ("locations", _("Location overview (connections between locations)")), ("locations_all", _("Cross-site location overview (all locations in one diagram)")), ("rack", _("Per rack")), - ("technician", _("Technician version (numbered connections + port list)")), ), initial=["site"], required=False, @@ -95,10 +94,10 @@ class ExportForm(forms.Form): ("site", _("Per site")), ("location", _("Per location")), ), - initial=["all", "site"], + initial=[], required=False, widget=forms.CheckboxSelectMultiple, - label=_("Technician version"), + label=_("Technician version (numbered connections + port list)"), ) topo_external = forms.BooleanField( required=False, initial=True, label=_("Show provider circuits and devices outside the scope") diff --git a/netbox_customer_export/locale/de/LC_MESSAGES/django.mo b/netbox_customer_export/locale/de/LC_MESSAGES/django.mo index 8508620012e2b4d502b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kIEc)(j$sByP2r=2Lr@#-LX~j0=^w}T^v|G<>LO~Ldl-f-rr&m|`+O{FJRaMl zjS+hPvuH#!kb_Z}kIJOT_)Ao&OHdV9in0>z z+mFFWz5iWl=n^HP78-;}I06;OJXB`osM7mU^Xkla5M$`SfZFKyroS6?Cz?wlTvVWWsP&4C!3rAs@H~$L@Dl2hMHaj7aWra!j;MtaPywW%0?kC7 zeIDw)pM-jTDk`x;)ZKDWmvN67Z^Ssg|3_(Pq4TJXZlhk4dzgriQ4c20ayLprWuAfD zS8Et*{sz=t*^Ub2b5vl>sQLdyRp1V4zZQ(t``>l8`(LGG)a{*(Dt#I1fqGQQUNXP$ zMs4^WDzKxddB@H8XU2b_F5|yZU)V=j7s9t>4*!>+zfm{5X;asmkxj#UUTPckRW7q@ zYn(FMTW(*k-&y38R`|T7UXRbNbNn^lYTxzxUADKzu5l`z(g5>3CDnCKmYwG*t*}e0 zeLhB+r76DJsuIVqDZVnh(p#h1OT2*!+ga)<4cLpT{ec?W>$5#}z*AD`WLeV|2b#KM zEKg{fm-kv&aB8ie>HbAEo~lfHiR1Ix)g_LPp#Iv4R zWZ4s)GRNlE60fhU*0(?ll_{Vq$M1Fg0lSuvs=NW7@_A}mwczJq9Iwyu+eMy|j!tEz XV|!}L7dYi7j#l^sSxqgI*F^sxyB&uu diff --git a/netbox_customer_export/locale/de/LC_MESSAGES/django.po b/netbox_customer_export/locale/de/LC_MESSAGES/django.po index 3930c36..a656ac0 100644 --- a/netbox_customer_export/locale/de/LC_MESSAGES/django.po +++ b/netbox_customer_export/locale/de/LC_MESSAGES/django.po @@ -1597,5 +1597,5 @@ msgstr "Je Lokation" msgid "Location %(name)s (%(site)s)" msgstr "Lokation %(name)s (%(site)s)" -msgid "Only used if “Technician version” is selected above. Each connection is numbered and listed with exact ports in a table." -msgstr "Nur wirksam, wenn oben „Techniker-Version“ gewählt ist. Jede Verbindung wird nummeriert und mit genauen Ports in einer Tabelle aufgeführt." +msgid "For third parties (other IT companies, electricians): each connection is numbered in the diagram and listed in a table with exact ports, cable and patch panels. Nothing selected = no technician version." +msgstr "Für Dritte (andere IT-Firmen, Elektriker): Jede Verbindung wird im Diagramm nummeriert und in einer Tabelle mit genauen Ports, Kabel und Patchpanels aufgeführt. Nichts gewählt = keine Techniker-Version." diff --git a/netbox_customer_export/sections.py b/netbox_customer_export/sections.py index ed9faf3..0ddadaf 100644 --- a/netbox_customer_export/sections.py +++ b/netbox_customer_export/sections.py @@ -610,7 +610,8 @@ def topology(scope, opts): from .topology import build_graphs, build_location_graphs, render_png title = H(1, _("Network topology")) - scopes = opts.get("topo_scope") or ["site"] + # Ohne Auswahl die Standortansicht – außer es ist nur die Techniker-Version gewählt + scopes = opts.get("topo_scope") or ([] if opts.get("topo_tech_per") else ["site"]) ports = "ports" in (opts.get("topo_details") or []) pages = [] # (Überschriften, Graph) – je eine Querformat-Seite if "site" in scopes: @@ -625,12 +626,13 @@ def topology(scope, opts): # Rack-Seiten unter einer gemeinsamen Zwischenüberschrift, Racks selbst eine Ebene tiefer (kürzeres Inhaltsverzeichnis) pages += [(([H(2, _("Topology per rack"))] if i == 0 else []) + [H(3, g.title)], g) for i, g in enumerate(racks)] tech = [] # Techniker-Ansicht: nummerierte Verbindungen + vollständige Portliste je Standort - if "technician" in scopes: + tech_per = opts.get("topo_tech_per") or [] + if tech_per: from .topology import number_connections graphs = [] for per in ("all", "site", "location"): - if per in (opts.get("topo_tech_per") or ["all", "site"]): + if per in tech_per: graphs += build_graphs(scope, opts, per=per) for i, g in enumerate(graphs): rows = number_connections(g) diff --git a/netbox_customer_export/templates/netbox_customer_export/export.html b/netbox_customer_export/templates/netbox_customer_export/export.html index 12d8ebf..f3414ba 100644 --- a/netbox_customer_export/templates/netbox_customer_export/export.html +++ b/netbox_customer_export/templates/netbox_customer_export/export.html @@ -179,7 +179,7 @@
{% trans "“Location overview” shows all locations of a site and the cables between them, from the server room to the last sub-distribution. “Cross-site” combines all sites in one diagram to show how buildings and their locations are connected. “Per rack” shows each rack separately. Connected devices outside appear dashed." %}
{{ form.topo_tech_per.label }}
{% include 'netbox_customer_export/_pills.html' with field=form.topo_tech_per %} -
{% trans "Only used if “Technician version” is selected above. Each connection is numbered and listed with exact ports in a table." %}
+
{% trans "For third parties (other IT companies, electricians): each connection is numbered in the diagram and listed in a table with exact ports, cable and patch panels. Nothing selected = no technician version." %}
{{ form.topo_details.label }}
{% include 'netbox_customer_export/_pills.html' with field=form.topo_details %}
{% trans "More" %}
diff --git a/pyproject.toml b/pyproject.toml index 170bf85..931b776 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "netbox-customer-export" -version = "0.20.1" +version = "0.20.2" description = "NetBox plugin: customer documentation (PDF/Word) for sites, locations, tenants and tenant groups" readme = "README.md" requires-python = ">=3.10"