macros.html 4.34 KB
Newer Older
1
{% macro preview(lecture) %}
Andreas Valder's avatar
Andreas Valder committed
2

Andreas Valder's avatar
Andreas Valder committed
3
<li class="list-group-item">
Andreas Valder's avatar
Andreas Valder committed
4
5
	<a class="hidden-xs" href="/play?lectureid={{ lecture['id'] }}" title="{{ lecture['coursetitle'] }}">
		<div class="row">
6
			<img class="col-xs-4" src="https://videoag.fsmpi.rwth-aachen.de/{{ lecture['titlefile'] }}" alt="Vorschaubild">
Andreas Valder's avatar
Andreas Valder committed
7
			<div class="col-xs-4">
8
9
				<span style="color: #000;"><strong>{{ lecture['short'] }}</strong></span><br>
				<span style="color: #000;">{{ lecture['time'] }}</span>
10
				{% if lecture['speaker'] %}
11
					<div class="small" style="color: #000;">Gehalten von {{ lecture['speaker'] }} </div>
12
				{% endif %}
Andreas Valder's avatar
Andreas Valder committed
13
			</div>
14
			<div class="col-xs-4" style="color: #000;">
Andreas Valder's avatar
.    
Andreas Valder committed
15
16
				<div style="color: #000;">{{ lecture['title']  }}</div>
				<p style="font-style: italic; color: #777;">{{ lecture['comment'] }}</p>
17
			</div>
Andreas Valder's avatar
Andreas Valder committed
18
19
20
21
22
23
24
25
26
27
		</div>
	</a>
	<a class="visible-xs" href="/play?lectureid={{ lecture['id'] }}" title="{{ lecture['coursetitle'] }}">
		<div class="row">
			<img class="col-xs-12" src="https://videoag.fsmpi.rwth-aachen.de/{{ lecture['titlefile'] }}" alt="Vorschaubild">
		</div>
		<div class="row">
			<div class="col-xs-12">
				<span style="color: #000;"><strong>{{ lecture['short'] }}</strong></span>
				<span style="color: #000;">{{ lecture['time'] }}</span>
Andreas Valder's avatar
.    
Andreas Valder committed
28
			</div>
Andreas Valder's avatar
Andreas Valder committed
29
30
31
32
33
		</div>
		{% if lecture['speaker'] %}
		<div class="row">
			<div class="col-xs-12">
				<div class="small" style="color: #000;">Gehalten von {{ lecture['speaker'] }} </div>
Andreas Valder's avatar
.    
Andreas Valder committed
34
			</div>
Andreas Valder's avatar
Andreas Valder committed
35
36
37
38
39
		</div>
		{% endif %}
		<div class="row">
			<div class="col-xs-12">
				<div style="color: #000;">{{ lecture['title']  }}</div>
Andreas Valder's avatar
.    
Andreas Valder committed
40
			</div>
Andreas Valder's avatar
Andreas Valder committed
41
42
43
44
		</div>
		<div class="row">
			<div class="col-xs-12">
				<p style="font-style: italic; color: #777;">{{ lecture['comment'] }}</p>
Andreas Valder's avatar
Andreas Valder committed
45
			</div>
Andreas Valder's avatar
Andreas Valder committed
46
47
		</div>
	</a>
Andreas Valder's avatar
Andreas Valder committed
48
49
</li>

Andreas Valder's avatar
Andreas Valder committed
50
51
{% endmacro %}

Julian Rother's avatar
Julian Rother committed
52
{% macro player(lecture, videos) %}
Andreas Valder's avatar
Andreas Valder committed
53
54
55
<script src="static/mediaelementjs/mediaelement-and-player.min.js"></script>
<link rel="stylesheet" href="static/mediaelementjs/mediaelementplayer.css" />
<video class="mejs-player" width="640" height="360" style="width: 100%; height: 80%;">
Julian Rother's avatar
Julian Rother committed
56
	<source type="video/mp4" src="https://videoag.fsmpi.rwth-aachen.de/{{ videos[0]['path'] }}" />
Andreas Valder's avatar
Andreas Valder committed
57
</video>
Andreas Valder's avatar
Andreas Valder committed
58
<script>
Andreas Valder's avatar
Andreas Valder committed
59
60
61
62
//$('.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']
//});
Andreas Valder's avatar
Andreas Valder committed
63
</script>
Andreas Valder's avatar
Andreas Valder committed
64
{% endmacro %}
65
66
67
68

{% macro course_list_item(course,show_semester=False) %}
<li class="list-group-item">
	<div class="row">
Andreas Valder's avatar
Andreas Valder committed
69
70
71
72
73
74
75
76
77
78
		<a href=/course?courseid={{course.handle}}>
			{% if show_semester %}
				<span class="col-xs-1">
					{{ course.semester }}
				</span>
				<span class="col-xs-6">
			{% else %}
				<span class="col-xs-7">
			{% endif %}
				{{ course.title }}
79
			</span>
Andreas Valder's avatar
Andreas Valder committed
80
81
82
83
84
85
86
			<span class="col-xs-3">
				{{ course.organizer }}
			</span>
			<span class="col-xs-2">
				{{ course.subject }}
			</span>
		</a>
87
88
89
	</div>
</li>
{% endmacro %}
Andreas Valder's avatar
Andreas Valder committed
90

Andreas Valder's avatar
Andreas Valder committed
91
{% macro lecture_list_item(lecture,videos) %}
Andreas Valder's avatar
Andreas Valder committed
92
93
<li class="list-group-item">
	<div class="row">
Andreas Valder's avatar
Andreas Valder committed
94
95
96
97
98
99
100
		<img class="col-sm-2 col-xs-12"src="https://videoag.fsmpi.rwth-aachen.de/{{lecture.titlefile}}" alt="Vorschaubild">
		<span class="col-sm-3 col-xs-12">
			<ul class="list-unstyled">
				<li>{{ lecture.title }}</li>
				{% if lecture.speaker %}<li>Gehalten von {{ lecture.speaker|safe }}</li>{% endif %}
				<li>{{ lecture.time }}</li>
			</ul>
Andreas Valder's avatar
Andreas Valder committed
101
		</span>
Andreas Valder's avatar
Andreas Valder committed
102
		<span class="col-sm-4 col-xs-12">
Andreas Valder's avatar
Andreas Valder committed
103
104
			{{ lecture.comment|safe }}
		</span>
Andreas Valder's avatar
Andreas Valder committed
105
		<span class="col-sm-3 col-xs-12">
Andreas Valder's avatar
Andreas Valder committed
106
107
			<span class="dropdown pull-right">
				<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Download <span class="caret"></span></button>
Andreas Valder's avatar
Andreas Valder committed
108
				<ul class="dropdown-menu">
Andreas Valder's avatar
Andreas Valder committed
109
110
111
					{% 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 %}
Andreas Valder's avatar
Andreas Valder committed
112
				</ul>
113
114
115
116
117
118
119
				<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>
Andreas Valder's avatar
Andreas Valder committed
120
			</span>
Andreas Valder's avatar
Andreas Valder committed
121
122
123
124
125
126
			<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>
Andreas Valder's avatar
Andreas Valder committed
127
128
129
130
		</span>
	</div>
</li>
{% endmacro %}