diff --git a/docs/plugins/development/templates.md b/docs/plugins/development/templates.md index 06876c04c..64616c442 100644 --- a/docs/plugins/development/templates.md +++ b/docs/plugins/development/templates.md @@ -230,6 +230,8 @@ The following custom template filters are available in NetBox. ::: utilities.templatetags.builtins.filters.content_type_id +::: utilities.templatetags.builtins.filters.linkify + ::: utilities.templatetags.builtins.filters.meta ::: utilities.templatetags.builtins.filters.placeholder diff --git a/netbox/templates/circuits/circuit.html b/netbox/templates/circuits/circuit.html index 94cad56b3..4f60feb47 100644 --- a/netbox/templates/circuits/circuit.html +++ b/netbox/templates/circuits/circuit.html @@ -18,9 +18,7 @@ - + @@ -28,7 +26,7 @@ - + @@ -39,9 +37,9 @@ @@ -48,11 +48,11 @@ {% with peer=termination.get_link_peer %} to {% if peer.device %} - {{ peer.device }}
+ {{ peer.device|linkify }}
{% elif peer.circuit %} - {{ peer.circuit }}
+ {{ peer.circuit|linkify }}
{% endif %} - {{ peer }} + {{ peer|linkify }} {% endwith %}
@@ -82,9 +82,7 @@ {% else %}
- + {% endif %} diff --git a/netbox/templates/circuits/providernetwork.html b/netbox/templates/circuits/providernetwork.html index d1c513f98..4987722a5 100644 --- a/netbox/templates/circuits/providernetwork.html +++ b/netbox/templates/circuits/providernetwork.html @@ -20,9 +20,7 @@
Provider - {{ object.provider }} - {{ object.provider|linkify }}
Circuit ID
Type{{ object.type }}{{ object.type|linkify }}
Status {% if object.tenant %} {% if object.tenant.group %} - {{ object.tenant.group }} / + {{ object.tenant.group|linkify }} / {% endif %} - {{ object.tenant }} + {{ object.tenant|linkify }} {% else %} None {% endif %} diff --git a/netbox/templates/circuits/inc/circuit_termination.html b/netbox/templates/circuits/inc/circuit_termination.html index d0a739c33..fdb01e803 100644 --- a/netbox/templates/circuits/inc/circuit_termination.html +++ b/netbox/templates/circuits/inc/circuit_termination.html @@ -32,9 +32,9 @@ Site {% if termination.site.region %} - {{ termination.site.region }} / + {{ termination.site.region|linkify }} / {% endif %} - {{ termination.site }} + {{ termination.site|linkify }}
Provider Network - {{ termination.provider_network }} - {{ termination.provider_network|linkify }}
- + diff --git a/netbox/templates/dcim/cable.html b/netbox/templates/dcim/cable.html index d68353274..cf12ba930 100644 --- a/netbox/templates/dcim/cable.html +++ b/netbox/templates/dcim/cable.html @@ -26,9 +26,9 @@ diff --git a/netbox/templates/dcim/inc/endpoint_connection.html b/netbox/templates/dcim/inc/endpoint_connection.html index d5b9f6112..c0167ff0f 100644 --- a/netbox/templates/dcim/inc/endpoint_connection.html +++ b/netbox/templates/dcim/inc/endpoint_connection.html @@ -1,7 +1,7 @@ {% if path.destination_id %} {% with endpoint=path.destination %} - - + + {% endwith %} {% else %} diff --git a/netbox/templates/dcim/inc/nonracked_devices.html b/netbox/templates/dcim/inc/nonracked_devices.html index f1b669eb9..7f4da2f24 100644 --- a/netbox/templates/dcim/inc/nonracked_devices.html +++ b/netbox/templates/dcim/inc/nonracked_devices.html @@ -21,7 +21,7 @@ {% if device.parent_bay %} - + {% else %} diff --git a/netbox/templates/dcim/inc/panels/inventory_items.html b/netbox/templates/dcim/inc/panels/inventory_items.html index c65b342b2..d8ca32dbd 100644 --- a/netbox/templates/dcim/inc/panels/inventory_items.html +++ b/netbox/templates/dcim/inc/panels/inventory_items.html @@ -15,19 +15,9 @@ {% for item in object.inventory_items.all %} - - - + + + - + @@ -196,13 +162,7 @@ - + @@ -225,11 +185,11 @@ {% with ct=object.connected_endpoint %} - + - + @@ -253,7 +213,7 @@ - + - + @@ -409,7 +365,7 @@ {% for member in object.member_interfaces.all %} - - - + + + {% empty %} diff --git a/netbox/templates/dcim/inventoryitem.html b/netbox/templates/dcim/inventoryitem.html index 0e30c5c8c..b52a7457b 100644 --- a/netbox/templates/dcim/inventoryitem.html +++ b/netbox/templates/dcim/inventoryitem.html @@ -18,19 +18,11 @@
Provider - {{ object.provider }} - {{ object.provider|linkify }}
Name {% if object.tenant %} {% if object.tenant.group %} - {{ object.tenant.group }} / + {{ object.tenant.group|linkify }} / {% endif %} - {{ object.tenant }} + {{ object.tenant|linkify }} {% else %} None {% endif %} diff --git a/netbox/templates/dcim/cable_trace.html b/netbox/templates/dcim/cable_trace.html index d9dbc5b2d..ac0481925 100644 --- a/netbox/templates/dcim/cable_trace.html +++ b/netbox/templates/dcim/cable_trace.html @@ -25,7 +25,7 @@ {% if next_node.cable %}
  • {{ next_node }} - (Cable {{ next_node.cable }}) + (Cable {{ next_node.cable|linkify }})
  • {% else %}
  • {{ next_node }}
  • diff --git a/netbox/templates/dcim/consoleport.html b/netbox/templates/dcim/consoleport.html index 08f409557..a8934357a 100644 --- a/netbox/templates/dcim/consoleport.html +++ b/netbox/templates/dcim/consoleport.html @@ -20,19 +20,11 @@ - + - + @@ -74,7 +66,7 @@ - + diff --git a/netbox/templates/dcim/consoleserverport.html b/netbox/templates/dcim/consoleserverport.html index 81d7734d3..799aa57bd 100644 --- a/netbox/templates/dcim/consoleserverport.html +++ b/netbox/templates/dcim/consoleserverport.html @@ -20,19 +20,11 @@
    Device - {{ object.device }} - {{ object.device|linkify }}
    Module - {% if object.module %} - {{ object.module }} - {% else %} - {{ None|placeholder }} - {% endif %} - {{ object.module|linkify|placeholder }}
    Name
    Cable - {{ object.cable }} + {{ object.cable|linkify }} @@ -83,9 +75,7 @@ {% if object.connected_endpoint %}
    Device - {{ object.connected_endpoint.device }} - {{ object.connected_endpoint.device|linkify }}
    Name
    - + - + @@ -74,7 +66,7 @@ diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html index db3a7868e..dde8adee0 100644 --- a/netbox/templates/dcim/device.html +++ b/netbox/templates/dcim/device.html @@ -19,28 +19,26 @@ - + @@ -127,7 +125,7 @@ {% for vc_member in vc_members %} - + @@ -187,9 +179,9 @@ {% if object.primary_ip4 %} {{ object.primary_ip4.address.ip }} {% if object.primary_ip4.nat_inside %} - (NAT for {{ object.primary_ip4.nat_inside.address.ip }}) + (NAT for {{ object.primary_ip4.nat_inside.address.ip|linkify }}) {% elif object.primary_ip4.nat_outside %} - (NAT: {{ object.primary_ip4.nat_outside.address.ip }}) + (NAT: {{ object.primary_ip4.nat_outside.address.ip|linkify }}) {% endif %} {% else %} @@ -202,9 +194,9 @@ {% if object.primary_ip6 %} {{ object.primary_ip6.address.ip }} {% if object.primary_ip6.nat_inside %} - (NAT for {{ object.primary_ip6.nat_inside.address.ip }}) + (NAT for {{ object.primary_ip6.nat_inside.address.ip|linkify }}) {% elif object.primary_ip6.nat_outside %} - (NAT: {{ object.primary_ip6.nat_outside.address.ip }}) + (NAT: {{ object.primary_ip6.nat_outside.address.ip|linkify }}) {% endif %} {% else %} @@ -216,9 +208,9 @@ {% endif %} diff --git a/netbox/templates/dcim/devicebay.html b/netbox/templates/dcim/devicebay.html index 3a470bec5..38cc8f16b 100644 --- a/netbox/templates/dcim/devicebay.html +++ b/netbox/templates/dcim/devicebay.html @@ -20,9 +20,7 @@
    Device - {{ object.device }} - {{ object.device|linkify }}
    Module - {% if object.module %} - {{ object.module }} - {% else %} - {{ None|placeholder }} - {% endif %} - {{ object.module|linkify|placeholder }}
    Name
    Cable - {{ object.cable }} + {{ object.cable|linkify }} @@ -84,7 +76,7 @@
    Device - {{ object.connected_endpoint.device }} + {{ object.connected_endpoint.device|linkify }}
    {% if object.site.region %} {% for region in object.site.region.get_ancestors %} - {{ region }} / + {{ region|linkify }} / {% endfor %} - {{ object.site.region }} + {{ object.site.region|linkify }} {% else %} - None + None {% endif %}
    Site - {{ object.site }} - {{ object.site|linkify }}
    Location {% if object.location %} {% for location in object.location.get_ancestors %} - {{ location }} / + {{ location|linkify }} / {% endfor %} - {{ object.location }} + {{ object.location|linkify }} {% else %} None {% endif %} @@ -61,7 +59,7 @@ {% if object.parent_bay %} {% with object.parent_bay.device as parent %} - {{ parent }} / {{ object.parent_bay }} + {{ parent|linkify }} / {{ object.parent_bay }} {% if parent.position %} (U{{ parent.position }} / {{ parent.get_face_display }}) {% endif %} @@ -80,9 +78,9 @@ {% if object.tenant %} {% if object.tenant.group %} - {{ object.tenant.group }} / + {{ object.tenant.group|linkify }} / {% endif %} - {{ object.tenant }} + {{ object.tenant|linkify }} {% else %} None {% endif %} @@ -91,7 +89,7 @@
    Device Type - {{ object.device_type }} ({{ object.device_type.u_height }}U) + {{ object.device_type|linkify }} ({{ object.device_type.u_height }}U)
    - {{ vc_member }} + {{ vc_member|linkify }} {% badge vc_member.vc_position show_empty=True %} @@ -173,13 +171,7 @@
    Platform - {% if object.platform %} - {{ object.platform }} - {% else %} - None - {% endif %} - {{ object.platform|linkify|placeholder }}
    Primary IPv4Cluster {% if object.cluster.group %} - {{ object.cluster.group }} / + {{ object.cluster.group|linkify }} / {% endif %} - {{ object.cluster }} + {{ object.cluster|linkify }}
    - + @@ -54,9 +52,7 @@
    Device - {{ object.device }} - {{ object.device|linkify }}
    Name
    - + diff --git a/netbox/templates/dcim/devicetype.html b/netbox/templates/dcim/devicetype.html index 4b9dc8db7..e717a48aa 100644 --- a/netbox/templates/dcim/devicetype.html +++ b/netbox/templates/dcim/devicetype.html @@ -14,7 +14,7 @@
    Device - {{ device }} - {{ device|linkify }}
    Device Type
    - + diff --git a/netbox/templates/dcim/frontport.html b/netbox/templates/dcim/frontport.html index a8d2dd06f..891f217ee 100644 --- a/netbox/templates/dcim/frontport.html +++ b/netbox/templates/dcim/frontport.html @@ -20,19 +20,11 @@
    Manufacturer{{ object.manufacturer }}{{ object.manufacturer|linkify }}
    Model Name
    - + - + @@ -54,9 +46,7 @@ - + @@ -88,7 +78,7 @@ - + - {% if termination.device.site %} - + - {% endif %} {% if termination.device.rack %} - - - - + + + + {% endif %} - + - + {% else %} {# Circuit termination #} - + - + {% endif %}
    Device - {{ object.device }} - {{ object.device|linkify }}
    Module - {% if object.module %} - {{ object.module }} - {% else %} - {{ None|placeholder }} - {% endif %} - {{ object.module|linkify|placeholder }}
    Name
    Rear Port - {{ object.rear_port }} - {{ object.rear_port|linkify }}
    Rear Port Position
    Cable - {{ object.cable }} + {{ object.cable|linkify }} diff --git a/netbox/templates/dcim/inc/cable_termination.html b/netbox/templates/dcim/inc/cable_termination.html index c9f3f0d4a..f44c3b9d1 100644 --- a/netbox/templates/dcim/inc/cable_termination.html +++ b/netbox/templates/dcim/inc/cable_termination.html @@ -4,51 +4,35 @@ {# Device component #}
    Device - {{ termination.device }} - {{ termination.device|linkify }}
    Site - {{ termination.device.site }} - {{ termination.device.site|linkify }}
    Rack - {{ termination.device.rack }} -
    Rack{{ termination.device.rack|linkify }}
    Type - {{ termination|meta:"verbose_name"|capfirst }} - {{ termination|meta:"verbose_name"|capfirst }}
    Component - {{ termination }} - {{ termination|linkify }}
    Provider - {{ termination.circuit.provider }} - {{ termination.circuit.provider|linkify }}
    Circuit - {{ termination.circuit }} ({{ termination }}) - {{ termination.|linkify }} ({{ termination }})
    diff --git a/netbox/templates/dcim/inc/cabletermination.html b/netbox/templates/dcim/inc/cabletermination.html index 26a7e1cd3..c7fa7918a 100644 --- a/netbox/templates/dcim/inc/cabletermination.html +++ b/netbox/templates/dcim/inc/cabletermination.html @@ -6,9 +6,9 @@ {{ termination.parent_object }} {% else %} - {{ termination.parent_object }} + {{ termination.parent_object|linkify }} {% endif %}
    - {{ termination }} + {{ termination|linkify }} {{ endpoint.parent_object }}{{ endpoint }}{{ endpoint.parent_object|linkify }}{{ endpoint|linkify }}Not connected{{ device.device_role }} {{ device.device_type }}{{ device.parent_bay.device }}{{ device.parent_bay.device|linkify }} {{ device.parent_bay }}
    - {{ item.name }} - - {{ item.label|placeholder }} - - {% if item.role %} - {{ item.role }} - {% else %} - - {% endif %} - {{ item.name }}{{ item.label|placeholder }}{{ item.role|linkify|placeholder }} {% if perms.dcim.change_inventoryitem %} diff --git a/netbox/templates/dcim/interface.html b/netbox/templates/dcim/interface.html index 35121b2e3..53e2f2103 100644 --- a/netbox/templates/dcim/interface.html +++ b/netbox/templates/dcim/interface.html @@ -30,19 +30,11 @@ - + - + @@ -74,33 +66,15 @@ - + - + - + @@ -128,13 +102,7 @@ - +
    Device - {{ object.device }} - {{ object.device|linkify }}
    Module - {% if object.module %} - {{ object.module }} - {% else %} - {{ None|placeholder }} - {% endif %} - {{ object.module|linkify|placeholder }}
    Name
    Parent - {% if object.parent %} - {{ object.parent }} - {% else %} - None - {% endif %} - {{ object.parent|linkify|placeholder }}
    Bridge - {% if object.bridge %} - {{ object.bridge }} - {% else %} - None - {% endif %} - {{ object.bridge|linkify|placeholder }}
    LAG - {% if object.lag%} - {{ object.lag }} - {% else %} - None - {% endif %} - {{ object.lag|linkify|placeholder }}
    Description
    VRF - {% if object.vrf %} - {{ object.vrf }} - {% else %} - None - {% endif %} - {{ object.vrf|linkify|placeholder }}
    @@ -170,7 +138,7 @@
    Cable - {{ object.cable }} + {{ object.cable|linkify }} @@ -180,9 +148,7 @@ {% with iface=object.connected_endpoint %}
    Device - {{ iface.device }} - {{ iface.device|linkify }}
    Name
    LAG - {% if iface.lag%} - {{ iface.lag }} - {% else %} - None - {% endif %} - {{ iface.lag|linkify|placeholder }}
    Description
    Provider{{ ct.circuit.provider }}{{ ct.circuit.provider|linkify }}
    Circuit{{ ct.circuit }}{{ ct.circuit|linkify }}
    Side
    Wireless Link - {{ object.wireless_link }} + {{ object.wireless_link|linkify }} @@ -262,15 +222,11 @@ {% with peer_interface=object.connected_endpoint %}
    Device - {{ peer_interface.device }} - {{ peer_interface.device|linkify }}
    Name - {{ peer_interface }} - {{ peer_interface|linkify }}
    Type
    {% if wlan.group %} - {{ wlan.group }} + {{ wlan.group|linkify }} {% else %} — {% endif %} @@ -443,15 +399,9 @@
    - {{ member.device }} - - {{ member }} - - {{ member.get_type_display }} - {{ member.device|linkify }}{{ member|linkify }}{{ member.get_type_display }}
    - + - + @@ -42,33 +34,15 @@ - + - + - + diff --git a/netbox/templates/dcim/location.html b/netbox/templates/dcim/location.html index 43bbfd114..ca48797d0 100644 --- a/netbox/templates/dcim/location.html +++ b/netbox/templates/dcim/location.html @@ -6,7 +6,7 @@ {% block breadcrumbs %} {{ block.super }} {% for location in object.get_ancestors %} - + {% endfor %} {% endblock %} @@ -37,26 +37,20 @@ - + - + - + - + @@ -62,9 +56,9 @@ - + diff --git a/netbox/templates/ipam/routetarget.html b/netbox/templates/ipam/routetarget.html index 71d6f9601..e093aee61 100644 --- a/netbox/templates/ipam/routetarget.html +++ b/netbox/templates/ipam/routetarget.html @@ -15,13 +15,7 @@ - + diff --git a/netbox/templates/ipam/service.html b/netbox/templates/ipam/service.html index 5a47e44f0..71ea20fa5 100644 --- a/netbox/templates/ipam/service.html +++ b/netbox/templates/ipam/service.html @@ -28,9 +28,7 @@ - + @@ -44,7 +42,7 @@ - + @@ -48,9 +42,9 @@ - diff --git a/netbox/templates/ipam/vrf.html b/netbox/templates/ipam/vrf.html index ae4f65887..07cf74cbb 100644 --- a/netbox/templates/ipam/vrf.html +++ b/netbox/templates/ipam/vrf.html @@ -20,13 +20,7 @@ - + diff --git a/netbox/templates/tenancy/contact.html b/netbox/templates/tenancy/contact.html index 6fa7c03d8..3b97a5a20 100644 --- a/netbox/templates/tenancy/contact.html +++ b/netbox/templates/tenancy/contact.html @@ -19,13 +19,7 @@
    Device - {{ object.device }} - {{ object.device|linkify }}
    Parent Item - {% if object.parent %} - {{ object.parent }} - {% else %} - - {% endif %} - {{ object.parent|linkify|placeholder }}
    Name
    Role - {% if object.role %} - {{ object.role }} - {% else %} - - {% endif %} - {{ object.role|linkify|placeholder }}
    Component - {% if object.component %} - {{ object.component }} - {% else %} - - {% endif %} - {{ object.component|linkify|placeholder }}
    Manufacturer - {% if object.manufacturer %} - {{ object.manufacturer }} - {% else %} - - {% endif %} - {{ object.manufacturer|linkify|placeholder }}
    Part ID
    Site{{ object.site }}{{ object.site|linkify }}
    Parent - {% if object.parent %} - {{ object.parent }} - {% else %} - - {% endif %} - {{ object.parent|linkify|placeholder }}
    Tenant {% if object.tenant %} {% if object.tenant.group %} - {{ object.tenant.group }} / + {{ object.tenant.group|linkify }} / {% endif %} - {{ object.tenant }} + {{ object.tenant|linkify }} {% else %} None {% endif %} diff --git a/netbox/templates/dcim/module.html b/netbox/templates/dcim/module.html index 4a6b7d097..632e37c2c 100644 --- a/netbox/templates/dcim/module.html +++ b/netbox/templates/dcim/module.html @@ -19,21 +19,15 @@ - + - + - + diff --git a/netbox/templates/dcim/modulebay.html b/netbox/templates/dcim/modulebay.html index f4d56e5f2..a12e020e9 100644 --- a/netbox/templates/dcim/modulebay.html +++ b/netbox/templates/dcim/modulebay.html @@ -54,15 +54,11 @@
    Device - {{ object.device }} - {{ object.device|linkify }}
    Device Type - {{ object.device.device_type }} - {{ object.device.device_type|linkify }}
    Module Type - {{ object.module_type }} - {{ object.module_type|linkify }}
    Serial Number
    - + - +
    Manufacturer - {{ module.module_type.manufacturer }} - {{ module.module_type.manufacturer|linkify }}
    Module Type - {{ module.module_type }} - {{ module.module_type|linkify }}
    {% endwith %} diff --git a/netbox/templates/dcim/moduletype.html b/netbox/templates/dcim/moduletype.html index 5d9aef940..59d1139be 100644 --- a/netbox/templates/dcim/moduletype.html +++ b/netbox/templates/dcim/moduletype.html @@ -12,7 +12,7 @@ - + diff --git a/netbox/templates/dcim/platform.html b/netbox/templates/dcim/platform.html index 5180d47c5..8d1e3797a 100644 --- a/netbox/templates/dcim/platform.html +++ b/netbox/templates/dcim/platform.html @@ -37,13 +37,7 @@ - + diff --git a/netbox/templates/dcim/powerfeed.html b/netbox/templates/dcim/powerfeed.html index 5157a5ec0..18945c0a0 100644 --- a/netbox/templates/dcim/powerfeed.html +++ b/netbox/templates/dcim/powerfeed.html @@ -24,19 +24,11 @@
    Manufacturer{{ object.manufacturer }}{{ object.manufacturer|linkify }}
    Model Name
    Manufacturer - {% if object.manufacturer %} - {{ object.manufacturer }} - {% else %} - None - {% endif %} - {{ object.manufacturer|linkify|placeholder }}
    NAPALM Driver
    - + - + @@ -50,7 +42,7 @@ - + diff --git a/netbox/templates/dcim/poweroutlet.html b/netbox/templates/dcim/poweroutlet.html index 1410c3c54..3900d174a 100644 --- a/netbox/templates/dcim/poweroutlet.html +++ b/netbox/templates/dcim/poweroutlet.html @@ -20,19 +20,11 @@
    Power Panel - {{ object.power_panel }} - {{ object.power_panel|linkify }}
    Rack - {% if object.rack %} - {{ object.rack }} - {% else %} - None - {% endif %} - {{ object.rack|linkify|placeholder }}
    TypeConnected Device {% if object.connected_endpoint %} - {{ object.connected_endpoint.device }} ({{ object.connected_endpoint }}) + {{ object.connected_endpoint.device|linkify }} ({{ object.connected_endpoint }}) {% else %} None {% endif %} @@ -122,7 +114,7 @@
    Cable - {{ object.cable }} + {{ object.cable|linkify }} @@ -131,9 +123,7 @@ {% if object.connected_endpoint %}
    Device - {{ object.connected_endpoint.device }} - {{ object.connected_endpoint.device|linkify }}
    Name
    - + - + @@ -80,7 +72,7 @@ - + diff --git a/netbox/templates/dcim/powerpanel.html b/netbox/templates/dcim/powerpanel.html index 02db0e56f..b7fe8eb39 100644 --- a/netbox/templates/dcim/powerpanel.html +++ b/netbox/templates/dcim/powerpanel.html @@ -7,7 +7,7 @@ {{ block.super }} {% if object.location %} - + {% endif %} {% endblock %} @@ -22,19 +22,11 @@
    Device - {{ object.device }} - {{ object.device|linkify }}
    Module - {% if object.module %} - {{ object.module }} - {% else %} - {{ None|placeholder }} - {% endif %} - {{ object.module|linkify|placeholder }}
    Name
    Cable - {{ object.cable }} + {{ object.cable|linkify }} @@ -89,9 +81,7 @@ {% if object.connected_endpoint %}
    Device - {{ object.connected_endpoint.device }} - {{ object.connected_endpoint.device|linkify }}
    Name
    - + - +
    Site - {{ object.site }} - {{ object.site|linkify }}
    Location - {% if object.location %} - {{ object.location }} - {% else %} - None - {% endif %} - {{ object.location|linkify|placeholder }}
    diff --git a/netbox/templates/dcim/powerport.html b/netbox/templates/dcim/powerport.html index f82eb1444..a542b3591 100644 --- a/netbox/templates/dcim/powerport.html +++ b/netbox/templates/dcim/powerport.html @@ -20,19 +20,11 @@ - + - + @@ -80,7 +72,7 @@ - + diff --git a/netbox/templates/dcim/rack.html b/netbox/templates/dcim/rack.html index aa8d3a94f..8b4034bea 100644 --- a/netbox/templates/dcim/rack.html +++ b/netbox/templates/dcim/rack.html @@ -39,9 +39,9 @@ @@ -49,9 +49,9 @@ - + @@ -179,18 +173,10 @@ {% for powerfeed in power_feeds %} - - - + + + + {% with power_port=powerfeed.connected_endpoint %} {% if power_port %} @@ -223,13 +209,7 @@ - + - + - + {% endwith %}
    Device - {{ object.device }} - {{ object.device|linkify }}
    Module - {% if object.module %} - {{ object.module }} - {% else %} - {{ None|placeholder }} - {% endif %} - {{ object.module|linkify|placeholder }}
    Name
    Cable - {{ object.cable }} + {{ object.cable|linkify }} @@ -89,9 +81,7 @@ {% if object.connected_endpoint %}
    Device - {{ object.connected_endpoint.device }} - {{ object.connected_endpoint.device|linkify }}
    NameSite {% if object.site.region %} - {{ object.site.region }} / + {{ object.site.region|linkify }} / {% endif %} - {{ object.site }} + {{ object.site|linkify }}
    {% if object.location %} {% for location in object.location.get_ancestors %} - {{ location }} / + {{ location|linkify }} / {% endfor %} - {{ object.location }} + {{ object.location|linkify }} {% else %} None {% endif %} @@ -66,9 +66,9 @@ {% if object.tenant %} {% if object.tenant.group %} - {{ object.tenant.group }} / + {{ object.tenant.group|linkify }}/ {% endif %} - {{ object.tenant }} + {{ object|linkify }} {% else %} None {% endif %} @@ -80,13 +80,7 @@
    Role - {% if object.role %} - {{ object.role }} - {% else %} - None - {% endif %} - {{ object.role|linkify|placeholder }}
    Serial Number
    - {{ powerfeed.power_panel.name }} - - - {{ powerfeed.name }} - - {% badge powerfeed.get_status_display bg_color=powerfeed.get_status_color %} - - {% badge powerfeed.get_type_display bg_color=powerfeed.get_type_color %} - {{ powerfeed.power_panel|linkify }}{{ powerfeed|linkify }}{% badge powerfeed.get_status_display bg_color=powerfeed.get_status_color %}{% badge powerfeed.get_type_display bg_color=powerfeed.get_type_color %}{% utilization_graph power_port.get_power_draw.allocated|percentage:powerfeed.available_power %} {{ resv.unit_list }} - {% if resv.tenant %} - {{ resv.tenant }} - {% else %} - None - {% endif %} - {{ resv.tenant|linkify|placeholder }} {{ resv.description }}
    {{ resv.user }} · {{ resv.created|annotated_date }} diff --git a/netbox/templates/dcim/rackreservation.html b/netbox/templates/dcim/rackreservation.html index 1e16af675..1464cc00c 100644 --- a/netbox/templates/dcim/rackreservation.html +++ b/netbox/templates/dcim/rackreservation.html @@ -24,26 +24,18 @@
    Site {% if rack.site.region %} - {{ rack.site.region }} / + {{ rack.site.region|linkify }} / {% endif %} - {{ rack.site }} + {{ rack.site|linkify }}
    Location - {% if rack.location %} - {{ rack.location }} - {% else %} - None - {% endif %} - {{ rack.location|linkify|placeholder }}
    Rack - {{ rack }} - {{ rack|linkify }}
    @@ -64,9 +56,9 @@
    {% if object.tenant %} {% if object.tenant.group %} - {{ object.tenant.group }} / + {{ object.tenant.group|linkify }} / {% endif %} - {{ object.tenant }} + {{ object.tenant|linkify }} {% else %} None {% endif %} diff --git a/netbox/templates/dcim/rearport.html b/netbox/templates/dcim/rearport.html index 3be2510d5..3cdccbd7c 100644 --- a/netbox/templates/dcim/rearport.html +++ b/netbox/templates/dcim/rearport.html @@ -20,19 +20,11 @@ - + - + @@ -82,7 +74,7 @@ - + diff --git a/netbox/templates/dcim/site.html b/netbox/templates/dcim/site.html index 41255b4a0..acd4756d1 100644 --- a/netbox/templates/dcim/site.html +++ b/netbox/templates/dcim/site.html @@ -30,9 +30,9 @@ {% for asn in asns %} - + {% endfor %} diff --git a/netbox/templates/dcim/sitegroup.html b/netbox/templates/dcim/sitegroup.html index 49f91b812..396271147 100644 --- a/netbox/templates/dcim/sitegroup.html +++ b/netbox/templates/dcim/sitegroup.html @@ -37,13 +37,7 @@ - + diff --git a/netbox/templates/dcim/trace/circuit.html b/netbox/templates/dcim/trace/circuit.html index 70e191dd2..330099235 100644 --- a/netbox/templates/dcim/trace/circuit.html +++ b/netbox/templates/dcim/trace/circuit.html @@ -1,5 +1,5 @@
    - {{ circuit }}
    + {{ circuit|linkify }}
    Circuit
    - {{ circuit.provider }} + {{ circuit.provider|linkify }}
    diff --git a/netbox/templates/dcim/trace/device.html b/netbox/templates/dcim/trace/device.html index b1d37b76c..30d1d7149 100644 --- a/netbox/templates/dcim/trace/device.html +++ b/netbox/templates/dcim/trace/device.html @@ -1,11 +1,11 @@
    - {{ device }}
    + {{ device|linkify }}
    {{ device.device_type.manufacturer }} {{ device.device_type }}
    - {{ device.site }} + {{ device.site|linkify }} {% if device.location %} - / {{ device.location }} + / {{ device.location|linkify }} {% endif %} {% if device.rack %} - / {{ device.rack }} + / {{ device.rack|linkify }} {% endif %}
    diff --git a/netbox/templates/dcim/trace/object.html b/netbox/templates/dcim/trace/object.html index 72e5b5787..fe9fe002b 100644 --- a/netbox/templates/dcim/trace/object.html +++ b/netbox/templates/dcim/trace/object.html @@ -1,3 +1,3 @@
    - {{ object }} + {{ object|linkify }}
    diff --git a/netbox/templates/dcim/trace/powerpanel.html b/netbox/templates/dcim/trace/powerpanel.html index f5b6230a7..d89b408fb 100644 --- a/netbox/templates/dcim/trace/powerpanel.html +++ b/netbox/templates/dcim/trace/powerpanel.html @@ -1,5 +1,5 @@
    - {{ powerpanel }}
    + {{ powerpanel|linkify }}
    Power Panel
    - {{ powerpanel.site }} + {{ powerpanel.site|linkify }}
    diff --git a/netbox/templates/dcim/trace/termination.html b/netbox/templates/dcim/trace/termination.html index f2dbca87f..3a2dbded2 100644 --- a/netbox/templates/dcim/trace/termination.html +++ b/netbox/templates/dcim/trace/termination.html @@ -1,6 +1,6 @@ {% load helpers %}
    - {{ termination }}
    + {{ termination|linkify }}
    {{ termination|meta:"verbose_name"|bettertitle }} {% if termination.type %} {{ termination.get_type_display }} diff --git a/netbox/templates/dcim/virtualchassis.html b/netbox/templates/dcim/virtualchassis.html index 2e1344f71..4683b775b 100644 --- a/netbox/templates/dcim/virtualchassis.html +++ b/netbox/templates/dcim/virtualchassis.html @@ -27,13 +27,7 @@
    - +
    Device - {{ object.device }} - {{ object.device|linkify }}
    Module - {% if object.module %} - {{ object.module }} - {% else %} - {{ None|placeholder }} - {% endif %} - {{ object.module|linkify|placeholder }}
    Name
    Cable - {{ object.cable }} + {{ object.cable|linkify }} diff --git a/netbox/templates/dcim/region.html b/netbox/templates/dcim/region.html index 10ecb9ea6..8a548dd4a 100644 --- a/netbox/templates/dcim/region.html +++ b/netbox/templates/dcim/region.html @@ -37,13 +37,7 @@
    Parent - {% if object.parent %} - {{ object.parent }} - {% else %} - - {% endif %} - {{ object.parent|linkify|placeholder }}
    Sites {% if object.region %} {% for region in object.region.get_ancestors %} - {{ region }} / + {{ region|linkify }} / {% endfor %} - {{ object.region }} + {{ object.region|linkify }} {% else %} None {% endif %} @@ -43,9 +43,9 @@ {% if object.group %} {% for group in object.group.get_ancestors %} - {{ group }} / + {{ group|linkify }} / {% endfor %} - {{ object.group }} + {{ object.group|linkify }} {% else %} None {% endif %} @@ -60,9 +60,9 @@ {% if object.tenant %} {% if object.tenant.group %} - {{ object.tenant.group }} / + {{ object.tenant.group|linkify }} / {% endif %} - {{ object.tenant }} + {{ object.tenant|linkify }} {% else %} None {% endif %} @@ -242,7 +242,7 @@
    {% for i in location.level|as_range %}{% endfor %} - {{ location }} + {{ location|linkify }} {{ location.rack_count }} @@ -281,7 +281,7 @@
    {{ asn }}{{ asn|linkify }} {{ asn.description|placeholder }}
    Parent - {% if object.parent %} - {{ object.parent }} - {% else %} - - {% endif %} - {{ object.parent|linkify|placeholder }}
    Sites
    Master - {% if object.master %} - {{ object.master }} - {% else %} - - {% endif %} - {{ object.master|linkify }}
    @@ -58,7 +52,7 @@ {% for vc_member in members %}
    - {{ vc_member }} + {{ vc_member|linkify }} {% badge vc_member.vc_position show_empty=True %} diff --git a/netbox/templates/dcim/virtualchassis_edit.html b/netbox/templates/dcim/virtualchassis_edit.html index a37ff102a..327f20531 100644 --- a/netbox/templates/dcim/virtualchassis_edit.html +++ b/netbox/templates/dcim/virtualchassis_edit.html @@ -51,9 +51,7 @@ {% endfor %} {% with device=form.instance virtual_chassis=vc_form.instance %}
    - {{ device }} - {{ device|linkify }} {{ device.pk }} {% if device.rack %} diff --git a/netbox/templates/extras/configcontext.html b/netbox/templates/extras/configcontext.html index 3a9cc2e0c..56ec52c07 100644 --- a/netbox/templates/extras/configcontext.html +++ b/netbox/templates/extras/configcontext.html @@ -56,7 +56,7 @@
      {% for object in objects %} -
    • {{ object }}
    • +
    • {{ object|linkify }}
    • {% empty %}
    • None
    • {% endfor %} diff --git a/netbox/templates/extras/imageattachment_edit.html b/netbox/templates/extras/imageattachment_edit.html index c841b9797..75b2ce48b 100644 --- a/netbox/templates/extras/imageattachment_edit.html +++ b/netbox/templates/extras/imageattachment_edit.html @@ -10,7 +10,7 @@
      - {{ object.parent }} + {{ object.parent|linkify }}
      diff --git a/netbox/templates/extras/journalentry.html b/netbox/templates/extras/journalentry.html index 4a38fb4e3..6d1d9599c 100644 --- a/netbox/templates/extras/journalentry.html +++ b/netbox/templates/extras/journalentry.html @@ -18,21 +18,15 @@ - + - + - + diff --git a/netbox/templates/inc/panels/contacts.html b/netbox/templates/inc/panels/contacts.html index e3e5cf483..26961f04a 100644 --- a/netbox/templates/inc/panels/contacts.html +++ b/netbox/templates/inc/panels/contacts.html @@ -14,9 +14,7 @@ {% for contact in contacts %} - + diff --git a/netbox/templates/ipam/ipaddress.html b/netbox/templates/ipam/ipaddress.html index 779d211f5..05ce7b22d 100644 --- a/netbox/templates/ipam/ipaddress.html +++ b/netbox/templates/ipam/ipaddress.html @@ -38,9 +38,9 @@ - +
      Object - {{ object.assigned_object }} - {{ object.assigned_object|linkify }}
      Created - {{ object.created|annotated_date }} - {{ object.created|annotated_date }}
      Created By - {{ object.created_by }} - {{ object.created_by }}
      Kind
      - {{ contact.contact }} - {{ contact.contact|linkify }} {{ contact.role|placeholder }} {{ contact.get_priority_display|placeholder }} diff --git a/netbox/templates/inc/panels/custom_fields.html b/netbox/templates/inc/panels/custom_fields.html index 88a4660f2..e0c7076ca 100644 --- a/netbox/templates/inc/panels/custom_fields.html +++ b/netbox/templates/inc/panels/custom_fields.html @@ -27,11 +27,11 @@ {% elif field.type == 'multiselect' and value %} {{ value|join:", " }} {% elif field.type == 'object' and value %} - {{ value }} + {{ value|linkify }} {% elif field.type == 'multiobject' and value %}
        {% for obj in value %} -
      • {{ obj }}
      • +
      • {{ obj|linkify }}
      • {% endfor %}
      {% elif value %} diff --git a/netbox/templates/ipam/aggregate.html b/netbox/templates/ipam/aggregate.html index 9f657c911..2ec12284e 100644 --- a/netbox/templates/ipam/aggregate.html +++ b/netbox/templates/ipam/aggregate.html @@ -31,9 +31,9 @@
      {% if object.tenant %} {% if prefix.object.group %} - {{ object.tenant.group }} / + {{ object.tenant.group|linkify }} / {% endif %} - {{ object.tenant }} + {{ object.tenant|linkify }} {% else %} None {% endif %} diff --git a/netbox/templates/ipam/asn.html b/netbox/templates/ipam/asn.html index 4a1ecda0d..35cfa5e64 100644 --- a/netbox/templates/ipam/asn.html +++ b/netbox/templates/ipam/asn.html @@ -30,10 +30,10 @@ Tenant {% if object.tenant %} - {% if prefix.object.group %} - {{ object.tenant.group }} / + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / {% endif %} - {{ object.tenant }} + {{ object.tenant|linkify }} {% else %} None {% endif %} diff --git a/netbox/templates/ipam/inc/panels/fhrp_groups.html b/netbox/templates/ipam/inc/panels/fhrp_groups.html index 6583694ef..63397a6f5 100644 --- a/netbox/templates/ipam/inc/panels/fhrp_groups.html +++ b/netbox/templates/ipam/inc/panels/fhrp_groups.html @@ -24,7 +24,7 @@ {% for ipaddress in assignment.group.ip_addresses.all %} - {{ ipaddress }} + {{ ipaddress|linkify }} {% if not forloop.last %}
      {% endif %} {% endfor %}
      {% if object.tenant %} {% if object.tenant.group %} - {{ object.tenant.group }} / + {{ object.tenant.group|linkify }} / {% endif %} - {{ object.tenant }} + {{ object.tenant|linkify }} {% else %} None {% endif %} @@ -73,9 +73,9 @@ {% if object.assigned_object %} {% if object.assigned_object.parent_object %} - {{ object.assigned_object.parent_object }} / + {{ object.assigned_object.parent_object|linkify }} / {% endif %} - {{ object.assigned_object }} + {{ object.assigned_object|linkify }} {% else %} {% endif %} @@ -85,9 +85,9 @@ NAT (inside) {% if object.nat_inside %} - {{ object.nat_inside }} + {{ object.nat_inside|linkify }} {% if object.nat_inside.assigned_object %} - ({{ object.nat_inside.assigned_object.parent_object }}) + ({{ object.nat_inside.assigned_object.parent_object|linkify }}) {% endif %} {% else %} None @@ -96,13 +96,7 @@
      NAT (outside) - {% if object.nat_outside %} - {{ object.nat_outside }} - {% else %} - None - {% endif %} - {{ object.nat_outside|linkify|placeholder }}
      diff --git a/netbox/templates/ipam/iprange.html b/netbox/templates/ipam/iprange.html index e4f27d68c..6e27227e5 100644 --- a/netbox/templates/ipam/iprange.html +++ b/netbox/templates/ipam/iprange.html @@ -37,7 +37,7 @@
    VRF {% if object.vrf %} - {{ object.vrf }} ({{ object.vrf.rd }}) + {{ object.vrf|linkify }} ({{ object.vrf.rd }}) {% else %} Global {% endif %} @@ -45,13 +45,7 @@
    Role - {% if object.role %} - {{ object.role }} - {% else %} - None - {% endif %} - {{ object.role|linkify|placeholder }}
    Status {% if object.tenant %} {% if object.tenant.group %} - {{ object.tenant.group }} / + {{ object.tenant.group|linkify }} / {% endif %} - {{ object.tenant }} + {{ object.tenant|linkify }} {% else %} None {% endif %} diff --git a/netbox/templates/ipam/prefix.html b/netbox/templates/ipam/prefix.html index ba3e84911..0c86fa196 100644 --- a/netbox/templates/ipam/prefix.html +++ b/netbox/templates/ipam/prefix.html @@ -29,9 +29,9 @@ {% if object.tenant %} {% if object.tenant.group %} - {{ object.tenant.group }} / + {{ object.tenant.group|linkify }} / {% endif %} - {{ object.tenant }} + {{ object.tenant|linkify }} {% else %} None {% endif %} @@ -52,9 +52,9 @@ {% if object.site %} {% if object.site.region %} - {{ object.site.region }} / + {{ object.site.region|linkify }} / {% endif %} - {{ object.site }} + {{ object.site|linkify }} {% else %} None {% endif %} @@ -65,9 +65,9 @@ {% if object.vlan %} {% if object.vlan.group %} - {{ object.vlan.group }} / + {{ object.vlan.group|linkify }} / {% endif %} - {{ object.vlan }} + {{ object.vlan|linkify }} {% else %} None {% endif %} @@ -79,13 +79,7 @@
    Role - {% if object.role %} - {{ object.role }} - {% else %} - None - {% endif %} - {{ object.role|linkify|placeholder }}
    Description
    Tenant - {% if object.tenant %} - {{ object.tenant }} - {% else %} - None - {% endif %} - {{ object.tenant|linkify|placeholder }}
    Description
    Parent - {{ object.parent }} - {{ object.parent|linkify }}
    ProtocolIP Addresses {% for ipaddress in object.ipaddresses.all %} - {{ ipaddress }}
    + {{ ipaddress|linkify }}
    {% empty %} None {% endfor %} diff --git a/netbox/templates/ipam/vlan.html b/netbox/templates/ipam/vlan.html index dc19bd34e..ceb291cfe 100644 --- a/netbox/templates/ipam/vlan.html +++ b/netbox/templates/ipam/vlan.html @@ -17,9 +17,9 @@
    {% if object.site %} {% if object.site.region %} - {{ object.site.region }} / + {{ object.site.region|linkify }} / {% endif %} - {{ object.site }} + {{ object.site|linkify }} {% else %} None {% endif %} @@ -27,13 +27,7 @@
    Group - {% if object.group %} - {{ object.group }} - {% else %} - None - {% endif %} - {{ object.group|linkify|placeholder }}
    VLAN ID {% if object.tenant %} {% if object.tenant.group %} - {{ object.tenant.group }} / + {{ object.tenant.group|linkify }} / {% endif %} - {{ object.tenant }} + {{ object.tenant|linkify }} {% else %} None {% endif %} diff --git a/netbox/templates/ipam/vlangroup.html b/netbox/templates/ipam/vlangroup.html index f92afce46..822b4a046 100644 --- a/netbox/templates/ipam/vlangroup.html +++ b/netbox/templates/ipam/vlangroup.html @@ -7,7 +7,7 @@ {{ block.super }} {% if object.scope %} {# TODO: This should link to a filtered list of VLANGroups #} - + {% endif %} {% endblock %} @@ -36,12 +36,7 @@
    Scope - {% if object.scope %} - {{ object.scope }} - {% else %} - - {% endif %} + {{ object.scope|linkify|placeholder }}
    Permitted VIDs
    Tenant - {% if object.tenant %} - {{ object.tenant }} - {% else %} - None - {% endif %} - {{ object.tenant|linkify|placeholder }}
    Unique IP Space
    - + diff --git a/netbox/templates/tenancy/contactgroup.html b/netbox/templates/tenancy/contactgroup.html index 7aed8182b..3f13dc932 100644 --- a/netbox/templates/tenancy/contactgroup.html +++ b/netbox/templates/tenancy/contactgroup.html @@ -29,13 +29,7 @@ - + diff --git a/netbox/templates/tenancy/tenant.html b/netbox/templates/tenancy/tenant.html index fb83a346f..e4c1db006 100644 --- a/netbox/templates/tenancy/tenant.html +++ b/netbox/templates/tenancy/tenant.html @@ -20,13 +20,7 @@
    Group - {% if object.group %} - {{ object.group }} - {% else %} - None - {% endif %} - {{ object.group|linkify|placeholder }}
    Name
    Parent - {% if object.parent %} - {{ object.parent }} - {% else %} - - {% endif %} - {{ object.parent|linkify|placeholder }}
    Contacts
    - + diff --git a/netbox/templates/tenancy/tenantgroup.html b/netbox/templates/tenancy/tenantgroup.html index 653c40a87..25f1fef1b 100644 --- a/netbox/templates/tenancy/tenantgroup.html +++ b/netbox/templates/tenancy/tenantgroup.html @@ -37,13 +37,7 @@ - + diff --git a/netbox/templates/virtualization/cluster.html b/netbox/templates/virtualization/cluster.html index b7af89bb2..8384d352f 100644 --- a/netbox/templates/virtualization/cluster.html +++ b/netbox/templates/virtualization/cluster.html @@ -17,37 +17,19 @@ - + - + - + - + diff --git a/netbox/templates/virtualization/virtualmachine.html b/netbox/templates/virtualization/virtualmachine.html index 22dd27b97..ccb769167 100644 --- a/netbox/templates/virtualization/virtualmachine.html +++ b/netbox/templates/virtualization/virtualmachine.html @@ -23,32 +23,20 @@ - + - + diff --git a/netbox/templates/virtualization/vminterface.html b/netbox/templates/virtualization/vminterface.html index 6d10ce91e..635654f86 100644 --- a/netbox/templates/virtualization/vminterface.html +++ b/netbox/templates/virtualization/vminterface.html @@ -21,9 +21,7 @@
    Group - {% if object.group %} - {{ object.group }} - {% else %} - None - {% endif %} - {{ object.group|linkify|placeholder }}
    Description
    Parent - {% if object.parent %} - {{ object.parent }} - {% else %} - - {% endif %} - {{ object.parent|linkify|placeholder }}
    Tenants
    Type{{ object.type }}{{ object.type|linkify }}
    Group - {% if object.group %} - {{ object.group }} - {% else %} - None - {% endif %} - {{ object.group|linkify }}
    Tenant - {% if object.tenant %} - {{ object.tenant }} - {% else %} - None - {% endif %} - {{ object.tenant|linkify }}
    Site - {% if object.site %} - {{ object.site }} - {% else %} - None - {% endif %} - {{ object.site|linkify }}
    Virtual Machines
    Role - {% if object.role %} - {{ object.role }} - {% else %} - None - {% endif %} - {{ object.role|linkify|placeholder }}
    Platform - {% if object.platform %} - {{ object.platform }} - {% else %} - None - {% endif %} - {{ object.platform|linkify|placeholder }}
    Tenant {% if object.tenant %} {% if object.tenant.group %} - {{ object.tenant.group }} / + {{ object.tenant.group|linkify }} / {% endif %} - {{ object.tenant }} + {{ object.tenant|linkify }} {% else %} None {% endif %} @@ -103,9 +91,9 @@ Cluster {% if object.cluster.group %} - {{ object.cluster.group }} / + {{ object.cluster.group|linkify }} / {% endif %} - {{ object.cluster }} + {{ object.cluster|linkify }}
    - + @@ -41,33 +39,15 @@ - + - + - + diff --git a/netbox/templates/wireless/inc/wirelesslink_interface.html b/netbox/templates/wireless/inc/wirelesslink_interface.html index e33047539..db4f84f0a 100644 --- a/netbox/templates/wireless/inc/wirelesslink_interface.html +++ b/netbox/templates/wireless/inc/wirelesslink_interface.html @@ -3,15 +3,11 @@
    Virtual Machine - {{ object.virtual_machine }} - {{ object.virtual_machine|linkify }}
    Name
    Parent - {% if object.parent %} - {{ object.parent }} - {% else %} - None - {% endif %} - {{ object.parent|linkify|placeholder }}
    Bridge - {% if object.bridge %} - {{ object.bridge }} - {% else %} - None - {% endif %} - {{ object.bridge|linkify|placeholder }}
    VRF - {% if object.vrf %} - {{ object.vrf }} - {% else %} - None - {% endif %} - {{ object.vrf|linkify|placeholder }}
    Description
    - + - + diff --git a/netbox/templates/wireless/wirelesslan.html b/netbox/templates/wireless/wirelesslan.html index a55d22974..185a44904 100644 --- a/netbox/templates/wireless/wirelesslan.html +++ b/netbox/templates/wireless/wirelesslan.html @@ -16,13 +16,7 @@ - + @@ -30,13 +24,7 @@ - +
    Device - {{ interface.device }} - {{ interface.device|linkify }}
    Interface - {{ interface }} - {{ interface|linkify }}
    Type
    Group - {% if object.group %} - {{ object.group }} - {% else %} - None - {% endif %} - {{ object.group|linkify|placeholder }}
    Description
    VLAN - {% if object.vlan %} - {{ object.vlan }} - {% else %} - None - {% endif %} - {{ object.vlan|linkify|placeholder }}
    diff --git a/netbox/templates/wireless/wirelesslangroup.html b/netbox/templates/wireless/wirelesslangroup.html index 226b39b1b..2b8de0fb8 100644 --- a/netbox/templates/wireless/wirelesslangroup.html +++ b/netbox/templates/wireless/wirelesslangroup.html @@ -35,13 +35,7 @@ Parent - - {% if object.parent %} - {{ object.parent }} - {% else %} - - {% endif %} - + {{ object.parent|linkify|placeholder }} Wireless LANs diff --git a/netbox/utilities/templatetags/builtins/filters.py b/netbox/utilities/templatetags/builtins/filters.py index afb40a308..eba0daa0e 100644 --- a/netbox/utilities/templatetags/builtins/filters.py +++ b/netbox/utilities/templatetags/builtins/filters.py @@ -20,6 +20,18 @@ register = template.Library() # General # +@register.filter() +def linkify(instance): + """ + Render a hyperlink for object's with a `get_absolute_url()` method, using the object's string representation + as the link's text. If the object has no `get_absolute_url()` method, return an empty string. + """ + try: + return mark_safe(f'{instance}') + except (AttributeError, TypeError): + return '' + + @register.filter() def bettertitle(value): """