mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-23 12:08:43 -06:00
Change approach for declaring object panels
This commit is contained in:
@@ -2,25 +2,13 @@
|
||||
{# 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 %}
|
||||
{% if linkify %}{{ group|linkify }}{% else %}{{ group }}{% endif %}
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
{% if object_url %}
|
||||
<a href="{{ object_url }}">{{ object }}</a>
|
||||
{% else %}
|
||||
{{ object }}
|
||||
{% endif %}
|
||||
{% if linkify %}{{ object|linkify }}{% else %}{{ object }}{% endif %}
|
||||
</li>
|
||||
</ol>
|
||||
{% else %}
|
||||
{# Display only the object #}
|
||||
{% if object_url %}
|
||||
<a href="{{ object_url }}">{{ object }}</a>
|
||||
{% else %}
|
||||
{{ object }}
|
||||
{% endif %}
|
||||
{% if linkify %}{{ object|linkify }}{% else %}{{ object }}{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<div class="card">
|
||||
<h2 class="card-header">{{ title }}</h2>
|
||||
<table class="table table-hover attr-table">
|
||||
{% for label, attr in attrs.items %}
|
||||
{% for attr in attrs %}
|
||||
<tr>
|
||||
<th scope="row">{{ label }}</th>
|
||||
<th scope="row">{{ attr.label }}</th>
|
||||
<td>
|
||||
<div class="d-flex justify-content-between align-items-start">{{ attr }}</div>
|
||||
<div class="d-flex justify-content-between align-items-start">{{ attr.value }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@@ -177,7 +177,7 @@
|
||||
{% plugin_left_page object %}
|
||||
</div>
|
||||
<div class="col col-12 col-xl-6">
|
||||
{{ device_attrs }}
|
||||
{{ device_panel }}
|
||||
<div class="card">
|
||||
<h2 class="card-header">{% trans "Management" %}</h2>
|
||||
<table class="table table-hover attr-table">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% if device.parent_bay %}
|
||||
{% if value %}
|
||||
<ol class="breadcrumb" aria-label="breadcrumbs">
|
||||
<li class="breadcrumb-item">{{ device.parent_bay.device|linkify }}</li>
|
||||
<li class="breadcrumb-item">{{ device.parent_bay }}</li>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
{% load i18n %}
|
||||
{% if device.rack %}
|
||||
{% if value %}
|
||||
<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 %}
|
||||
{{ value|linkify }}
|
||||
{% if value and object.position %}
|
||||
(U{{ object.position|floatformat }} / {{ object.get_face_display }})
|
||||
{% elif value and object.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" %}">
|
||||
{% if value and object.position %}
|
||||
<a href="{{ value.get_absolute_url }}?device={{ object.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 %}
|
||||
|
||||
Reference in New Issue
Block a user