Commit 98a238db authored by Julian Rother's avatar Julian Rother
Browse files

Added "live" option to lectures

parent 96a63fae
......@@ -97,7 +97,8 @@ CREATE TABLE IF NOT EXISTS `lectures_data` (
`time_created` datetime NOT NULL,
`time_updated` datetime NOT NULL,
`jumplist` text NOT NULL DEFAULT '',
`titlefile` varchar(255) NOT NULL DEFAULT ''
`titlefile` varchar(255) NOT NULL DEFAULT '',
`live` INTEGER NOT NULL DEFAULT 0
);
CREATE TABLE IF NOT EXISTS `places` (
`place` varchar(20) NOT NULL PRIMARY KEY,
......
......@@ -40,7 +40,8 @@ editable_tables = {
'time': {'type': 'datetime'},
'duration': {'type': 'duration'},
'jumplist': {'type': ''},
'deleted': {'type': 'boolean'}},
'deleted': {'type': 'boolean'},
'live': {'type': 'boolean'}},
'creationtime_fields': ['course_id', 'time_created', 'time_updated'] },
'videos': {
'table': 'videos_data',
......
{% from 'macros.html' import preview, featured_content %}
{% from 'macros.html' import preview, featured_content, livelabel %}
{% extends "base.html" %}
{% set page_border = 0 %}
{% if ismod() %}
......@@ -111,7 +111,7 @@
<ul class="list-group" style="margin: 0px;">
{% for i in g.list %}
<li class="list-group-item list-group-item-condensed">
{{i.time|time}} <a href="{{url_for('course', id=i.course_id)}}">{{i.course.title}}</a>: <a href="{{url_for('course', id=i.course_id)}}#lecture-{{i.id}}">{{i.title}}</a>
{{i.time|time}} <a href="{{url_for('course', id=i.course_id)}}">{{i.course.title}}</a>: <a href="{{url_for('course', id=i.course_id)}}#lecture-{{i.id}}">{{i.title}}</a> {{livelabel(i.live, False)}}
</li>
{% endfor %}
</ul>
......
{% 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 %}
{% macro preview(lecture) %}
<li class="list-group-item">
<a href="{{url_for('lecture', course=lecture.course.handle, id=lecture['id'])}}" title="{{ lecture.course.title }}" style="color: #000">
......@@ -5,7 +11,7 @@
<div class="row">
<img class="col-xs-4" style="max-height: 120px; height: auto; width:170px" src="{{ config.VIDEOPREFIX }}/thumbnail/l_{{ lecture['id'] }}.jpg" alt="Vorschaubild">
<div class="col-xs-4">
<span>{% if lecture.livehandle %}<span class="label label-danger">Live</span> {% endif %}<strong>{{ lecture.course.short }}</strong>{% if ismod() %} <i>({{lecture.course_id}})</i>{% endif %}</span><br>
<span><strong>{{ lecture.course.short }}</strong>{{livelabel(lecture.live, lecture.livehandle)}}{% if ismod() %} <i>({{lecture.course_id}})</i>{% endif %}</span><br>
<span>{% if ismod() %}ID: {{lecture.id}}{% endif %}</span><br>
<span>{{ lecture['time'] }}</span>
{% if lecture['speaker'] %}
......@@ -23,8 +29,8 @@
<img style="width: 100%;" src="{{ config.VIDEOPREFIX }}/thumbnail/l_{{ lecture['id'] }}.jpg" alt="Vorschaubild">
</li>
<li>
{% if lecture.livehandle %}<span class="label label-danger">Live</span> {% endif %}
<strong>{{ lecture.course.title }}</strong>
{{livelabel(lecture.live, lecture.livehandle)}}
</li>
<li>{{ lecture['time'] }}</li>
{% if lecture['speaker'] %}
......@@ -169,7 +175,7 @@ $('#embedcodebtn').popover(
{% endif %}
</div>
<ul class="list-unstyled col-sm-3 col-xs-12">
<li>{% if videos|selectattr("livehandle")|list|length %}<span class="label label-danger">Live</span> {% endif %}{{ moderator_editor(['lectures',lecture.id,'title'], lecture.title) }}</li>
<li>{{ moderator_editor(['lectures',lecture.id,'title'], lecture.title) }}{{livelabel(lecture.live, videos|selectattr("livehandle")|list|length)}}</li>
{% if lecture.speaker or ismod() %}<li>Gehalten von {{ moderator_editor(['lectures',lecture.id,'speaker'], lecture.speaker) }}</li>{% endif %}
<li>{{ moderator_editor(['lectures',lecture.id,'time'], lecture.time) }} </li>
<li>Dauer: {{ moderator_editor(['lectures',lecture.id,'duration'], lecture.duration) }} min</li>
......@@ -182,6 +188,7 @@ $('#embedcodebtn').popover(
{% if ismod() %}
<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>
<li>Hörsaal: {{ moderator_editor(['lectures',lecture.id,'place'], lecture.place) }} </li>
{% endif %}
</ul>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment