Commit ef02a3e2 authored by Andreas Valder's avatar Andreas Valder
Browse files

enhanced course site

parent bfb6b3fa
......@@ -145,9 +145,10 @@ def search():
def course():
if 'courseid' in request.args:
id = request.args['courseid']
course = query('SELECT * FROM courses WHERE handle = ?', id)[0]
return render_template('course.html',
course=query('SELECT * FROM courses WHERE handle = ?', id),
lectures=query('SELECT * FROM lectures WHERE course_id = ?', id))
course=course,
lectures=query('SELECT * FROM lectures WHERE course_id = ?', course['id']))
else:
return redirect(url_for('index'))
......
{% from 'macros.html' import course_list_item %}
{% from 'macros.html' import lecture_list_item %}
{% from 'macros.html' import preview %}
{% extends "base.html" %}
{% block content %}
......@@ -8,11 +8,9 @@
<div class="panel-heading">
<h1 class="panel-title">Veranstaltungen</h1>
</div>
{{course|pprint}}
{{lectures|pprint}}
<ul class="list-group courselist">
{% for course in courses %}
{{ course_list_item(course,true) }}
<ul class="list-group lectureslist">
{% for l in lectures %}
{{ lecture_list_item(l) }}
{% endfor %}
</ul>
</div>
......
......@@ -55,6 +55,12 @@
<video class="mejs-player" width="640" height="360" style="width: 100%; height: 80%;">
<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']
});
</script>
{% endmacro %}
{% macro course_list_item(course,show_semester=False) %}
......@@ -81,3 +87,31 @@
</div>
</li>
{% endmacro %}
{% macro lecture_list_item(lecture) %}
<li class="list-group-item">
<div class="row">
<span class="col-xs-3">
{{ lecture.title }}
</span>
<span class="col-xs-2">
{{ lecture.time }}
</span>
<span class="col-xs-3">
{{ 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>
<ul class="dropdown-menu">
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
<li><a href="#">JavaScript</a></li>
</ul>
</span>
<span class="glyphicon glyphicon-play"></span>
</ul>
</span>
</div>
</li>
{% endmacro %}
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