Commit 25297e65 authored by Andreas Valder's avatar Andreas Valder
Browse files

made course site functional

parent 601a9130
......@@ -148,7 +148,8 @@ def course():
course = query('SELECT * FROM courses WHERE handle = ?', id)[0]
return render_template('course.html',
course=course,
lectures=query('SELECT * FROM lectures WHERE course_id = ?', course['id']))
lectures=query('SELECT * FROM lectures WHERE course_id = ?', course['id']),
videos=query('SELECT *, formats.description AS format_description FROM videos JOIN lectures ON (videos.lecture_id = lectures.id) JOIN formats ON (videos.video_format = formats.id) WHERE lectures.course_id= ? ORDER BY formats.prio DESC', course['id']))
else:
return redirect(url_for('index'))
......
......@@ -3,7 +3,7 @@
('/videos', 'videos', 'Videos', 'film'),
('/faq', 'faq', 'FAQ', 'question-sign')
] -%}
{% set active_page = active_page|default('index') -%}
{% set active_page = active_page|default('none') -%}
<!DOCTYPE html>
<html>
......
......@@ -10,7 +10,7 @@
</div>
<ul class="list-group lectureslist">
{% for l in lectures %}
{{ lecture_list_item(l) }}
{{ lecture_list_item(l,videos|selectattr('lecture_id','equalto',l.id)) }}
{% endfor %}
</ul>
</div>
......
......@@ -56,10 +56,10 @@
<source type="video/mp4" src="https://videoag.fsmpi.rwth-aachen.de/{{ videos[0]['path'] }}" />
</video>
<script>
$('.mejs-player').mediaelementplayer({
features: ['playpause','progress','current','duration','tracks','volume','fullscreen'],
speeds: ['3.00', '2.50', '2.00', '1.50', '1.25', '1.00', '0.75']
});
//$('.mejs-player').mediaelementplayer({
// features: ['playpause','progress','current','duration','tracks','volume','fullscreen'],
// speeds: ['3.00', '2.50', '2.00', '1.50', '1.25', '1.00', '0.75']
//});
</script>
{% endmacro %}
......@@ -88,7 +88,7 @@ $('.mejs-player').mediaelementplayer({
</li>
{% endmacro %}
{% macro lecture_list_item(lecture) %}
{% macro lecture_list_item(lecture,videos) %}
<li class="list-group-item">
<div class="row">
<span class="col-xs-3">
......@@ -97,20 +97,24 @@ $('.mejs-player').mediaelementplayer({
<span class="col-xs-2">
{{ lecture.time }}
</span>
<span class="col-xs-3">
<span class="col-xs-4">
{{ lecture.comment|safe }}
</span>
<span class="col-xs-2 pull-right">
<span class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Download<span class="caret"></span></button>
<span class="col-xs-3">
<span class="dropdown pull-right">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Download <span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
<li><a href="#">JavaScript</a></li>
{% for v in videos %}
<li><a href="https://video.fsmpi.rwth-aachen.de/{{v.path}}">{{v.format_description}} ({{v.file_size|filesizeformat(true)}})</a></li>
{% endfor %}
</ul>
</span>
<span class="glyphicon glyphicon-play"></span>
</ul>
<a href="/play?lectureid={{lecture.id}}" class="pull-right">
<button class="btn btn-default" type="button">
<span class="glyphicon glyphicon-play"></span>
<span>Play</span>
</button>
</a>
</span>
</div>
</li>
......
Supports Markdown
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