- Fix template comments rendering as literal text: Django's {# #} tag
regex (tag_re in django/template/base.py) has no re.DOTALL, so a
comment spanning multiple lines is never recognized as a tag at all
and leaks into the rendered output verbatim - exactly what showed up
under "Elevation". Collapsed all three offending comments to single
lines. This was also almost certainly the real cause of the "PNG
could not be generated" report: two of the leaked comments sat
inside the shared SVG partial, corrupting the exported SVG enough
that the browser's image decoder rejected it (my own onerror handler
then showed a misleading CORS-sounding message - the actual bug was
malformed markup, not cross-origin images).
- Add a German translation (locale/de/), built from every _() and
{% trans %}/{% blocktrans %} string in the plugin (269 entries,
cross-checked against the source for completeness). English needs no
catalog of its own since it's the literal source text; both were
already listed in NetBox's own language selector.
- Add CHANGELOG.md and bump the version to 0.2.0, covering this and
every unreleased change so far; will keep bumping per change from
here on.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
50 lines
1.7 KiB
Python
50 lines
1.7 KiB
Python
from netbox.plugins import PluginConfig
|
|
|
|
__version__ = '0.2.0'
|
|
|
|
|
|
class RackConceptConfig(PluginConfig):
|
|
name = 'netbox_rack_concept'
|
|
verbose_name = 'NetBox Rack Concepts'
|
|
description = 'Rack blueprints: plan racks and their equipment without creating real racks or devices'
|
|
version = __version__
|
|
author = 'Claude'
|
|
base_url = 'rack-concepts'
|
|
min_version = '4.6.0'
|
|
max_version = '4.6.99'
|
|
# These paths are relative to this module (NetBox prepends self.__module__),
|
|
# so they must NOT be prefixed with 'netbox_rack_concept.' again.
|
|
menu = 'navigation.menu'
|
|
template_extensions = 'template_content.template_extensions'
|
|
|
|
default_settings = {
|
|
# Defaults used when a concept is created from scratch.
|
|
'default_u_height': 42,
|
|
'default_width': 19,
|
|
|
|
# Show the "Copy to concept" button on the dcim.Rack detail page.
|
|
'enable_rack_tab': True,
|
|
|
|
# Status assigned to the objects created when a concept is deployed.
|
|
'deployed_rack_status': 'planned',
|
|
'deployed_device_status': 'planned',
|
|
|
|
# Mapping onto the partial-width implementation of netbox_utilities.
|
|
# Adjust these if that plugin renames its fields; set 'enabled' to False
|
|
# to never write partial-width data during deployment.
|
|
'partial_width': {
|
|
'enabled': True,
|
|
'model': 'netbox_utilities.RackDevicePosition',
|
|
'device_field': 'device',
|
|
'fraction_field': 'width_fraction',
|
|
'position_field': 'horizontal_position',
|
|
},
|
|
}
|
|
|
|
def ready(self):
|
|
super().ready()
|
|
from . import search # noqa: F401
|
|
|
|
|
|
config = RackConceptConfig
|