Fix badge background colors in table content

This commit is contained in:
Jeremy Stretch 2024-01-05 11:20:16 -05:00
parent ee4842e08d
commit cdbf1950a6
4 changed files with 7 additions and 7 deletions

View File

@ -21,16 +21,16 @@ WEIGHT = """
""" """
DEVICE_LINK = """ DEVICE_LINK = """
{{ value|default:'<span class="badge bg-info">Unnamed device</span>' }} {{ value|default:'<span class="badge text-bg-info">Unnamed device</span>' }}
""" """
DEVICEBAY_STATUS = """ DEVICEBAY_STATUS = """
{% if record.installed_device_id %} {% if record.installed_device_id %}
<span class="badge bg-{{ record.installed_device.get_status_color }}"> <span class="badge text-bg-{{ record.installed_device.get_status_color }}">
{{ record.installed_device.get_status_display }} {{ record.installed_device.get_status_display }}
</span> </span>
{% else %} {% else %}
<span class="badge bg-secondary">Vacant</span> <span class="badge text-bg-secondary">Vacant</span>
{% endif %} {% endif %}
""" """
@ -38,7 +38,7 @@ INTERFACE_IPADDRESSES = """
<div class="table-badge-group"> <div class="table-badge-group">
{% for ip in value.all %} {% for ip in value.all %}
{% if ip.status != 'active' %} {% if ip.status != 'active' %}
<a href="{{ ip.get_absolute_url }}" class="table-badge badge bg-{{ ip.get_status_color }}" data-bs-toggle="tooltip" data-bs-placement="left" title="{{ ip.get_status_display }}">{{ ip }}</a> <a href="{{ ip.get_absolute_url }}" class="table-badge badge text-bg-{{ ip.get_status_color }}" data-bs-toggle="tooltip" data-bs-placement="left" title="{{ ip.get_status_display }}">{{ ip }}</a>
{% else %} {% else %}
<a href="{{ ip.get_absolute_url }}" class="table-badge">{{ ip }}</a> <a href="{{ ip.get_absolute_url }}" class="table-badge">{{ ip }}</a>
{% endif %} {% endif %}

View File

@ -18,7 +18,7 @@ __all__ = (
'RoleTable', 'RoleTable',
) )
AVAILABLE_LABEL = mark_safe('<span class="badge bg-success">Available</span>') AVAILABLE_LABEL = mark_safe('<span class="badge text-bg-success">Available</span>')
AGGREGATE_COPY_BUTTON = """ AGGREGATE_COPY_BUTTON = """
{% copy_content record.pk prefix="aggregate_" %} {% copy_content record.pk prefix="aggregate_" %}

View File

@ -18,7 +18,7 @@ __all__ = (
'VLANVirtualMachinesTable', 'VLANVirtualMachinesTable',
) )
AVAILABLE_LABEL = mark_safe('<span class="badge bg-success">Available</span>') AVAILABLE_LABEL = mark_safe('<span class="badge text-bg-success">Available</span>')
VLAN_LINK = """ VLAN_LINK = """
{% if record.pk %} {% if record.pk %}

View File

@ -1,6 +1,6 @@
SEARCH_RESULT_ATTRS = """ SEARCH_RESULT_ATTRS = """
{% for name, value in record.display_attrs.items %} {% for name, value in record.display_attrs.items %}
<span class="badge bg-secondary" <span class="badge text-bg-secondary"
{% if value|length > 40 %} data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{ value }}"{% endif %} {% if value|length > 40 %} data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{ value }}"{% endif %}
> >
{{ name|bettertitle }}: {{ name|bettertitle }}: