Skip to content
Snippets Groups Projects
Commit cde7516f authored by Andreas Valder's avatar Andreas Valder
Browse files

timetable will now show hidden lectures/courses in a different color. closes #168

parent 5976cb7b
No related branches found
No related tags found
No related merge requests found
......@@ -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>
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment