table in evidence page details

This commit is contained in:
Cayo Puigdefabregas 2024-10-31 13:15:56 +01:00
parent 7926943947
commit 65bd88a2a2
1 changed files with 38 additions and 20 deletions

View File

@ -29,26 +29,44 @@
<div class="tab-content pt-2"> <div class="tab-content pt-2">
<div class="tab-pane fade show active" id="device"> <div class="tab-pane fade show active" id="device">
<h5 class="card-title">List of chids</h5> <h5 class="card-title"></h5>
<div class="list-group col-6"> <div class="list-group col-6">
{% for snap in object.annotations %} <table class="table">
{% if snap.type == 0 %} <thead>
<div class="list-group-item"> <tr>
<div class="d-flex w-100 justify-content-between"> <th scope="col" data-sortable="">
<h5 class="mb-1"></h5> {% trans "Type" %}
<small class="text-muted"> </th>
{{ snap.created }} <th scope="col" data-sortable="">
</small> {% trans "Identificator" %}
</div> </th>
<p class="mb-1"> <th scope="col" data-sortable="">
{{ snap.key }}<br /> {% trans "Data" %}
</p> </th>
<small class="text-muted"> </tr>
<a href="{% url 'device:details' snap.value %}">{{ snap.value }}</a> </thead>
</small> {% for snap in object.annotations %}
</div> <tbody>
{% endif %} {% if snap.type == 0 %}
{% endfor %} <tr>
<td>
{{ snap.key }}
</td>
<td>
<small class="text-muted">
<a href="{% url 'device:details' snap.value %}">{{ snap.value }}</a>
</small>
</td>
<td>
<small class="text-muted">
{{ snap.created }}
</small>
</td>
</tr>
{% endif %}
</tbody>
{% endfor %}
</table>
</div> </div>
</div> </div>
<div class="tab-pane fade" id="tag"> <div class="tab-pane fade" id="tag">
@ -97,7 +115,7 @@
if (hash) { if (hash) {
// Buscar el botón o enlace que corresponde al hash y activarlo // Buscar el botón o enlace que corresponde al hash y activarlo
const tabTrigger = document.querySelector(`[data-bs-target="${hash}"]`); const tabTrigger = document.querySelector(`[data-bs-target="${hash}"]`);
if (tabTrigger) { if (tabTrigger) {
// Crear una instancia de tab de Bootstrap para activar el tab // Crear una instancia de tab de Bootstrap para activar el tab
const tab = new bootstrap.Tab(tabTrigger); const tab = new bootstrap.Tab(tabTrigger);