瀏覽代碼

Linkify connected object

Jeremy Stretch 4 年之前
父節點
當前提交
cd64fcac8d
共有 1 個文件被更改,包括 2 次插入7 次删除
  1. 2 7
      netbox/templates/circuits/inc/circuit_termination.html

+ 2 - 7
netbox/templates/circuits/inc/circuit_termination.html

@@ -55,13 +55,8 @@
                                 <i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
                             </a>
                             {% with peer=termination.get_cable_peer %}
-                                to
-                                {% if peer.device %}
-                                    <a href="{{ peer.device.get_absolute_url }}">{{ peer.device }}</a>
-                                {% elif peer.circuit %}
-                                    <a href="{{ peer.circuit.get_absolute_url }}">{{ peer.circuit }}</a>
-                                {% endif %}
-                                ({{ peer }})
+                                to <a href="{{ peer.parent_object.get_absolute_url }}">{{ peer.parent_object }}</a>
+                                / {% if peer.get_absolute_url %}<a href="{{ peer.get_absolute_url }}">{{ peer }}</a>{% else %}{{ peer }}{% endif %}
                             {% endwith %}
                         {% else %}
                             {% if perms.dcim.add_cable %}