Select Git revision
Forked from
Video AG Infrastruktur / website
Source project has a limited visibility.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
macros.html 6.78 KiB
{% macro preview(lecture) %}
<li class="list-group-item">
<a class="hidden-xs" href="{{url_for('play', id=lecture['id'])}}" title="{{ lecture['coursetitle'] }}">
<div class="row">
<img class="col-xs-4" src="{{ config.VIDEOPREFIX }}/{{ lecture['titlefile'] }}" alt="Vorschaubild">
<div class="col-xs-4">
<span style="color: #000;"><strong>{{ lecture['short'] }}</strong></span><br>
<span style="color: #000;">{{ lecture['time'] }}</span>
{% if lecture['speaker'] %}
<div class="small" style="color: #000;">Gehalten von {{ lecture['speaker'] }} </div>
{% endif %}
</div>
<div class="col-xs-4" style="color: #000;">
<div style="color: #000;">{{ lecture['title'] }}</div>
<p style="font-style: italic; color: #777;">{{ lecture['comment'] }}</p>
</div>
</div>
</a>
<a class="visible-xs" href="{{url_for('play', id=lecture['id'])}}" title="{{ lecture['coursetitle'] }}">
<div class="row">
<img class="col-xs-12" src="{{ config.VIDEOPREFIX }}/{{ 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>
</div>
</div>
{% if lecture['speaker'] %}
<div class="row">
<div class="col-xs-12">
<div class="small" style="color: #000;">Gehalten von {{ lecture['speaker'] }} </div>
</div>
</div>
{% endif %}
<div class="row">
<div class="col-xs-12">
<div style="color: #000;">{{ lecture['title'] }}</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<p style="font-style: italic; color: #777;">{{ lecture['comment'] }}</p>
</div>
</div>
</a>
</li>
{% endmacro %}
{% macro player(lecture, videos) %}
<script src="{{url_for('static', filename='mediaelementjs/mediaelement-and-player.min.js')}}"></script>
<link rel="stylesheet" href="{{url_for('static', filename='mediaelementjs/mediaelementplayer.css')}}" />
<video class="mejs-player" width="640" height="360" style="width: 100%; height: 100%;">
{% for v in videos %}
<source type="video/mp4" src="{{ config.VIDEOPREFIX }}/{{ v.path }}" />
{% endfor %}
</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) %}
<li class="list-group-item {% if (not course.visible) or (not course.listed) %}list-group-item-danger{% endif %}">
<div class="row">
<a href="{{url_for('course_id', numid=course.id)}}">
{% 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 }}
</span>
<span class="col-xs-3">
{{ course.organizer }}
</span>
<span class="col-xs-2">
{{ course.subject }}
</span>
</a>
</div>
</li>
{% endmacro %}
{% macro video_download_btn(videos) %}
<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>
<ul class="dropdown-menu">
{% for v in videos %}
{% if v.downloadable %}
<li><a href="{{ config.VIDEOPREFIX }}/{{v.path}}">{{ valuecheckbox(['videos',v.id,'visible'], v.visible) }} {{v.format_description}} ({{v.file_size|filesizeformat(true)}})</a></li>
{% endif %}
{% endfor %}
</ul>
<noscript>
<ul class="pull-right list-unstyled" style="margin-left:10px;">
{% for v in videos %}
<li><a href="{{ config.VIDEOPREFIX }}/{{v.path}}">{{v.format_description}} ({{v.file_size|filesizeformat(true)}})</a></li>
{% endfor %}
</ul>
</noscript>
{% endmacro %}
{%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 %}
{% macro lecture_list_item(lecture,videos) %}
<li class="list-group-item" id="lecture-{{lecture.id}}">
<div class="row">
<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>{{ valueeditor(['lectures',lecture.id,'title'], lecture.title) }}</li>
{% if lecture.speaker or ismod() %}<li>Gehalten von {{ valueeditor(['lectures',lecture.id,'speaker'], lecture.speaker) }}</li>{% endif %}
<li>{{ valueeditor(['lectures',lecture.id,'time'], lecture.time) }} </li>
<li>Dauer: {{ valueeditor(['lectures',lecture.id,'duration'], lecture.duration) }} min</li>
{% if ismod() %}
{% endif %}
</ul>
</span>
<span class="col-sm-4 col-xs-12">
<ul class="list-unstyled">
<li>{{ valueeditor(['lectures',lecture.id,'comment'], lecture.comment) }}</li>
{% if ismod() %}
<li>{{ valueeditor(['lectures',lecture.id,'internal'], lecture.internal) }}</li>
<li>Sichtbar: {{ valuecheckbox(['lectures',lecture.id,'visible'], lecture.visible) }}</li>
<li>Hörsaal: {{ valueeditor(['lectures',lecture.id,'place'], lecture.place) }} </li>
{% endif %}
</ul>
</span>
<span class="col-sm-3 col-xs-12">
<span class="pull-right">
<span>
{{ video_download_btn(videos) }}
</span>
<a href="{{url_for('play', id=lecture.id)}}" class="btn btn-default {% if videos|length is equalto 0 %}disabled{% endif %}">
<span class="glyphicon glyphicon-play"></span>
Play
</a>
{{ valuedeletebtn(['lectures',lecture.id,'deleted']) }}
</span>
</span>
</div>
</li>
{% endmacro %}
{% 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 %}
{% macro valuecheckbox (path,value) %}
{% if ismod() %}
<input type="checkbox" data-path="{{path|join('.')}}" {% if value %} checked {% endif %} onchange="moderatorinterface.change(this)"/>
{% endif %}
{% endmacro %}
{% macro valuedeletebtn (path) %}
{% if ismod() %}
<button data-path="{{path|join('.')}}" onclick="moderatorinterface.delete(this)">
<span class="glyphicon glyphicon-trash"></span>
</button>
{% endif %}
{% endmacro %}