Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
website
Commits
289fdcdb
Commit
289fdcdb
authored
Aug 28, 2016
by
Andreas Valder
Browse files
added course and lecture title to the player
parent
d682e596
Changes
3
Hide whitespace changes
Inline
Side-by-side
server.py
View file @
289fdcdb
...
...
@@ -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'
))
...
...
templates/macros.html
View file @
289fdcdb
...
...
@@ -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"
>
...
...
templates/play.html
View file @
289fdcdb
{% 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 %}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment