From 6e31bb13780b4ec11aa51694a6cc7e9658fceb3d Mon Sep 17 00:00:00 2001 From: "Andreas (@xAndy) Zimmermann" Date: Sat, 13 May 2023 15:34:10 +0200 Subject: [PATCH] order team backup shifts and add page title --- shiftregister/fallback/templates/my_fallback_shifts.html | 4 +--- shiftregister/fallback/views.py | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/shiftregister/fallback/templates/my_fallback_shifts.html b/shiftregister/fallback/templates/my_fallback_shifts.html index 07bc986..d7e42a5 100644 --- a/shiftregister/fallback/templates/my_fallback_shifts.html +++ b/shiftregister/fallback/templates/my_fallback_shifts.html @@ -1,8 +1,6 @@ {% extends "base.html" %} +{% block title %}Teamschichten{%endblock%} -{% block head %} - -{% endblock %} {% block body %}
diff --git a/shiftregister/fallback/views.py b/shiftregister/fallback/views.py index 502c790..8318e6b 100644 --- a/shiftregister/fallback/views.py +++ b/shiftregister/fallback/views.py @@ -7,8 +7,8 @@ from shiftregister.fallback.models import TeamMember def my_fallback_shifts(request, team_member_id): team_member = get_object_or_404(TeamMember, pk=team_member_id) - context = {"team_member": team_member, "shifts": team_member.fallback_shifts.all()} - - print(context) - + context = { + "team_member": team_member, + "shifts": team_member.fallback_shifts.order_by("start_at").all(), + } return render(request, "my_fallback_shifts.html", context)