12216 Add color to circuit-type and add to SVG rendering (#14098)

* 12216 add color to model

* 12216 add forms, serializers for color

* 12216 color to detail view, add type to svg

* 12216 add color to svg

* 12216 review changes
This commit is contained in:
Arthur Hanson
2023-10-24 05:19:04 -07:00
committed by GitHub
parent 450790ab4a
commit ae447bd187
11 changed files with 65 additions and 10 deletions

View File

@@ -159,6 +159,7 @@ class CableTraceSVG:
labels.append(location_label)
elif instance._meta.model_name == 'circuit':
labels[0] = f'Circuit {instance}'
labels.append(instance.type)
labels.append(instance.provider)
if instance.description:
labels.append(instance.description)
@@ -181,6 +182,8 @@ class CableTraceSVG:
if hasattr(instance, 'role'):
# Device
return instance.role.color
elif instance._meta.model_name == 'circuit' and instance.type.color:
return instance.type.color
else:
# Other parent object
return 'e0e0e0'