Commit 289fdcdb authored by Andreas Valder's avatar Andreas Valder
Browse files

added course and lecture title to the player

parent d682e596
......@@ -153,9 +153,11 @@ def faq():
def play():
if 'lectureid' in request.args:
id = request.args['lectureid']
lecture=query('SELECT * FROM lectures WHERE id = ?', id)[0]
return render_template('play.html',
lecture=query('SELECT * FROM lectures WHERE id = ?', id)[0],
videos=query('SELECT * FROM videos WHERE lecture_id = ?', id))
lecture=lecture,
videos=query('SELECT * FROM videos WHERE lecture_id = ?', id),
course=query('SELECT * FROM courses WHERE id = ?',lecture['course_id'])[0])
else:
return redirect(url_for('index'))
......
......@@ -88,6 +88,22 @@
</li>
{% endmacro %}
{% macro video_download_btn(videos) %}
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Download <span class="caret"></span></button>
<ul class="dropdown-menu">
{% 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>
<noscript>
<ul class="pull-right list-unstyled" style="margin-left:10px;">
{% 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>
</noscript>
{% endmacro %}
{% macro lecture_list_item(lecture,videos) %}
<li class="list-group-item">
<div class="row">
......@@ -104,19 +120,7 @@
</span>
<span class="col-sm-3 col-xs-12">
<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">
{% 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>
<noscript>
<ul class="pull-right list-unstyled" style="margin-left:10px;">
{% 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>
</noscript>
{{ video_download_btn(videos) }}
</span>
<a href="/play?lectureid={{lecture.id}}" class="pull-right">
<button class="btn btn-default" type="button">
......
{% from 'macros.html' import player %}
{% set page_border = 0 -%}
{% extends "base.html" %}
{% block content %}
{{ player(lecture, videos) }}
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">{{ course.title }}: {{ lecture.title}}</h1>
</div>
<div class="row panel-body">
{{ player(lecture, videos) }}
</div>
</div>
{% endblock %}
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