Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Projects
Groups
Snippets
Sign up now
Login
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
website
Commits
ef02a3e2
Commit
ef02a3e2
authored
Aug 25, 2016
by
Andreas Valder
Browse files
enhanced course site
parent
bfb6b3fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
server.py
View file @
ef02a3e2
...
...
@@ -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'
))
...
...
templates/course.html
View file @
ef02a3e2
{% from 'macros.html' import
co
ur
s
e_list_item %}
{% from 'macros.html' import
lect
ure_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>
...
...
templates/macros.html
View file @
ef02a3e2
...
...
@@ -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 %}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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