macros.html 5.33 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="{{ videoprefix }}/{{ 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
		</div>
	</a>
	<a class="visible-xs" href="/play?lectureid={{ lecture['id'] }}" title="{{ lecture['coursetitle'] }}">
		<div class="row">
22
			<img class="col-xs-12" src="{{ videoprefix }}/{{ lecture['titlefile'] }}" alt="Vorschaubild">
Andreas Valder's avatar
Andreas Valder committed
23
24
25
26
27
		</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
<script src="static/mediaelementjs/mediaelement-and-player.min.js"></script>
<link rel="stylesheet" href="static/mediaelementjs/mediaelementplayer.css" />
Andreas Valder's avatar
Andreas Valder committed
55
<video class="mejs-player" width="640" height="360" style="width: 100%; height: 100%;">
Andreas Valder's avatar
Andreas Valder committed
56
	{% for v in videos %}
57
		<source type="video/mp4" src="{{ videoprefix }}/{{ v.path }}" />
Andreas Valder's avatar
Andreas Valder committed
58
	{% endfor %}
Andreas Valder's avatar
Andreas Valder committed
59
</video>
Andreas Valder's avatar
Andreas Valder committed
60
<script>
Andreas Valder's avatar
Andreas Valder committed
61
62
63
64
//$('.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
65
</script>
Andreas Valder's avatar
Andreas Valder committed
66
{% endmacro %}
67
68
69
70

{% macro course_list_item(course,show_semester=False) %}
<li class="list-group-item">
	<div class="row">
Andreas Valder's avatar
Andreas Valder committed
71
72
73
74
75
76
77
78
79
80
		<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 }}
81
			</span>
Andreas Valder's avatar
Andreas Valder committed
82
83
84
85
86
87
88
			<span class="col-xs-3">
				{{ course.organizer }}
			</span>
			<span class="col-xs-2">
				{{ course.subject }}
			</span>
		</a>
89
90
91
	</div>
</li>
{% endmacro %}
Andreas Valder's avatar
Andreas Valder committed
92

93
{% macro video_download_btn(videos) %}
94
<button class="btn btn-primary dropdown-toggle {% if videos|length is equalto 0 %}disabled{% endif %}" type="button" data-toggle="dropdown">Download <span class="caret"></span></button>
95
96
<ul class="dropdown-menu">
	{% for v in videos %}
97
	<li><a href="{{ videoprefix }}/{{v.path}}">{{v.format_description}} ({{v.file_size|filesizeformat(true)}})</a></li>
98
99
100
101
102
	{% endfor %}
</ul>
<noscript>
	<ul class="pull-right list-unstyled" style="margin-left:10px;">
		{% for v in videos %}
103
		<li><a href="{{ videoprefix }}/{{v.path}}">{{v.format_description}} ({{v.file_size|filesizeformat(true)}})</a></li>
104
105
106
107
108
		{% endfor %}
	</ul>
</noscript>
{% endmacro %}

Andreas Valder's avatar
Andreas Valder committed
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{%macro video_embed_btn(lectureid) %}
<a class="btn btn-default" id="embedcodebtn" data-container="body" data-toggle="popover" data-placement="bottom">
	<span>Einbetten</span>
</a>
<script>
{% set embedcode = '<iframe width="700" height="394" src="https://videoag.fsmpi.rwth-aachen.de/site/embed.php?lecture='+lectureid|string+'" frameborder="0" allowfullscreen="true"></iframe>' %}
$('#embedcodebtn').popover(
		{
			html:true,
			title:'Einbettcode',
			content:'<span><input type="text" onclick="this.select()" value="{{embedcode}}"></span>'
		}
		)
</script>
{% endmacro %}

Andreas Valder's avatar
Andreas Valder committed
125
{% macro lecture_list_item(lecture,videos) %}
Andreas Valder's avatar
Andreas Valder committed
126
127
<li class="list-group-item">
	<div class="row">
Andreas Valder's avatar
Andreas Valder committed
128
129
130
131
132
133
134
		<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
135
		</span>
Andreas Valder's avatar
Andreas Valder committed
136
		<span class="col-sm-4 col-xs-12">
Andreas Valder's avatar
Andreas Valder committed
137
138
			{{ lecture.comment|safe }}
		</span>
Andreas Valder's avatar
Andreas Valder committed
139
		<span class="col-sm-3 col-xs-12">
Andreas Valder's avatar
Andreas Valder committed
140
141
142
143
			<span class="pull-right">
				<span class="dropdown">
					{{ video_download_btn(videos) }}
				</span>
144
145
146
				<a href="/play?lectureid={{lecture.id}}" class="btn btn-default {% if videos|length is equalto 0 %}disabled{% endif %}">
					<span class="glyphicon glyphicon-play"></span>
					Play
Andreas Valder's avatar
Andreas Valder committed
147
				</a>
Andreas Valder's avatar
Andreas Valder committed
148
149
150
151
152
			</span>
		</span>
	</div>
</li>
{% endmacro %}
153
154
155
156
157
158
159
160

{% macro valueeditor (path,value) %}
	{% if ismod() %}
	<span class="modeditable" data-path="{{path|join('.')}}" ><a class="modeditablesign btn btn-default" tabindex="0" style="padding: 3px; margin-right: 5px;"><span class="glyphicon glyphicon-pencil"></span></a><span class="modeditablevalue">{{ value|safe }}</span></span>
	{% else %}
		{{value|safe}}
	{% endif %}
{% endmacro%}