Patient schreibgeschützt #29
This commit is contained in:
parent
12a4b236ed
commit
2c4d284708
4 changed files with 117 additions and 4 deletions
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('#t__bird_all').DataTable({
|
$('#t__bird_inactive').DataTable({
|
||||||
language: {
|
language: {
|
||||||
url: 'https://cdn.datatables.net/plug-ins/1.11.3/i18n/de_de.json',
|
url: 'https://cdn.datatables.net/plug-ins/1.11.3/i18n/de_de.json',
|
||||||
},
|
},
|
||||||
|
@ -34,7 +34,8 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h3>Übersicht aller Patienten in Behandlung</h3>
|
<h3>Übersicht aller Patienten in Behandlung</h3>
|
||||||
<p>
|
<p>
|
||||||
Übersicht aller in Behandlung befindlichen oder behandelten Vögel.
|
Übersicht aller in Behandlung befindlichen oder behandelten Vögel. Die nicht
|
||||||
|
mehr in Behandlung befindlichen Patienten finden Sie <a href="{% url 'bird_inactive' %}">hier</a>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addPatientModal">einen Patienten
|
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addPatientModal">einen Patienten
|
||||||
|
@ -104,4 +105,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
102
app/bird/templates/bird/bird_inactive.html
Normal file
102
app/bird/templates/bird/bird_inactive.html
Normal file
|
@ -0,0 +1,102 @@
|
||||||
|
{% 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>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('#t__bird_all').DataTable({
|
||||||
|
language: {
|
||||||
|
url: 'https://cdn.datatables.net/plug-ins/1.11.3/i18n/de_de.json',
|
||||||
|
},
|
||||||
|
paging: false,
|
||||||
|
info: false,
|
||||||
|
responsive: true,
|
||||||
|
columnDefs: [
|
||||||
|
{ responsivePriority: 1, targets: 0 },
|
||||||
|
]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</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>Voliere</th>
|
||||||
|
<th>Kosten</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 }}</a>
|
||||||
|
</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" }} €</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div class="modal fade" id="addPatientModal" tabindex="-1" data-bs-backdrop="static"
|
||||||
|
aria-labelledby="addRescuerModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header bg-primary">
|
||||||
|
<h5 class="modal-title text-white" id="addRescuerModalLabel">(neuen) Finder zuweisen</h5>
|
||||||
|
</div>
|
||||||
|
<form method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
<div class="modal-body">
|
||||||
|
<label for="rescuer" class="form-label mt-3">Wählen Sie einen <strong>bereits angelegten</strong>
|
||||||
|
Finder aus oder legen Sie einen <strong>neuen</strong> Finder an:</label>
|
||||||
|
<select id="rescuer" class="form-select" name="rescuer_id">
|
||||||
|
<option value="new_rescuer"><strong>neuen
|
||||||
|
Finder anlegen</strong></option>
|
||||||
|
{% for rescuer in rescuer_modal %}
|
||||||
|
<option value={{rescuer.id}}>
|
||||||
|
{{rescuer.first_name}} {{rescuer.last_name}},
|
||||||
|
{{rescuer.street}} {{rescuer.street_number}},
|
||||||
|
{{rescuer.city}}
|
||||||
|
</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-danger" data-bs-dismiss="modal">Abbruch</button>
|
||||||
|
<button class="btn btn-primary" type="submit">Übernehmen und weiter</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
{% endblock content %}
|
|
@ -2,9 +2,10 @@ from django.urls import path
|
||||||
|
|
||||||
from .views import (
|
from .views import (
|
||||||
bird_all,
|
bird_all,
|
||||||
bird_help,
|
|
||||||
bird_create,
|
bird_create,
|
||||||
bird_delete,
|
bird_delete,
|
||||||
|
bird_help,
|
||||||
|
bird_inactive,
|
||||||
bird_recover,
|
bird_recover,
|
||||||
bird_recover_all,
|
bird_recover_all,
|
||||||
bird_single,
|
bird_single,
|
||||||
|
@ -12,6 +13,7 @@ from .views import (
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("all/", bird_all, name="bird_all"),
|
path("all/", bird_all, name="bird_all"),
|
||||||
|
path("inactive/", bird_inactive, name="bird_inactive"),
|
||||||
path("create/", bird_create, name="bird_create"),
|
path("create/", bird_create, name="bird_create"),
|
||||||
path("delete/<id>", bird_delete, name="bird_delete"),
|
path("delete/<id>", bird_delete, name="bird_delete"),
|
||||||
path("help/", bird_help, name="bird_help"),
|
path("help/", bird_help, name="bird_help"),
|
||||||
|
|
|
@ -59,6 +59,14 @@ def bird_all(request):
|
||||||
return redirect("rescuer_create")
|
return redirect("rescuer_create")
|
||||||
return render(request, "bird/bird_all.html", context)
|
return render(request, "bird/bird_all.html", context)
|
||||||
|
|
||||||
|
@login_required(login_url="account_login")
|
||||||
|
def bird_inactive(request):
|
||||||
|
birds = FallenBird.objects.filter(~Q(status="1") | ~Q(status="2")).annotate(
|
||||||
|
total_costs=Sum("costs__costs")
|
||||||
|
)
|
||||||
|
context = {"birds": birds}
|
||||||
|
return render(request, "bird/bird_inactive.html", context)
|
||||||
|
|
||||||
|
|
||||||
@login_required(login_url="account_login")
|
@login_required(login_url="account_login")
|
||||||
def bird_recover_all(request):
|
def bird_recover_all(request):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue