macros.html 18.8 KB
Newer Older
1
2
3
4
5
6
{% macro livelabel(live=None, nowlive=None) %}
{% if live or nowlive %}
<span class="label {% if nowlive %}label-danger{% else %}label-default{% endif %}">Live</span>
{% endif %}
{% endmacro %}

7
{% macro preview(lecture) %}
Andreas Valder's avatar
Andreas Valder committed
8
<li class="list-group-item">
9
	<a href="{{url_for('lecture', course=lecture.course.handle, id=lecture['id'])}}" title="{{ lecture.course.title }}" style="color: #000">
10
11
		<div class="hidden-xs">
			<div class="row">
12
				<img class="col-xs-4" style="max-height: 120px; height: auto; width:170px" src="{{ config.VIDEOPREFIX }}/thumbnail/l_{{ lecture['id'] }}.jpg" alt="Vorschaubild">
13
				<div class="col-xs-4">
14
					<span><strong>{{ lecture.course.short }}</strong> {{livelabel(0, lecture.livehandle)}}{% if ismod() %} <i>({{lecture.course_id}})</i>{% endif %}</span><br>
15
					<span>{% if ismod() %}ID: {{lecture.id}}{% endif %}</span><br>
16
					<span>{{ lecture['time']|fulldate }}</span>
17
18
19
20
21
					{% if lecture['speaker'] %}
						<div class="small">Gehalten von {{ lecture['speaker']|safe }} </div>
					{% endif %}
				</div>
				<div class="col-xs-4">
22
					<div>{{ lecture['title']|fixnl|safe }}</div>
23
24
25
26
27
28
				</div>
			</div>
		</div>
		<div class="visible-xs">
			<ul class="list-unstyled">
				<li>
29
					<img style="width: 100%;" src="{{ config.VIDEOPREFIX }}/thumbnail/l_{{ lecture['id'] }}.jpg" alt="Vorschaubild">
30
31
				</li>
				<li>
32
					<strong>{{ lecture.course.title }}</strong>
33
					{{livelabel(0, lecture.livehandle)}}
34
				</li>
35
				<li>{{ lecture['time']|fulldate }}</li>
36
				{% if lecture['speaker'] %}
37
38
39
				<li>
					<span class="small">Gehalten von {{ lecture['speaker']|safe }} </span>
				</li>
40
				{% endif %}
41
				<li>
42
					{{ lecture['title']|fixnl|safe }}
43
44
				</li>
			</ul>
Andreas Valder's avatar
Andreas Valder committed
45
46
		</div>
	</a>
Andreas Valder's avatar
Andreas Valder committed
47
48
</li>

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

51
52
53
54
55
56
{% macro player(lecture, videos, msgs=[], autoplay=True, seek=None) %}
{% if seek == None %}
	{% set mfrag = "" %}
{% else %}
	{% set mfrag = "#t="+seek %}
{% endif %}
57
<video id="videoplayer" style="width: 100%" class="video-js vjs-default-skin vjs-big-play-centered" width="640" height="320" controls data-wasnotplayed="1" data-setup='{ "language":"de", "plugins" : {"hotkeys": {"seekStep": 15, "enableVolumeScroll": false, "alwaysCaptureHotkeys": true}, "videoJsResolutionSwitcher": { "ui": true, "default": "720p", "dynamicLabel": false } }, "customControlsOnMobile": true, "playbackRates": [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.25, 3.5, 3.75, 4] }'>
58
	{% for v in videos|sort(attribute='formats.player_prio', reverse=True) %}
59
	<source type="{{ v.formats.mimetype }}" src="{{ config.VIDEOPREFIX }}/{{ v.path }}{{mfrag}}" data-label="{{ v.formats.description }}" data-res="{{v.formats.resolution}}" data-aspect="{{v.formats.aspect}}" data-player_prio="{{v.formats.player_prio}}"/>
Andreas Valder's avatar
Andreas Valder committed
60
	{% endfor %}
61
	<track srclang="de" kind="chapters" src="{{ url_for('chapters',lectureid=lecture.id) }}" />
Andreas Valder's avatar
Andreas Valder committed
62
</video>
Andreas Valder's avatar
Andreas Valder committed
63
<script>
Jan Philipp Hafer's avatar
Jan Philipp Hafer committed
64
$(function() {
Andreas Valder's avatar
Andreas Valder committed
65
66
67
68
69
70
	$('#videoplayer').addClass("vjs-fluid");
	$('#videoplayer').css("width");
	videojs("videoplayer").ready(function() {
		//resume
		var progress_key = "progress_{{ lecture.id }}";
		var seconds_played;
Andreas Valder's avatar
Andreas Valder committed
71
		if (localStorage) {
Andreas Valder's avatar
Andreas Valder committed
72
73
74
75
			seconds_played = localStorage.getItem(progress_key);
			if (!seconds_played) {
				seconds_played = 0;
			} else {
76
			{% if seek == None %}
Andreas Valder's avatar
Andreas Valder committed
77
				videojs('videoplayer').currentTime(seconds_played);
78
			{% endif %}
Andreas Valder's avatar
Andreas Valder committed
79
80
			}
		}
Andreas Valder's avatar
Andreas Valder committed
81
82
83
84
85
86
87
88
		videojs("videoplayer").on("timeupdate", function() {
			if (localStorage) {
				var player_cur_Time = Math.round(videojs("videoplayer").currentTime());
				if(Math.abs(player_cur_Time - seconds_played) >= 10) {
					seconds_played = player_cur_Time;
					localStorage.setItem( progress_key , seconds_played)
				}
			}
Andreas Valder's avatar
Andreas Valder committed
89

Andreas Valder's avatar
Andreas Valder committed
90
		});
Andreas Valder's avatar
Andreas Valder committed
91

Andreas Valder's avatar
Andreas Valder committed
92
93
94
95
96
97
98
		//autoplay
		var playerplay = function() {
			if ($('#videoplayer').data("wasnotplayed") == 1) {
				videojs('videoplayer').play();
				$('#videoplayer').data("wasnotplayed","0");
			}
		};
Julian Rother's avatar
Julian Rother committed
99
		{% if autoplay %}
Andreas Valder's avatar
Andreas Valder committed
100
101
102
		$(window).focus(playerplay);
		if (document.hasFocus()) {
			playerplay();
Jan Philipp Hafer's avatar
Jan Philipp Hafer committed
103
		}
Julian Rother's avatar
Julian Rother committed
104
		{% endif %}
Andreas Valder's avatar
Andreas Valder committed
105
106
107
108
109
110
111
112
113
114
115
116
		// errors as modal dialog
		videojs("videoplayer").on("error", function() {
			var modals = [];
			//display errors
			{% for msg in msgs %}
				var m = videojs("videoplayer").createModal('',{"uncloseable": true });
				modals.push(m);
				m.contentEl().innerHTML='<div class="hidden-print alert alert-danger" role="alert">{{ msg|safe }}</div>';
				
			{% endfor %}
			videojs("videoplayer").on('play', function() {
				for (var i=0; i < modals.length; i++) {
Andreas Valder's avatar
Andreas Valder committed
117
					//modals[i].close();
Andreas Valder's avatar
Andreas Valder committed
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
				}
			});
		});
		//markers
		$.ajax({method: "GET", url: "{{url_for('chapters',lectureid=lecture.id, json=1)}}", dataType: "json",
			success: function (data) {
				videojs("videoplayer").markers({
					markerStyle: {
						'width':'5px',
						'border-radius': '40%',
						'background-color': 'black'
					},
					markerTip:{
						display: true,
						text: function(marker) {
							return marker.text;
						}
					},
					markers: data});
			}});
Andreas Valder's avatar
Andreas Valder committed
138
139

	});
Jan Philipp Hafer's avatar
Jan Philipp Hafer committed
140
});
Andreas Valder's avatar
Andreas Valder committed
141
</script>
Andreas Valder's avatar
Andreas Valder committed
142
{% endmacro %}
143
144

{% macro course_list_item(course,show_semester=False) %}
145
<li class="list-group-item list-group-item-condensed {% if (not course.visible) or (not course.listed) %}list-group-item-danger{% endif %}">
146
	<div class="row">
Andreas Valder's avatar
Andreas Valder committed
147
			{% if show_semester %}
148
				<span class="col-xs-2 col-md-1">
149
					{{ course.semester|semester }}
Andreas Valder's avatar
Andreas Valder committed
150
				</span>
151
				<span class="col-xs-10 col-md-6">
Andreas Valder's avatar
Andreas Valder committed
152
			{% else %}
153
				<span class="col-xs-12 col-md-7">
Andreas Valder's avatar
Andreas Valder committed
154
			{% endif %}
155
				<a href="{{url_for('course', handle=course.handle)}}">
156
					{{ course.title }}{% if ismod() %}<i> ({{course.id}})</i>{% endif %}
157
				</a>
158
159
160
				{% if course.chapter_count|d(0) > 0 and ismod() %}
					<span class="label label-info" data-toggle="tooltip" title="Nicht freigegebene Kapitel">{{ course.chapter_count }}</span>
				{% endif %}
161
			</span>
162
			<span class="col-xs-8 col-md-3">
Andreas Valder's avatar
Andreas Valder committed
163
164
				{{ course.organizer }}
			</span>
165
			<span class="col-xs-4 col-md-2">
Andreas Valder's avatar
Andreas Valder committed
166
167
				{{ course.subject }}
			</span>
168
169
170
	</div>
</li>
{% endmacro %}
Andreas Valder's avatar
Andreas Valder committed
171

172
{% macro video_download_btn(videos) %}
173
{% if not ismod() %}
174
<button class="btn btn-default dropdown-toggle{% if not videos|selectattr('downloadable')|list and not ismod() %} disabled{% endif %}" type="button" data-toggle="dropdown">Download <span class="caret"></span></button>
175
<ul class="dropdown-menu">
176
177
	{% for v in videos|sort(attribute='formats.prio', reverse=True) if (v.downloadable or ismod() ) %}
	<li><a href="{{ config.VIDEOPREFIX }}/{{v.path}}">{{v.formats.description}} ({{v.file_size|filesizeformat(true)}})</a></li>
178
179
	{% endfor %}
</ul>
180
181
{% endif %}
{% if not ismod() %}
182
	<noscript> 
183
{% endif %}
184
<ul class="pull-right list-unstyled" style="margin-left:10px;">
185
186
{% for v in videos|sort(attribute='formats.prio', reverse=True) if (v.downloadable or ismod() ) %}
	<li>{{moderator_delete(['videos',v.id,'deleted'])}} {{ moderator_checkbox(['videos',v.id,'visible'], v.visible) }} <a href="{{ config.VIDEOPREFIX }}/{{v.path}}">{{v.formats.description}} ({{v.file_size|filesizeformat(true)}})</a></li>
187
188
{% endfor %}
</ul>
189
{% if not ismod() %}
190
	</noscript> 
191
{% endif %}
192
193
{% endmacro %}

194
{%macro video_embed_btn(lectureid, course=None) %}
Andreas Valder's avatar
Andreas Valder committed
195
196
197
198
<a class="btn btn-default" id="embedcodebtn" data-container="body" data-toggle="popover" data-placement="bottom">
	<span>Einbetten</span>
</a>
<script>
199
{% set embedcode = '<iframe width="700" height="394" src="'+url_for('embed', course=course, id=lectureid, _external=True)+'" frameborder="0" allowfullscreen="true"></iframe>' %}
Andreas Valder's avatar
Andreas Valder committed
200
201
202
203
204
205
206
207
208
209
$('#embedcodebtn').popover(
		{
			html:true,
			title:'Einbettcode',
			content:'<span><input type="text" onclick="this.select()" value="{{embedcode}}"></span>'
		}
		)
</script>
{% endmacro %}

210
{% macro lecture_list_item(lecture,videos,global_permissions,chapters=[]) %}
211
<li class="list-group-item{% if lecture.norecording %} text-muted{% endif %}" id="lecture-{{lecture.id}}">
Andreas Valder's avatar
Andreas Valder committed
212
	<div class="row">
213
		{% if ismod() or (videos|length > 0) %}
214
			<div style="background-image: url('{{ config.VIDEOPREFIX }}/thumbnail/l_{{lecture.id}}.jpg')" class="col-sm-2 col-xs-12 thumbnailimg">
215
			{% if (not videos|length is equalto 0) or ismod() %}
216
217
218
				<a href="{{url_for('lecture', course=lecture.course.handle, id=lecture.id)}}">
					<span class="glyphicon glyphicon-play-circle playpreviewbtn"></span>
				</a>
219
			{% endif %}
220
221
			</div>
			<ul class="list-unstyled col-sm-3 col-xs-12">
222
223
224
225
226
227
228
				<li>
					{{ moderator_editor(['lectures',lecture.id,'title'], lecture.title) }}
					{{ livelabel((lecture.live and lecture.time > datetime.now()-timedelta(days=1)), videos|selectattr("livehandle")|list|length) }}
					{% if lecture.chapter_count|d(0) > 0 and ismod() %}
						<span class="label label-info" data-toggle="tooltip" title="Nicht freigegebene Kapitel">{{ lecture.chapter_count }}</span>
					{% endif %}
				</li>
229
				{% if lecture.speaker or ismod() %}<li>Gehalten von {{ moderator_editor(['lectures',lecture.id,'speaker'], lecture.speaker) }}</li>{% endif %}
230
				{% if ismod() %}
231
				<li>{{ moderator_editor(['lectures',lecture.id,'time'], lecture.time) }} </li>
232
				<li>Dauer: {{ moderator_editor(['lectures',lecture.id,'duration'], lecture.duration) }} min</li>
233
				<li>ID: <a href="{{url_for('course',handle=lecture.course.handle)}}#lecture-{{lecture.id}}">{{lecture.id}}</a></li>
234
235
				{% else %}
				<li>{{ lecture.time|fulldate }}</li>
236
237
238
239
				{% endif %}
			</ul>
			<ul class="list-unstyled col-sm-3 col-xs-12">
				<li>{{ moderator_editor(['lectures',lecture.id,'comment'], lecture.comment) }}</li>
240
241
242
				{% for chapter in chapters %}
				<li><span class="glyphicon glyphicon-play"></span> <a href="{{url_for('lecture', course=lecture.course.handle, id=lecture.id, t=chapter.time)}}">{{chapter.text}}</a></li>
				{% endfor %}
243
				{% if ismod() %}
244
245
246
				<li>{{ moderator_editor(['lectures',lecture.id,'internal'], lecture.internal) }}</li>
				<li>Sichtbar: {{ moderator_checkbox(['lectures',lecture.id,'visible'], lecture.visible) }}</li>
				<li>Livestream geplant: {{ moderator_checkbox(['lectures',lecture.id,'live'], lecture.live) }}</li>
247
				<li>Wird nicht aufgenommen: {{ moderator_checkbox(['lectures',lecture.id,'norecording'], lecture.norecording) }}</li>
248
249
250
				<li>Hörsaal: {{ moderator_editor(['lectures',lecture.id,'place'], lecture.place) }} </li>
				{% endif %}
			</ul>
251
252
253
254
255
256
257
258
259
260
261
262
			<ul class="col-sm-4 col-xs-12 list-unstyled">
				<li>
					<ul class="list-inline">
						<li class="dropdown">
							{{ video_download_btn(videos) }}
						</li>
						<li class="pull-right">
							{{ moderator_permissioneditor('lecture', lecture.id, lecture.perm, global_permissions) }}
						</li>
						<li class="pull-right">
							{{ moderator_delete(['lectures',lecture.id,'deleted']) }}
						</li>
263
264
						{% if ismod() %}
						<li class="pull-right">
265
							<button class="btn btn-{{ 'default' if not lecture.stream_settings else 'danger' if lecture.stream_job else 'primary' }}" data-toggle="modal" data-target="#editstream" data-lectureid="{{ lecture.id }}" data-active="{{ 1 if lecture.stream_job else '' }}" data-path="{{ 'lectures.%i.stream_settings'%lecture.id }}" data-value='{{ lecture.stream_settings|e }}'>
Julian Rother's avatar
Julian Rother committed
266
								<span class="fas fa-broadcast-tower"></span>
267
268
269
							</button>
						</li>
						{% endif %}
270
					</ul>
271
				</li>
272
				{% if ismod() %}
273
				<li class="pull-right">
Andreas Valder's avatar
Andreas Valder committed
274
					<p>Abrufe: <span data-lectureid="{{ lecture.id }}" data-lecturedate="{{ lecture.time }}" class="viewcounter">loading...</span></p>
275
				</li>
276
				{% endif %}
277
278
279
280
281
			</ul>
		{% else %}
			<div class="col-sm-2 col-xs-12">
			</div>
			<ul class="list-unstyled col-sm-3 col-xs-12">
282
283
284
285
286
287
288
				<li>
					{{ moderator_editor(['lectures',lecture.id,'title'], lecture.title) }}
					{{livelabel((lecture.live and lecture.time > datetime.now()-timedelta(days=1)), videos|selectattr("livehandle")|list|length)}}
					{% if lecture.chapter_count|d(0) > 0 and ismod() %}
						<span class="label label-info" data-toggle="tooltip" title="Nicht freigegebene Kapitel">{{ lecture.chapter_count }}</span>
					{% endif %}
				</li>
289
290
			</ul>
			<ul class="list-unstyled col-sm-3 col-xs-12">
291
				{% if ismod() %}
292
				<li>{{ moderator_editor(['lectures',lecture.id,'time'], lecture.time) }} </li>
293
294
295
				{% else %}
				<li>{{ lecture.time|fulldate }}</li>
				{% endif %}
296
297
298
299
300
			</ul>
			<ul class="list-inline col-sm-4 col-xs-12">
				<li>{{ moderator_editor(['lectures',lecture.id,'comment'], lecture.comment) }}</li>
			</ul>
		{% endif %}
Andreas Valder's avatar
Andreas Valder committed
301
302
303
	</div>
</li>
{% endmacro %}
304

305
{% macro moderator_editor (path,value,reload=false) %}
306
	{% if ismod() %}
307
	<span class="moderator_editor" data-path="{{path|join('.')}}" data-reload="{{ reload|int }}" >
308
		<a class="moderator_editor_sign btn btn-default" title="{{path|join('.')}}{{ path|join('.')|getfielddescription }}{% for l in  path|join('.')|getfieldchangelog %}<br>{% if (l.who != l.who|string) %}{{ l.name }} ({{ l.who }}){% else %}{{ l.who }}{%endif%} <{{ l.when }}>: {{ l.value_new|truncate(60, killwords=True)|forceescape|forceescape }}{% endfor %}" data-toggle="tooltip" tabindex="0" style="padding: 3px; margin-right: 5px;">
309
310
			<span class="glyphicon glyphicon-pencil"></span>
		</a>
311
		<span class="moderator_editor_value">{{ value|fixnl|safe }}</span>
312
	</span>
313
	{% else %}
314
		{{value|fixnl|safe}}
315
	{% endif %}
316
317
{% endmacro %}

318
{% macro moderator_checkbox (path,value) %}
319
	{% if ismod() %}
320
	<input title="{{path|join('.')}}{{ path|join('.')|getfielddescription }}{% for l in  path|join('.')|getfieldchangelog %}<br>{% if (l.who != l.who|string) %}{{ l.name }} ({{ l.who }}){% else %}{{ l.who }}{%endif%} <{{ l.when }}>: {{ l.value_new|truncate(60, killwords=True)|forceescape|forceescape }}{% endfor %}" data-toggle="tooltip" type="checkbox" data-path="{{path|join('.')}}" {% if value %} checked {% endif %} onchange="moderator.editor.changeboxclick(this)"/>
321
322
	{% endif %}
{% endmacro %}
323

324
{% macro moderator_delete (path) %}
325
	{% if ismod() %}
326
	<button class="btn btn-default" style="background-color: red;" data-path="{{path|join('.')}}" onclick="moderator.editor.deletebtnclick(this)" >
Andreas Valder's avatar
Andreas Valder committed
327
328
329
330
331
		<span class="glyphicon glyphicon-trash"></span>
	</button>
	{% endif %}
{% endmacro %}

332
333
334
{% macro moderator_permissioneditor(type,id,perm,global_permissions) %}
	{% set tmp = global_permissions.extend(perm) %}
	{% set permdescription = perm|permdescr %}
335
336
337
	{% set permlogos = '' %}

	{% if permdescription[0] == 'public' %}
Julian Rother's avatar
Julian Rother committed
338
		{% set permlogos = '<span class="fa fa-globe-asia" aria-hidden="true"></span>' %}
339
	{% endif %}
Julian Rother's avatar
Julian Rother committed
340
341
342
	{% if permdescription[0] == 'none' %}
		{% set permlogos = '<span class="fa fa-ban" aria-hidden="true"></span>' %}
	{% endif %}
343
344
345
346
	{% if permdescription[0] == 'password' %}
		{% set permlogos = '<span class="fa fa-lock" aria-hidden="true"></span>' %}
	{% endif %}
	{% if permdescription[0] == 'l2p' %}
347
		{% set permlogos = '<span class="fa" aria-hidden="true" style="width: 12px; height: 14px; background-size: cover; background-image: url(\'/static/l2p-logo.gif\');"></span>' %}
348
349
	{% endif %}
	{% if permdescription[0] == 'rwth' %}
350
		{% set permlogos = '<span class="fa" aria-hidden="true" style="width: 25px; height: 20px; background-size: cover; background-image: url(\'/static/rwth.png\');"></span>' %}
351
	{% endif %}
352
	{% if permdescription[0] == 'fsmpi' %}
353
		{% set permlogos = '<span class="fa" aria-hidden="true" style="width: 25px; height: 20px; background-size: cover; background-image: url(\'/static/fsmpi.png\');"></span>' %}
354
	{% endif %}
355
356

	{% if ismod() %}
357
		<button class="btn btn-default" data-toggle="modal" data-target="#editperm" data-type="{{ type }}" data-id="{{ id }}">
358
			{{ permlogos|safe }}
359
		</button>
Andreas Valder's avatar
Andreas Valder committed
360
	{% else %}
Andreas Valder's avatar
Andreas Valder committed
361
		<span title="{{permdescription[1]}}">
362
			{{ permlogos|safe }}
Andreas Valder's avatar
Andreas Valder committed
363
		</span>
364
	{% endif %}
Andreas Valder's avatar
Andreas Valder committed
365
	
366
{% endmacro %}
Andreas Valder's avatar
Andreas Valder committed
367

368
{% macro vtttime(time) %}{{ time|time_offset }}.000{% endmacro %}
369

Julian Rother's avatar
Julian Rother committed
370
{% macro stats_viewsperday(id, req, title, type="scatter", param=None, maxtraces=7) %}
371
372
373
<script>
	$.ajax({
		method: "GET",
Julian Rother's avatar
Julian Rother committed
374
		url: "{{url_for('stats_viewsperday', req=req, param=param)}}",
375
376
377
378
		dataType: "json",
		error: moderator.api.handleapierror,
		success: function (data) {
			var traces = [];
Julian Rother's avatar
Julian Rother committed
379
380
381
382
383
			for (var i = 0; i < data.views.length; i++) {
				if (data.views[i].name == 'total' && data.views.length > 2)
					traces.push({"x": data.times, "y": data.views[i].vals, "type": "{{type}}", "name": "gesamt", line: {"color": "black", "width": 2}});
				else
					traces.push({"x": data.times, "y": data.views[i].vals, "type": "{{type}}", "name": data.views[i].name, line: {"width": 1}});
384
			}
Julian Rother's avatar
Julian Rother committed
385
386
387
388
389
390
391
392
393
394
395
396
			traces.sort(function (a, b) {
				amax = 0;
				bmax = 0;
				for (var i = 0; i < a.y.length; i++)
					amax = Math.max(amax, a.y[i]);
				for (var i = 0; i < b.y.length; i++)
					bmax = Math.max(bmax, b.y[i]);
				return bmax-amax;
			});
			for (var i = 0; i < traces.length; i++)
				if (i > {{maxtraces}})
					traces[i].visible = "legendonly";
397
398
399
400
401
402
403
404
405
			var layout = {
				"title": "{{title}}",
				"showlegend": (traces.length != 1)
			};
			Plotly.newPlot("{{id}}", traces, layout, { "modeBarButtonsToRemove": ['sendDataToCloud','hoverCompareCartesian'], "displaylogo": false});
		}
	});
</script>
{% endmacro %}
Julian Rother's avatar
Julian Rother committed
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437

{% macro featured_content(item) %} {# This macro is used in a panel div after the panel header #}
	{% if item.type == 'image' %}
		<!-- Putting image tag here makes it borderless. This should be replaced by a bootstrap-compatible solution. -->
		<img src="{{item.param}}" style="width: 100%;"/>
		{% if ismod() %}
		<p>{{moderator_editor(('featured',item.id,'param'), item.param)}}</p>
		{% endif %}
		{% if item.text or ismod() %}
			<div class="panel-body">{{ moderator_editor(('featured',item.id,'text'), item.text) }}</div>
		{% endif %}
	{% elif item.type == 'courses' %}
		{% if item.text or ismod() %}
			<div class="panel-body">{{ moderator_editor(('featured',item.id,'text'), item.text) }}</div>
		{% endif %}
		<ul class="courses-list list-group">
		{% for i in item.courses %}
			{{ course_list_item(i) }}
		{% endfor %}
		</ul>
		<div class="panel-footer">
		{% if ismod() %}
			<ul class="list-inline">	
			<li><div class="dropdown">
				{% set params = {'semester': 'Semester', 'title': 'Veranstaltung', 'organizer': 'Dozent', 'subject': 'Kategorie'} %}
				<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">{{params[item.param]}}: <span class="caret"></span></button>
				<ul class="dropdown-menu">
					{% for key, name in params.items() %}
					<li><a href="{{url_for('edit', **{'featured.'+item.id|string+'.param': key, 'ref': request.url})}}">{{name}}</a></li>
					{% endfor %}
				</ul>
			</div></li>
438
			<li>{{ moderator_editor(('featured',item.id,'param2'), item.param2, reload=True) }}</li>
Julian Rother's avatar
Julian Rother committed
439
440
441
442
			</ul>
		{% endif %}
		Die vollständige Liste findest du <a href="{{ url_for('courses') }}">hier</a>.
		</div>
Julian Rother's avatar
Julian Rother committed
443
444
445
446
447
448
449
	{% elif item.type == 'video' %}
		<div class="panel-body">
			<div>{{ moderator_editor(('featured',item.id,'text'), item.text) }}</div>
			{% if item.videos %}
			{{ player(item.lecture, item.videos, autoplay=False)}}
			{% endif %}
			{% if ismod() %}
450
			<div>ID des Videos: {{ moderator_editor(('featured',item.id,'param'), item.param, reload=True) }}</div>
Julian Rother's avatar
Julian Rother committed
451
452
453
			{% endif %}
			<div>{{ moderator_editor(('featured',item.id,'param2'), item.param2) }}</div>
		</div>
Julian Rother's avatar
Julian Rother committed
454
455
456
457
458
459
	{% else %}
		{% if item.text or ismod() %}
			<div class="panel-body">{{ moderator_editor(('featured',item.id,'text'), item.text) }}</div>
		{% endif %}
	{% endif %}
{% endmacro %}