1
0
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:
jeremystretch
2022-08-30 09:53:38 -04:00
parent 924471ee76
commit 14f79ef85a
7 changed files with 9 additions and 9 deletions

View File

@ -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()

View File

@ -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 %}
"""

View File

@ -9,7 +9,7 @@ CONFIGCONTEXT_ACTIONS = """
OBJECTCHANGE_FULL_NAME = """
{% load helpers %}
{{ record.user.get_full_name|placeholder }}
{{ value.get_full_name|placeholder }}
"""
OBJECTCHANGE_OBJECT = """

View File

@ -10,7 +10,7 @@ __all__ = (
IPADDRESSES = """
{% for ip in record.ip_addresses.all %}
{% for ip in value.all %}
<a href="{{ ip.get_absolute_url }}">{{ ip }}</a><br />
{% endfor %}
"""

View File

@ -47,7 +47,7 @@ IPADDRESS_ASSIGN_LINK = """
"""
VRF_LINK = """
{% if record.vrf %}
{% if value %}
<a href="{{ record.vrf.get_absolute_url }}">{{ record.vrf }}</a>
{% elif object.vrf %}
<a href="{{ object.vrf.get_absolute_url }}">{{ object.vrf }}</a>

View File

@ -30,7 +30,7 @@ VLAN_LINK = """
"""
VLAN_PREFIXES = """
{% for prefix in record.prefixes.all %}
{% for prefix in value.all %}
<a href="{% url 'ipam:prefix' pk=prefix.pk %}">{{ prefix }}</a>{% if not forloop.last %}<br />{% endif %}
{% endfor %}
"""

View File

@ -12,7 +12,7 @@ __all__ = (
)
VMINTERFACE_BUTTONS = """
{% if perms.virtualization.edit_vminterface %}
{% if perms.virtualization.change_vminterface %}
<span class="dropdown">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="Add">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span>