diff options
author | Alban Gruin | 2018-01-19 19:20:21 +0100 |
---|---|---|
committer | Alban Gruin | 2018-01-19 19:54:09 +0100 |
commit | d7dfa0c001a9b84541e1545e45d0536a87d6880e (patch) | |
tree | dd563d246239934ff4d83ceeab892dbdafb31d8b /views.py | |
parent | 7a4bdfda6df3ca46f4805c145a42793cacc0809f (diff) |
Liens permettant de naviguer sur les pages des semaines suivantes et précédentes
Diffstat (limited to 'views.py')
-rw-r--r-- | views.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -79,12 +79,19 @@ def timetable_common(request, obj, year=None, week=None, timetable=None): if not courses.exists() and provided_week: raise Http404 + # Récupération des semaines suivantes et précédentes pour les + # afficher proprement dans l’emploi du temps + last_week = getattr(Course.objects.get_courses(obj, begin__lt=start).last(), "begin", None) + next_week = getattr(Course.objects.get_courses(obj, begin__gte=end).first(), "begin", None) + last_update = courses.aggregate(Max("last_update"))["last_update__max"] grouped_courses = group_courses(courses) return render(request, "timetable.html", {"group": obj, "courses": grouped_courses, "last_update": last_update, "year": year, "week": int(week), + "last_week": last_week, + "next_week": next_week, "is_old_timetable": is_old_timetable, "group_mode": isinstance(obj, Group), "timetable": timetable}) |