1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Simplify CircuitTermination display in circuits table

This commit is contained in:
jeremystretch
2021-04-05 15:24:57 -04:00
parent ae18693715
commit a313b675a6

View File

@ -6,6 +6,15 @@ from utilities.tables import BaseTable, ButtonsColumn, ChoiceFieldColumn, TagCol
from .models import * from .models import *
CIRCUITTERMINATION_LINK = """
{% if value.site %}
<a href="{{ value.site.get_absolute_url }}">{{ value.site }}</a>
{% elif value.provider_network %}
<a href="{{ value.provider_network.get_absolute_url }}">{{ value.provider_network }}</a>
{% endif %}
"""
# #
# Providers # Providers
# #
@ -88,12 +97,12 @@ class CircuitTable(BaseTable):
) )
status = ChoiceFieldColumn() status = ChoiceFieldColumn()
tenant = TenantColumn() tenant = TenantColumn()
termination_a = tables.Column( termination_a = tables.TemplateColumn(
linkify=True, template_code=CIRCUITTERMINATION_LINK,
verbose_name='Side A' verbose_name='Side A'
) )
termination_z = tables.Column( termination_z = tables.TemplateColumn(
linkify=True, template_code=CIRCUITTERMINATION_LINK,
verbose_name='Side Z' verbose_name='Side Z'
) )
tags = TagColumn( tags = TagColumn(