diff --git a/templates/timetable.html b/templates/timetable.html index 25e10efbca25e5b9cbc2efeeec1ed7e998c551ac..4b295246e5468615793a5208da224b9972af5ed5 100644 --- a/templates/timetable.html +++ b/templates/timetable.html @@ -22,9 +22,9 @@ {% for d in days if (d.index < 5) or (d.lectures|length) > 0 %} {% for i in range(1,d.maxcol+1) %} {% for l in d.lectures|selectattr('timetable_col','equalto',i) if (((l.time.time() > t) and (l.time.time() < times[time_loop.index+1])) != (l.time.time() == t ) ) %} - <td rowspan="{{l.duration / 15}}" style="background: lightgrey;"> + <td rowspan="{{l.duration / 15}}" style="background: {% if l.visible and l.course.visible %}lightgrey;{% else %}#f2dede{% endif %}"> <p class="small"> - <strong><a class="hidden-print" href="{{url_for('course', id=l.course_id)}}#lecture-{{l.id}}">{{l.short}}</a><span class="visible-print-inline">{{l.short}}</span></strong><br> + <strong><a class="hidden-print" href="{{url_for('course', id=l.course_id)}}#lecture-{{l.id}}">{{l.course.short}}</a><span class="visible-print-inline">{{l.course.short}}</span></strong><br> {{l.time.strftime("%H:%M")}} - {{l.time_end.strftime("%H:%M")}}<br> {{l.place}}</p> </td> diff --git a/timetable.py b/timetable.py index 0b036c056d8d3578e2ba27839bf8446e45eb70be..a8e18be29a810c85b67f578167cdfb3c96db08b3 100644 --- a/timetable.py +++ b/timetable.py @@ -23,7 +23,7 @@ def timetable(): e = datetime.combine(i['date'],time(23,59)) i['lectures'] = [] for l in query (''' - SELECT lectures.*,courses.short + SELECT lectures.*, courses.short, "course" AS sep, courses.* FROM lectures JOIN courses ON (lectures.course_id = courses.id) WHERE time < ? and time > ? @@ -55,7 +55,6 @@ def timetable(): unique = False if unique: tmp.append(x) - print(x[0],x[1],x[2]['short']) sweeplinetupels = sorted(tmp, key=lambda t:(t[0],t[1])) for l in sweeplinetupels: