ui: Drop use of badge-* utility classes for newer replacements

- Keep the badge-{severity} classes as they are meant for convenience of mapping
severity to style.

- Match bootstrap colors to maintain consistency and contrast.

Tests:

- Visually confirm that all the changes effective.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa authored and Veiko Aasa committed 2024-12-12 12:30:28 +02:00
1 parent 65165f4b42
commit 4d71e80b1e
13 files changed
+43 -51

No files matched your search

@@ -18,13 +18,13 @@
<td>{{ result.translated_description }}</td>
<td class="diagnostics-result">
{% if result.result == 'passed' %}
<span class="badge badge-success">{% trans result.result %}</span>
<span class="badge text-bg-success">{% trans result.result %}</span>
{% elif result.result == 'failed' %}
<span class="badge badge-danger">{% trans result.result %}</span>
<span class="badge text-bg-danger">{% trans result.result %}</span>
{% elif result.result == 'error' or result.result == 'warning' %}
<span class="badge badge-warning">{% trans result.result %}</span>
<span class="badge text-bg-warning">{% trans result.result %}</span>
{% elif result.result == 'skipped' %}
<span class="badge badge-secondary">{% trans result.result %}</span>
<span class="badge text-bg-secondary">{% trans result.result %}</span>
{% else %}
{{ result.result }}
{% endif %}
@@ -28,11 +28,11 @@
<td>{{ domain.timestamp|timesince }}</td>
<td>
{% if domain.result %}
<span class="badge badge-success">
<span class="badge text-bg-success">
{% trans "Success" %}
</span>
{% else %}
<span class="badge badge-warning">
<span class="badge text-bg-warning">
{% trans "Failed" %}
</span>
{% endif %}
@@ -36,10 +36,10 @@
</td>
<td class="app-status">
{% if component.is_enabled %}
<span class='badge badge-success'>
<span class='badge text-bg-success'>
{% trans "Enabled" %}</span>
{% else %}
<span class='badge badge-warning'>
<span class='badge text-bg-warning'>
{% trans "Disabled" %}</span>
{% endif %}
</td>
@@ -54,16 +54,16 @@
</td>
<td class="service-status">
{% if port.name in internal_enabled_ports and port.name in external_enabled_ports %}
<span class='badge badge-success'>
<span class='badge text-bg-success'>
{% trans "Permitted" %}</span>
{% elif port.name in internal_enabled_ports %}
<span class='badge badge-warning'>
<span class='badge text-bg-warning'>
{% trans "Permitted (internal only)" %}</span>
{% elif port.name in external_enabled_ports %}
<span class='badge badge-warning'>
<span class='badge text-bg-warning'>
{% trans "Permitted (external only)" %}</span>
{% else %}
<span class='badge badge-danger'>
<span class='badge text-bg-danger'>
{% trans "Blocked" %}</span>
{% endif %}
</td>
@@ -33,13 +33,13 @@
<td>{{ domain }}</td>
<td>
{% if domain_status.certificate_available and domain_status.validity == "valid" %}
<span class="badge badge-success">
<span class="badge text-bg-success">
{% blocktrans trimmed with expiry_date=domain_status.expiry_date %}
Valid, expires on {{ expiry_date }}
{% endblocktrans %}
</span>
{% elif domain_status.certificate_available and not domain_status.validity == "valid" %}
<span class="badge badge-warning">
<span class="badge text-bg-warning">
{% if "revoked" in domain_status.validity %}
{% blocktrans trimmed %}
Revoked
@@ -59,16 +59,16 @@
{% endif %}
</span>
{% else %}
<span class="badge badge-warning">
<span class="badge text-bg-warning">
{% trans "No certificate" %}
</span>
{% endif %}
</td>
<td>
{% if domain_status.web_enabled %}
<span class="badge badge-success">{% trans "Enabled" %}</span>
<span class="badge text-bg-success">{% trans "Enabled" %}</span>
{% else %}
<span class="badge badge-warning">{% trans "Disabled" %}</span>
<span class="badge text-bg-warning">{% trans "Disabled" %}</span>
{% endif %}
</td>
<td class="operations">
@@ -62,7 +62,7 @@
{% if connection.primary %}
<div class="list-group-item">
<span class="primary">{% trans "Primary connection" %}</span>
<span class="badge badge-success secondary">
<span class="badge text-bg-success secondary">
{% trans "yes" %}
</span>
</div>
@@ -113,10 +113,10 @@
<div class="list-group-item">
<span class="primary">{% trans "Link state" %}</span>
{% if device.ethernet.carrier %}
<span class='badge badge-success secondary'>
<span class='badge text-bg-success secondary'>
{% trans "cable is connected" %}</span>
{% else %}
<span class='badge badge-warning secondary'>
<span class='badge text-bg-warning secondary'>
{% trans "please check cable" %}</span>
{% endif %}
</div>
@@ -152,7 +152,7 @@
{% if access_point.strength %}
<div class="list-group-item">
<span class="primary">{% trans "Signal strength" %}</span>
<span class="badge badge-secondary secondary">
<span class="badge text-bg-secondary secondary">
{{ access_point.strength }}%
</span>
</div>
@@ -273,7 +273,7 @@
<div class="list-group list-group-two-column">
<div class="list-group-item">
<span class="primary">{% trans "Firewall zone" %}</span>
<span class="badge badge-success secondary">
<span class="badge text-bg-success secondary">
{{ connection.zone_string }}
</span>
</div>
@@ -293,7 +293,7 @@
<div class="list-group list-group-two-column">
<div class="list-group-item">
<span class="primary">{% trans "Firewall zone" %}</span>
<span class="badge badge-warning secondary">
<span class="badge text-bg-warning secondary">
{{ connection.zone_string }}
</span>
</div>
@@ -312,7 +312,7 @@
<div class="list-group list-group-two-column">
<div class="list-group-item">
<span class="primary">{% trans "Firewall zone" %}</span>
<span class="badge badge-danger secondary">
<span class="badge text-bg-danger secondary">
{% trans "External" %}
</span>
</div>
@@ -27,11 +27,11 @@
<tr>
<td class="connection-status-cell">
{% if connection.is_active %}
<span class="badge badge-success connection-status-label">
<span class="badge text-bg-success connection-status-label">
{% trans "Active" %}
</span>
{% else %}
<span class="badge badge-warning connection-status-label">
<span class="badge text-bg-warning connection-status-label">
{% trans "Inactive" %}
</span>
{% endif %}
@@ -43,7 +43,7 @@
</a>
</span>
<span class="badge badge-secondary secondary">
<span class="badge text-bg-secondary secondary">
{{ access_point.strength }}%
</span>
</div>
@@ -36,12 +36,12 @@
<td>
{{ snapshot.number }}
{% if snapshot.is_default %}
<span class="badge badge-secondary">
<span class="badge text-bg-secondary">
{% trans "will be used at next boot" %}
</span>
{% endif %}
{% if snapshot.is_active %}
<span class="badge badge-success">
<span class="badge text-bg-success">
{% trans "in use" %}
</span>
{% endif %}