From 599ca85167ad7d53f6434b105cb74c761d994ecf Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Sat, 18 Nov 2017 16:04:18 +0100 Subject: Liens et URLs pour les emplois du temps des salles --- templates/group_list.html | 2 +- urls.py | 3 ++- views.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/group_list.html b/templates/group_list.html index 88cc7a4..7fe1fe8 100644 --- a/templates/group_list.html +++ b/templates/group_list.html @@ -7,7 +7,7 @@

{% if timetable %}{{ timetable }}{% else %}Emploi du temps des salles{% endif %}

{% endblock %} diff --git a/urls.py b/urls.py index b0ca9f4..4c4abe3 100644 --- a/urls.py +++ b/urls.py @@ -20,7 +20,8 @@ urlpatterns = [ url(r"^$", views.index, name="index"), url(r"^pages/", include("django.contrib.flatpages.urls")), url(r"^salles/$", views.rooms, name="rooms"), - url(r"^salles/(?P[-\w]+)$", views.room_timetable), + url(r"^salles/(?P[-\w]+)$", views.room_timetable, name="room-timetable"), + url(r"^salles/(?P[-\w]+)/(?P[0-9]{4})/(?P[0-4]?[0-9]|5[0-3])/$", views.room_timetable, name="room-timetable"), url(r"^(?P[-\w]+)/$", views.mention_list, name="mentions"), url(r"^(?P[-\w]+)/(?P[-\w]+)/$", views.group_list, name="groups"), url(r"^(?P[-\w]+)/(?P[-\w]+)/(?P[-\w]+)/$", views.timetable, name="timetable"), diff --git a/views.py b/views.py index 9047329..e35796b 100644 --- a/views.py +++ b/views.py @@ -121,7 +121,7 @@ def rooms(request): return render(request, "group_list.html", {"groups": rooms_weeks}) -def room_timetable(request, room_slug): +def room_timetable(request, room_slug, year=None, week=None): room = get_object_or_404(Room, slug=room_slug) courses = Course.objects.filter(rooms__in=(room,)).order_by("begin") -- cgit v1.2.1