CABLETERMINATION = """
{% if value %}
{{ value.parent }}
{{ value }}
{% else %}
—
{% endif %}
"""
CABLE_LENGTH = """
{% if record.length %}{{ record.length }} {{ record.get_length_unit_display }}{% else %}—{% endif %}
"""
CABLE_TERMINATION_PARENT = """
{% if value.device %}
{{ value.device }}
{% elif value.circuit %}
{{ value.circuit }}
{% elif value.power_panel %}
{{ value.power_panel }}
{% endif %}
"""
DEVICE_LINK = """
{{ record.name|default:'Unnamed device' }}
"""
INTERFACE_IPADDRESSES = """
{% for ip in record.ip_addresses.unrestricted %}
{{ ip }}
{% endfor %}
"""
INTERFACE_TAGGED_VLANS = """
{% for vlan in record.tagged_vlans.unrestricted %}
{{ vlan }}
{% endfor %}
"""
MPTT_LINK = """
{% if record.get_children %}
{% else %}
{% endif %}
{{ record.name }}
"""
POWERFEED_CABLE = """
{{ value }}
"""
POWERFEED_CABLETERMINATION = """
{{ value.parent }}
{{ value }}
"""
RACKGROUP_ELEVATIONS = """
"""
UTILIZATION_GRAPH = """
{% load helpers %}
{% utilization_graph value %}
"""
#
# Device component buttons
#
CONSOLEPORT_BUTTONS = """
{% if record.cable %}
{% include 'dcim/inc/cable_toggle_buttons.html' with cable=record.cable %}
{% elif perms.dcim.add_cable %}
{% endif %}
"""
CONSOLESERVERPORT_BUTTONS = """
{% if record.cable %}
{% include 'dcim/inc/cable_toggle_buttons.html' with cable=record.cable %}
{% elif perms.dcim.add_cable %}
{% endif %}
"""
POWERPORT_BUTTONS = """
{% if record.cable %}
{% include 'dcim/inc/cable_toggle_buttons.html' with cable=record.cable %}
{% elif perms.dcim.add_cable %}
{% endif %}
"""
POWEROUTLET_BUTTONS = """
{% if record.cable %}
{% include 'dcim/inc/cable_toggle_buttons.html' with cable=record.cable %}
{% elif perms.dcim.add_cable %}
{% endif %}
"""