diff options
-rw-r--r-- | templates/index.html | 2 | ||||
-rw-r--r-- | views.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/templates/index.html b/templates/index.html index 3170aea..d834884 100644 --- a/templates/index.html +++ b/templates/index.html @@ -62,7 +62,7 @@ li.course { <section id="{{ timetable.slug }}"> <h3><a href="{{ timetable.url }}">{{ timetable.name }}</a></h3> <ul>{% for group in groups %}{% if group.timetable.id == timetable.id %} - <li><a class="text" href="{% url "timetable" timetable.slug group.slug %}">{{ group.name }}</a> – {% for week in group.weeks %}<a href="{% url "timetable" timetable.slug group.slug week.year week|dt_week %}">{{ week|dt_prettyprint }}</a> {% endfor %}</li>{% endif %}{% endfor %} + <li><a class="text"{% if group.weeks is not None %} href="{% url "timetable" timetable.slug group.slug %}"{% endif %}>{{ group.name }}</a> – {% for week in group.weeks %}<a href="{% url "timetable" timetable.slug group.slug week.year week|dt_week %}">{{ week|dt_prettyprint }}</a> {% empty %}<em>aucun cours</em>{% endfor %}</li>{% endif %}{% endfor %} </ul> </section>{% endfor %}{% endblock %} </div> @@ -29,7 +29,7 @@ from .utils import get_current_week, get_week, group_courses import datetime def index(request): - timetables = Timetable.objects.all() + timetables = Timetable.objects.all().order_by("name") groups = Group.objects.filter(tp__isnull=False).order_by("name") year, week = get_current_week() |