Merge pull request #4026 from hSaria/4025-cable-status-class

Fixes #4025: Cable status class
This commit is contained in:
Jeremy Stretch 2020-01-28 13:34:46 -05:00 committed by GitHub
commit e7ef142620
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 9 additions and 9 deletions

View File

@ -32,7 +32,7 @@
{% if cable.label %}<code>{{ cable.label }}</code>{% else %}Cable #{{ cable.pk }}{% endif %} {% if cable.label %}<code>{{ cable.label }}</code>{% else %}Cable #{{ cable.pk }}{% endif %}
</a> </a>
</h4> </h4>
<p><span class="label label-{% if cable.status %}success{% else %}info{% endif %}">{{ cable.get_status_display }}</span></p> <p><span class="label label-{{ cable.get_status_class }}">{{ cable.get_status_display }}</span></p>
<p>{{ cable.get_type_display|default:"" }}</p> <p>{{ cable.get_type_display|default:"" }}</p>
{% if cable.length %}{{ cable.length }} {{ cable.get_length_unit_display }}{% endif %} {% if cable.length %}{{ cable.length }} {{ cable.get_length_unit_display }}{% endif %}
{% if cable.color %} {% if cable.color %}

View File

@ -1,5 +1,5 @@
{% if perms.dcim.change_cable %} {% if perms.dcim.change_cable %}
{% if cable.status %} {% if cable.status == 'connected' %}
<a href="#" class="btn btn-warning btn-xs cable-toggle connected" title="Mark planned" data="{{ cable.pk }}"> <a href="#" class="btn btn-warning btn-xs cable-toggle connected" title="Mark planned" data="{{ cable.pk }}">
<i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i> <i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i>
</a> </a>

View File

@ -1,4 +1,4 @@
<tr class="consoleport{% if cp.cable.status %} success{% elif cp.cable %} info{% endif %}"> <tr class="consoleport{% if cp.cable %} {{ cp.cable.get_status_class }}{% endif %}">
{# Name #} {# Name #}
<td> <td>

View File

@ -1,6 +1,6 @@
{% load helpers %} {% load helpers %}
<tr class="consoleserverport{% if csp.cable.status %} success{% elif csp.cable %} info{% endif %}"> <tr class="consoleserverport{% if csp.cable %} {{ csp.cable.get_status_class }}{% endif %}">
{# Checkbox #} {# Checkbox #}
{% if perms.dcim.change_consoleserverport or perms.dcim.delete_consoleserverport %} {% if perms.dcim.change_consoleserverport or perms.dcim.delete_consoleserverport %}

View File

@ -1,5 +1,5 @@
{% load helpers %} {% load helpers %}
<tr class="frontport{% if frontport.cable.status %} success{% elif frontport.cable %} info{% endif %}"> <tr class="frontport{% if frontport.cable %} {{ frontport.cable.get_status_class }}{% endif %}">
{# Checkbox #} {# Checkbox #}
{% if perms.dcim.change_frontport or perms.dcim.delete_frontport %} {% if perms.dcim.change_frontport or perms.dcim.delete_frontport %}

View File

@ -1,5 +1,5 @@
{% load helpers %} {% load helpers %}
<tr class="interface{% if not iface.enabled %} danger{% elif iface.cable.status %} success{% elif iface.cable %} info{% elif iface.is_virtual %} warning{% endif %}" id="interface_{{ iface.name }}"> <tr class="interface{% if not iface.enabled %} danger{% elif iface.cable %} {{ iface.cable.get_status_class }}{% elif iface.is_virtual %} warning{% endif %}" id="interface_{{ iface.name }}">
{# Checkbox #} {# Checkbox #}
{% if perms.dcim.change_interface or perms.dcim.delete_interface %} {% if perms.dcim.change_interface or perms.dcim.delete_interface %}

View File

@ -1,6 +1,6 @@
{% load helpers %} {% load helpers %}
<tr class="poweroutlet{% if po.cable.status %} success{% elif po.cable %} info{% endif %}"> <tr class="poweroutlet{% if po.cable %} {{ po.cable.get_status_class }}{% endif %}">
{# Checkbox #} {# Checkbox #}
{% if perms.dcim.change_poweroutlet or perms.dcim.delete_poweroutlet %} {% if perms.dcim.change_poweroutlet or perms.dcim.delete_poweroutlet %}

View File

@ -1,4 +1,4 @@
<tr class="powerport{% if pp.cable.status %} success{% elif pp.cable %} info{% endif %}"> <tr class="powerport{% if pp.cable %} {{ pp.cable.get_status_class }}{% endif %}">
{# Name #} {# Name #}
<td> <td>

View File

@ -1,5 +1,5 @@
{% load helpers %} {% load helpers %}
<tr class="rearport{% if rearport.cable.status %} success{% elif rearport.cable %} info{% endif %}"> <tr class="rearport{% if rearport.cable %} {{ rearport.cable.get_status_class }}{% endif %}">
{# Checkbox #} {# Checkbox #}
{% if perms.dcim.change_rearport or perms.dcim.delete_rearport %} {% if perms.dcim.change_rearport or perms.dcim.delete_rearport %}