FallenBirdyForm/app/bird/templates/bird/bird_all.html
2025-06-10 14:49:08 +02:00

90 lines
2.9 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,
"pagingType": "first_last_numbers",
responsive: true,
scrollX: true,
autoWidth: false,
order: [[2, 'desc']],
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 Patienten in Behandlung</h3>
<p>
Übersicht aller in Behandlung befindlichen Vögel. Die nicht
mehr in Behandlung befindlichen Patienten finden Sie <a href="{% url 'bird_inactive' %}">hier</a>.
</p>
<p>
<p><a href="{% url 'bird_create' %}" class="btn btn-primary">einen Patienten anlegen</a></p>
</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>Fundort</th>
<th>Status</th>
<th>Voliere</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 data-order="{{ forloop.counter }}">{{ bird.date_found }}</td>
<td>{{ bird.place }}</td>
<td>{{ bird.status }}</td>
<td>{{ bird.aviary|default_if_none:"" }}</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>
</form>
<!-- Notizen für diese Übersicht -->
{% load notizen_tags %}
{% show_page_notizen "patient_overview" %}
{% endblock content %}