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' }} """ DEVICEBAY_STATUS = """ {% if record.installed_device_id %} {{ record.installed_device.get_status_display }} {% else %} Vacant {% endif %} """ INTERFACE_IPADDRESSES = """ {% for ip in record.ip_addresses.all %} {{ 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 %} """ INTERFACE_BUTTONS = """ {% if perms.ipam.add_ipaddress %} {% endif %} {% if record.cable %} {% include 'dcim/inc/cable_toggle_buttons.html' with cable=record.cable %} {% elif record.is_connectable and perms.dcim.add_cable %} {% endif %} """ FRONTPORT_BUTTONS = """ {% if record.cable %} {% include 'dcim/inc/cable_toggle_buttons.html' with cable=record.cable %} {% elif perms.dcim.add_cable %} {% endif %} """ REARPORT_BUTTONS = """ {% if record.cable %} {% include 'dcim/inc/cable_toggle_buttons.html' with cable=record.cable %} {% elif perms.dcim.add_cable %} {% endif %} """ DEVICEBAY_BUTTONS = """ {% if perms.dcim.change_devicebay %} {% if record.installed_device %} {% else %} {% endif %} {% endif %} """