mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Standardize on get_FOO_color() method for returning ChoiceField colors
This commit is contained in:
@@ -19,9 +19,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Status</th>
|
||||
<td>
|
||||
<span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
|
||||
</td>
|
||||
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Tenant</th>
|
||||
|
@@ -163,9 +163,7 @@
|
||||
<table class="table table-hover attr-table">
|
||||
<tr>
|
||||
<th scope="row">Status</th>
|
||||
<td>
|
||||
<span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
|
||||
</td>
|
||||
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Role</th>
|
||||
|
@@ -40,15 +40,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Type</th>
|
||||
<td>
|
||||
<span class="badge bg-{{ object.get_type_class }}">{{ object.get_type_display }}</span>
|
||||
</td>
|
||||
<td>{% badge object.get_type_display bg_color=object.get_type_color %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Status</th>
|
||||
<td>
|
||||
<span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
|
||||
</td>
|
||||
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Connected Device</th>
|
||||
|
@@ -76,9 +76,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Status</th>
|
||||
<td>
|
||||
<span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
|
||||
</td>
|
||||
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Role</th>
|
||||
@@ -188,10 +186,10 @@
|
||||
<a href="{{ powerfeed.get_absolute_url }}">{{ powerfeed.name }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-{{ powerfeed.get_status_class }}">{{ powerfeed.get_status_display }}</span>
|
||||
{% badge powerfeed.get_status_display bg_color=powerfeed.get_status_color %}
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-{{ powerfeed.get_type_class }}">{{ powerfeed.get_type_display }}</span>
|
||||
{% badge powerfeed.get_type_display bg_color=powerfeed.get_type_color %}
|
||||
</td>
|
||||
{% with power_port=powerfeed.connected_endpoint %}
|
||||
{% if power_port %}
|
||||
|
@@ -53,9 +53,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Status</th>
|
||||
<td>
|
||||
<span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
|
||||
</td>
|
||||
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Tenant</th>
|
||||
|
@@ -12,7 +12,7 @@
|
||||
{% if cable.length %}
|
||||
({{ cable.length|floatformat }} {{ cable.get_length_unit_display }})<br />
|
||||
{% endif %}
|
||||
<span class="badge bg-{{ cable.get_status_class }}">{{ cable.get_status_display }}</span><br />
|
||||
{% badge object.get_status_display bg_color=object.get_status_color %}<br />
|
||||
{% for tag in cable.tags.all %}
|
||||
{% tag tag 'dcim:cable_list' %}
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user