Optimized front/rear port connection displays

This commit is contained in:
Jeremy Stretch 2018-10-29 12:56:17 -04:00
parent dfffb04b9c
commit 9ad167016c
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 %}"> <tr class="frontport{% if cable %} {% if cable.status %}success{% else %}info{% endif %}{% endif %}">
{# Checkbox #} {# Checkbox #}
@ -22,8 +21,8 @@
{# Cable #} {# Cable #}
<td> <td>
{% if cable %} {% if frontport.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 }} <a href="{{ frontport.cable.get_absolute_url }}">{{ frontport.cable }}</a>
{% else %} {% else %}
<span class="text-muted">Not connected</span> <span class="text-muted">Not connected</span>
{% endif %} {% endif %}
@ -43,4 +42,3 @@
{% endif %} {% endif %}
</td> </td>
</tr> </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 %}"> <tr class="rearport{% if cable %} {% if cable.status %}success{% else %}info{% endif %}{% endif %}">
{# Checkbox #} {# Checkbox #}
@ -21,8 +20,8 @@
{# Cable #} {# Cable #}
<td> <td>
{% if cable %} {% if rearport.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 }} <a href="{{ rearport.cable.get_absolute_url }}">{{ rearport.cable }}</a>
{% else %} {% else %}
<span class="text-muted">Not connected</span> <span class="text-muted">Not connected</span>
{% endif %} {% endif %}
@ -42,4 +41,3 @@
{% endif %} {% endif %}
</td> </td>
</tr> </tr>
{% endwith %}