mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-23 12:08:43 -06:00
Initial work on #20204
This commit is contained in:
13
netbox/templates/components/attributes_panel.html
Normal file
13
netbox/templates/components/attributes_panel.html
Normal 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>
|
||||
8
netbox/templates/components/gps_coordinates.html
Normal file
8
netbox/templates/components/gps_coordinates.html
Normal 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 %}
|
||||
11
netbox/templates/components/nested_object.html
Normal file
11
netbox/templates/components/nested_object.html
Normal 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>
|
||||
26
netbox/templates/components/object.html
Normal file
26
netbox/templates/components/object.html
Normal 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 %}
|
||||
@@ -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">
|
||||
|
||||
8
netbox/templates/dcim/device/attrs/parent_device.html
Normal file
8
netbox/templates/dcim/device/attrs/parent_device.html
Normal 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 %}
|
||||
18
netbox/templates/dcim/device/attrs/rack.html
Normal file
18
netbox/templates/dcim/device/attrs/rack.html
Normal 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 %}
|
||||
Reference in New Issue
Block a user