mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Closes #10202: Clean up TemplateColumn template code & accessors
This commit is contained in:
@@ -51,7 +51,7 @@ class RackTable(TenancyColumnsMixin, NetBoxTable):
|
||||
status = columns.ChoiceFieldColumn()
|
||||
role = columns.ColoredLabelColumn()
|
||||
u_height = tables.TemplateColumn(
|
||||
template_code="{{ record.u_height }}U",
|
||||
template_code="{{ value }}U",
|
||||
verbose_name='Height'
|
||||
)
|
||||
comments = columns.MarkdownColumn()
|
||||
|
||||
@@ -33,7 +33,7 @@ DEVICEBAY_STATUS = """
|
||||
|
||||
INTERFACE_IPADDRESSES = """
|
||||
<div class="table-badge-group">
|
||||
{% for ip in record.ip_addresses.all %}
|
||||
{% for ip in value.all %}
|
||||
{% if ip.status != 'active' %}
|
||||
<a href="{{ ip.get_absolute_url }}" class="table-badge badge bg-{{ ip.get_status_color }}" data-bs-toggle="tooltip" data-bs-placement="left" title="{{ ip.get_status_display }}">{{ ip }}</a>
|
||||
{% else %}
|
||||
@@ -53,7 +53,7 @@ INTERFACE_FHRPGROUPS = """
|
||||
|
||||
INTERFACE_TAGGED_VLANS = """
|
||||
{% if record.mode == 'tagged' %}
|
||||
{% for vlan in record.tagged_vlans.all %}
|
||||
{% for vlan in value.all %}
|
||||
<a href="{{ vlan.get_absolute_url }}">{{ vlan }}</a><br />
|
||||
{% endfor %}
|
||||
{% elif record.mode == 'tagged-all' %}
|
||||
@@ -62,7 +62,7 @@ INTERFACE_TAGGED_VLANS = """
|
||||
"""
|
||||
|
||||
INTERFACE_WIRELESS_LANS = """
|
||||
{% for wlan in record.wireless_lans.all %}
|
||||
{% for wlan in value.all %}
|
||||
<a href="{{ wlan.get_absolute_url }}">{{ wlan }}</a><br />
|
||||
{% endfor %}
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user