Commit 985a5447 authored by Christoph Rackwitz's avatar Christoph Rackwitz Committed by Julian Rother
Browse files

cutprogress: fixe Breite; user-gefilterte Ansicht hatte irrelevante Kurse

parent bde747c0
...@@ -11,9 +11,9 @@ def cutprogress(user=None): ...@@ -11,9 +11,9 @@ def cutprogress(user=None):
allsemester = query('SELECT DISTINCT semester from courses ORDER BY semester DESC') allsemester = query('SELECT DISTINCT semester from courses ORDER BY semester DESC')
semester = request.values.get('semester', allsemester[0]['semester']) semester = request.values.get('semester', allsemester[0]['semester'])
# column headers: courses # find courses for semester
courses = query(''' courses = query('''
SELECT courses.id, courses.handle, courses.short, courses.responsible SELECT courses.id, courses.handle, courses.short
FROM courses FROM courses
WHERE semester = ? WHERE semester = ?
ORDER by id DESC ORDER by id DESC
...@@ -30,12 +30,21 @@ def cutprogress(user=None): ...@@ -30,12 +30,21 @@ def cutprogress(user=None):
''', course['id']) ''', course['id'])
if not people: if not people:
people = [{ 'realname': 'Niemand' }] people = [{ 'realname': 'Niemand', 'id': -1 }]
course['responsible'] = people course['responsible'] = people
# fetch lectures # filter for responsibility
lectures = query(''' if user is not None:
courses = [
c for c in courses
if user in (r['id'] for r in c['responsible'])
]
# fetch lectures for courses
lectures = []
for c in courses:
lectures += query('''
SELECT SELECT
lectures.id, lectures.id,
lectures.course_id, lectures.course_id,
...@@ -46,12 +55,12 @@ def cutprogress(user=None): ...@@ -46,12 +55,12 @@ def cutprogress(user=None):
FROM lectures FROM lectures
JOIN courses ON courses.id = lectures.course_id JOIN courses ON courses.id = lectures.course_id
LEFT JOIN videos ON lectures.id = videos.lecture_id LEFT JOIN videos ON lectures.id = videos.lecture_id
WHERE courses.semester = ? WHERE courses.id = ?
AND date <= DATE('now') AND date <= DATE('now')
AND NOT lectures.norecording AND NOT lectures.norecording
GROUP BY lectures.id GROUP BY lectures.id
ORDER BY date DESC, lectures.time ASC, lectures.id ASC ORDER BY date DESC, lectures.time ASC, lectures.id ASC
''', semester) ''', c['id'])
# sort dates, figure out when weeks change # sort dates, figure out when weeks change
dates = sorted({ dates = sorted({
......
...@@ -137,7 +137,12 @@ th.rotate { ...@@ -137,7 +137,12 @@ th.rotate {
th.rotate > div { th.rotate > div {
transform: transform:
rotate(270deg) rotate(270deg)
translate(-50px,0px); translate(-100px,0px);
width: 30px;
}
th.rotate > div > span {
padding: 5px 10px;
} }
.tooltip-inner { .tooltip-inner {
...@@ -145,6 +150,10 @@ th.rotate > div { ...@@ -145,6 +150,10 @@ th.rotate > div {
} }
#cutprogress td {
white-space: nowrap;
}
#cutprogress.table tr.weekbreak td { #cutprogress.table tr.weekbreak td {
border-top: 2px solid black !important; border-top: 2px solid black !important;
} }
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
Datum Datum
</th> </th>
{% for course in courses %} {% for course in courses %}
<th class="text-center rotate"> <th class="rotate">
<div> <div>
<a title="Zuständig: {{ course.responsible|join(attribute='realname') }}" href="{{ url_for("course", handle=course.handle) }}">{{ course.short }}</a> <span><a title="Zuständig: {{ course.responsible|join(attribute='realname') }}" href="{{ url_for("course", handle=course.handle) }}">{{ course.short }}</a></span>
</div> </div>
</th> </th>
{% endfor %} {% endfor %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment