Commit 014909dd authored by Andreas Valder's avatar Andreas Valder

add support for not released videos to cut progress view

parent 525eb2ac
......@@ -20,7 +20,7 @@ def cutprogress(user=None):
course['lectures'] = query('SELECT lectures.title, lectures.time, lectures.id FROM lectures WHERE lectures.course_id= ? AND NOT lectures.deleted AND NOT lectures.norecording ORDER BY lectures.time', course['id'])
maxlecturecount = max(len(course['lectures']),maxlecturecount)
for lecture in course['lectures']:
lecture['videos'] = query('SELECT videos.path, formats.description as formatdesc FROM videos JOIN formats ON (videos.video_format = formats.id) WHERE videos.lecture_id = ? AND NOT videos.deleted', lecture['id'])
lecture['videos'] = query('SELECT videos.path, formats.description as formatdesc, videos.visible FROM videos JOIN formats ON (videos.video_format = formats.id) WHERE videos.lecture_id = ? AND NOT videos.deleted', lecture['id'])
course['responsible'] = query('''SELECT users.*
FROM responsible
JOIN users ON (responsible.user_id = users.id AND responsible.course_id = ?)
......
......@@ -32,7 +32,11 @@
{% if l.videos|count == 0 %}
<span style="color: red" aria-hidden="true" class="fa fa-times"></span>
{% else %}
<span style="color: green" aria-hidden="true" class="glyphicon glyphicon-ok"></span>
{% if l.videos|selectattr('visible')|list|count == 0 %}
<span style="color: orange" aria-hidden="true" class="glyphicon glyphicon-ok"></span>
{% else %}
<span style="color: green" aria-hidden="true" class="glyphicon glyphicon-ok"></span>
{% endif %}
{% endif %}
{% else %}
<span style="color: grey" aria-hidden="true" class="fa fa-times"></span>
......
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