Initial work on #20204

This commit is contained in:
Jeremy Stretch
2025-10-29 17:14:55 -04:00
parent 068d493cc6
commit fd3a9a0c37
10 changed files with 247 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
<div class="card">
<h2 class="card-header">{{ title }}</h2>
<table class="table table-hover attr-table">
{% for label, attr in attrs.items %}
<tr>
<th scope="row">{{ label }}</th>
<td>
<div class="d-flex justify-content-between align-items-start">{{ attr }}</div>
</td>
</tr>
{% endfor %}
</table>
</div>

View File

@@ -0,0 +1,8 @@
{% load i18n %}
{% load l10n %}
<span>{{ latitude }}, {{ longitude }}</span>
{% if map_url %}
<a href="{{ map_url }}{{ latitude|unlocalize }},{{ longitude|unlocalize }}" target="_blank" class="btn btn-primary btn-sm print-none">
<i class="mdi mdi-map-marker"></i> {% trans "Map" %}
</a>
{% endif %}

View File

@@ -0,0 +1,11 @@
<ol class="breadcrumb" aria-label="breadcrumbs">
{% for node in nodes %}
<li class="breadcrumb-item">
{% if linkify %}
<a href="{{ node.get_absolute_url }}">{{ node }}</a>
{% else %}
{{ node }}
{% endif %}
</li>
{% endfor %}
</ol>

View File

@@ -0,0 +1,26 @@
{% if group %}
{# Display an object with its parent group #}
<ol class="breadcrumb" aria-label="breadcrumbs">
<li class="breadcrumb-item">
{% if group_url %}
<a href="{{ group_url }}">{{ group }}</a>
{% else %}
{{ object.group }}
{% endif %}
</li>
<li class="breadcrumb-item">
{% if object_url %}
<a href="{{ object_url }}">{{ object }}</a>
{% else %}
{{ object }}
{% endif %}
</li>
</ol>
{% else %}
{# Display only the object #}
{% if object_url %}
<a href="{{ object_url }}">{{ object }}</a>
{% else %}
{{ object }}
{% endif %}
{% endif %}

View File

@@ -177,6 +177,7 @@
{% plugin_left_page object %}
</div>
<div class="col col-12 col-xl-6">
{{ device_attrs }}
<div class="card">
<h2 class="card-header">{% trans "Management" %}</h2>
<table class="table table-hover attr-table">

View File

@@ -0,0 +1,8 @@
{% if device.parent_bay %}
<ol class="breadcrumb" aria-label="breadcrumbs">
<li class="breadcrumb-item">{{ device.parent_bay.device|linkify }}</li>
<li class="breadcrumb-item">{{ device.parent_bay }}</li>
</ol>
{% else %}
{{ ''|placeholder }}
{% endif %}

View File

@@ -0,0 +1,18 @@
{% load i18n %}
{% if device.rack %}
<span>
{{ device.rack|linkify }}
{% if device.rack and device.position %}
(U{{ device.position|floatformat }} / {{ device.get_face_display }})
{% elif device.rack and device.device_type.u_height %}
<span class="badge text-bg-warning">{% trans "Not racked" %}</span>
{% endif %}
</span>
{% if device.rack and device.position %}
<a href="{{ device.rack.get_absolute_url }}?device={{ device.pk }}" class="btn btn-primary btn-sm d-print-none" title="{% trans "Highlight device in rack" %}">
<i class="mdi mdi-view-day-outline"></i>
</a>
{% endif %}
{% else %}
{{ ''|placeholder }}
{% endif %}