Переглянути джерело

Closes #5411: Include cable tags in trace view

Jeremy Stretch 5 роки тому
батько
коміт
2c7fc5df75

+ 4 - 0
docs/release-notes/version-2.10.md

@@ -2,6 +2,10 @@
 
 
 ## v2.10-beta3 (FUTURE)
 ## v2.10-beta3 (FUTURE)
 
 
+### Enhancements
+
+* [#5411](https://github.com/netbox-community/netbox/issues/5411) - Include cable tags in trace view
+
 ### Bug Fixes
 ### Bug Fixes
 
 
 * [#5417](https://github.com/netbox-community/netbox/issues/5417) - Fix exception when viewing a device installed within a device bay
 * [#5417](https://github.com/netbox-community/netbox/issues/5417) - Fix exception when viewing a device installed within a device bay

+ 10 - 6
netbox/templates/dcim/trace/cable.html

@@ -1,3 +1,5 @@
+{% load helpers %}
+
 <div class="cable" style="border-left-color: #{{ cable.color|default:'606060' }}; {% if cable.status != 'connected' %} border-left-style: dashed{% endif %}">
 <div class="cable" style="border-left-color: #{{ cable.color|default:'606060' }}; {% if cable.status != 'connected' %} border-left-style: dashed{% endif %}">
     <strong>
     <strong>
         <a href="{% url 'dcim:cable' pk=cable.pk %}">
         <a href="{% url 'dcim:cable' pk=cable.pk %}">
@@ -5,11 +7,13 @@
         </a>
         </a>
     </strong><br />
     </strong><br />
     {% if cable.type %}
     {% if cable.type %}
-        {{ cable.get_type_display|default:"" }}
-        {% if cable.length %}
-            ({{ cable.length }} {{ cable.get_length_unit_display }})
-        {% endif %}
-        <br />
+        {{ cable.get_type_display|default:"" }}<br />
     {% endif %}
     {% endif %}
-    <span class="label label-{{ cable.get_status_class }}">{{ cable.get_status_display }}</span>
+    {% if cable.length %}
+        ({{ cable.length }} {{ cable.get_length_unit_display }})<br />
+    {% endif %}
+    <span class="label label-{{ cable.get_status_class }}">{{ cable.get_status_display }}</span><br />
+    {% for tag in cable.tags.all %}
+        {% tag tag 'dcim:cable_list' %}
+    {% endfor %}
 </div>
 </div>