Optimized front/rear port connection displays

This commit is contained in:
Jeremy Stretch 2018-10-29 12:56:17 -04:00
parent 05431aa83b
commit 17a71d3e26
2 changed files with 81 additions and 85 deletions

View File

@ -1,4 +1,3 @@
{% with cable=frontport.get_connected_cable %}
<tr class="frontport{% if cable %} {% if cable.status %}success{% else %}info{% endif %}{% endif %}">
{# Checkbox #}
@ -22,8 +21,8 @@
{# Cable #}
<td>
{% if cable %}
<a href="{{ cable.get_absolute_url }}">{{ cable }}</a> to <a href="{{ cable.far_end.device.get_absolute_url }}">{{ cable.far_end.device }}</a> {{ cable.far_end }}
{% if frontport.cable %}
<a href="{{ frontport.cable.get_absolute_url }}">{{ frontport.cable }}</a>
{% else %}
<span class="text-muted">Not connected</span>
{% endif %}
@ -43,4 +42,3 @@
{% endif %}
</td>
</tr>
{% endwith %}

View File

@ -1,4 +1,3 @@
{% with cable=rearport.get_connected_cable %}
<tr class="rearport{% if cable %} {% if cable.status %}success{% else %}info{% endif %}{% endif %}">
{# Checkbox #}
@ -21,8 +20,8 @@
{# Cable #}
<td>
{% if cable %}
<a href="{{ cable.get_absolute_url }}">{{ cable }}</a> to <a href="{{ cable.far_end.device.get_absolute_url }}">{{ cable.far_end.device }}</a> {{ cable.far_end }}
{% if rearport.cable %}
<a href="{{ rearport.cable.get_absolute_url }}">{{ rearport.cable }}</a>
{% else %}
<span class="text-muted">Not connected</span>
{% endif %}
@ -42,4 +41,3 @@
{% endif %}
</td>
</tr>
{% endwith %}