Files
NetBox-Customer-Export/netbox_customer_export/template_content.py
T
MrBlakeandClaude Opus 5.5 8f45bffa99 NetBox Customer Export plugin with configurable branding
Plugin for NetBox 4.6.8–4.6.99 that exports customer documentation
(PDF, Word, HTML preview) for a site, location, tenant or tenant group.
Technicians pick sections, device roles and columns before exporting.

Branding profiles (colors, font, logo, footer, Word template incl. .dotx,
table style, extra CSS) are configurable via PLUGINS_CONFIG and selectable
per export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 12:43:19 +02:00

22 lines
692 B
Python

from django.urls import reverse
from django.utils.html import format_html
from netbox.plugins import PluginTemplateExtension
class CustomerExportButton(PluginTemplateExtension):
models = ["dcim.site", "dcim.location", "tenancy.tenant", "tenancy.tenantgroup"]
def buttons(self):
obj = self.context["object"]
url = reverse(
"plugins:netbox_customer_export:export",
kwargs={"kind": obj._meta.model_name, "pk": obj.pk},
)
return format_html(
'<a href="{}" class="btn btn-primary"><i class="mdi mdi-file-document-outline"></i> Kundendoku</a>',
url,
)
template_extensions = [CustomerExportButton]