FallenBirdyForm/app/bird/templates/bird/bird_inactive.html
2023-07-28 16:05:49 +02:00

78 lines
2.5 KiB
HTML

{% extends "base.html" %}
{% load static %}
{% block header %}
<!-- Datatable CSS -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.4/css/dataTables.bootstrap5.min.css" />
<link rel="stylesheet" href="https://cdn.datatables.net/responsive/2.2.9/css/responsive.bootstrap5.min.css">
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<!-- Datatable jQuery -->
<script src="https://cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.11.3/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.2.9/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.2.9/js/responsive.bootstrap5.min.js"></script>
<script nonce="{{request.csp_nonce}}">
$(document).ready(function () {
let table = $('#t__bird_all').DataTable({
language: {
url: 'https://cdn.datatables.net/plug-ins/1.11.3/i18n/de_de.json',
},
paging: true,
info: true,
responsive: true,
columnDefs: [
{ responsivePriority: 1, targets: 0 },
]
});
table.on( 'responsive-display', function ( e, datatable, row, showHide, update ) {
table.rows().every( function () {
if (showHide && row.index() !== this.index() && this.child.isShown()) {
$('td', this.node()).eq(0).click();
}
});
});
})
</script>
{% endblock header %}
{% block content %}
<h3>Übersicht aller inaktiven Patienten</h3>
<p>
Übersicht aller nicht mehr in Behandlung befindlichen oder behandelten Vögel.
</p>
<table class="table table-striped table-hover display responsive nowrap" id="t__bird_all">
<thead>
<tr>
<th>Patienten Alias</th>
<th>Vogel</th>
<th>gefunden am</th>
<th>Finder</th>
<th>Fundort</th>
<th>Status</th>
<th>Kosten</th>
<th>Alter</th>
<th>Geschlecht</th>
</tr>
</thead>
<tbody>
{% for bird in birds %}
<tr>
<td><a href="{% url 'bird_single' bird.id %}">{{ bird.bird_identifier }}</a></td>
<td>{{ bird.bird }}</td>
<td>{{ bird.date_found }}</td>
<td>
<a href="{% url 'rescuer_single' bird.rescuer_id %}">{{ bird.rescuer|default_if_none:"" }}</a>
</td>
<td>{{ bird.place }}</td>
<td>{{ bird.status }}</td>
<td>{{ bird.total_costs|default_if_none:"0,00" }} &euro;</td>
<td>{{ bird.age|default_if_none:"" }} </td>
<td>{{ bird.sex }} </td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock content %}